devices: Fix guessed icons in DeviceIcons
In the initial implementation, DeviceLister::DeviceIcons returned a string list and some listers would concatenate other lists to form that list. When DeviceIcons was changed to return a variant list, that logic wasn't changed in many places, so instead of appending, string list variants are being added icon list.
This commit is contained in:
parent
20647e8a98
commit
708385c71f
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QStringList>
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
@ -171,8 +170,8 @@ bool DeviceLister::IsIpod(const QString& path) const {
|
||||||
QFile::exists(path + "/iTunes/iTunes_Control");
|
QFile::exists(path + "/iTunes/iTunes_Control");
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList DeviceLister::GuessIconForPath(const QString& path) {
|
QVariantList DeviceLister::GuessIconForPath(const QString& path) {
|
||||||
QStringList ret;
|
QVariantList ret;
|
||||||
|
|
||||||
#ifdef HAVE_LIBGPOD
|
#ifdef HAVE_LIBGPOD
|
||||||
if (IsIpod(path)) {
|
if (IsIpod(path)) {
|
||||||
|
@ -200,9 +199,9 @@ QStringList DeviceLister::GuessIconForPath(const QString& path) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList DeviceLister::GuessIconForModel(const QString& vendor,
|
QVariantList DeviceLister::GuessIconForModel(const QString& vendor,
|
||||||
const QString& model) {
|
const QString& model) {
|
||||||
QStringList ret;
|
QVariantList ret;
|
||||||
if (vendor.startsWith("Google") && model.contains("Nexus")) {
|
if (vendor.startsWith("Google") && model.contains("Nexus")) {
|
||||||
ret << "phone-google-nexus-one";
|
ret << "phone-google-nexus-one";
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ class DeviceLister : public QObject {
|
||||||
QUrl MakeUrlFromLocalPath(const QString& path) const;
|
QUrl MakeUrlFromLocalPath(const QString& path) const;
|
||||||
bool IsIpod(const QString& path) const;
|
bool IsIpod(const QString& path) const;
|
||||||
|
|
||||||
QStringList GuessIconForPath(const QString& path);
|
QVariantList GuessIconForPath(const QString& path);
|
||||||
QStringList GuessIconForModel(const QString& vendor, const QString& model);
|
QVariantList GuessIconForModel(const QString& vendor, const QString& model);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QThread* thread_;
|
QThread* thread_;
|
||||||
|
|
|
@ -99,7 +99,7 @@ class GioLister : public DeviceLister {
|
||||||
QString mount_path;
|
QString mount_path;
|
||||||
QString mount_uri;
|
QString mount_uri;
|
||||||
QString mount_name;
|
QString mount_name;
|
||||||
QStringList mount_icon_names;
|
QVariantList mount_icon_names;
|
||||||
QString mount_uuid;
|
QString mount_uuid;
|
||||||
quint64 filesystem_size;
|
quint64 filesystem_size;
|
||||||
quint64 filesystem_free;
|
quint64 filesystem_free;
|
||||||
|
|
Loading…
Reference in New Issue