~ubuntu-branches/ubuntu/saucy/clementine/saucy

« back to all changes in this revision

Viewing changes to src/devices/devicelister.cpp

  • Committer: Package Import Robot
  • Author(s): Thomas PIERSON
  • Date: 2012-01-01 20:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120101204339-lsb6nndwhfy05sde
Tags: 1.0.1+dfsg-1
New upstream release. (Closes: #653926, #651611, #657391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
namespace {
56
56
 
57
 
bool IsIpod(const QString& path) {
58
 
  return QFile::exists(path + "/iTunes_Control") ||
59
 
         QFile::exists(path + "/iPod_Control") ||
60
 
         QFile::exists(path + "/iTunes/iTunes_Control");
61
 
}
62
 
 
63
57
#ifdef HAVE_LIBGPOD
64
58
 
65
59
QString GetIpodColour(Itdb_IpodModel model) {
164
158
 
165
159
}
166
160
 
167
 
QUrl DeviceLister::MakeUrlFromLocalPath(const QString& path) {
 
161
QUrl DeviceLister::MakeUrlFromLocalPath(const QString& path) const {
168
162
  if (IsIpod(path)) {
169
163
    QUrl ret;
170
164
    ret.setScheme("ipod");
175
169
  return QUrl::fromLocalFile(path);
176
170
}
177
171
 
 
172
bool DeviceLister::IsIpod(const QString& path) const {
 
173
  return QFile::exists(path + "/iTunes_Control") ||
 
174
         QFile::exists(path + "/iPod_Control") ||
 
175
         QFile::exists(path + "/iTunes/iTunes_Control");
 
176
}
 
177
 
178
178
QStringList DeviceLister::GuessIconForPath(const QString& path) {
179
179
  QStringList ret;
180
180
 
183
183
    Itdb_Device* device = itdb_device_new();
184
184
    itdb_device_set_mountpoint(device, path.toLocal8Bit().constData());
185
185
    const Itdb_IpodInfo* info = itdb_device_get_ipod_info(device);
186
 
    qDebug() << info->model_number
187
 
             << info->ipod_model
188
 
             << GetIpodColour(info->ipod_model);
189
186
 
190
187
    QString colour = GetIpodColour(info->ipod_model);
191
188
    QString model = GetIpodModel(info->ipod_model);