From a2bdd5b9a534717fc2c788daee6e92c1df8c4690 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 25 Jan 2018 16:25:11 +0100 Subject: [PATCH] Placeholders: Fixup clicking on placeholder after previous change Now that the name in the db is the name of the placeholder file, we need to adjust the call to downloadPlaceholder --- src/gui/application.cpp | 4 ++-- src/gui/application.h | 1 + src/gui/folder.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index c0936f3bd..f6d67a4bd 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -684,15 +684,15 @@ void Application::openPlaceholder(const QString &filename) qWarning(lcApplication) << "Can only handle file ending in .owncloud. Unable to open" << filename; return; } - QString normalName = filename.left(filename.size() - placeholderExt.size()); auto folder = FolderMan::instance()->folderForPath(filename); if (!folder) { qWarning(lcApplication) << "Can't find sync folder for" << filename; // TODO: show a QMessageBox for errors return; } - QString relativePath = QDir::cleanPath(normalName).mid(folder->cleanPath().length() + 1); + QString relativePath = QDir::cleanPath(filename).mid(folder->cleanPath().length() + 1); folder->downloadPlaceholder(relativePath); + QString normalName = filename.left(filename.size() - placeholderExt.size()); auto con = QSharedPointer::create(); *con = QObject::connect(folder, &Folder::syncFinished, [con, normalName] { QObject::disconnect(*con); diff --git a/src/gui/application.h b/src/gui/application.h index a184cf5ef..d771c1422 100644 --- a/src/gui/application.h +++ b/src/gui/application.h @@ -75,6 +75,7 @@ public slots: void slotCrash(); /** * Will download a placeholder file, and open the result. + * The argument is the filename of the placeholder file (including the extension) */ void openPlaceholder(const QString &filename); diff --git a/src/gui/folder.h b/src/gui/folder.h index 778e35ad5..3759f16da 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -280,6 +280,7 @@ public slots: /** * Mark a placeholder as being ready for download, and start a sync. + * relativePath is the patch to the placeholder file (includeing the extension) */ void downloadPlaceholder(const QString &relativepath); -- 2.30.2