瀏覽代碼

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
Olivier Goffart 8 年之前
父節點
當前提交
a2bdd5b9a5
共有 3 個文件被更改,包括 4 次插入2 次删除
  1. 2 2
      src/gui/application.cpp
  2. 1 0
      src/gui/application.h
  3. 1 0
      src/gui/folder.h

+ 2 - 2
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<QMetaObject::Connection>::create();
     *con = QObject::connect(folder, &Folder::syncFinished, [con, normalName] {
         QObject::disconnect(*con);

+ 1 - 0
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);
 

+ 1 - 0
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);