Skip to content

Commit 9f43d8e

Browse files
committedOct 31, 2018
Revert "Database: future-proof to allow downgrade from future version"
This commit does not need to be in 2.6, it is only supposed to be in 2.5.1 This reverts commit a97f6fc.
1 parent a699903 commit 9f43d8e

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed
 

‎src/common/syncjournaldb.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -314,20 +314,6 @@ bool SyncJournalDb::checkConnect()
314314
qCInfo(lcDb) << "sqlite3 version" << pragma1.stringValue(0);
315315
}
316316

317-
{
318-
// Future version of the client (2.6) will have an index 'metadata_parent' which
319-
// depends on a custom sqlite function which does not exist yet in 2.5.
320-
// So make sure to remove the index if it exists, otherwise we will crash when inserting
321-
// rows in the metadata database.
322-
// This needs to be done before the synchronous mode is enabled.
323-
// The 2.6 client will anyway re-creates this index if it does not exist.
324-
SqlQuery query(_db);
325-
query.prepare("DROP INDEX IF EXISTS metadata_parent;");
326-
if (!query.exec()) {
327-
return sqlFail("updateMetadataTableStructure: remove index metadata_parent", query);
328-
}
329-
}
330-
331317
pragma1.prepare("PRAGMA journal_mode=" + _journalMode + ";");
332318
if (!pragma1.exec()) {
333319
return sqlFail("Set PRAGMA journal_mode", pragma1);

‎src/gui/folder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ void FolderDefinition::save(QSettings &settings, const FolderDefinition &folder)
11141114
settings.setValue(QLatin1String("paused"), folder.paused);
11151115
settings.setValue(QLatin1String("ignoreHiddenFiles"), folder.ignoreHiddenFiles);
11161116
settings.setValue(QLatin1String("usePlaceholders"), folder.useVirtualFiles);
1117-
settings.setValue(QLatin1String(versionC), 1);
1117+
settings.setValue(QLatin1String(versionC), maxSettingsVersion());
11181118

11191119
// Happens only on Windows when the explorer integration is enabled.
11201120
if (!folder.navigationPaneClsid.isNull())

‎src/gui/folder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class FolderDefinition
7777
FolderDefinition *folder);
7878

7979
/// The highest version in the settings that load() can read
80-
static int maxSettingsVersion() { return 2; }
80+
static int maxSettingsVersion() { return 1; }
8181

8282
/// Ensure / as separator and trailing /.
8383
static QString prepareLocalPath(const QString &path);

0 commit comments

Comments
 (0)
Please sign in to comment.