diff --git a/src/devices/devicekitlister.cpp b/src/devices/devicekitlister.cpp index 354341046..567231a81 100644 --- a/src/devices/devicekitlister.cpp +++ b/src/devices/devicekitlister.cpp @@ -92,7 +92,8 @@ QStringList DeviceKitLister::DeviceIcons(const QString &id) { QString path = LockAndGetDeviceInfo(id, &DeviceData::device_mount_paths)[0]; QStringList guessed = DeviceLister::GuessIconForPath(path); return QStringList() - << guessed + << GuessIconForPath(path) + << GuessIconForModel(DeviceManufacturer(id), DeviceModel(id)) << LockAndGetDeviceInfo(id, &DeviceData::device_presentation_icon_name); } diff --git a/src/devices/devicelister.cpp b/src/devices/devicelister.cpp index bc2cd71b4..a3220df6d 100644 --- a/src/devices/devicelister.cpp +++ b/src/devices/devicelister.cpp @@ -190,12 +190,12 @@ QStringList DeviceLister::GuessIconForPath(const QString& path) { itdb_device_free(device); if (!colour.isEmpty()) { - QString colour_icon = "multimedia-player-ipod-%1-%2.png"; + QString colour_icon = "multimedia-player-ipod-%1-%2"; ret << colour_icon.arg(colour, model); } if (!model.isEmpty()) { - QString model_icon = "multimedia-player-ipod-%1.png"; + QString model_icon = "multimedia-player-ipod-%1"; ret << model_icon.arg(model); } } @@ -203,3 +203,12 @@ QStringList DeviceLister::GuessIconForPath(const QString& path) { return ret; } + +QStringList DeviceLister::GuessIconForModel(const QString& vendor, const QString& model) { + qDebug() << vendor << ":" << model; + QStringList ret; + if (vendor.startsWith("Google") && model.contains("Nexus")) { + ret << "phone-google-nexus-one"; + } + return ret; +} diff --git a/src/devices/devicelister.h b/src/devices/devicelister.h index 0fe23ef60..4bbf34263 100644 --- a/src/devices/devicelister.h +++ b/src/devices/devicelister.h @@ -65,6 +65,7 @@ protected: QUrl MakeUrlFromLocalPath(const QString& path); QStringList GuessIconForPath(const QString& path); + QStringList GuessIconForModel(const QString& vendor, const QString& model); protected: QThread* thread_; diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp index c7e7d8a4b..87f763025 100644 --- a/src/devices/giolister.cpp +++ b/src/devices/giolister.cpp @@ -65,6 +65,7 @@ QStringList GioLister::DeviceIcons(const QString &id) { QStringList ret; QString path = LockAndGetMountInfo(id, &MountInfo::mount_path); ret << DeviceLister::GuessIconForPath(path) + << DeviceLister::GuessIconForModel(DeviceManufacturer(id), DeviceModel(id)) << LockAndGetMountInfo(id, &MountInfo::icon_names); return ret; }