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

bool MtpDevice::UpdateSpaceInformation (  ) 

This function updates the space usage information, it should be called at every function call that could potentially change the space usage of the device

Returns:
true if successfully retreived, false otherwise

Definition at line 784 of file MtpDevice.cpp.

References processErrorStack().

Referenced by Initialize(), MtpDevice(), NewAlbum(), TransferFile(), and TransferTrack().

{
  if (!_device)
    return false;
  int ret = LIBMTP_Get_Storage(_device, LIBMTP_STORAGE_SORTBY_NOTSORTED);
  if (ret != 0)
  {
    processErrorStack();
    return false;
  }
  for (count_t i =0; i < _storageDeviceList.size(); i++)
  {
    delete _storageDeviceList[i];
  }
  _storageDeviceList.clear();

  LIBMTP_devicestorage_t* storage_dev = _device->storage;
  while (storage_dev)
  {
    MtpStorage* new_storage = new MtpStorage(storage_dev); 
    _storageDeviceList.push_back(new_storage);
    storage_dev = storage_dev->next;
  }
  return true;
}


Generated by  Doxygen 1.6.0   Back to index