Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-10-07 15:26:39 +0300
committerHannah von Reth <hannah.vonreth@owncloud.com>2021-10-07 15:26:39 +0300
commit35d059e2875732696b0bc6a164cb90f45c56e40a (patch)
tree80f6c586918d1c99c39e1e7c2a40f96bf8593eec
parent934d2aa724a9943d326624bc5829e544107cc375 (diff)
parent6a2510185909fb8c8c44b17cc61c32bf98a0beca (diff)
Merge remote-tracking branch 'origin/2.9.1' into 2.9
-rw-r--r--changelog/unreleased/90006
-rw-r--r--changelog/unreleased/90107
-rw-r--r--changelog/unreleased/91145
-rw-r--r--cmake/modules/FindLibcloudproviders.cmake7
-rw-r--r--src/gui/folder.cpp24
-rw-r--r--src/gui/folder.h3
-rw-r--r--src/gui/folderman.cpp22
-rw-r--r--src/gui/libcloudproviders/libcloudproviders.cmake2
8 files changed, 54 insertions, 22 deletions
diff --git a/changelog/unreleased/9000 b/changelog/unreleased/9000
deleted file mode 100644
index 833db2234..000000000
--- a/changelog/unreleased/9000
+++ /dev/null
@@ -1,6 +0,0 @@
-Enhancement: Display the error type in the issue protocol and allow filtering
-
-We now display the error type in the not synced protocol and allow to filter by the
-error type.
-
-https://github.com/owncloud/client/issues/9000
diff --git a/changelog/unreleased/9010 b/changelog/unreleased/9010
new file mode 100644
index 000000000..ee56eabe7
--- /dev/null
+++ b/changelog/unreleased/9010
@@ -0,0 +1,7 @@
+Enhancement: Display the error type in the issue protocol to allow sorting
+
+We now display the error type in the not synced protocol and allow to sort by the
+error type.
+
+https://github.com/owncloud/client/issues/9000
+https://github.com/owncloud/client/pull/9010
diff --git a/changelog/unreleased/9114 b/changelog/unreleased/9114
new file mode 100644
index 000000000..39afc7d45
--- /dev/null
+++ b/changelog/unreleased/9114
@@ -0,0 +1,5 @@
+Bugfix: Downgrades could trigger deletion of virtual files
+
+We now prevent the downgrade of Windows VFS folders.
+
+https://github.com/owncloud/client/issues/9114
diff --git a/cmake/modules/FindLibcloudproviders.cmake b/cmake/modules/FindLibcloudproviders.cmake
index 0e1875fdc..800c1e482 100644
--- a/cmake/modules/FindLibcloudproviders.cmake
+++ b/cmake/modules/FindLibcloudproviders.cmake
@@ -35,8 +35,9 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
- LIBCLOUDPROVIDERS
- DEFAULT_MSG
- LIBCLOUDPROVIDERS_LIBRARY LIBCLOUDPROVIDERS_INCLUDE_DIR)
+ Libcloudproviders
+ DEFAULT_MSG
+ LIBCLOUDPROVIDERS_LIBRARY LIBCLOUDPROVIDERS_INCLUDE_DIR
+)
mark_as_advanced(LIBCLOUDPROVIDERS_INCLUDE_DIR LIBCLOUDPROVIDERS_LIBRARY)
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index d352b817a..b6c7afa4f 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -47,7 +47,21 @@
#include <QPushButton>
#include <QApplication>
-static const char versionC[] = "version";
+namespace {
+
+/*
+ * [Accounts]
+ * 1\Folders\4\version=2
+ * 1\FoldersWithPlaceholders\3\version=3
+ */
+auto versionC()
+{
+ return QStringLiteral("version");
+}
+
+constexpr int WinVfsSettingsVersion = 4;
+constexpr int SettingsVersion = 2;
+}
namespace OCC {
@@ -1298,11 +1312,9 @@ void FolderDefinition::save(QSettings &settings, const FolderDefinition &folder)
settings.setValue(QStringLiteral("virtualFilesMode"), Vfs::modeToString(folder.virtualFilesMode));
// Ensure new vfs modes won't be attempted by older clients
- if (folder.virtualFilesMode == Vfs::WindowsCfApi) {
- settings.setValue(QLatin1String(versionC), 3);
- } else {
- settings.setValue(QLatin1String(versionC), 2);
- }
+ const int version = folder.virtualFilesMode == Vfs::WindowsCfApi ? WinVfsSettingsVersion : SettingsVersion;
+ Q_ASSERT(version <= maxSettingsVersion());
+ settings.setValue(versionC(), version);
// Happens only on Windows when the explorer integration is enabled.
if (!folder.navigationPaneClsid.isNull())
diff --git a/src/gui/folder.h b/src/gui/folder.h
index ecd3327a9..3f7d30737 100644
--- a/src/gui/folder.h
+++ b/src/gui/folder.h
@@ -90,8 +90,9 @@ public:
* Version 2: introduction of metadata_parent hash in 2.6.0
* (version remains readable by 2.5.1)
* Version 3: introduction of new windows vfs mode in 2.6.0
+ * Version 4: until 2.9.1 windows vfs tried to unregister folders with a different id from windows.
*/
- static int maxSettingsVersion() { return 3; }
+ static int maxSettingsVersion() { return 4; }
/// Ensure / as separator and trailing /.
static QString prepareLocalPath(const QString &path);
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index 0d0daac5b..d32d0c056 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -37,8 +37,20 @@
#include <QNetworkProxy>
namespace {
-const char versionC[] = "version";
-const int maxFoldersVersion = 1;
+/*
+ * [Accounts]
+ * 0\version=1
+ */
+auto versionC()
+{
+ return QStringLiteral("version");
+}
+
+/*
+ * Folders with a version > maxFoldersVersion will be removed
+ * After the user was prompted for consent.
+ */
+constexpr int maxFoldersVersion = 1;
int numberOfSyncJournals(const QString &path)
{
@@ -347,7 +359,7 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account,
Folder *f = addFolderInternal(std::move(folderDefinition), account.data(), std::move(vfs));
if (f) {
// Migrate the old "usePlaceholders" setting to the root folder pin state
- if (settings.value(QLatin1String(versionC), 1).toInt() == 1
+ if (settings.value(versionC(), 1).toInt() == 1
&& settings.value(QLatin1String("usePlaceholders"), false).toBool()) {
qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly";
f->setRootPinState(PinState::OnlineOnly);
@@ -403,12 +415,12 @@ void FolderMan::backwardMigrationSettingsKeys(QStringList *deleteKeys, QStringLi
auto processSubgroup = [&](const QString &name) {
settings->beginGroup(name);
- const int foldersVersion = settings->value(QLatin1String(versionC), 1).toInt();
+ const int foldersVersion = settings->value(versionC(), 1).toInt();
if (foldersVersion <= maxFoldersVersion) {
const auto &childGroups = settings->childGroups();
for (const auto &folderAlias : childGroups) {
settings->beginGroup(folderAlias);
- const int folderVersion = settings->value(QLatin1String(versionC), 1).toInt();
+ const int folderVersion = settings->value(versionC(), 1).toInt();
if (folderVersion > FolderDefinition::maxSettingsVersion()) {
ignoreKeys->append(settings->group());
}
diff --git a/src/gui/libcloudproviders/libcloudproviders.cmake b/src/gui/libcloudproviders/libcloudproviders.cmake
index 0dc9816e6..cfb86b894 100644
--- a/src/gui/libcloudproviders/libcloudproviders.cmake
+++ b/src/gui/libcloudproviders/libcloudproviders.cmake
@@ -4,7 +4,7 @@
set(LIBCLOUDPROVIDERS_POSSIBLE "")
find_package(Libcloudproviders QUIET)
find_package(PkgConfig)
-if(LIBCLOUDPROVIDERS_FOUND AND PKG_CONFIG_FOUND)
+if(Libcloudproviders_FOUND AND PKG_CONFIG_FOUND)
pkg_search_module(GIO gio-2.0)
if(GIO_FOUND)
set(LIBCLOUDPROVIDERS_POSSIBLE "1")