Use correct icon for Nexus One.

This commit is contained in:
John Maguire 2010-07-25 13:32:47 +00:00
parent 39b72e2b9c
commit 6358198b06
4 changed files with 15 additions and 3 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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_;

View File

@ -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;
}