mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-01 03:47:10 +01:00
Fix copying to iDevice when artwork directory doesn't exist.
This commit is contained in:
parent
136a72b0cc
commit
d98e16e1b9
@ -97,6 +97,10 @@ bool AfcTransfer::CopyDirFromDevice(iMobileDeviceConnection* c, const QString& p
|
|||||||
bool AfcTransfer::CopyDirToDevice(iMobileDeviceConnection* c, const QString& path) {
|
bool AfcTransfer::CopyDirToDevice(iMobileDeviceConnection* c, const QString& path) {
|
||||||
QDir dir(local_destination_ + path);
|
QDir dir(local_destination_ + path);
|
||||||
|
|
||||||
|
if (!c->Exists(path)) {
|
||||||
|
c->MkDir(path);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (const QString& filename, dir.entryList(QDir::Files | QDir::NoDotAndDotDot)) {
|
foreach (const QString& filename, dir.entryList(QDir::Files | QDir::NoDotAndDotDot)) {
|
||||||
if (!CopyFileToDevice(c, path + "/" + filename))
|
if (!CopyFileToDevice(c, path + "/" + filename))
|
||||||
return false;
|
return false;
|
||||||
|
@ -144,6 +144,11 @@ QStringList iMobileDeviceConnection::ReadDirectory(const QString& path,
|
|||||||
return ret;
|
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 iMobileDeviceConnection::GetFileInfo(const QString& path, const QString& key) {
|
||||||
QString ret;
|
QString ret;
|
||||||
char** infolist = NULL;
|
char** infolist = NULL;
|
||||||
|
@ -37,6 +37,7 @@ public:
|
|||||||
|
|
||||||
QVariant GetProperty(const QString& property, const QString& domain = QString());
|
QVariant GetProperty(const QString& property, const QString& domain = QString());
|
||||||
QStringList ReadDirectory(const QString& path, QDir::Filters filters = QDir::NoFilter);
|
QStringList ReadDirectory(const QString& path, QDir::Filters filters = QDir::NoFilter);
|
||||||
|
bool MkDir(const QString& path);
|
||||||
|
|
||||||
QString GetFileInfo(const QString& path, const QString& key);
|
QString GetFileInfo(const QString& path, const QString& key);
|
||||||
bool Exists(const QString& path);
|
bool Exists(const QString& path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user