1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 19:45:31 +01:00

Fix copying to iDevice when artwork directory doesn't exist.

This commit is contained in:
John Maguire 2010-08-28 23:37:10 +00:00
parent 136a72b0cc
commit d98e16e1b9
3 changed files with 10 additions and 0 deletions

View File

@ -97,6 +97,10 @@ bool AfcTransfer::CopyDirFromDevice(iMobileDeviceConnection* c, const QString& p
bool AfcTransfer::CopyDirToDevice(iMobileDeviceConnection* c, const QString& path) {
QDir dir(local_destination_ + path);
if (!c->Exists(path)) {
c->MkDir(path);
}
foreach (const QString& filename, dir.entryList(QDir::Files | QDir::NoDotAndDotDot)) {
if (!CopyFileToDevice(c, path + "/" + filename))
return false;

View File

@ -144,6 +144,11 @@ QStringList iMobileDeviceConnection::ReadDirectory(const QString& path,
return ret;
}
bool iMobileDeviceConnection::MkDir(const QString& path) {
afc_error_t err = afc_make_directory(afc_, path.toUtf8().constData());
return err == AFC_E_SUCCESS;
}
QString iMobileDeviceConnection::GetFileInfo(const QString& path, const QString& key) {
QString ret;
char** infolist = NULL;

View File

@ -37,6 +37,7 @@ public:
QVariant GetProperty(const QString& property, const QString& domain = QString());
QStringList ReadDirectory(const QString& path, QDir::Filters filters = QDir::NoFilter);
bool MkDir(const QString& path);
QString GetFileInfo(const QString& path, const QString& key);
bool Exists(const QString& path);