mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Merge branch 'master' into upstream/pr/6688
This commit is contained in:
commit
091c4fd9b0
4 changed files with 67 additions and 18 deletions
|
@ -198,7 +198,7 @@ X-GNOME-Autostart-Delay=3
|
||||||
|
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
Comment[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
|
Comment[de_DE]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
|
||||||
Icon[de]=@APPLICATION_ICON_NAME@
|
Icon[de_DE]=@APPLICATION_ICON_NAME@
|
||||||
Name[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
|
Name[de_DE]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
|
||||||
GenericName[de]=Synchronisationsordner
|
GenericName[de_DE]=Synchronisationsordner
|
||||||
|
|
|
@ -204,6 +204,10 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
|
||||||
if( !cur->file_id.isEmpty() ) {
|
if( !cur->file_id.isEmpty() ) {
|
||||||
other->file_id = cur->file_id;
|
other->file_id = cur->file_id;
|
||||||
}
|
}
|
||||||
|
if (ctx->current == LOCAL_REPLICA) {
|
||||||
|
// Keep the local mtime.
|
||||||
|
other->modtime = cur->modtime;
|
||||||
|
}
|
||||||
other->inode = cur->inode;
|
other->inode = cur->inode;
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
||||||
// We have consumed 'other': exit this loop to not consume another one.
|
// We have consumed 'other': exit this loop to not consume another one.
|
||||||
|
|
|
@ -576,6 +576,51 @@ private slots:
|
||||||
//QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
//QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/owncloud/client/issues/6629#issuecomment-402450691
|
||||||
|
// When a file is moved and the server mtime was not in sync, the local mtime should be kept
|
||||||
|
void testMoveAndMTimeChange()
|
||||||
|
{
|
||||||
|
FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
|
||||||
|
int nPUT = 0;
|
||||||
|
int nDELETE = 0;
|
||||||
|
int nGET = 0;
|
||||||
|
int nMOVE = 0;
|
||||||
|
fakeFolder.setServerOverride([&](QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *) {
|
||||||
|
if (op == QNetworkAccessManager::PutOperation)
|
||||||
|
++nPUT;
|
||||||
|
if (op == QNetworkAccessManager::DeleteOperation)
|
||||||
|
++nDELETE;
|
||||||
|
if (op == QNetworkAccessManager::GetOperation)
|
||||||
|
++nGET;
|
||||||
|
if (req.attribute(QNetworkRequest::CustomVerbAttribute) == "MOVE")
|
||||||
|
++nMOVE;
|
||||||
|
return nullptr;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Changing the mtime on the server (without invalidating the etag)
|
||||||
|
fakeFolder.remoteModifier().find("A/a1")->lastModified = QDateTime::currentDateTimeUtc().addSecs(-50000);
|
||||||
|
fakeFolder.remoteModifier().find("A/a2")->lastModified = QDateTime::currentDateTimeUtc().addSecs(-40000);
|
||||||
|
|
||||||
|
// Move a few files
|
||||||
|
fakeFolder.remoteModifier().rename("A/a1", "A/a1_server_renamed");
|
||||||
|
fakeFolder.localModifier().rename("A/a2", "A/a2_local_renamed");
|
||||||
|
|
||||||
|
QVERIFY(fakeFolder.syncOnce());
|
||||||
|
QCOMPARE(nGET, 0);
|
||||||
|
QCOMPARE(nPUT, 0);
|
||||||
|
QCOMPARE(nMOVE, 1);
|
||||||
|
QCOMPARE(nDELETE, 0);
|
||||||
|
|
||||||
|
// Another sync should do nothing
|
||||||
|
QVERIFY(fakeFolder.syncOnce());
|
||||||
|
QCOMPARE(nGET, 0);
|
||||||
|
QCOMPARE(nPUT, 0);
|
||||||
|
QCOMPARE(nMOVE, 1);
|
||||||
|
QCOMPARE(nDELETE, 0);
|
||||||
|
|
||||||
|
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(TestSyncMove)
|
QTEST_GUILESS_MAIN(TestSyncMove)
|
||||||
|
|
|
@ -2274,7 +2274,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/libsync/propagateremotemove.cpp" line="141"/>
|
<location filename="../src/libsync/propagateremotemove.cpp" line="141"/>
|
||||||
<source>The file was renamed but is part of a read only share. The original file was restored.</source>
|
<source>The file was renamed but is part of a read only share. The original file was restored.</source>
|
||||||
<translation>文件已经更名,但这是某个只读分享的一部分,原文件已经恢复。</translation>
|
<translation>文件已经更名,但这是某个只读共享的一部分,原文件已经恢复。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/libsync/propagateremotemove.cpp" line="158"/>
|
<location filename="../src/libsync/propagateremotemove.cpp" line="158"/>
|
||||||
|
@ -2355,7 +2355,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/libsync/propagateuploadv1.cpp" line="191"/>
|
<location filename="../src/libsync/propagateuploadv1.cpp" line="191"/>
|
||||||
<source>The file was edited locally but is part of a read only share. It is restored and your edit is in the conflict file.</source>
|
<source>The file was edited locally but is part of a read only share. It is restored and your edit is in the conflict file.</source>
|
||||||
<translation>文件已经在本地修改,但这是某个只读分享的一部分,原文件已经恢复。您的修改已保存在冲突文件中。</translation>
|
<translation>文件已经在本地修改,但这是某个只读共享的一部分,原文件已经恢复。您的修改已保存在冲突文件中。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/libsync/propagateuploadv1.cpp" line="205"/>
|
<location filename="../src/libsync/propagateuploadv1.cpp" line="205"/>
|
||||||
|
@ -2581,7 +2581,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharedialog.ui" line="28"/>
|
<location filename="../src/gui/sharedialog.ui" line="28"/>
|
||||||
<source>share label</source>
|
<source>share label</source>
|
||||||
<translation>分享标签</translation>
|
<translation>共享标签</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharedialog.ui" line="14"/>
|
<location filename="../src/gui/sharedialog.ui" line="14"/>
|
||||||
|
@ -2596,7 +2596,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharedialog.cpp" line="109"/>
|
<location filename="../src/gui/sharedialog.cpp" line="109"/>
|
||||||
<source>%1 Sharing</source>
|
<source>%1 Sharing</source>
|
||||||
<translation>%1 分享</translation>
|
<translation>%1 共享</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharedialog.cpp" line="84"/>
|
<location filename="../src/gui/sharedialog.cpp" line="84"/>
|
||||||
|
@ -2639,7 +2639,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.ui" line="14"/>
|
<location filename="../src/gui/sharelinkwidget.ui" line="14"/>
|
||||||
<source>Share NewDocument.odt</source>
|
<source>Share NewDocument.odt</source>
|
||||||
<translation>分享 NewDocument.odt</translation>
|
<translation>共享 NewDocument.odt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.ui" line="276"/>
|
<location filename="../src/gui/sharelinkwidget.ui" line="276"/>
|
||||||
|
@ -2710,12 +2710,12 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.cpp" line="93"/>
|
<location filename="../src/gui/sharelinkwidget.cpp" line="93"/>
|
||||||
<source>Link shares have been disabled</source>
|
<source>Link shares have been disabled</source>
|
||||||
<translation>分享链接已被关闭</translation>
|
<translation>共享链接已被关闭</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.cpp" line="107"/>
|
<location filename="../src/gui/sharelinkwidget.cpp" line="107"/>
|
||||||
<source>Create public link share</source>
|
<source>Create public link share</source>
|
||||||
<translation>创建公共分享链接</translation>
|
<translation>创建公共共享链接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.cpp" line="168"/>
|
<location filename="../src/gui/sharelinkwidget.cpp" line="168"/>
|
||||||
|
@ -2777,7 +2777,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.cpp" line="459"/>
|
<location filename="../src/gui/sharelinkwidget.cpp" line="459"/>
|
||||||
<source>Public sh&aring requires a password</source>
|
<source>Public sh&aring requires a password</source>
|
||||||
<translation>公开分享需要密码</translation>
|
<translation>公开共享需要密码</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/sharelinkwidget.cpp" line="477"/>
|
<location filename="../src/gui/sharelinkwidget.cpp" line="477"/>
|
||||||
|
@ -2790,12 +2790,12 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.ui" line="14"/>
|
<location filename="../src/gui/shareusergroupwidget.ui" line="14"/>
|
||||||
<source>Share NewDocument.odt</source>
|
<source>Share NewDocument.odt</source>
|
||||||
<translation>分享 NewDocument.odt</translation>
|
<translation>共享 NewDocument.odt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.ui" line="22"/>
|
<location filename="../src/gui/shareusergroupwidget.ui" line="22"/>
|
||||||
<source>Share with users or groups ...</source>
|
<source>Share with users or groups ...</source>
|
||||||
<translation>分享给其他用户或组 ...</translation>
|
<translation>共享给其他用户或组 ...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.ui" line="108"/>
|
<location filename="../src/gui/shareusergroupwidget.ui" line="108"/>
|
||||||
|
@ -2805,7 +2805,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.cpp" line="186"/>
|
<location filename="../src/gui/shareusergroupwidget.cpp" line="186"/>
|
||||||
<source>The item is not shared with any users or groups</source>
|
<source>The item is not shared with any users or groups</source>
|
||||||
<translation>本条目没有被任何用户或组分享</translation>
|
<translation>本条目没有被任何用户或组共享</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.cpp" line="235"/>
|
<location filename="../src/gui/shareusergroupwidget.cpp" line="235"/>
|
||||||
|
@ -2830,7 +2830,7 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/shareusergroupwidget.cpp" line="337"/>
|
<location filename="../src/gui/shareusergroupwidget.cpp" line="337"/>
|
||||||
<source>I shared something with you</source>
|
<source>I shared something with you</source>
|
||||||
<translation>我向您分享了一些东西</translation>
|
<translation>我向您共享了一些东西</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
@ -2923,12 +2923,12 @@ It is not advisable to use it.</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/socketapi.cpp" line="557"/>
|
<location filename="../src/gui/socketapi.cpp" line="557"/>
|
||||||
<source>I shared something with you</source>
|
<source>I shared something with you</source>
|
||||||
<translation>我向您分享了一些东西</translation>
|
<translation>我向您共享了一些东西</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/socketapi.cpp" line="565"/>
|
<location filename="../src/gui/socketapi.cpp" line="565"/>
|
||||||
<source>Share...</source>
|
<source>Share...</source>
|
||||||
<translation>分享到...</translation>
|
<translation>共享到...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui/socketapi.cpp" line="567"/>
|
<location filename="../src/gui/socketapi.cpp" line="567"/>
|
||||||
|
|
Loading…
Reference in a new issue