Fix minor code issues
This commit is contained in:
@@ -56,10 +56,10 @@ class DeviceLister : public QObject {
|
||||
virtual quint64 DeviceCapacity(const QString &id) = 0;
|
||||
virtual quint64 DeviceFreeSpace(const QString &id) = 0;
|
||||
virtual QVariantMap DeviceHardwareInfo(const QString &id) = 0;
|
||||
virtual bool DeviceNeedsMount(const QString &id) { return false; }
|
||||
virtual bool DeviceNeedsMount(const QString &id) { Q_UNUSED(id); return false; }
|
||||
|
||||
// When connecting to a device for the first time, do we want an user's confirmation for scanning it? (by default yes)
|
||||
virtual bool AskForScan(const QString&) const { return true; }
|
||||
virtual bool AskForScan(const QString &id) const { Q_UNUSED(id); return true; }
|
||||
|
||||
virtual QString MakeFriendlyName(const QString &id) = 0;
|
||||
virtual QList<QUrl> MakeDeviceUrls(const QString &id) = 0;
|
||||
@@ -74,7 +74,7 @@ class DeviceLister : public QObject {
|
||||
virtual void UpdateDeviceFreeSpace(const QString &id) = 0;
|
||||
virtual void ShutDown() {}
|
||||
virtual void MountDevice(const QString &id, const int ret);
|
||||
virtual void UnmountDevice(const QString &id) {}
|
||||
virtual void UnmountDevice(const QString &id) { Q_UNUSED(id); }
|
||||
virtual void Exit();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -757,6 +757,8 @@ DeviceLister *DeviceManager::GetLister(QModelIndex idx) const {
|
||||
|
||||
void DeviceManager::Disconnect(DeviceInfo *info, QModelIndex idx) {
|
||||
|
||||
Q_UNUSED(idx);
|
||||
|
||||
info->device_->Close();
|
||||
|
||||
}
|
||||
@@ -901,6 +903,8 @@ void DeviceManager::Unmount(QModelIndex idx) {
|
||||
|
||||
void DeviceManager::DeviceSongCountUpdated(int count) {
|
||||
|
||||
Q_UNUSED(count);
|
||||
|
||||
ConnectedDevice *device = qobject_cast<ConnectedDevice*>(sender());
|
||||
if (!device) return;
|
||||
|
||||
@@ -915,11 +919,14 @@ void DeviceManager::DeviceSongCountUpdated(int count) {
|
||||
}
|
||||
|
||||
void DeviceManager::LazyPopulate(DeviceInfo *parent, bool signal) {
|
||||
|
||||
Q_UNUSED(signal);
|
||||
if (parent->lazy_loaded) return;
|
||||
parent->lazy_loaded = true;
|
||||
|
||||
}
|
||||
|
||||
QString DeviceManager::DeviceNameByID(QString unique_id) {
|
||||
QString DeviceManager::DeviceNameByID(const QString &unique_id) {
|
||||
|
||||
DeviceInfo *info = FindDeviceById(unique_id);
|
||||
if (!info) return QString();
|
||||
|
||||
@@ -98,7 +98,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
|
||||
|
||||
DeviceInfo *FindDeviceById(const QString &id) const;
|
||||
DeviceInfo *FindDeviceByUrl(const QList<QUrl> &url) const;
|
||||
QString DeviceNameByID(QString unique_id);
|
||||
QString DeviceNameByID(const QString &unique_id);
|
||||
DeviceInfo *FindEquivalentDevice(DeviceInfo *info) const;
|
||||
|
||||
// Actions on devices
|
||||
|
||||
@@ -35,6 +35,7 @@ DeviceStateFilterModel::DeviceStateFilterModel(QObject *parent, DeviceManager::S
|
||||
connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(ProxyRowCountChanged(QModelIndex, int, int)));
|
||||
connect(this, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(ProxyRowCountChanged(QModelIndex, int, int)));
|
||||
connect(this, SIGNAL(modelReset()), this, SLOT(ProxyRowCountChanged()));
|
||||
|
||||
}
|
||||
|
||||
bool DeviceStateFilterModel::filterAcceptsRow(int row, const QModelIndex&) const {
|
||||
@@ -46,12 +47,19 @@ void DeviceStateFilterModel::ProxyRowCountChanged() {
|
||||
}
|
||||
|
||||
void DeviceStateFilterModel::ProxyRowCountChanged(QModelIndex index, int first, int last) {
|
||||
|
||||
Q_UNUSED(index);
|
||||
Q_UNUSED(first);
|
||||
Q_UNUSED(last);
|
||||
emit IsEmptyChanged(rowCount() == 0);
|
||||
|
||||
}
|
||||
|
||||
void DeviceStateFilterModel::setSourceModel(QAbstractItemModel *sourceModel) {
|
||||
|
||||
QSortFilterProxyModel::setSourceModel(sourceModel);
|
||||
setDynamicSortFilter(true);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
sort(0);
|
||||
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ QVariantList GioLister::DeviceIcons(const QString &id) {
|
||||
|
||||
}
|
||||
|
||||
QString GioLister::DeviceManufacturer(const QString &id) { return QString(); }
|
||||
QString GioLister::DeviceManufacturer(const QString &id) { Q_UNUSED(id); return QString(); }
|
||||
|
||||
QString GioLister::DeviceModel(const QString &id) {
|
||||
|
||||
|
||||
@@ -106,10 +106,12 @@ QStringList iLister::DeviceUniqueIDs() {
|
||||
}
|
||||
|
||||
QVariantList iLister::DeviceIcons(const QString &id) {
|
||||
Q_UNUSED(id);
|
||||
return QVariantList() << "ipodtouchicon";
|
||||
}
|
||||
|
||||
QString iLister::DeviceManufacturer(const QString &id) {
|
||||
Q_UNUSED(id);
|
||||
return "Apple";
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,8 @@ bool iMobileDeviceConnection::Exists(const QString &path) {
|
||||
|
||||
QString iMobileDeviceConnection::GetUnusedFilename(Itdb_iTunesDB *itdb, const Song &metadata) {
|
||||
|
||||
Q_UNUSED(itdb);
|
||||
|
||||
// This function does the same as itdb_cp_get_dest_filename, except it accesses the device's filesystem through imobiledevice.
|
||||
|
||||
// Get the total number of F.. directories
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
bool is_valid() { return device_ && afc_; }
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(iMobileDeviceConnection);
|
||||
Q_DISABLE_COPY(iMobileDeviceConnection)
|
||||
|
||||
idevice_t device_;
|
||||
afc_client_t afc_;
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
bool GetSupportedFiletypes(QList<Song::FileType> *ret);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(MtpConnection);
|
||||
Q_DISABLE_COPY(MtpConnection)
|
||||
|
||||
LIBMTP_mtpdevice_t *device_;
|
||||
};
|
||||
|
||||
@@ -61,6 +61,7 @@ QStringList Udisks2Lister::DeviceUniqueIDs() {
|
||||
}
|
||||
|
||||
QVariantList Udisks2Lister::DeviceIcons(const QString &id) {
|
||||
Q_UNUSED(id);
|
||||
return QVariantList();
|
||||
}
|
||||
|
||||
@@ -245,6 +246,7 @@ void Udisks2Lister::DBusInterfaceAdded(const QDBusObjectPath &path, const Interf
|
||||
}
|
||||
|
||||
void Udisks2Lister::DBusInterfaceRemoved(const QDBusObjectPath &path, const QStringList &ifaces) {
|
||||
Q_UNUSED(ifaces);
|
||||
if (!isPendingJob(path)) RemoveDevice(path);
|
||||
}
|
||||
|
||||
@@ -296,6 +298,8 @@ QList<QDBusObjectPath> Udisks2Lister::GetMountedPartitionsFromDBusArgument(const
|
||||
|
||||
void Udisks2Lister::JobCompleted(bool success, const QString &message) {
|
||||
|
||||
Q_UNUSED(message);
|
||||
|
||||
auto job = qobject_cast<OrgFreedesktopUDisks2JobInterface*>(sender());
|
||||
QDBusObjectPath jobPath(job->path());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user