Logo Search packages:      
Sourcecode: qlix version File versions  Download package

bool MtpDevice::RemoveTrack ( MTP::Track in_track  ) 

Removes a track from the device

Parameters:
in_track the track to remove

Definition at line 967 of file MtpDevice.cpp.

References MTP::Track::GetRowIndex(), MTP::Track::ParentAlbum(), processErrorStack(), MTP::Album::RawAlbum(), MTP::Album::RemoveFromRawAlbum(), removeObject(), and MTP::Album::SetInitialized().

{
  assert(in_track);
  MTP::Album* parentAlbum = in_track->ParentAlbum();
  parentAlbum->SetInitialized();

  parentAlbum->RemoveFromRawAlbum(in_track->GetRowIndex());

#ifndef SIMULATE_TRANSFERS
  int ret = LIBMTP_Update_Album(_device, parentAlbum->RawAlbum());
  if (ret != 0)
  {
    processErrorStack();
    return false;
  }
// simulate transfers is kind of redundant here
  ret = removeObject(in_track->ID());
#endif
  return true;
}


Generated by  Doxygen 1.6.0   Back to index