From 9bd583b0e5d290ffabd05d0ab17cd7e07657a45f 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 033a63c648..693aaa989e 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -633,15 +633,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 7e5c662e58..744bc1819a 100644 --- a/src/gui/application.h +++ b/src/gui/application.h @@ -74,6 +74,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 0fca5f750a..2bd8a28825 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -286,6 +286,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);