@@ -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_;
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
|
||||
Role_TranscodeMode,
|
||||
Role_TranscodeFormat,
|
||||
Role_SongCount,
|
||||
Role_CopyMusic,
|
||||
LastRole,
|
||||
};
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user