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:
authorChristian Kamm <mail@ckamm.de>2019-03-25 12:53:13 +0300
committerChristian Kamm <mail@ckamm.de>2019-03-28 19:30:28 +0300
commitaca19c7a6dd005feb0f8ec909070cd63a1b9a8fb (patch)
tree084791d69a80f8f42ad6919b31720b3f1d284c62
parentf1602a7cb7246c468bd16aaf31bbe8ec2ddffcf0 (diff)
Vfs: Hydrating a virtual is SYNC not NEW #7101
Previously it'd be NEW(ItemTypeFile), but now it has changed to be SYNC(ItemTypeVirtualFileDownload) which allows better classification.
-rw-r--r--src/gui/folder.cpp4
-rw-r--r--src/libsync/discovery.cpp4
-rw-r--r--src/libsync/propagatedownload.cpp3
-rw-r--r--test/testsyncvirtualfiles.cpp13
4 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 01b48d2e1..3d41f48bf 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -416,9 +416,9 @@ void Folder::createGuiLog(const QString &filename, LogStatus status, int count,
break;
case LogStatusNew:
if (count > 1) {
- text = tr("%1 and %n other file(s) are new.", "", count - 1).arg(file);
+ text = tr("%1 and %n other file(s) have been added.", "", count - 1).arg(file);
} else {
- text = tr("%1 is new.", "%1 names a file.").arg(file);
+ text = tr("%1 has been added.", "%1 names a file.").arg(file);
}
break;
case LogStatusUpdated:
diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp
index 16b11cf11..221e40259 100644
--- a/src/libsync/discovery.cpp
+++ b/src/libsync/discovery.cpp
@@ -333,7 +333,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
|| localEntry.type == ItemTypeVirtualFileDownload)
&& (localEntry.isValid() || _queryLocal == ParentNotChanged)) {
item->_direction = SyncFileItem::Down;
- item->_instruction = CSYNC_INSTRUCTION_NEW;
+ item->_instruction = CSYNC_INSTRUCTION_SYNC;
item->_type = ItemTypeVirtualFileDownload;
}
@@ -382,7 +382,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
// The above check for the localEntry existing is important. Otherwise it breaks
// the case where a file is moved and simultaneously tagged for download in the db.
item->_direction = SyncFileItem::Down;
- item->_instruction = CSYNC_INSTRUCTION_NEW;
+ item->_instruction = CSYNC_INSTRUCTION_SYNC;
item->_type = ItemTypeVirtualFileDownload;
} else if (dbEntry._etag != serverEntry.etag) {
item->_direction = SyncFileItem::Down;
diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index 1260a2183..886271cd8 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -1023,9 +1023,6 @@ void PropagateDownloadFile::downloadFinished()
propagator()->_journal->setConflictRecord(_conflictRecord);
if (_item->_type == ItemTypeVirtualFileDownload) {
- // A downloaded virtual file becomes normal
- _item->_type = ItemTypeFile;
-
// If the virtual file used to have a different name and db
// entry, wipe both now.
auto vfs = propagator()->syncOptions()._vfs;
diff --git a/test/testsyncvirtualfiles.cpp b/test/testsyncvirtualfiles.cpp
index 7e1ba9516..a850f5390 100644
--- a/test/testsyncvirtualfiles.cpp
+++ b/test/testsyncvirtualfiles.cpp
@@ -356,9 +356,11 @@ private slots:
fakeFolder.localModifier().insert("A/a6");
fakeFolder.localModifier().remove("A/a6.owncloud");
QVERIFY(fakeFolder.syncOnce());
- QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_NEW));
+ QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_SYNC));
+ QCOMPARE(findItem(completeSpy, "A/a1")->_type, ItemTypeVirtualFileDownload);
QVERIFY(itemInstruction(completeSpy, "A/a1.owncloud", CSYNC_INSTRUCTION_NONE));
- QVERIFY(itemInstruction(completeSpy, "A/a2", CSYNC_INSTRUCTION_NEW));
+ QVERIFY(itemInstruction(completeSpy, "A/a2", CSYNC_INSTRUCTION_SYNC));
+ QCOMPARE(findItem(completeSpy, "A/a2")->_type, ItemTypeVirtualFileDownload);
QVERIFY(itemInstruction(completeSpy, "A/a2.owncloud", CSYNC_INSTRUCTION_NONE));
QVERIFY(itemInstruction(completeSpy, "A/a3.owncloud", CSYNC_INSTRUCTION_REMOVE));
QVERIFY(itemInstruction(completeSpy, "A/a4m", CSYNC_INSTRUCTION_NEW));
@@ -405,7 +407,7 @@ private slots:
triggerDownload(fakeFolder, "A/a1");
fakeFolder.serverErrorPaths().append("A/a1", 500);
QVERIFY(!fakeFolder.syncOnce());
- QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_NEW));
+ QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_SYNC));
QVERIFY(itemInstruction(completeSpy, "A/a1.owncloud", CSYNC_INSTRUCTION_NONE));
QVERIFY(fakeFolder.currentLocalState().find("A/a1.owncloud"));
QVERIFY(!fakeFolder.currentLocalState().find("A/a1"));
@@ -415,7 +417,7 @@ private slots:
fakeFolder.serverErrorPaths().clear();
QVERIFY(fakeFolder.syncOnce());
- QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_NEW));
+ QVERIFY(itemInstruction(completeSpy, "A/a1", CSYNC_INSTRUCTION_SYNC));
QVERIFY(itemInstruction(completeSpy, "A/a1.owncloud", CSYNC_INSTRUCTION_NONE));
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
QCOMPARE(dbRecord(fakeFolder, "A/a1")._type, ItemTypeFile);
@@ -622,7 +624,8 @@ private slots:
QVERIFY(itemInstruction(completeSpy, "renamed2.owncloud", CSYNC_INSTRUCTION_RENAME));
QVERIFY(dbRecord(fakeFolder, "renamed2.owncloud")._type == ItemTypeVirtualFile);
- QVERIFY(itemInstruction(completeSpy, "file3", CSYNC_INSTRUCTION_NEW));
+ QVERIFY(itemInstruction(completeSpy, "file3", CSYNC_INSTRUCTION_SYNC));
+ QVERIFY(dbRecord(fakeFolder, "file3")._type == ItemTypeFile);
cleanup();
// Test rename while adding/removing vfs suffix