diff --git a/src/device/cddalister.h b/src/device/cddalister.h index 908ea2f93..a6364f5af 100644 --- a/src/device/cddalister.h +++ b/src/device/cddalister.h @@ -52,6 +52,7 @@ class CddaLister : public DeviceLister { void UnmountDevice(const QString&); void UpdateDeviceFreeSpace(const QString&); bool Init(); + bool CopyMusic() { return false; } private: QStringList devices_list_; diff --git a/src/device/devicelister.h b/src/device/devicelister.h index 0bb03deb9..795a13389 100644 --- a/src/device/devicelister.h +++ b/src/device/devicelister.h @@ -69,6 +69,8 @@ class DeviceLister : public QObject { // Do whatever needs to be done to safely remove the device. virtual void UnmountDeviceAsync(const QString &id); + virtual bool CopyMusic() { return true; } + public slots: virtual void UpdateDeviceFreeSpace(const QString &id) = 0; virtual void ShutDown() {} diff --git a/src/device/devicemanager.cpp b/src/device/devicemanager.cpp index 2bd9791fc..359620065 100644 --- a/src/device/devicemanager.cpp +++ b/src/device/devicemanager.cpp @@ -385,6 +385,10 @@ QVariant DeviceManager::data(const QModelIndex &idx, int role) const { if (!info->device_) return QVariant(); return info->device_->song_count(); + case Role_CopyMusic: + if (info->BestBackend() && info->BestBackend()->lister_) return info->BestBackend()->lister_->CopyMusic(); + else return false; + default: return QVariant(); } diff --git a/src/device/devicemanager.h b/src/device/devicemanager.h index 980439b87..73f641c11 100644 --- a/src/device/devicemanager.h +++ b/src/device/devicemanager.h @@ -73,6 +73,7 @@ class DeviceManager : public SimpleTreeModel { Role_TranscodeMode, Role_TranscodeFormat, Role_SongCount, + Role_CopyMusic, LastRole, }; diff --git a/src/device/devicestatefiltermodel.cpp b/src/device/devicestatefiltermodel.cpp index 58c5717cd..0b502546e 100644 --- a/src/device/devicestatefiltermodel.cpp +++ b/src/device/devicestatefiltermodel.cpp @@ -40,7 +40,7 @@ DeviceStateFilterModel::DeviceStateFilterModel(QObject *parent, DeviceManager::S } bool DeviceStateFilterModel::filterAcceptsRow(int row, const QModelIndex&) const { - return sourceModel()->index(row, 0).data(DeviceManager::Role_State).toInt() != state_; + return sourceModel()->index(row, 0).data(DeviceManager::Role_State).toInt() != state_ && sourceModel()->index(row, 0).data(DeviceManager::Role_CopyMusic).toBool(); } void DeviceStateFilterModel::ProxyRowCountChanged() {