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

« back to all changes in this revision

Viewing changes to src/devices/mtpdevice.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:
19
19
#include "mtpconnection.h"
20
20
#include "mtpdevice.h"
21
21
#include "mtploader.h"
 
22
#include "core/logging.h"
22
23
#include "library/librarybackend.h"
23
24
#include "library/librarymodel.h"
24
25
 
111
112
 
112
113
  // Add it to our LibraryModel
113
114
  Song metadata_on_device;
114
 
  metadata_on_device.InitFromMTP(&track);
 
115
  metadata_on_device.InitFromMTP(&track, url_.host());
115
116
  metadata_on_device.set_directory_id(1);
116
 
  metadata_on_device.set_filename("mtp://" + url_.host() + "/" + metadata_on_device.filename());
117
117
  songs_to_add_ << metadata_on_device;
118
118
 
119
119
  // Remove the original if requested
149
149
 
150
150
bool MtpDevice::DeleteFromStorage(const DeleteJob& job) {
151
151
  // Extract the ID from the song's URL
152
 
  QUrl url(job.metadata_.filename());
153
 
  QString filename = url.path();
 
152
  QString filename = job.metadata_.url().path();
154
153
  filename.remove('/');
155
154
 
156
155
  bool ok = false;
177
176
  QMutexLocker l(&db_busy_);
178
177
  MtpConnection connection(url_);
179
178
  if (!connection.is_valid()) {
180
 
    qWarning() << "Error connecting to MTP device, couldn't get list of supported filetypes";
 
179
    qLog(Warning) << "Error connecting to MTP device, couldn't get list of supported filetypes";
181
180
    return false;
182
181
  }
183
182
 
211
210
        *ret << Song::Type_OggFlac;
212
211
        break;
213
212
      default:
214
 
        qDebug() << "Unknown MTP file format" <<
 
213
        qLog(Error) << "Unknown MTP file format" <<
215
214
            LIBMTP_Get_Filetype_Description(LIBMTP_filetype_t(list[i]));
216
215
        break;
217
216
    }