1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-07 18:46:49 +02:00

Compare commits

..

256 Commits

Author SHA1 Message Date
Dominik Schmidt
b247c41c64 Make SYSTEM_LIBRARY_BLACKLIST less brittle 2018-10-11 13:09:35 +02:00
Dominik Schmidt
de3dd3f889 Package libcrypto.dylib and libssl.dylib even if they are also available as system library 2018-10-11 13:09:35 +02:00
Dominik Schmidt
b5a06361b9 Don't look for Qt plugins or libraries in system dirs. 2018-10-11 13:09:35 +02:00
Dominik Schmidt
f8e7df42a8 Simplify Sparkle handling in CMake 2018-10-11 13:09:35 +02:00
Dominik Schmidt
ba2c4d1b21 Add more debug output to macdeployqt.py 2018-10-11 13:09:35 +02:00
Jenkins for ownCloud
5c3dc990ca [tx-robot] updated from transifex 2018-10-11 02:18:38 +02:00
Jenkins for ownCloud
aee4ed6192 [tx-robot] updated from transifex 2018-10-10 02:18:43 +02:00
Christian Kamm
777e6ff5e0 PropagateUpload: Avoid crash due to cascading aborts
https://sentry.io/owncloud/desktop-win-and-mac/issues/698694072/activity/
2018-10-09 13:25:54 +02:00
Olivier Goffart
df68d2b76f Remove translations comments in desktop file 2018-10-09 09:24:39 +02:00
Jenkins for ownCloud
a4c6b48824 [tx-robot] updated from transifex 2018-10-09 02:18:42 +02:00
Jenkins for ownCloud
47cd931193 [tx-robot] updated from transifex 2018-10-07 02:18:43 +02:00
Jenkins for ownCloud
7f104355f1 [tx-robot] updated from transifex 2018-10-06 02:18:42 +02:00
Olivier Goffart
8a08a51540 Fix leaks in tests
As discovered by AddressSanitizer
2018-10-05 19:03:08 +02:00
Jenkins for ownCloud
d8aa08d6ea [tx-robot] updated from transifex 2018-10-04 02:18:42 +02:00
Jenkins for ownCloud
778186b9ce [tx-robot] updated from transifex 2018-10-03 02:18:39 +02:00
Jenkins for ownCloud
4c07c4070b [tx-robot] updated from transifex 2018-10-02 02:18:40 +02:00
Jenkins for ownCloud
d434b2fd2a [tx-robot] updated from transifex 2018-10-01 02:18:39 +02:00
Jenkins for ownCloud
a1db6bfce5 [tx-robot] updated from transifex 2018-09-30 02:18:40 +02:00
Jenkins for ownCloud
83eeef1410 [tx-robot] updated from transifex 2018-09-29 02:18:41 +02:00
Jenkins for ownCloud
cccf4b100b [tx-robot] updated from transifex 2018-09-28 02:18:39 +02:00
Jenkins for ownCloud
5481060f82 [tx-robot] updated from transifex 2018-09-27 02:18:39 +02:00
Markus Goetz
5cd9082bea VERSION.cmake: This branch is 2.5.1 2018-09-26 11:43:39 -04:00
Christian Kamm
5e442f588e Virtual files: Renames propagate #6718 2018-09-26 16:39:41 +02:00
Jenkins for ownCloud
15e5cd9be0 [tx-robot] updated from transifex 2018-09-26 02:18:39 +02:00
Jenkins for ownCloud
73641bfb9b [tx-robot] updated from transifex 2018-09-25 02:18:38 +02:00
Jenkins for ownCloud
85464a9230 [tx-robot] updated from transifex 2018-09-24 02:18:40 +02:00
Jenkins for ownCloud
e65a8b44be [tx-robot] updated from transifex 2018-09-23 02:18:42 +02:00
Jenkins for ownCloud
a3f0c7f010 [tx-robot] updated from transifex 2018-09-22 02:18:35 +02:00
Olivier Goffart
30fb68b3b7 Folder Wizard: Disable the 'choose what to sync' treeview if virtual files are selected
Don't allow to configure virtual files with a selective sync blacklist
2018-09-21 14:16:12 +02:00
Olivier Goffart
e04af3088b Windows Shell Integration: Don't limit the size of the buffer
Otherwise we can't have operation that has many many filename

As reported in #6780
2018-09-21 11:50:23 +02:00
Jenkins for ownCloud
44ae0df62b [tx-robot] updated from transifex 2018-09-21 02:18:35 +02:00
Jenkins for ownCloud
58a4bcb50f [tx-robot] updated from transifex 2018-09-20 02:18:40 +02:00
Jenkins for ownCloud
cad3c8a136 [tx-robot] updated from transifex 2018-09-19 02:18:40 +02:00
lefherz
131c3448e3 Documented: unsupported server version warning message 2018-09-18 16:31:57 +02:00
Jenkins for ownCloud
117f6a86a7 [tx-robot] updated from transifex 2018-09-18 02:18:39 +02:00
Jenkins for ownCloud
34e7782d91 [tx-robot] updated from transifex 2018-09-17 02:18:38 +02:00
Olivier Goffart
413ff1c7a0 AccountSetting: Fix Small Memoy leak 2018-09-16 21:54:25 +02:00
Olivier Goffart
a50eee8d8a IssueWidget: fix memory leak 2018-09-16 21:54:25 +02:00
Jenkins for ownCloud
10b9b7a793 [tx-robot] updated from transifex 2018-09-16 02:18:35 +02:00
Jenkins for ownCloud
3b57e22fc8 [tx-robot] updated from transifex 2018-09-15 02:18:36 +02:00
Jenkins for ownCloud
19951e5533 [tx-robot] updated from transifex 2018-09-14 02:18:38 +02:00
Jenkins for ownCloud
2a2451f4db [tx-robot] updated from transifex 2018-09-13 02:18:36 +02:00
Jenkins for ownCloud
9560cf2734 [tx-robot] updated from transifex 2018-09-12 02:18:33 +02:00
Jenkins for ownCloud
ba388934a2 [tx-robot] updated from transifex 2018-09-11 02:18:37 +02:00
Jenkins for ownCloud
cd5d8b3f5a [tx-robot] updated from transifex 2018-09-10 02:18:38 +02:00
Jenkins for ownCloud
04770d51d5 [tx-robot] updated from transifex 2018-09-09 02:18:44 +02:00
Jenkins for ownCloud
8130963476 [tx-robot] updated from transifex 2018-09-08 02:18:36 +02:00
Jenkins for ownCloud
fe28e00357 [tx-robot] updated from transifex 2018-09-07 02:18:41 +02:00
Markus Goetz
7d023348ab ChangeLog: More 2.5.0 stuff 2018-09-06 11:07:03 +02:00
Olivier Goffart
0abf2c603e Fix tx.pl
The conflict filename changed
2018-09-06 10:57:12 +02:00
Olivier Goffart
9f742f059a AccountSettings: Force sync should wipe the blacklist
Issue #6757
2018-09-06 10:56:58 +02:00
Jenkins for ownCloud
5bcbcecb09 [tx-robot] updated from transifex 2018-09-06 02:18:36 +02:00
Markus Goetz
41ba1bf6e9 ChangeLog: 2.5.0 changes 2018-09-05 17:09:10 +02:00
Dominik Schmidt
822637965b Remove unused installers before copying new ones into the appdata dir 2018-09-05 15:05:19 +02:00
Olivier Goffart
54c6967956 Activity: Do not remove the username from the account name
Issue #6728
2018-09-05 09:20:48 +02:00
Jenkins for ownCloud
e281f081dc [tx-robot] updated from transifex 2018-09-05 02:18:39 +02:00
Dominik Schmidt
7080c0b33b Ignore indirect mysql dependency in craft 2018-09-04 10:45:59 +02:00
Dominik Schmidt
a82ef9979c Whitelist symbol dumps for craft packagers 2018-09-04 10:45:59 +02:00
Dominik Schmidt
5cb7344c0b Update craft config to version 6 and lock it to that version 2018-09-04 10:45:59 +02:00
Dominik Schmidt
82553270cf Require current openSSL on appveyor 2018-09-04 10:45:59 +02:00
Jenkins for ownCloud
ceb112d1fd [tx-robot] updated from transifex 2018-09-04 02:18:41 +02:00
Jenkins for ownCloud
a26901ea30 [tx-robot] updated from transifex 2018-09-01 02:18:39 +02:00
Christian Kamm
9b7da91f6d Private links: improve legacy fileid derivation #6745 2018-08-31 18:10:01 +02:00
Olivier Goffart
a31eadcadf Discovery: Do full local discovery when changing the ignore files config
Since we are now skipping the full local discovery, we also need to
call the method to force a full local discovery while we were making
full remote discovery, for the same reason.

Same applies when applying a selective sync: Normally there should not
be any file or directory with the same same of a blacklisted folder, but
if there is one, it was ignored and now need to be taken in account.

Also make the F6 shortcut do a full local discovery as well.
2018-08-31 16:41:23 +02:00
Olivier Goffart
7209fd27a0 Virtual files: don't check for new big folders
https://github.com/owncloud/client/issues/6724#issuecomment-417368475
2018-08-31 16:40:27 +02:00
Christian Kamm
0bab7cb068 virtual files: show option only when branding allows it 2018-08-31 16:33:19 +02:00
Olivier Goffart
0696805cef Virtual files: Don't show selective sync
Issue #6724
2018-08-31 16:01:21 +02:00
Jenkins for ownCloud
1e5b632e60 [tx-robot] updated from transifex 2018-08-31 02:18:47 +02:00
Olivier Goffart
61452de83d Socket API: add an option to replace existing files with virtual files
Issue #6726
2018-08-30 17:59:02 +02:00
Olivier Goffart
aefeb08e36 Update the minimum supported version
We want to warn if the server version is not supported and did not get
appropriate QA for this client version.

https://github.com/owncloud/enterprise/issues/2687
2018-08-30 17:57:02 +02:00
Jenkins for ownCloud
918f6abd98 [tx-robot] updated from transifex 2018-08-30 02:18:41 +02:00
Jenkins for ownCloud
00674b12a7 [tx-robot] updated from transifex 2018-08-29 02:18:38 +02:00
Jenkins for ownCloud
af6accc3cc [tx-robot] updated from transifex 2018-08-28 02:18:37 +02:00
Michael Stingl
ba2e006263 Merge pull request #6739 from owncloud/msi-doc
Add documentation for installing the .msi
2018-08-27 13:04:13 +02:00
Jenkins for ownCloud
0a88b069dd [tx-robot] updated from transifex 2018-08-27 02:18:38 +02:00
Jenkins for ownCloud
b98d96a82d [tx-robot] updated from transifex 2018-08-26 02:18:34 +02:00
Jenkins for ownCloud
6ed83d4a60 [tx-robot] updated from transifex 2018-08-25 02:18:38 +02:00
Matthew Setter
d3d16e2259 Minor updates to the installing guide
There were a number of little things that needed touching up, including
properly formatting inline code blocks, headers, and reformatting
content to match the (unpublished) style guide.
2018-08-24 15:19:08 +02:00
Dominik Schmidt
fe043006c8 Add documentation for installing the .msi 2018-08-24 12:15:16 +02:00
Jenkins for ownCloud
bd5897a422 [tx-robot] updated from transifex 2018-08-24 02:18:42 +02:00
Jenkins for ownCloud
46d3e0d68c [tx-robot] updated from transifex 2018-08-23 02:18:36 +02:00
Markus Goetz
662d218595 CMakeLists.txt: Log the Qt version in compile 2018-08-22 16:39:24 +02:00
Christian Kamm
b4f63ca219 Conflicts: Rename BasePath to InitialBasePath #6709 2018-08-22 09:03:54 +02:00
Jenkins for ownCloud
f50afaf3eb [tx-robot] updated from transifex 2018-08-22 02:18:39 +02:00
Olivier Goffart
64c1f7752b Fix test link with older Qt 2018-08-21 10:45:27 +02:00
Olivier Goffart
4194025eeb Account Settings: the info text should not be clickable
Adjustment for #6723
2018-08-21 10:36:44 +02:00
Jenkins for ownCloud
4dc2a70031 [tx-robot] updated from transifex 2018-08-21 02:18:41 +02:00
Markus Goetz
b03d106d0b ChangeLog: More 2.5.0 entries 2018-08-20 14:34:55 +02:00
Jenkins for ownCloud
c1751de118 [tx-robot] updated from transifex 2018-08-20 02:18:47 +02:00
Olivier Goffart
6b8af42419 Activity: Handle the fact that the username can contain a '@'
Issue #6728
2018-08-19 21:26:16 +02:00
Olivier Goffart
c85cd8e225 Conflict handling: add the OC-ConflictBasePath header
Issue #6702
2018-08-19 21:22:08 +02:00
Olivier Goffart
dd13e6304a Account Settings: Add a text for folder using vierual files
Issue #6723
2018-08-19 21:18:15 +02:00
Olivier Goffart
d1e15b7802 Virtual Files: Set the mtime of the virtual file to that of the server
Note: When the server mtime is modified, the mtime of the file is not updated

Issue #6727
2018-08-19 21:11:59 +02:00
Olivier Goffart
add417e7af Virtual Files Mime Type: use "vnd." prefix instead of "x-"
As reported in https://github.com/owncloud/client/issues/6717#issuecomment-413703567
2018-08-19 21:10:23 +02:00
Jenkins for ownCloud
9db3439aeb [tx-robot] updated from transifex 2018-08-19 02:18:35 +02:00
Jenkins for ownCloud
5deeb6cd87 [tx-robot] updated from transifex 2018-08-18 02:18:39 +02:00
Markus Goetz
06633cf7f6 ChangeLog 2.5.0 updates 2018-08-17 14:56:37 +02:00
Christian Kamm
406192d0ba Windows: Release handle/fd when file open fails #6699 2018-08-17 14:35:49 +02:00
Christian Kamm
0b9049e6ff Virtual files: Renaming to virtual doesn't delete data #6718
Unfortunately to do this, the local update phase must write to the
database, creating a new side-effect and order dependency (local update
must run before remote update).
2018-08-17 14:27:09 +02:00
Jenkins for ownCloud
c2020e467b [tx-robot] updated from transifex 2018-08-17 02:18:42 +02:00
Olivier Goffart
4a3fce531c SyncEngine: Fix renames making hierarchy inversion
Issue #6694
2018-08-16 10:38:18 +02:00
Christian Kamm
760f0eab89 C++: Don't use auto parameters in lambdas
The mingw compiler isn't happy with them.
2018-08-16 10:26:44 +02:00
Christian Kamm
c8ecbc30ed RemotePermissions: Fix empty vs null
Fixes two bugs that appeared since the introduction of the struct:
- when reading permissions from the journal, null ("") was read as
  empty-not-null
- when reading permissinos from the server, empty ("") was read as null

Addresses #4608
2018-08-16 09:08:17 +02:00
Christian Kamm
2811aebf1a nautilus: Fix GET_MENU_ITEMS with utf8 filenames #6643 2018-08-16 09:07:00 +02:00
Jenkins for ownCloud
3450b2b85e [tx-robot] updated from transifex 2018-08-16 02:18:35 +02:00
Olivier Goffart
d038ffa1fd FolderStatusModel: Do not abort applying selective sync if one folder has an error
Issue #6675
2018-08-15 09:34:43 +02:00
Olivier Goffart
58f46010b5 SyncEngine: Fix the "direction" of the "all file delted" message when the server is reset
Using the direction of the "first" item is not enough as it might be a directory
which is a UPDATE_META_DATA,  or there can have been a few changes locally as well.

As reported on https://github.com/owncloud/client/issues/6317#issuecomment-412163113
2018-08-15 09:34:19 +02:00
Jenkins for ownCloud
3dcf2479ad [tx-robot] updated from transifex 2018-08-15 02:18:35 +02:00
Olivier Goffart
8ba0b83353 Wizard: pre-select the right radio button...
... when the wizardSelectiveSyncDefaultNothing branding option is set

Note: bormally the right option is set when the "choose what to sync"
dialog is closed.  So this was only a problem when the dialog was visible
for the first time, the wrong option would be selected underneath.

Issue #6685
2018-08-14 11:03:28 +02:00
Olivier Goffart
cf6e8269bf Activities: Remove the text that a server does not support activities when the account is removed
Issue #6679
2018-08-14 11:03:02 +02:00
Olivier Goffart
58d6632eaf Data-Fingerprint: Fix backup detection when fingerprint is empty
Add a test to test the data fingerprint feature make me realize it was broken.
The code was relying in the distinction between empty and null QByteArray,
but this was a bad idea as this difference is lost when going through QString.
2018-08-14 10:57:20 +02:00
Jenkins for ownCloud
81cc4c064e [tx-robot] updated from transifex 2018-08-14 02:18:40 +02:00
Markus Goetz
f27e5374eb ChangeLog: 2.4.3 changes from 2.4 branch 2018-08-13 15:23:31 +02:00
Jenkins for ownCloud
7ec97f3f3a [tx-robot] updated from transifex 2018-08-13 02:18:40 +02:00
Jenkins for ownCloud
e9c9f5301e [tx-robot] updated from transifex 2018-08-12 02:18:44 +02:00
Jenkins for ownCloud
ab98547677 [tx-robot] updated from transifex 2018-08-11 02:18:41 +02:00
Jenkins for ownCloud
659aefa8ad [tx-robot] updated from transifex 2018-08-10 02:18:43 +02:00
Olivier Goffart
eb7e074795 OAuth: Fix infinite loop when the refresh token is expired
The server reply with a code 400 when the token is invalid,
the client was understanding this error as a network error, and was retying
again with the same token.

Instead, we must rely on what the json is saying, even if the reply is
not a 200 code.

Issue https://github.com/owncloud/enterprise/issues/2777
2018-08-09 13:48:45 +02:00
Markus Goetz
d0bdccc60a Windows: Don't ignore files with FILE_ATTRIBUTE_TEMPORARY
Too many applications incorrectly use this attribute.

For #6696 #6610
2018-08-09 13:37:50 +02:00
Jenkins for ownCloud
84b98ca29f [tx-robot] updated from transifex 2018-08-09 02:18:47 +02:00
Jenkins for ownCloud
299851c817 [tx-robot] updated from transifex 2018-08-08 02:18:47 +02:00
Olivier Goffart
45bf2e9023 MSI: Fix crash in the auto updater
'auto' here is a QStringBuilder referencing a temporary

Ammend commit 150d4f5935
(MSI: Always with logfile #6609)

Found in the crash reporter:
https://sentry.io/owncloud/desktop-win-and-mac/issues/623245771/
2018-08-07 09:56:05 +02:00
Jenkins for ownCloud
de0883d1a8 [tx-robot] updated from transifex 2018-08-07 02:18:48 +02:00
Jenkins for ownCloud
02fc7d3d0d [tx-robot] updated from transifex 2018-08-06 02:18:45 +02:00
Jenkins for ownCloud
d9e7ecd00a [tx-robot] updated from transifex 2018-08-05 02:18:52 +02:00
Jenkins for ownCloud
86fbde7147 [tx-robot] updated from transifex 2018-08-04 02:18:47 +02:00
Dominik Schmidt
3f120ce134 Support higher resolution theme icons 2018-08-03 16:16:05 +02:00
Jenkins for ownCloud
0b8e40b4af [tx-robot] updated from transifex 2018-08-03 02:18:45 +02:00
Jenkins for ownCloud
0af89b1937 [tx-robot] updated from transifex 2018-08-02 02:18:43 +02:00
Jenkins for ownCloud
ef873efb97 [tx-robot] updated from transifex 2018-08-01 02:18:43 +02:00
Jenkins for ownCloud
289dac3e36 [tx-robot] updated from transifex 2018-07-31 02:18:48 +02:00
Jenkins for ownCloud
c1ff89a47d [tx-robot] updated from transifex 2018-07-28 02:18:46 +02:00
Jenkins for ownCloud
7199f51ac4 [tx-robot] updated from transifex 2018-07-27 02:18:46 +02:00
Jenkins for ownCloud
1c6afda0d5 [tx-robot] updated from transifex 2018-07-26 02:18:45 +02:00
Markus Goetz
97a229cbf1 Settings: Attempt to fix rename issue on old macOS
Found by @hurradieweltgehtunter
2018-07-25 16:54:37 +02:00
Christian Kamm
597d76137b Do not require server replies to contain an mtime
The check was added for #6317 in commit
13eb64584f.

We did see missing mtimes in replies in tests with live servers though.
Possibly those were old incomplete responses cached in the stat cache?
2018-07-25 14:24:35 +02:00
Olivier Goffart
56166deb76 Added test that checks what happens when there is an error in the remote discovery
(Many of the expected error string are left empty because the current
error message is not insterresting
2018-07-25 13:48:58 +02:00
Olivier Goffart
a0675bd0ab Convert p7.pl to a C++ test
This is just a translation of test/scripts/txpl/t7.pl to C++ using the test
framework.
2018-07-25 13:48:58 +02:00
Jenkins for ownCloud
b2b347417e [tx-robot] updated from transifex 2018-07-25 02:18:47 +02:00
Jenkins for ownCloud
d23b7a7a25 [tx-robot] updated from transifex 2018-07-24 02:18:44 +02:00
Jenkins for ownCloud
88676360b4 [tx-robot] updated from transifex 2018-07-23 02:18:44 +02:00
Jenkins for ownCloud
ae2724fd17 [tx-robot] updated from transifex 2018-07-22 02:18:52 +02:00
Jenkins for ownCloud
9e94faa967 [tx-robot] updated from transifex 2018-07-21 02:18:45 +02:00
Markus Goetz
fbed75ff98 mirall.desktop.in: Remove buggy comments 2018-07-20 16:25:29 +02:00
Markus Goetz
847f82c44d More 2.5.0 changelog updates 2018-07-20 16:23:42 +02:00
Jürgen Weigert
04bbe2a34b Update ocssharejob.cpp 2018-07-20 16:02:32 +02:00
Jenkins for ownCloud
590dab8548 [tx-robot] updated from transifex 2018-07-20 02:18:46 +02:00
Markus Goetz
9ea402a67e sqlite: Update bundled version to 3.24.0
For OS X and Windows.
2018-07-19 17:11:47 +02:00
Markus Goetz
69fae8dd6a ChangeLog: Re-orderings 2018-07-19 16:44:03 +02:00
Markus Goetz
93cacdf04d ChangeLog: More 2.5.0 entries 2018-07-19 16:33:37 +02:00
Christian Kamm
1872e9a5f9 Update: Report on readdir() errors #6610 2018-07-19 08:24:24 +02:00
Jenkins for ownCloud
106dffba54 [tx-robot] updated from transifex 2018-07-19 02:18:45 +02:00
Markus Goetz
c645ca0711 ChangeLog of 2.4.2 (from 2.4 branch) 2018-07-18 17:26:50 +02:00
Olivier Goffart
d6b7bde3ca TestChunkingNG: Make it faster
Use smaller files so the test run faster.
Particulary usefull for TestChunkingNG::connectionDroppedBeforeEtagRecieved
Which had become so much slower after 2638332dc6
increased the timeout for bigger files
2018-07-18 15:48:43 +02:00
Jenkins for ownCloud
77768a12a2 [tx-robot] updated from transifex 2018-07-18 02:18:58 +02:00
Olivier Goffart
d7e77b7473 FolderMan::checkPathValidityForNewFolder: make sure to work when folder points to deleted folders
Note that we also needed to adjust the server url to contains the user name
in the folder wizard. (As checkPathValidityForNewFolder expect the user name)

Issue #6654
2018-07-17 09:02:37 +02:00
Jenkins for ownCloud
9c47f63812 [tx-robot] updated from transifex 2018-07-17 02:18:59 +02:00
Olivier Goffart
3d850fe24d Log: Remove inaccurate comment about --logdebug
The exact string is actually "sync.*.debug=true\ngui.*.debug=true".
And this is not strictly equivalent to setting the env var, as it
calls QLoggingCategory::setFilterRules.
Over all, that's an implementation details that users do not care about.
2018-07-16 16:33:38 +02:00
Markus Goetz
0f79406e93 Help Text: really wrap the text
Issue #6644
2018-07-16 16:33:38 +02:00
Olivier Goffart
ff09ebd47a Help Text: wrap the text
But add a line of spaces to make sure it is wide enough otherwise the
default messagebox size is way too small.

Issue #6644
2018-07-16 16:33:38 +02:00
Olivier Goffart
916343d7c2 Wizard OAuth2 Page: add a context menu to copy the link
Relates to https://github.com/owncloud/enterprise/issues/2600
2018-07-16 12:55:31 +02:00
Christian Kamm
c9e97c12cd Nautilus: Guard against None state #6643
It seems None gets assigned to 'state' in some paths.
2018-07-16 10:18:48 +02:00
Olivier Goffart
c620683251 Wizard: show a message when the URL is invalid
Rather than let Qt show "Host not found"

Issue #6646
2018-07-16 10:06:44 +02:00
Jenkins for ownCloud
530ff542ea [tx-robot] updated from transifex 2018-07-16 02:18:44 +02:00
Jenkins for ownCloud
046047a370 [tx-robot] updated from transifex 2018-07-15 02:18:44 +02:00
Jenkins for ownCloud
890cd3ee1a [tx-robot] updated from transifex 2018-07-14 02:18:46 +02:00
Jenkins for ownCloud
e352032d99 [tx-robot] updated from transifex 2018-07-13 02:18:45 +02:00
Dmitry Mayorov
4c2f690dab added logdebug 2018-07-12 16:33:31 +02:00
Jenkins for ownCloud
acbab4a8e9 [tx-robot] updated from transifex 2018-07-12 02:18:46 +02:00
Jenkins for ownCloud
37e5c47cdc [tx-robot] updated from transifex 2018-07-11 02:18:46 +02:00
Jenkins for ownCloud
6b3ce1939c [tx-robot] updated from transifex 2018-07-10 02:18:45 +02:00
Jenkins for ownCloud
7590edd971 [tx-robot] updated from transifex 2018-07-09 02:18:48 +02:00
Jenkins for ownCloud
9292be1374 [tx-robot] updated from transifex 2018-07-08 02:18:52 +02:00
Jenkins for ownCloud
e91a4211e4 [tx-robot] updated from transifex 2018-07-07 02:18:46 +02:00
Jenkins for ownCloud
05bd8291b9 [tx-robot] updated from transifex 2018-07-06 02:19:00 +02:00
Olivier Goffart
90ec9a9735 Reconcile: When detecting a local move, keep the local mtime
https://github.com/owncloud/client/issues/6629#issuecomment-402450691
2018-07-05 16:31:16 +02:00
Christian Kamm
25cca051a9 Log: Adjust update/reconcile log verbosity
Not having these enabled by default is causing significant extra back
and forth with reporters since they must manually use --logdebug for the
log to be useful.
2018-07-05 14:09:35 +02:00
Thomas Boerger
ab3315594d Drop Jenkinsfile, replaced by DroneCI
So far DroneCI is showing stable results, that's the point in time where
we can get rid of Jenkins 💣
2018-07-05 13:19:09 +02:00
Markus Goetz
c7aca2d4a9 Introduce an about dialog
Every proper application has that!

For decreasing window height in #6075
2018-07-05 13:15:43 +02:00
Olivier Goffart
64014dd374 Upload: Store the size in the UploadInfo, and compare it when resolving potential conflict
This is about the conflicts that happens when the file has been uploaded
correctly to the server, but the etag was not recieved because the connection
was closed before we got the reply.

We used to compare only the mtime when comparing the uploaded file and the
existing file.  However, to be perfectly correct, we also should check the
size.

This was found because TestChunkingNG::connectionDroppedBeforeEtagRecieved is
flaky. Example of faillure found in https://drone.owncloud.com/owncloud/client/481/5
while testing PR #6626

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2018-07-04 17:26:56 +02:00
Jenkins for ownCloud
5b4c98d015 [tx-robot] updated from transifex 2018-07-04 02:18:43 +02:00
Jenkins for ownCloud
585a42cec9 [tx-robot] updated from transifex 2018-07-03 02:18:40 +02:00
Jenkins for ownCloud
11cba10290 [tx-robot] updated from transifex 2018-07-02 02:18:39 +02:00
Jenkins for ownCloud
c398300721 [tx-robot] updated from transifex 2018-07-01 02:18:43 +02:00
Jenkins for ownCloud
df5ec640e1 [tx-robot] updated from transifex 2018-06-30 02:18:41 +02:00
Olivier Goffart
7029ad1a29 TestOAuth: Don't have global static QObject
Fix a strange warning seen on the log from the CI on Windows in
https://github.com/owncloud/client/pull/6621

The test shows, at the beginning
QObject::connect: No such signal DesktopServiceHook::destroyed(QObject*)
And crashes at the and.

My guess is that when QDesktopServices::setUrlHandler is called, the
QMetaObject is not yet initialized

But this is probably not the reason of the crash
2018-06-29 10:57:24 +02:00
Dominik Schmidt
4517d0224e Build (PRs to) 2.5 branch 2018-06-29 10:57:24 +02:00
Dominik Schmidt
d332319394 Use Qt 5.11 in Craft 2018-06-29 10:57:24 +02:00
Jenkins for ownCloud
3e40166ad2 [tx-robot] updated from transifex 2018-06-29 02:18:40 +02:00
Jenkins for ownCloud
dc14dae63d [tx-robot] updated from transifex 2018-06-28 02:18:41 +02:00
Olivier Goffart
c095a0f25b Fix MIRALL_STRINGIFY for empty defines in MSVC 2018-06-27 18:42:10 +02:00
Olivier Goffart
347d35ae5d OAuth: Remove the timeout
There is no real reason to have a timeout. The connection can stay open
as long as we are not authenticated. The User can still re-open a browser
from the UI at any time.

Issue #6612
2018-06-27 15:10:09 +02:00
Dominik Schmidt
ea94c414b2 Update libcrashreporter-qt to support Qt 5.11 2018-06-27 12:32:17 +02:00
Markus Goetz
150d4f5935 MSI: Always with logfile #6609 2018-06-27 10:25:33 +02:00
Dominik Schmidt
e2a8975ad8 Extract filename of updateFile without leading slash 2018-06-27 10:25:33 +02:00
Dominik Schmidt
0dc8bde694 Escape msi and owncloud.exe path (who knows...) 2018-06-27 10:25:33 +02:00
Dominik Schmidt
4d826a3d21 Run msi properly and restart client after update 2018-06-27 10:25:33 +02:00
Dominik Schmidt
52bccac23a Implement basic .msi support in updater 2018-06-27 10:25:33 +02:00
Jenkins for ownCloud
399046c7d5 [tx-robot] updated from transifex 2018-06-27 02:18:42 +02:00
Dominik Schmidt
07e2230dd9 ECMAddAppIconMacro: Rename OUTFILE_BASE to OUTFILE_BASENAME and fix sidebar icon resolutions 2018-06-27 01:28:44 +02:00
Dominik Schmidt
b4b1409148 Fix app icon macro 2018-06-27 01:28:44 +02:00
Jenkins for ownCloud
1a7a1552b0 [tx-robot] updated from transifex 2018-06-26 02:18:43 +02:00
Markus Goetz
8e4d2e8c9f Updater: Comments 2018-06-25 12:29:45 +02:00
Christian Kamm
b2fa9edd14 Wizard errors in a scroll area #6546 2018-06-25 11:21:17 +02:00
Jenkins for ownCloud
8dad4406ec [tx-robot] updated from transifex 2018-06-25 02:18:41 +02:00
Jenkins for ownCloud
f27fd4f693 [tx-robot] updated from transifex 2018-06-24 02:18:47 +02:00
Jenkins for ownCloud
2fec00a052 [tx-robot] updated from transifex 2018-06-23 02:18:44 +02:00
Jenkins for ownCloud
4cf53aa5ef [tx-robot] updated from transifex 2018-06-22 02:18:43 +02:00
Jenkins for ownCloud
a93f2d4ba9 [tx-robot] updated from transifex 2018-06-21 02:18:44 +02:00
Markus Goetz
e1a4c3ab72 GeneralSettings: Hide update channel for other themes
For #6585
2018-06-20 12:29:52 +02:00
Dominik Schmidt
4f96647bae Rename ocsync library to ${APPLICATION_EXECUTABLE}_csync 2018-06-20 11:23:16 +02:00
Dominik Schmidt
79ef892e71 Install libocsync to lib/ without subfolder.
Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of
irritations in the past and subtle annoying to fix bugs. To avoid name
clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now
part of the filename instead of the subfolder.

The concrete motivation to change this now is that on Windows there
is no RPATH and it's not possible to run owncloud directly from the
Craft Root folder, which is nice when you're developing on Windows.

It would have been possible to change this just for Windows but as
written earlier this has caused lots of issues and thus I think it's
a good idea to just stay consistent accross platforms when touching it.
2018-06-20 11:23:16 +02:00
Jenkins for ownCloud
464c1fbce0 [tx-robot] updated from transifex 2018-06-20 02:18:42 +02:00
Olivier Goffart
841606d138 nautilus shell integration: Fix when there are several branded client installed
It appears that several extension can be loaded at the same time, but their
classname for the extension need to be different, otherwise only the last
loaded one would be active.

Issue #6524
2018-06-19 19:38:31 +02:00
Olivier Goffart
850dc67a25 Wizard + OAuth: Make opening a new browser after clicking back works again
Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
2018-06-19 15:12:29 +02:00
Olivier Goffart
ae80317a74 Updater: Fix beta channel for translated clients.
The names in the combobox are being translated, so we need to rely
on the index rather than the text.
2018-06-19 12:56:31 +02:00
Christian Kamm
a0d6139505 fixup: remove outdated Qt5.5 workaround code 2018-06-19 12:47:23 +02:00
Christian Kamm
8b1d9799a3 fixup: use initializer for contextMenuVisibleManual 2018-06-19 12:47:23 +02:00
Christian Kamm
ca033b9685 fixup: make logging "info" 2018-06-19 12:47:23 +02:00
Christian Kamm
99116acdca Tray workarounds #6545
* Disentangle the previous 'qdbusWorkarounds' into three different
  things
* Make not trusting tray.isVisible() a new workaround
* Introduce env vars for all workaround flags
* Use the workaround flags for OSX
* Determine workaround flags for KDE when the plasma integration plugin
  is missing
2018-06-19 12:47:23 +02:00
Markus Goetz
92219c5bf7 SettingsDialogMac: Show the page for the newly created account 2018-06-19 09:47:07 +02:00
Olivier Goffart
de6b23c854 SettingsDialog: Show the page for the newly created account 2018-06-19 09:47:07 +02:00
Jenkins for ownCloud
5b1057ea94 [tx-robot] updated from transifex 2018-06-19 02:18:44 +02:00
Christian Kamm
92b1375c58 Windows shellext: Update copyrights and company name 2018-06-18 10:49:14 +02:00
Olivier Goffart
9dac8be0ed windows shell extension: add OCUtil/resource.h
It's a copy from OCContextMenu/resources.h
2018-06-18 10:49:14 +02:00
Christian Kamm
d188b37caf Windows shellext: Add rc for OCUtil #6554
To set the dll's metadata.
2018-06-18 10:49:14 +02:00
Jenkins for ownCloud
343a27cbd8 [tx-robot] updated from transifex 2018-06-18 02:18:42 +02:00
Jenkins for ownCloud
0c49e6cc19 [tx-robot] updated from transifex 2018-06-17 02:18:44 +02:00
Jenkins for ownCloud
cdf0f04e45 [tx-robot] updated from transifex 2018-06-16 02:18:43 +02:00
Dominik Schmidt
5989c84949 Move theme related logic into a single THEME.cmake 2018-06-15 09:44:24 +02:00
Jenkins for ownCloud
3e9dadc1ed [tx-robot] updated from transifex 2018-06-15 02:18:50 +02:00
Olivier Goffart
0062a28864 Theme: Put back the string as it was in 2.4, for branded clients.
Issue #6422
2018-06-14 12:59:02 +02:00
Olivier Goffart
4cc0539080 OAuth2: Try to refresh the token even if the credentials weren't ready.
This can happen when the client is started and the internet connection
was not enabled. Then we would fetch the credentials, but we would
no do the refresh token step (because network is down).
So next time we try to connect, we would also not refresh the token
because the credentials are not marked as 'ready'

Reported in
https://github.com/owncloud/client/issues/6522#issuecomment-396845167
2018-06-14 12:58:18 +02:00
Jenkins for ownCloud
9bb2f1965d [tx-robot] updated from transifex 2018-06-14 02:18:54 +02:00
Christian Kamm
62d9f74aa8 ShareLink: translate the send-email string 2018-06-13 16:47:11 +02:00
Christian Kamm
ad2446b036 Ensure GETFileJob notices finishing #6581
It could happen that readyRead was emitted for incoming data while the
download was not yet finished. Then the network job could finish with
no more data arriving - so readyRead wasn't emitted again.

To fix this, the finished signal also gets connected to the readyRead
slot.
2018-06-13 16:44:24 +02:00
Christian Kamm
9c66dbb2b7 Selective sync: Hide ui on disconnect #5809
The previous patch did forget about the big-folder-ui which should
also be hidden on disconnect.
2018-06-13 14:51:39 +02:00
Jenkins for ownCloud
e4574b2628 [tx-robot] updated from transifex 2018-06-13 02:18:45 +02:00
Jenkins for ownCloud
7557a124d8 [tx-robot] updated from transifex 2018-06-12 02:18:44 +02:00
Jenkins for ownCloud
f80c237c5c [tx-robot] updated from transifex 2018-06-11 02:18:42 +02:00
Jenkins for ownCloud
b7cee004cb [tx-robot] updated from transifex 2018-06-10 02:18:42 +02:00
Jenkins for ownCloud
bfd6b21591 [tx-robot] updated from transifex 2018-06-09 02:18:42 +02:00
Jenkins for ownCloud
d11e3e1f5f [tx-robot] updated from transifex 2018-06-08 02:18:42 +02:00
Jenkins for ownCloud
ab0813c77f [tx-robot] updated from transifex 2018-06-07 02:18:42 +02:00
Jenkins for ownCloud
4a8f99d628 [tx-robot] updated from transifex 2018-06-06 02:18:43 +02:00
Jenkins for ownCloud
789c7062fe [tx-robot] updated from transifex 2018-06-05 02:18:43 +02:00
Olivier Goffart
9a8078944f FindSql3.cmake: Add the input variable in the search path
Issue #6278
2018-06-04 11:44:09 +02:00
Olivier Goffart
76bb76a59e FolderStatusModel: Fix crash when there is an error while expanding folders
In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

Fix this problem twice by
 1) Get the error code before caling resetSubs
 2) in FolderStatusModel::SubFolderInfo::resetSubs, call deleteLater instead of delete

Regression introduced in commit d69936e0

Issue #6562
2018-06-04 10:32:30 +02:00
Olivier Goffart
888f2aae2f csync: refactor csync_s::error_string to avoid valgrind error
The problem here is that we were sometimes allocating the error_string with
qstrdup, which need to be released with delete[] and not free().

Simplify the code by using QString instead.

```
==7230== Mismatched free() / delete / delete []
==7230==    at 0x4C2E10B: free (vg_replace_malloc.c:530)
==7230==    by 0x57C2321: csync_s::reinitialize() (csync.cpp:247)
==7230==    by 0x548130F: OCC::SyncEngine::finalize(bool) (syncengine.cpp:1212)
==7230==    by 0x5481223: OCC::SyncEngine::handleSyncError(csync_s*, char const*) (syncengine.cpp:746)
==7230==    by 0x5483E78: OCC::SyncEngine::slotDiscoveryJobFinished(int) (syncengine.cpp:965)
==7230==    by 0x5495E34: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (OCC::SyncEngine::*)(int)>::call(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:134)
==7230==    by 0x5495D92: void QtPrivate::FunctionPointer<void (OCC::SyncEngine::*)(int)>::call<QtPrivate::List<int>, void>(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:167)
==7230==    by 0x5495CB5: QtPrivate::QSlotObject<void (OCC::SyncEngine::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:396)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==  Address 0x225b2640 is 0 bytes inside a block of size 50 alloc'd
==7230==    at 0x4C2DC6F: operator new[](unsigned long) (vg_replace_malloc.c:423)
==7230==    by 0xA7E8FC8: qstrdup(char const*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x53F5750: OCC::DiscoveryJob::remote_vio_opendir_hook(char const*, void*) (discoveryphase.cpp:666)
==7230==    by 0x57E1278: csync_vio_opendir(csync_s*, char const*) (csync_vio.cpp:39)
==7230==    by 0x57D718F: csync_ftw(csync_s*, char const*, int (*)(csync_s*, std::unique_ptr<csync_file_stat_s, std::default_delete<csync_file_stat_s> >), unsigned int) (csync_update.cpp:674)
==7230==    by 0x57C1B05: csync_update(csync_s*) (csync.cpp:109)
==7230==    by 0x53F5BCC: OCC::DiscoveryJob::start() (discoveryphase.cpp:718)
==7230==    by 0x54B8F74: OCC::DiscoveryJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_discoveryphase.cpp:494)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==
```
2018-06-04 08:57:24 +02:00
Chih-Hsuan Yen
9e26b0fea3 Fix build without Sparkle.framework
(PR #6567)
2018-06-04 08:57:10 +02:00
Jenkins for ownCloud
52cfb6bfef [tx-robot] updated from transifex 2018-06-04 02:18:42 +02:00
Jenkins for ownCloud
1c03ba03e4 [tx-robot] updated from transifex 2018-06-03 02:18:41 +02:00
Jenkins for ownCloud
eeff148051 [tx-robot] updated from transifex 2018-06-02 02:18:42 +02:00
Olivier Goffart
13cb9ab1c5 PropagateDownload: Don't discard the body of error message
We want to keep the body so we can get the message from it
(Issue #6459)

TestDownload::testErrorMessage did not fail because the FakeErrorReply
did not emit readyRead and did not implement bytesAvailable.
2018-06-01 13:21:22 +02:00
Jenkins for ownCloud
f5ac5f2973 [tx-robot] updated from transifex 2018-06-01 02:18:43 +02:00
Jenkins for ownCloud
bff1c1cf28 [tx-robot] updated from transifex 2018-05-31 02:18:44 +02:00
159 changed files with 19093 additions and 14953 deletions

View File

@@ -5,48 +5,15 @@ project(client)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
include("${CMAKE_CURRENT_LIST_DIR}/THEME.cmake")
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
include ( ${OEM_THEME_DIR}/OEM.cmake )
else ()
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
endif()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# Default suffix if the theme doesn't define one
if(NOT DEFINED APPLICATION_VIRTUALFILE_SUFFIX)
set(APPLICATION_VIRTUALFILE_SUFFIX "${APPLICATION_SHORTNAME}_virtual" CACHE STRING "Virtual file suffix (not including the .)")
endif()
# need this logic to not mess with re/uninstallations via macosx.pkgproj
if(${APPLICATION_REV_DOMAIN} STREQUAL "com.owncloud.desktopclient")
set(APPLICATION_REV_DOMAIN_INSTALLER "com.ownCloud.client")
else()
set(APPLICATION_REV_DOMAIN_INSTALLER ${APPLICATION_REV_DOMAIN})
endif()
# For usage in XML files we preprocess
string(REPLACE "&" "&amp;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
string(REPLACE "<" "&lt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
string(REPLACE ">" "&gt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
if (NOT DEFINED LINUX_PACKAGE_SHORTNAME)
set(LINUX_PACKAGE_SHORTNAME "${APPLICATION_SHORTNAME}")
endif()
if (NOT DEFINED PACKAGE)
set(PACKAGE "${LINUX_PACKAGE_SHORTNAME}-client")
endif()
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
if(NOT CRASHREPORTER_EXECUTABLE)
set(CRASHREPORTER_EXECUTABLE "${APPLICATION_EXECUTABLE}_crash_reporter")
endif()
set(synclib_NAME "${APPLICATION_EXECUTABLE}sync")
set(csync_NAME "${APPLICATION_EXECUTABLE}_csync")
include(Warnings)
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
# For config.h
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
# Allows includes based on src/ like #include "common/utility.h" or #include "csync/csync.h"

131
ChangeLog
View File

@@ -1,29 +1,58 @@
ChangeLog
=========
version 2.5.0 (2018-06-xx)
version 2.5.0 (2018-09-xx)
* Local discovery: Speed up by skipping directories without changes reported by the file system watcher.
* Experimental option to create virtual files (e.g. my_document.txt.owncloud) and download contents on demand ("placeholders")
* Windows: Add sync folders to Explorer's navigation pane (#5295)
* Config: Client configuration in roaming profile on Windows, XDG conform on Linux (#684, #2245)
* Experimental option to upload conflict files (#4557)
* Conflicts: Change conflict file naming scheme
* Conflicts: Add user name to conflict file name (#6325)
* ConnectionValidator: change the minimum server version to 7.0
* ConnectionValidator: Warn when the server version is less than 9.1
* Experimental option to create virtual files and download contents on demand ("placeholders")
* Experimental option to upload conflict files (#4557)
* Wizard: Remove the "Skip folder config" button and instead add a radio button (#3664)
* Conflicts: Better comparison when connection broke (#6626)
* Conflicts: Deal with file/folder conflicts (#6312)
* Conflicts: Change tray icon for unresolved conflicts (#6277)
* Conflicts: Add documentation link to conflicts listing (#6396)
* Conflicts: Change tags to be more user friendly (#6365)
* Share dialog: Allow opening it if the file's contents are still syncing (#4608)
* Share dialog: Don't hide account settings when opening it (#6185)
* Share dialog: Remove odd grey square on OSX (#5774)
* Share dialog: Preserve the entered password when unrelated changes are done (#6512)
* Share dialog: Fix Re-shares not not showing up (#6666)
* Sharing: Add "copy public link" to menu (#6356)
* Share link: Update permission wording (#6192)
* Private links: improve legacy fileid derivation (#6745)
* User shares: Show avatars
* OAuth2: Remove the timeout (#6612)
* Wizard: Remove the "Skip folder config" button and instead add a radio button (#3664)
* Wizard: Fix for back button in OAuth2 (#6574)
* Wizard: add a context menu to copy the OAuth2 link (enterprise
* Wizard: Put errors into a scroll area (#6546)
* Wizard: show a message when the URL is invalid
* Wizard: pre-select the right radio button (#6685)
* Selective Sync: Do not abort applying selective sync if one folder has an error (#6675)
* Protocol: Introduce context menu with "open in browser" (#6121)
* Protocol: Correct sorting by size (#6326)
* Issues tab: Invalidate issues selectively (#6226)
* Issues tab: Don't allow two issues for the same file/folder
* Issues tab: addItem performance improvement
* Activities: Remove the text that a server does not support activities when the account is removed (#6679)
* Activities: Handle the fact that the username can contain a '@' (#6728)
* Notifications: Lower hiding timeout
* Notifications: Also have clickable link (#6236)
* Shell integration: Add "Open in browser" entry in the explorer menu (#5903)
* Sync journal: Fix crash when unmounting a drive while a sync is running (#6049)
* Client certs: Improve error message (#6128)
* User shares: Show avatars
* Settings: Hide selective sync buttons while disconnected (#5809)
* Settings: Show account page when account created
* Settings: Move "About" to a dialog (#6075)
* Settings: Force sync should wipe the blacklist (#6757)
* Excludes: Optimize further the matching of exclude files using regular expression
* Don't use Qt deprecated API now that we required Qt 5.6
* Windows: Update Overlay Icon naming
* SyncEngine: Recover when the PUT reply (or chunkin's MOVE) is lost (#5106)
* Windows: Release handle/fd when file open fails (#6699)
* Config: Look for exclude file in a relative path.
* Config: Versionize settings
* Settings: Fix rename migration issue on old macOS
* Credentials: Re-try on Linux if daemon not running (#4274, #6522)
* Windows: Fixed MSVC build and compiler bugs
* Proxy: Hostname validation and reconnection on setting change (#6140)
@@ -31,60 +60,86 @@ version 2.5.0 (2018-06-xx)
* Exclude regex: Restore old matching on Windows (#6245)
* Build system: Modernize the CMakeLists.txt files
* Use standard png2ico
* Sync: Deal with file/folder conflicts (#6312)
* Protocol: Correct sorting by size (#6326)
* Sync: When detecting a local move, keep the local mtime (#6629)
* Sync: Better error handling for local directory parsing (#6610)
* Sync: Error if properties are missing (#6317)
* Sync: Recover when the PUT reply (or chunkin's MOVE) is lost (#5106)
* Sync: Do not abort a sync if the server closes the connection (#6516)
* Sync: Increase the timeout for the last MOVE/PUT for huge files (#6527)
* Sync: Fix renames making hierarchy inversion (#6694)
* Sync: RemotePermissions: Fix empty vs null (#4608)
* Sync: Fix the "direction" of the "all file delted" message when the server is reset (#6317)
* Data-Fingerprint: Fix backup detection when fingerprint is empty
* propagateuploadv1: Fixed an assert with ownCloud 5
* Download: Use the <s:message> from the reply in the error message (#6459, #6459)
* SocketAPI: dynamic action menu
* Hidden option to move remote-deleted files to trash (#6265)
* Tray: Change icon for unresolved conflicts (#6277)
* FolderStatusModel: Refresh folders on Problem sync (#6337)
* SyncJournal: Clear etag filter before sync
* SyncEngine: Use separate state for two unicode conversions
* Conflicts: Add documentation link to conflicts listing (#6396)
* owncloudcmd: Do not read the proxy settings from the gui's config file
* Discovery: Error if properties are missing (#6317)
* ProgressInfo: Add information for local vs remote discovery
* Issues tab: Invalidate issues selectively (#6226)
* SyncResult: Make sure the number of conflicts is correct (#6226)
* IssuesWidget: Don't allow two issues for the same file/folder
* IssuesWidget: addItem performance improvement
* Remove the "CSync" wording from the error messages
* Apply branding to crashreporter resources file
* Dolphin plugin: fall back if $XDG_RUNTIME_DIR is empty
* SslButton: Add HTTP/2 info (#3146)
* propagateuploadv1: Fixed an assert with ownCloud 5
* Folder: normalize the local path. (#4424)
* SslButton: Improve speed (especially on macOS) (#6031)
* Folder: normalize the local path. (#4424)
* Folder: Fix checking if the folder can be used as sync folder (#6654)
* Blacklisting must prevent parent etag updates (#6411)
* FolderStatusModel: fix potential assert
* Nautilus integration: Not a ColumnProvider
* Nautilus integration: Fix python3 compatibility (#6406)
* Conflicts: Change tags to be more user friendly (#6365)
* Nautilus integration: Fix python3 compatibility (#6406, #6643)
* Nautilus: Guard against None state (#6643)
* Dolphin plugin: fall back if $XDG_RUNTIME_DIR is empty
* Notify if an explicitly excluded folder is created (#6222)
* Theme: unify ownCloudTheme and Theme classes
* Share link: Update permission wording (#6192)
* SyncJournalDb::setSelectiveSyncList: Always use a transaction (#6431)
* Folders: Use "Problem" icon for unresolved conflicts (#6277)
* macOS: Unload the Finder extension on exit (#5382, #3819)
* LogDir: Go to new file on Problem/Abort too (#6442)
* LogDir: Compress log when switching files (#6442)
* Logging: Go to new file on Problem/Abort too (#6442)
* Logging: Compress log when switching files (#6442)
* Logging: Add persistent auto-logdir option (#6442)
* .owncloudsynclog: Allow 10 MB of size (#6420)
* .owncloudsynclog: Persist X-Request-ID for correlation with server (#6420)
* Notifications: Lower hiding timeout
* Download: Use the <s:message> from the reply in the error message (#6459)
* Notifications: Also have clickable link (#6236)
* Logging: .owncloudsynclog: Allow 10 MB of size (#6420)
* Logging: .owncloudsynclog: Persist X-Request-ID for correlation with server (#6420)
* UI: High-DPI layout fixes
* Network settings: Better warnings about bad configuration (#5885)
* Share dialog: Allow opening it if the file's contents are still syncing (#4608)
* Share dialog: Don't hide account settings when opening it (#6185)
* Share dialog: Remove odd grey square on OSX (#5774)
* Share dialog: Preserve the entered password when unrelated changes are done (#6512)
* Folder watcher: Show a notification if it becomes unreliable (#6119)
* Ignore editor: Preserve comments in the exclude list file
* Propagation: Do not abort a sync if the server closes the connection (#6516)
* Propagation: Increase the timeout for the last MOVE/PUT for huge files (#6527)
* Update bundled sqlite version to 3.23.1
* Auto Updater: Drop down menu to switch update channels
* Updater: Support EXE->MSI upgrade (different code than 2.4)
* Updater: Remove unused installers before copying new ones into the appdata dir (#6690)
* ConnectionValidator: change the minimum server version to 7.0
* ConnectionValidator: Warn when the server version is less than 10.0
* Valgrind: Refactorings to avoid errors
* Crash fixes (#6562 and more)
* Windows: Fix missing company name in our DLLs
* Windows: Appveyor/craft changes
* Linux: More tray workarounds (#6545)
* libocsync: Rename to ${APPLICATION_EXECUTABLE}_csync
* Don't use Qt deprecated API now that we required Qt 5.6
version 2.4.3 (2018-08-13)
* Windows: Don't ignore files with FILE_ATTRIBUTE_TEMPORARY (#6696, #6610)
* OAuth2: Fix infinite loop when the refresh token is expired
* Windows MSI: Fix crash in the auto updater
* Nautilus: Guard against None state (#6643)
version 2.4.2 (2018-07-18)
* Linux: Tray workarounds (#6545)
* Fix nautilus/nemo shell issues (#6393, #6406)
* Updater: Add update channel feature (#6259)
* Updater: Support EXE->MSI upgrade
* SyncJournal: Fixes for sync folders on removable media (#6049, #6049)
* SslButton: Add HTTP/2 info (#3146)
* Fix assert when using ownCloud server 5 (which you should not) (#6403)
* Normalize local path (#4424)
* Blacklisting must prevent parent etag updates (#6411)
* macdeployqt: Adjust minimum version based on our Qt (#5932)
* macOS: Unload the Finder extension on exit (#5382, #3819)
* Upload: Adjust timeout for final job based on file size (#6527)
* Sync: When detecting a local move, keep the local mtime (#6629)
* Credentials: Retry fetching from the keychain in case the keychain is still starting (#4274, #6522)
* OAuth2: Try to refresh the token even if the credentials weren't ready (#6522)
version 2.4.1 (2018-03-05)
* Ignore files with file names that can't be encoded for the filesystem (#6287, #5676, #5719)

72
Jenkinsfile vendored
View File

@@ -1,72 +0,0 @@
#!groovy
//
// We now run the tests in Debug mode so that ASSERTs are triggered.
// Ideally we should run the tests in both Debug and Release so we catch
// all possible error combinations.
// See also the top comment in syncenginetestutils.h
//
// We are building "Linux - GCC" with "make" and "Linux - Clang" with ninja,
// the combinations are more or less arbitrarily chosen. We just want to
// check that both compilers and both CMake generators work. It's
// unlikely that a specific generator only breaks with a specific
// compiler.
// Constructed from the DockerFile in admin/linux/DockerFile
def linux = docker.image('dominikschmidt/docker-owncloud-client-linux:latest')
// Constructed from the DockerFile in admin/win/docker/DockerFile
def win32 = docker.image('dominikschmidt/docker-owncloud-client-win32-cross:latest')
node('CLIENT') {
stage 'Checkout'
checkout scm
sh '''git submodule update --init'''
stage 'Linux - Pull Docker Image'
linux.pull()
stage 'Linux - GCC'
linux.inside {
sh '''
export HOME="$(pwd)/home"
rm -rf build home
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 ..
make -j4
LC_ALL=C.UTF-8 ctest -V --output-on-failure
'''
}
stage 'Linux - Clang'
linux.inside {
sh '''
export HOME="$(pwd)/home"
rm -rf build home
mkdir build
cd build
cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 ..
ninja -j4
LC_ALL=C.UTF-8 ctest -V --output-on-failure
'''
}
stage 'Win32 Cross - Pull Docker Image'
win32.pull()
stage 'Win32 Cross'
win32.inside {
sh '''
rm -rf build-win32
mkdir build-win32
cd build-win32
../admin/win/download_runtimes.sh
cmake .. -DCMAKE_TOOLCHAIN_FILE=../admin/win/Toolchain-mingw32-openSUSE.cmake -DWITH_CRASHREPORTER=ON
make -j4
make package
ctest .
'''
}
// Stage 'macOS' TODO
}

View File

@@ -1,6 +1,6 @@
# ownCloud Desktop Client
[![Build Status](https://jenkins.owncloud.org/buildStatus/icon?job=owncloud-client/client/master)](https://jenkins.owncloud.org/job/owncloud-client/job/client/job/master/) [![Build status](https://ci.appveyor.com/api/projects/status/a1x3dslys7de6e21/branch/master?svg=true)](https://ci.appveyor.com/project/ownclouders/client/branch/master)
[![Build Status](https://drone.owncloud.com/api/badges/owncloud/client/status.svg)](https://drone.owncloud.com/owncloud/client) [![Build status](https://ci.appveyor.com/api/projects/status/a1x3dslys7de6e21/branch/master?svg=true)](https://ci.appveyor.com/project/ownclouders/client/branch/master)
## Introduction

38
THEME.cmake Normal file
View File

@@ -0,0 +1,38 @@
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
if (EXISTS "${OEM_THEME_DIR}/OEM.cmake")
include("${OEM_THEME_DIR}/OEM.cmake")
else()
include ("${CMAKE_CURRENT_LIST_DIR}/OWNCLOUD.cmake")
endif()
# Default suffix if the theme doesn't define one
if(NOT DEFINED APPLICATION_VIRTUALFILE_SUFFIX)
set(APPLICATION_VIRTUALFILE_SUFFIX "${APPLICATION_SHORTNAME}_virtual" CACHE STRING "Virtual file suffix (not including the .)")
endif()
# need this logic to not mess with re/uninstallations via macosx.pkgproj
if(${APPLICATION_REV_DOMAIN} STREQUAL "com.owncloud.desktopclient")
set(APPLICATION_REV_DOMAIN_INSTALLER "com.ownCloud.client")
else()
set(APPLICATION_REV_DOMAIN_INSTALLER ${APPLICATION_REV_DOMAIN})
endif()
# For usage in XML files we preprocess
string(REPLACE "&" "&amp;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
string(REPLACE "<" "&lt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
string(REPLACE ">" "&gt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
if (NOT DEFINED LINUX_PACKAGE_SHORTNAME)
set(LINUX_PACKAGE_SHORTNAME "${APPLICATION_SHORTNAME}")
endif()
if (NOT DEFINED PACKAGE)
set(PACKAGE "${LINUX_PACKAGE_SHORTNAME}-client")
endif()
if(NOT CRASHREPORTER_EXECUTABLE)
set(CRASHREPORTER_EXECUTABLE "${APPLICATION_EXECUTABLE}_crash_reporter")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/VERSION.cmake")

View File

@@ -1,11 +1,11 @@
set( MIRALL_VERSION_MAJOR 2 )
set( MIRALL_VERSION_MINOR 5 )
set( MIRALL_VERSION_PATCH 0 )
set( MIRALL_VERSION_PATCH 1 )
set( MIRALL_VERSION_YEAR 2018 )
set( MIRALL_SOVERSION 0 )
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
set( MIRALL_VERSION_SUFFIX "alpha1") #e.g. beta1, beta2, rc1
set( MIRALL_VERSION_SUFFIX "git") #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
if( NOT DEFINED MIRALL_VERSION_BUILD )

View File

@@ -24,6 +24,9 @@ import sys
from glob import glob
from distutils.version import LooseVersion
bundle_dir = sys.argv[1]
qmake_path = sys.argv[2]
def QueryQMake(attrib):
return subprocess.check_output([qmake_path, '-query', attrib]).rstrip('\n')
@@ -32,7 +35,9 @@ FRAMEWORK_SEARCH_PATH=[
os.path.join(os.environ['HOME'], 'Library/Frameworks')
]
LIBRARY_SEARCH_PATH=['/usr/local/lib', '.']
LIBRARY_SEARCH_PATH=[
'.'
]
QT_PLUGINS = [
'sqldrivers/libqsqlite.dylib',
@@ -44,10 +49,12 @@ QT_PLUGINS = [
]
QT_PLUGINS_SEARCH_PATH=[
# os.path.join(os.environ['QTDIR'], 'plugins'),
'/usr/local/Cellar/qt/5.2.1/plugins',
]
# Package libraries from these paths even if they are also a system library
SYSTEM_LIBRARY_BLACKLIST = [
QueryQMake('QT_INSTALL_LIBS')
]
class Error(Exception):
pass
@@ -78,8 +85,6 @@ if len(sys.argv) < 3:
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
bundle_dir = sys.argv[1]
qmake_path = sys.argv[2]
bundle_name = os.path.basename(bundle_dir).split('.')[0]
@@ -198,7 +203,7 @@ def FixFramework(path):
FixLibraryInstallPath(library, new_path)
def FixLibrary(path):
if path in fixed_libraries or FindSystemLibrary(os.path.basename(path)) is not None:
if path in fixed_libraries or FindSystemLibrary(path) is not None:
return
else:
fixed_libraries.append(path)
@@ -235,6 +240,7 @@ def FixBinary(path):
FixLibraryInstallPath(library, path)
def CopyLibrary(path):
print "CopyLibrary:", path
new_path = os.path.join(binary_dir, os.path.basename(path))
args = ['ditto', '--arch=x86_64', path, new_path]
commands.append(args)
@@ -243,6 +249,7 @@ def CopyLibrary(path):
return new_path
def CopyPlugin(path, subdir):
print "CopyPlugin:", path, subdir
new_path = os.path.join(plugins_dir, subdir, os.path.basename(path))
args = ['mkdir', '-p', os.path.dirname(new_path)]
commands.append(args)
@@ -253,8 +260,8 @@ def CopyPlugin(path, subdir):
return new_path
def CopyFramework(source_dylib):
parts = source_dylib.split(os.sep)
print "CopyFramework:", source_dylib
parts = source_dylib.split(os.sep)
for i, part in enumerate(parts):
matchObj = re.match(r'(\w+\.framework)', part)
if matchObj:
@@ -301,7 +308,12 @@ def FixInstallPath(library_path, library, new_path):
args = ['install_name_tool', '-change', library_path, new_path, library]
commands.append(args)
def FindSystemLibrary(library_name):
def FindSystemLibrary(library_path):
for item in SYSTEM_LIBRARY_BLACKLIST:
if library_path.startswith(item):
return None
library_name = os.path.basename(library_path)
for path in ['/lib', '/usr/lib']:
full_path = os.path.join(path, library_name)
if os.path.exists(full_path):
@@ -309,7 +321,7 @@ def FindSystemLibrary(library_name):
return None
def FixLibraryInstallPath(library_path, library):
system_library = FindSystemLibrary(os.path.basename(library_path))
system_library = FindSystemLibrary(library_path)
if system_library is None:
new_path = '@executable_path/../MacOS/%s' % os.path.basename(library_path)
FixInstallPath(library_path, library, new_path)

View File

@@ -9,16 +9,18 @@ Command=craft
#Values need to be overwritten to create a chache
UseCache = True
CreateCache = False
QtVersion = 5.10.1
OpenSslVersion = 1.1.0h
CacheVersion = Qt_${Variables:QtVersion}-1
QtVersion = 5.11.1
OpenSslVersion = 1.1.0i
CacheVersion = Qt_${Variables:QtVersion}
# Settings applicable for all Crafts matrices
# Settings are Category/key=value
# Category is case sensitive
[GeneralSettings]
General/EMERGE_PKGDSTDIR=${Variables:APPVEYOR_BUILD_FOLDER}/binaries
Version/ConfigVersion = 6
Packager/Destination=${Variables:APPVEYOR_BUILD_FOLDER}/binaries
Paths/python = C:\Python36
Paths/python27 = C:\Python27
Paths/downloaddir = ${Variables:Root}\downloads
@@ -31,13 +33,15 @@ Packager/CreateCache = ${Variables:CreateCache}
Packager/CacheVersion = ${Variables:CacheVersion}
; Packager/RepositoryUrl = https://files.kde.org/craft/
Packager/PackageType = PortablePackager
Packager/RepositoryUrl = http://ftp.acc.umu.se/mirror/kde.org/files/craft/master/
Packager/Whitelist = *.pdb;*.sym;symbols
Packager/RepositoryUrl = https://attic.owncloud.com/org/mirror/craft/
Compile/BuildType = RelWithDebInfo
ContinuousIntegration/Enabled = True
[BlueprintSettings]
# don't try to pip install on the ci
python-modules.ignored = True
binary/mysql.ignored = True
libs/qt5.version = ${Variables:QtVersion}
win32libs/openssl.version = ${Variables:OpenSslVersion}

View File

@@ -3,6 +3,7 @@ version: '{build}-{branch}'
branches:
only:
- master
- 2.5
clone_depth: 50

View File

@@ -8,8 +8,8 @@
#
# ecm_add_app_icon(<sources_var>
# ICONS <icon> [<icon> [...]]
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.4x
# [OUTFILE_BASE <name>]) # Since 5.4x
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.49
# [OUTFILE_BASENAME <name>]) # Since 5.49
# )
#
# The given icons, whose names must match the pattern::
@@ -27,20 +27,21 @@
#
# ``SIDEBAR_ICONS`` can be used to add Mac OS X sidebar
# icons to the generated iconset. They are used when a folder monitored by the
# application is dragged into Finder's sidebar. Since 5.4x.
# application is dragged into Finder's sidebar. Since 5.49.
#
# ``OUTFILE_BASE`` will be used as the basename for the icon file. If
# you specify it, the icon file will be called ``<OUTFILE_BASE>.icns`` on Mac OS X
# and ``<OUTFILE_BASE>.ico`` on Windows. If you don't specify it, it defaults
# to ``<sources_var>.<ext>``. Since 5.4x.
# ``OUTFILE_BASENAME`` will be used as the basename for the icon file. If
# you specify it, the icon file will be called ``<OUTFILE_BASENAME>.icns`` on Mac OS X
# and ``<OUTFILE_BASENAME>.ico`` on Windows. If you don't specify it, it defaults
# to ``<sources_var>.<ext>``. Since 5.49.
#
#
# Windows notes
# * Icons are compiled into the executable using a resource file.
# * Icons may not show up in Windows Explorer if the executable
# target does not have the ``WIN32_EXECUTABLE`` property set.
# * The tool png2ico is required. See :find-module:`FindPng2Ico`.
# * Supported sizes: 16, 32, 48, 64, 128.
# * One of the tools png2ico (See :find-module:`FindPng2Ico`) or
# icotool (see :find-module:`FindIcoTool`) is required.
# * Supported sizes: 16, 24, 32, 48, 64, 128, 256, 512 and 1024.
#
# Mac OS X notes
# * The executable target must have the ``MACOSX_BUNDLE`` property set.
@@ -101,7 +102,7 @@ include(CMakeParseArguments)
function(ecm_add_app_icon appsources)
set(options)
set(oneValueArgs OUTFILE_BASE)
set(oneValueArgs OUTFILE_BASENAME)
set(multiValueArgs ICONS SIDEBAR_ICONS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -140,7 +141,7 @@ function(ecm_add_app_icon appsources)
_ecm_add_app_icon_categorize_icons("${ARG_ICONS}" "icons" "16;32;48;64;128;256;512;1024")
if(ARG_SIDEBAR_ICONS)
_ecm_add_app_icon_categorize_icons("${ARG_SIDEBAR_ICONS}" "sidebar_icons" "16;18;32;36;64")
_ecm_add_app_icon_categorize_icons("${ARG_SIDEBAR_ICONS}" "sidebar_icons" "16;32;64;128;256")
endif()
set(mac_icons
@@ -179,8 +180,8 @@ function(ecm_add_app_icon appsources)
message(AUTHOR_WARNING "No icons suitable for use on Windows provided")
endif()
if (ARG_OUTFILE_BASE)
set (_outfilebasename "${ARG_OUTFILE_BASE}")
if (ARG_OUTFILE_BASENAME)
set (_outfilebasename "${ARG_OUTFILE_BASENAME}")
else()
set (_outfilebasename "${appsources}")
endif()
@@ -213,7 +214,7 @@ function(ecm_add_app_icon appsources)
endfunction()
if (IcoTool_FOUND)
set(icotool_args "-c -o \"${_outfilename}.ico\"")
list(APPEND icotool_args "-c" "-o" "${_outfilename}.ico")
# According to https://stackoverflow.com/a/40851713/2886832
# Windows always chooses the first icon above 255px, all other ones will be ignored
@@ -297,6 +298,9 @@ function(ecm_add_app_icon appsources)
list(APPEND iconset_icons
"${_outfilename}.iconset/${type}_${sizename}.png")
endmacro()
# List of supported sizes and filenames taken from:
# https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW4
foreach(size 16 32 128 256 512)
math(EXPR double_size "2 * ${size}")
foreach(file ${icons_at_${size}px})
@@ -307,14 +311,25 @@ function(ecm_add_app_icon appsources)
endforeach()
endforeach()
foreach(size 16 18 32)
math(EXPR double_size "2 * ${size}")
foreach(file ${sidebar_icons_at_${size}px})
copy_icon("${file}" "${size}x${size}" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_${double_size}px})
copy_icon("${file}" "${size}x${size}@2x" "sidebar")
endforeach()
# List of supported sizes and filenames taken from:
# https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
foreach(file ${sidebar_icons_at_16px})
copy_icon("${file}" "16x16" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_32px})
copy_icon("${file}" "16x16@2x" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_32px})
copy_icon("${file}" "18x18" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_64px})
copy_icon("${file}" "18x18@2x" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_128px})
copy_icon("${file}" "32x32" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_256px})
copy_icon("${file}" "32x32@2x" "sidebar")
endforeach()
# generate .icns icon file

View File

@@ -26,6 +26,7 @@ find_path(SQLITE3_INCLUDE_DIR
sqlite3.h
PATHS
${_SQLITE3_INCLUDEDIR}
${SQLITE3_INCLUDE_DIRS}
)
find_library(SQLITE3_LIBRARY
@@ -33,6 +34,7 @@ find_library(SQLITE3_LIBRARY
sqlite3 sqlite3-0
PATHS
${_SQLITE3_LIBDIR}
${SQLITE3_LIBRARIES}
)
set(SQLITE3_INCLUDE_DIRS

View File

@@ -2,8 +2,7 @@
#
# Once done this will define
# SPARKLE_FOUND - system has Sparkle
# SPARKLE_INCLUDE_DIR - the Sparkle include directory
# SPARKLE_LIBRARY - The library needed to use Sparkle
# SPARKLE_LIBRARY - The framework needed to use Sparkle
# Copyright (c) 2009, Vittorio Giovara <vittorio.giovara@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
@@ -15,9 +14,8 @@
include(FindPackageHandleStandardArgs)
find_path(SPARKLE_INCLUDE_DIR Sparkle.h)
find_library(SPARKLE_LIBRARY NAMES Sparkle)
find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_LIBRARY)
mark_as_advanced(SPARKLE_LIBRARY)

View File

@@ -389,7 +389,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}"
File "${BUILD_PATH}\bin\${APPLICATION_CMD_EXECUTABLE}"
File "${BUILD_PATH}\bin\lib${APPLICATION_SHORTNAME}sync.dll"
File "${BUILD_PATH}\bin\libocsync.dll"
File "${BUILD_PATH}\bin\lib${APPLICATION_SHORTNAME}_csync.dll"
File "${BUILD_PATH}\src\gui\client*.qm"
; Make sure only to copy qt, not qt_help, etc

View File

@@ -21,6 +21,40 @@ When a deeply nested directory is excluded from synchronization it will be
listed with other ignored files and directories in the "Not synced" tab of
the "Activity" pane.
I See a Warning Message for Unsupported Versions.
-------------------------------------------------
Keeping software up to date is crucial for file integrity and security if
software is outdated, there can be unfixed bugs. Thats why you should always
upgrade your software when there is a new version.
The ownCloud Desktop Client talks to a server, e.g. the ownCloud server so
you dont only have to upgrade your client when there is a new version for it,
also the server has to be kept up-to-date by your sysadmin.
Starting with version 2.5.0, the client will show a warning message if you
connect to an outdated or unsupported server:
.. image:: https://owncloud.org/wp-content/uploads/2018/09/ownCloud-unsupported-version-warning-message.png
**Because earlier versions are not maintained anymore, only ownCloud 10.0.0 or
higher is supported.** So if you encounter such a message, you should ask your
administrator to upgrade ownCloud to a secure version.
An important feature of the ownCloud Client is checksumming each time you
download or upload a file, the client and the server both check if the file was
corrupted during the sync. This way you can be sure that you dont lose any
files.
There are servers out there which dont have checksumming implemented on their
side, or which are not tested by ownClouds QA team. They cant ensure file
integrity, they have potential security issues, and we cant guarantee that
they are compatible with the ownCloud Desktop Client.
**We care about your data and want it to be safe.** Thats why you see this warning
message, so you can evaluate your data security. Dont worry you can still
use the client with an unsupported server, but do so at your own risk.
There Was A Warning About Changes In Synchronized Folders Not Being Tracked Reliably.
-------------------------------------------------------------------------------------

View File

@@ -2,30 +2,21 @@
Installing the Desktop Synchronization Client
=============================================
You can download the latest version of the ownCloud Desktop Synchronization
Client from the `ownCloud download page`_.
There are clients for Linux, Mac OS X, and Microsoft Windows.
You can download the latest version of the ownCloud Desktop Synchronization Client from the `ownCloud download page`_.
There are clients for *Linux*, *macOS*, and *Microsoft Windows*.
Installation on Mac OS X and Windows is the same as for any software
application: download the program and then double-click it to launch the
installation, and then follow the installation wizard. After it is installed and
configured the sync client will automatically keep itself updated; see
:doc:`autoupdate` for more information.
Installation on Mac OS X and Windows is the same as for any software application: download the program and then double-click it to launch the installation, and then follow the installation wizard.
After it is installed and configured the sync client will automatically keep itself updated; see :doc:`autoupdate` for more information.
Linux users must follow the instructions on the download page to add the
appropriate repository for their Linux distribution, install the signing key,
and then use their package managers to install the desktop sync client. Linux
users will also update their sync clients via package manager, and the client
will display a notification when an update is available.
Linux users must follow the instructions on the download page to add the appropriate repository for their Linux distribution, install the signing key, and then use their package managers to install the desktop sync client.
Linux users will also update their sync clients via package manager, and the client will display a notification when an update is available.
Linux users must also have a password manager enabled, such as GNOME Keyring or
KWallet, so that the sync client can login automatically.
Linux users must also have a password manager enabled, such as `GNOME Keyring`_ or `KWallet`_, so that the sync client can login automatically.
You will also find links to source code archives and older versions on the
download page.
You will also find links to source code archives and older versions on the download page.
System Requirements
----------------------------------
-------------------
- Windows 7+
- Mac OS X 10.7+ (**64-bit only**)
@@ -38,36 +29,176 @@ System Requirements
.. note::
For Linux distributions, we support, if technically feasible, the latest 2 versions per platform and the previous Ubuntu `LTS`_.
Customizing the Windows installation
------------------------------------
If you just want to install ownCloud Desktop Synchronization Client on your local system, you can simply launch the .msi file and configure it in the wizard that pops up.
Features
^^^^^^^^
The MSI installer provides several features that can be installed or removed individually, which you can also control via command-line, if you are automating the installation, then run the following command:
::
msiexec /passive /i ownCloud-x.y.z.msi
The command will install the ownCloud Desktop Synchronization Client into the default location with the default features enabled.
If you want to disable, e.g., desktop shortcut icons you can simply change the above command to the following:
::
msiexec /passive /i ownCloud-x.y.z.msi REMOVE=DesktopShortcut
See the following table for a list of available features:
+--------------------+--------------------+----------------------------------+-----------------------------+
| Feature | Enabled by default | Description |Property to disable |
+====================+====================+==================================+=============================+
| Client | Yes, required | The actual client | |
+--------------------+--------------------+----------------------------------+-----------------------------+
| DesktopShortcut | Yes | Adds a shortcut to the desktop |``NO_DESKTOP_SHORTCUT`` |
+--------------------+--------------------+----------------------------------+-----------------------------+
| StartMenuShortcuts | Yes | Adds shortcuts to the start menu |``NO_START_MENU_SHORTCUTS``|
+--------------------+--------------------+----------------------------------+-----------------------------+
| ShellExtensions | Yes | Adds Explorer integration |``NO_SHELL_EXTENSIONS`` |
+--------------------+--------------------+----------------------------------+-----------------------------+
Installation
~~~~~~~~~~~~
You can also choose to only install the client itself by using the following command:
::
msiexec /passive /i ownCloud-x.y.z.msi ADDDEFAULT=Client
If you for instance want to install everything but the ``DesktopShortcut`` and the ``ShellExtensions`` feature, you have two possibilities:
1. You explicitly name all the features you actually want to install (whitelist) where ``Client`` is always installed anyway:
::
msiexec /passive /i ownCloud-x.y.z.msi ADDDEFAULT=StartMenuShortcuts
2. You pass the ``NO_DESKTOP_SHORTCUT`` and ``NO_SHELL_EXTENSIONS`` properties:
::
msiexec /passive /i ownCloud-x.y.z.msi NO_DESKTOP_SHORTCUT="1" NO_SHELL_EXTENSIONS="1"
.. note:: The ownCloud .msi remembers these properties, so you don't need to specify them on upgrades.
.. note:: You cannot use these to change the installed features, if you want to do that, see the next section.
Changing Installed Features
~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can change the installed features later by using ``REMOVE`` and ``ADDDEFAULT`` properties.
1. If you want to add the desktop shortcut later, run the following command:
::
msiexec /passive /i ownCloud-x.y.z.msi ADDDEFAULT="DesktopShortcut"
2. If you want to remove it, simply run the following command:
::
msiexec /passive /i ownCloud-x.y.z.msi REMOVE="DesktopShortcut"
Windows keeps track of the installed features and using ``REMOVE`` or ``ADDDEFAULT`` will only affect the mentioned features.
Compare `REMOVE <https://msdn.microsoft.com/en-us/library/windows/desktop/aa371194(v=vs.85).aspx>`_ and `ADDDEFAULT <https://msdn.microsoft.com/en-us/library/windows/desktop/aa367518(v=vs.85).aspx>`_ on the Windows Installer Guide.
.. note:: You cannot specify `REMOVE` on initial installation as it will disable all features.
Installation Folder
^^^^^^^^^^^^^^^^^^^
You can adjust the installation folder by specifying the ``INSTALLDIR`` property like this
::
msiexec /passive /i ownCloud-x.y.z.msi INSTALLDIR="C:\Program Files (x86)\Non Standard ownCloud Client Folder"
Be careful when using PowerShell instead of ``cmd.exe``, it can be tricky to get the whitespace escaping right there.
Specifying the ``INSTALLDIR`` like this only works on first installation, you cannot simply re-invoke the .msi with a different path.
If you still need to change it, uninstall it first and reinstall it with the new path.
Disabling Automatic Updates
^^^^^^^^^^^^^^^^^^^^^^^^^^^
To disable automatic updates, you can pass the ``SKIPAUTOUPDATE`` property.
::
msiexec /passive /i ownCloud-x.y.z.msi SKIPAUTOUPDATE="1"
Launch After Installation
^^^^^^^^^^^^^^^^^^^^^^^^^
To launch the client automatically after installation, you can pass the ``LAUNCH`` property.
::
msiexec /i ownCloud-x.y.z.msi LAUNCH="1"
This option also removes the checkbox to let users decide if they want to launch the client for non passive/quiet mode.
.. note:: This option does not have any effect without GUI.
No Reboot After Installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ownCloud Client schedules a reboot after installation to make sure the Explorer extension is correctly (un)loaded.
If you're taking care of the reboot yourself, you can set the ``REBOOT`` property
::
msiexec /i ownCloud-x.y.z.msi REBOOT=ReallySuppress
This will make `msiexec` exit with error `ERROR_SUCCESS_REBOOT_REQUIRED` (3010).
If your deployment tooling interprets this as an actual error and you want to avoid that, you may want to set the ``DO_NOT_SCHEDULE_REBOOT`` instead
::
msiexec /i ownCloud-x.y.z.msi DO_NOT_SCHEDULE_REBOOT="1"
Installation Wizard
-------------------
The installation wizard takes you step-by-step through configuration options and
account setup. First you need to enter the URL of your ownCloud server.
The installation wizard takes you step-by-step through configuration options and account setup.
First you need to enter the URL of your ownCloud server.
.. image:: images/client-1.png
:alt: form for entering ownCloud server URL
Enter your ownCloud login on the next screen.
.. image:: images/client-2.png
:alt: form for entering your ownCloud login
On the Local Folder Option screen you may sync
all of your files on the ownCloud server, or select individual folders. The
default local sync folder is ``ownCloud``, in your home directory. You may
change this as well.
On the *"Local Folder Option"* screen you may sync all of your files on the ownCloud server, or select individual folders.
The default local sync folder is ``ownCloud``, in your home directory.
You may change this as well.
.. image:: images/client-3.png
:alt: Select which remote folders to sync, and which local folder to store
:alt: Select which remote folders to sync, and which local folder to store
them in.
When you have completed selecting your sync folders, click the Connect button
at the bottom right. The client will attempt to connect to your ownCloud
server, and when it is successful you'll see two buttons: one to connect to
your ownCloud Web GUI, and one to open your local folder. It will also start
synchronizing your files.
When you have completed selecting your sync folders, click the *"Connect"* button at the bottom right.
The client will attempt to connect to your ownCloud server, and when it is successful you'll see two buttons:
- one to connect to your ownCloud Web GUI
- one to open your local folder
It will also start synchronizing your files.
.. Links
.. _ownCloud download page: https://owncloud.com/download/#desktop-clients
.. _LTS: https://wiki.ubuntu.com/LTS
.. _LTS: https://wiki.ubuntu.com/LTS
.. _GNOME Keyring: https://wiki.gnome.org/Projects/GnomeKeyring/
.. _KWallet: https://utils.kde.org/projects/kwalletmanager/

View File

@@ -24,7 +24,9 @@ The other options are:
``--logflush``
Clears (flushes) the log file after each write action.
``--logdebug``
Also output debug-level messages in the log (equivalent to setting the env var QT_LOGGING_RULES="qt.*=true;*.debug=true").
)
``--confdir`` `<dirname>`
Uses the specified configuration directory.

View File

@@ -8,199 +8,205 @@ GenericName=Folder Sync
Icon=@APPLICATION_EXECUTABLE@
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
X-GNOME-Autostart-Delay=3
MimeType=application/x-@APPLICATION_EXECUTABLE@;
MimeType=application/vnd.@APPLICATION_EXECUTABLE@;
# Translations
# Translations
# Translations
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client
GenericName[oc]=Dorsièr de Sincronizacion
Name[oc]=@APPLICATION_NAME@ sincronizacion del client
Icon[oc]=@APPLICATION_EXECUTABLE@
Name[oc]=@APPLICATION_NAME@ sincronizacion del client
GenericName[oc]=Dorsièr de Sincronizacion
Comment[ar]=@APPLICATION_NAME@ زبون مزامنة مكتبي
GenericName[ar]=مزامنة المجلد
Name[ar]=@APPLICATION_NAME@ زبون مزامنة مكتبي
Icon[ar]=@APPLICATION_EXECUTABLE@
Name[ar]=@APPLICATION_NAME@ زبون مزامنة مكتبي
GenericName[ar]=مزامنة المجلد
Comment[bg_BG]=@APPLICATION_NAME@ клиент за десктоп синхронизация
GenericName[bg_BG]=Синхронизиране на папката
Name[bg_BG]=@APPLICATION_NAME@ клиент десктоп синхронизация
Icon[bg_BG]=@APPLICATION_EXECUTABLE@
Name[bg_BG]=@APPLICATION_NAME@ клиент десктоп синхронизация
GenericName[bg_BG]=Синхронизиране на папката
Comment[ca]=Client de sincronització d'escriptori @APPLICATION_NAME@
GenericName[ca]=Sincronització de carpetes
Name[ca]=Client de sincronització d'escriptori @APPLICATION_NAME@
Icon[ca]=@APPLICATION_EXECUTABLE@
Name[ca]=Client de sincronització d'escriptori @APPLICATION_NAME@
GenericName[ca]=Sincronització de carpetes
Comment[da]=@APPLICATION_NAME@ skrivebordsklient til synkronisering
GenericName[da]=Mappesynkronisering
Name[da]=@APPLICATION_NAME@ skrivebordsklient til synk
Icon[da]=@APPLICATION_EXECUTABLE@
Name[da]=@APPLICATION_NAME@ skrivebordsklient til synk
GenericName[da]=Mappesynkronisering
Comment[de]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
GenericName[de]=Ordner-Synchronisation
Name[de]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
Icon[de]=@APPLICATION_EXECUTABLE@
Name[de]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
GenericName[de]=Ordner-Synchronisation
Comment[ja_JP]=@APPLICATION_NAME@ デスクトップ同期クライアント
GenericName[ja_JP]=フォルダー同期
Name[ja_JP]=@APPLICATION_NAME@ デスクトップ同期クライアント
Icon[ja_JP]=@APPLICATION_EXECUTABLE@
Name[ja_JP]=@APPLICATION_NAME@ デスクトップ同期クライアント
GenericName[ja_JP]=フォルダー同期
Comment[el]=@ΟΝΟΜΑ_ΕΦΑΡΜΟΓΗΣ@ συγχρονισμός επιφάνειας εργασίας πελάτη
GenericName[el]=Συγχρονισμός φακέλου
Name[el]=@ΟΝΟΜΑ_ΕΦΑΡΜΟΓΗΣ@ συγχρονισμός επιφάνειας εργασίας πελάτη
Icon[el]=@APPLICATION_EXECUTABLE@
Name[el]=@ΟΝΟΜΑ_ΕΦΑΡΜΟΓΗΣ@ συγχρονισμός επιφάνειας εργασίας πελάτη
GenericName[el]=Συγχρονισμός φακέλου
Comment[en_GB]=@APPLICATION_NAME@ desktop synchronisation client
GenericName[en_GB]=Folder Sync
Name[en_GB]=@APPLICATION_NAME@ desktop sync client
Icon[en_GB]=@APPLICATION_EXECUTABLE@
Name[en_GB]=@APPLICATION_NAME@ desktop sync client
GenericName[en_GB]=Folder Sync
Comment[es]=@APPLICATION_NAME@ cliente de sincronización de escritorio
GenericName[es]=Sincronización de carpeta
Name[es]=@APPLICATION_NAME@ cliente de sincronización de escritorio
Icon[es]=@APPLICATION_EXECUTABLE@
Name[es]=@APPLICATION_NAME@ cliente de sincronización de escritorio
GenericName[es]=Sincronización de carpeta
Comment[de_DE]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
GenericName[de_DE]=Ordner-Synchronisation
Name[de_DE]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
Icon[de_DE]=@APPLICATION_EXECUTABLE@
Name[de_DE]=@APPLICATION_NAME@ Desktop-Synchronisationsclient
GenericName[de_DE]=Ordner-Synchronisation
Comment[eu]=@APPLICATION_NAME@ mahaigaineko sinkronizazio bezeroa
GenericName[eu]=Karpetaren sinkronizazioa
Name[eu]=@APPLICATION_NAME@ mahaigaineko sinkronizazio bezeroa
Icon[eu]=@APPLICATION_EXECUTABLE@
GenericName[fa]=همسان سازی پوشه‌ها
Name[fa]=@APPLICATION_EXECUTABLE@ نسخه‌ی همسان سازی مشتری
Name[eu]=@APPLICATION_NAME@ mahaigaineko sinkronizazio bezeroa
GenericName[eu]=Karpetaren sinkronizazioa
Icon[fa]=@APPLICATION_EXECUTABLE@
Name[fa]=@APPLICATION_EXECUTABLE@ نسخه‌ی همسان سازی مشتری
GenericName[fa]=همسان سازی پوشه‌ها
Comment[fr]=Client de synchronisation @APPLICATION_NAME@
GenericName[fr]=Synchronisation de dossier
Name[fr]=Client de synchronisation @APPLICATION_NAME@
Icon[fr]=@APPLICATION_EXECUTABLE@
Name[fr]=Client de synchronisation @APPLICATION_NAME@
GenericName[fr]=Synchronisation de dossier
Comment[gl]=@APPLICATION_NAME@ cliente de sincronización para escritorio
GenericName[gl]=Sincronizar Cartafol
Name[gl]=@APPLICATION_NAME@ cliente de sincronización para escritorio
Icon[gl]=@APPLICATION_EXECUTABLE@
Name[gl]=@APPLICATION_NAME@ cliente de sincronización para escritorio
GenericName[gl]=Sincronizar Cartafol
Comment[he]=@APPLICATION_NAME@ לקוח סנכון שולחן עבודה
GenericName[he]=סנכון תיקייה
Name[he]=@APPLICATION_NAME@ לקוח סנכרון שולחן עבודה
Icon[he]=@APPLICATION_EXECUTABLE@
Name[he]=@APPLICATION_NAME@ לקוח סנכרון שולחן עבודה
GenericName[he]=סנכון תיקייה
Comment[ia]=@APPLICATION_NAME@ cliente de synchronisation pro scriptorio
GenericName[ia]=Synchronisar Dossier
Name[ia]=@APPLICATION_NAME@ cliente de synchronisation pro scriptorio
Icon[ia]=@APPLICATION_EXECUTABLE@
Name[ia]=@APPLICATION_NAME@ cliente de synchronisation pro scriptorio
GenericName[ia]=Synchronisar Dossier
Comment[id]=Klien sinkronisasi desktop @APPLICATION_NAME@
GenericName[id]=Folder Sync
Name[id]=Klien sync desktop @APPLICATION_NAME@
Icon[id]=@APPLICATION_EXECUTABLE@
Name[id]=Klien sync desktop @APPLICATION_NAME@
GenericName[id]=Folder Sync
Comment[is]=@APPLICATION_NAME@ skjáborðsforrit samstillingar
GenericName[is]=Samstilling möppu
Name[is]=@APPLICATION_NAME@ skjáborðsforrit samstillingar
Icon[is]=@APPLICATION_EXECUTABLE@
Name[is]=@APPLICATION_NAME@ skjáborðsforrit samstillingar
GenericName[is]=Samstilling möppu
Comment[it]=Client di sincronizzazione del desktop di @APPLICATION_NAME@
GenericName[it]=Sincronizzazione cartella
Name[it]=Client di sincronizzazione del desktop di @APPLICATION_NAME@
Icon[it]=@APPLICATION_EXECUTABLE@
Name[it]=Client di sincronizzazione del desktop di @APPLICATION_NAME@
GenericName[it]=Sincronizzazione cartella
Comment[ko]=@APPLICATION_NAME@ 데스크톱 동기화 클라이언트
GenericName[ko]=폴더 동기화
Name[ko]=@APPLICATION_NAME@ 데스크톱 동기화 클라이언트
Icon[ko]=@APPLICATION_EXECUTABLE@
Name[ko]=@APPLICATION_NAME@ 데스크톱 동기화 클라이언트
GenericName[ko]=폴더 동기화
Comment[lo]=@APPLICATION_NAME@ ການປະສານຂໍ້ມູນຄອມພິວເຕີລູກຂ່າຍ
GenericName[lo]=ໂຟນເດີຊິງ
Name[lo]=@APPLICATION_NAME@ ຊິງຄອມພິວເຕີລູກຂ່າຍ
Icon[lo]=@APPLICATION_EXECUTABLE@
Name[lo]=@APPLICATION_NAME@ ຊິງຄອມພິວເຕີລູກຂ່າຍ
GenericName[lo]=ໂຟນເດີຊິງ
Comment[mk]=@APPLICATION_NAME@ десктор клиент за синхронизација
GenericName[mk]=Папка за синхронизација
Name[mk]=@APPLICATION_NAME@ десктор клиент за синхронизација
Icon[mk]=@APPLICATION_EXECUTABLE@
Name[mk]=@APPLICATION_NAME@ десктор клиент за синхронизација
GenericName[mk]=Папка за синхронизација
Comment[hu_HU]=@APPLICATION_NAME@ asztali szinkronizációs kliens
GenericName[hu_HU]=Mappaszinkronizálás
Name[hu_HU]=@APPLICATION_NAME@ asztali szinkronizációs kliens
Icon[hu_HU]=@APPLICATION_EXECUTABLE@
Name[hu_HU]=@APPLICATION_NAME@ asztali szinkronizációs kliens
GenericName[hu_HU]=Mappaszinkronizálás
Comment[af_ZA]=@APPLICATION_NAME@ werkskermsinchroniseerkliënt
GenericName[af_ZA]=Vouersinchronisering
Name[af_ZA]=@APPLICATION_NAME@ werkskermsinchroniseerkliënt
Icon[af_ZA]=@APPLICATION_EXECUTABLE@
Name[af_ZA]=@APPLICATION_NAME@ werkskermsinchroniseerkliënt
GenericName[af_ZA]=Vouersinchronisering
Comment[nl]=@APPLICATION_NAME@ desktop synchronisatie client
GenericName[nl]=Mappen sync
Name[nl]=@APPLICATION_NAME@ desktop sync client
Icon[nl]=@APPLICATION_EXECUTABLE@
Name[nl]=@APPLICATION_NAME@ desktop sync client
GenericName[nl]=Mappen sync
Comment[et_EE]=@APPLICATION_NAME@ sünkroonimise klient töölauale
GenericName[et_EE]=Kaustade sünkroonimine
Name[et_EE]=@APPLICATION_NAME@ sünkroonimise klient töölauale
Icon[et_EE]=@APPLICATION_EXECUTABLE@
Name[et_EE]=@APPLICATION_NAME@ sünkroonimise klient töölauale
GenericName[et_EE]=Kaustade sünkroonimine
Comment[pl]=@APPLICATION_NAME@ klient synchronizacji dla komputerów stacjonarnych
GenericName[pl]=Folder Synchronizacji
Name[pl]=@APPLICATION_NAME@ klient synchronizacji dla komputerów stacjonarnych
Icon[pl]=@APPLICATION_EXECUTABLE@
Name[pl]=@APPLICATION_NAME@ klient synchronizacji dla komputerów stacjonarnych
GenericName[pl]=Folder Synchronizacji
Comment[pt_BR]=@APPLICATION_NAME@ cliente de sincronização do computador
GenericName[pt_BR]=Sincronização de Pasta
Name[pt_BR]=@APPLICATION_NAME@ cliente de sincronização de desktop
Icon[pt_BR]=@APPLICATION_EXECUTABLE@
Name[pt_BR]=@APPLICATION_NAME@ cliente de sincronização de desktop
GenericName[pt_BR]=Sincronização de Pasta
Comment[cs_CZ]=@APPLICATION_NAME@ počítačový synchronizační klient
GenericName[cs_CZ]=Synchronizace adresáře
Name[cs_CZ]=@APPLICATION_NAME@ počítačový synchronizační klient
Icon[cs_CZ]=@APPLICATION_EXECUTABLE@
Name[cs_CZ]=@APPLICATION_NAME@ počítačový synchronizační klient
GenericName[cs_CZ]=Synchronizace adresáře
Comment[ru]=Настольный клиент синхронизации @APPLICATION_NAME@
GenericName[ru]=Синхронизация каталогов
Name[ru]=Настольный клиент синхронизации @APPLICATION_NAME@
Icon[ru]=@APPLICATION_EXECUTABLE@
Name[ru]=Настольный клиент синхронизации @APPLICATION_NAME@
GenericName[ru]=Синхронизация каталогов
Comment[sl]=@APPLICATION_NAME@ Program za usklajevanje datotek z namizjem
GenericName[sl]=Usklajevanje map
Name[sl]=@APPLICATION_NAME@ Program za usklajevanje datotek z namizjem
Icon[sl]=@APPLICATION_EXECUTABLE@
Name[sl]=@APPLICATION_NAME@ Program za usklajevanje datotek z namizjem
GenericName[sl]=Usklajevanje map
Comment[sq]=Klient njëkohësimesh @APPLICATION_NAME@ për desktop
GenericName[sq]=Njëkohësim Dosjesh
Name[sq]=Klient njëkohësimesh @APPLICATION_NAME@ për desktop
Icon[sq]=@APPLICATION_EXECUTABLE@
Name[sq]=Klient njëkohësimesh @APPLICATION_NAME@ për desktop
GenericName[sq]=Njëkohësim Dosjesh
Comment[fi_FI]=@APPLICATION_NAME@ työpöytäsynkronointisovellus
GenericName[fi_FI]=Kansion synkronointi
Name[fi_FI]=@APPLICATION_NAME@ työpöytäsynkronointisovellus
Icon[fi_FI]=@APPLICATION_EXECUTABLE@
Name[fi_FI]=@APPLICATION_NAME@ työpöytäsynkronointisovellus
GenericName[fi_FI]=Kansion synkronointi
Comment[sv]=@APPLICATION_NAME@ desktop synkroniseringsklient
GenericName[sv]=Mappsynk
Name[sv]=@APPLICATION_NAME@ desktop synk-klient
Icon[sv]=@APPLICATION_EXECUTABLE@
Name[sv]=@APPLICATION_NAME@ desktop synk-klient
GenericName[sv]=Mappsynk
Comment[tr]=@APPLICATION_NAME@ masaüstü eşitleme istemcisi
GenericName[tr]=Dosya Eşitleme
Name[tr]=@APPLICATION_NAME@ masaüstü eşitleme istemcisi
Icon[tr]=@APPLICATION_EXECUTABLE@
Name[tr]=@APPLICATION_NAME@ masaüstü eşitleme istemcisi
GenericName[tr]=Dosya Eşitleme
Comment[uk]=Настільний клієнт синхронізації @APPLICATION_NAME@
GenericName[uk]=Синхронізація теки
Name[uk]=Настільний клієнт синхронізації @APPLICATION_NAME@
Icon[uk]=@APPLICATION_EXECUTABLE@
Name[uk]=Настільний клієнт синхронізації @APPLICATION_NAME@
GenericName[uk]=Синхронізація теки
Comment[ro]=@APPLICATION_NAME@ client de sincronizare pe desktop
GenericName[ro]=Sincronizare director
Name[ro]=@APPLICATION_NAME@ client de sincronizare pe desktop
Icon[ro]=@APPLICATION_EXECUTABLE@
Name[ro]=@APPLICATION_NAME@ client de sincronizare pe desktop
GenericName[ro]=Sincronizare director
Comment[zh_CN]=@APPLICATION_NAME@ 桌面同步客户端
GenericName[zh_CN]=文件夹同步
Name[zh_CN]=@APPLICATION_NAME@ 桌面同步客户端
Icon[zh_CN]=@APPLICATION_EXECUTABLE@
Name[zh_CN]=@APPLICATION_NAME@ 桌面同步客户端
GenericName[zh_CN]=文件夹同步
Comment[zh_HK]=桌面版同步客户端
Comment[zh_TW]=@APPLICATION_NAME@ 桌面同步客戶端
GenericName[zh_TW]=資料夾同步
Name[zh_TW]=@APPLICATION_NAME@ 桌面同步客戶端
Icon[zh_TW]=@APPLICATION_EXECUTABLE@
Name[zh_TW]=@APPLICATION_NAME@ 桌面同步客戶端
GenericName[zh_TW]=資料夾同步
Comment[es_AR]=Cliente de sincronización para escritorio @APPLICATION_NAME@
GenericName[es_AR]=Sincronización de directorio
Name[es_AR]=Cliente de sincronización para escritorio @APPLICATION_NAME@
Icon[es_AR]=@APPLICATION_EXECUTABLE@
Name[es_AR]=Cliente de sincronización para escritorio @APPLICATION_NAME@
GenericName[es_AR]=Sincronización de directorio
Comment[lt_LT]=@APPLICATION_NAME@ darbalaukio sinchronizavimo programa
GenericName[lt_LT]=Katalogo sinchnorizacija
Name[lt_LT]=@APPLICATION_NAME@ darbalaukio programa
Icon[lt_LT]=@APPLICATION_EXECUTABLE@
Name[lt_LT]=@APPLICATION_NAME@ darbalaukio programa
GenericName[lt_LT]=Katalogo sinchnorizacija
Comment[th_TH]=@APPLICATION_NAME@ ประสานข้อมูลด้วยโปรแกรมบนเดสก์ท็อป
GenericName[th_TH]=ประสานข้อมูลโฟลเดอร์
Name[th_TH]= @APPLICATION_NAME@ ประสานข้อมูลด้วยโปรแกรมบนเดสก์ท็อป
Icon[th_TH]=@APPLICATION_EXECUTABLE@
Name[th_TH]= @APPLICATION_NAME@ ประสานข้อมูลด้วยโปรแกรมบนเดสก์ท็อป
GenericName[th_TH]=ประสานข้อมูลโฟลเดอร์
Comment[es_MX]=Cliente de escritorio para sincronziación de @APPLICATION_NAME@
GenericName[es_MX]=Sincronización de Carpetas
Name[es_MX]=Cliente de escritorio para sincronziación de @APPLICATION_NAME@
Icon[es_MX]=@APPLICATION_EXECUTABLE@
Name[es_MX]=Cliente de escritorio para sincronziación de @APPLICATION_NAME@
GenericName[es_MX]=Sincronización de Carpetas
Comment[nb_NO]=@APPLICATION_NAME@ skrivebordssynkroniseringsklient
GenericName[nb_NO]=Mappesynkronisering
Name[nb_NO]=@APPLICATION_NAME@ skrivebordssynkroniseringsklient
Icon[nb_NO]=@APPLICATION_EXECUTABLE@
Name[nb_NO]=@APPLICATION_NAME@ skrivebordssynkroniseringsklient
GenericName[nb_NO]=Mappesynkronisering
Comment[nn_NO]=@APPLICATION_NAME@ klient for å synkronisera frå skrivebord
GenericName[nn_NO]=Mappe synkronisering
Name[nn_NO]=@APPLICATION_NAME@ klient for å synkronisera frå skrivebord
Icon[nn_NO]=@APPLICATION_EXECUTABLE@
Name[nn_NO]=@APPLICATION_NAME@ klient for å synkronisera frå skrivebord
GenericName[nn_NO]=Mappe synkronisering
Comment[pt_PT]=@APPLICATION_NAME@ - Cliente de Sincronização para PC
GenericName[pt_PT]=Sincronizar Pasta
Name[pt_PT]=@APPLICATION_NAME@ - Cliente de Sincronização para PC
Icon[pt_PT]=@APPLICATION_EXECUTABLE@
Name[pt_PT]=@APPLICATION_NAME@ - Cliente de Sincronização para PC
GenericName[pt_PT]=Sincronizar Pasta
Icon[km]=@APPLICATION_EXECUTABLE@
Comment[lb]=@APPLICATION_NAME@ Desktop Synchronisatioun Client
GenericName[lb]=Dossier Dync
Name[lb]=@APPLICATION_NAME@ Desktop Sync Client
Icon[lb]=@APPLICATION_EXECUTABLE@
Name[lb]=@APPLICATION_NAME@ Desktop Sync Client
GenericName[lb]=Dossier Dync

View File

@@ -3,4 +3,6 @@
# this script replaces the line
# appname = 'ownCloud'
# with the correct branding name in the syncstate.py script
sed -i.org -e 's/appname\s*=\s*'"'"'ownCloud'"'/appname = '$1'/" syncstate.py
# It also replaces the occurences in the class name so several
# branding can be loaded (see #6524)
sed -i.org -e "s/ownCloud/$1/g" syncstate.py

View File

@@ -28,10 +28,8 @@ import time
from gi.repository import GObject, Nautilus
# Please do not touch the following line.
# The reason is that we use a script to adopt this file for branding
# by replacing this line with the branding app name. If the following
# line is changed, the script can not match the pattern and fails.
# Note: setappname.sh will search and replace 'ownCloud' on this file to update this line and other
# occurrences of the name
appname = 'ownCloud'
print("Initializing "+appname+"-client-nautilus extension")
@@ -178,7 +176,7 @@ class SocketConnect(GObject.GObject):
socketConnect = SocketConnect()
class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
class MenuExtension_ownCloud(GObject.GObject, Nautilus.MenuProvider):
def __init__(self):
GObject.GObject.__init__(self)
@@ -235,7 +233,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
def ask_for_menu_items(self, files):
record_separator = '\x1e'
filesstring = record_separator.join(files)
socketConnect.sendCommand('GET_MENU_ITEMS:{}\n'.format(filesstring))
socketConnect.sendCommand(u'GET_MENU_ITEMS:{}\n'.format(filesstring))
done = False
start = time.time()
@@ -295,8 +293,8 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
# and we definitely don't want to show them for IGNORED.
shareable = False
state = entry['state']
state_ok = state.startswith('OK')
state_sync = state.startswith('SYNC')
state_ok = state and state.startswith('OK')
state_sync = state and state.startswith('SYNC')
if state_ok:
shareable = True
elif state_sync and isDir:
@@ -346,7 +344,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
socketConnect.sendCommand(action + ":" + filename + "\n")
class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider):
class SyncStateExtension_ownCloud(GObject.GObject, Nautilus.InfoProvider):
def __init__(self):
GObject.GObject.__init__(self)

View File

@@ -32,7 +32,6 @@
using namespace std;
#define PIPE_TIMEOUT 5*1000 //ms
#define SOCK_BUFFER 4096
OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo(const std::wstring &files)
{
@@ -92,9 +91,5 @@ void OCClientInterface::SendRequest(const wchar_t *verb, const std::wstring &pat
return;
}
wchar_t msg[SOCK_BUFFER] = { 0 };
if (SUCCEEDED(StringCchPrintf(msg, SOCK_BUFFER, L"%s:%s\n", verb, path.c_str())))
{
socket.SendMsg(msg);
}
socket.SendMsg((verb + (L":" + path + L"\n")).data());
}

View File

@@ -5,6 +5,7 @@ add_library(OCUtil SHARED
RemotePathChecker.cpp
stdafx.cpp
StringUtil.cpp
OCUtil.rc
)
target_include_directories(OCUtil

Binary file not shown.

View File

@@ -169,8 +169,11 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="StringUtil.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="OCUtil.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by OCContextMenu.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.23.1"
#define SQLITE_VERSION_NUMBER 3023001
#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
#define SQLITE_VERSION "3.24.0"
#define SQLITE_VERSION_NUMBER 3024000
#define SQLITE_SOURCE_ID "2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -504,6 +504,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -511,6 +512,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8))
#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8))
#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
@@ -1930,6 +1932,22 @@ struct sqlite3_mem_methods {
** I/O required to support statement rollback.
** The default value for this setting is controlled by the
** [SQLITE_STMTJRNL_SPILL] compile-time option.
**
** [[SQLITE_CONFIG_SORTERREF_SIZE]]
** <dt>SQLITE_CONFIG_SORTERREF_SIZE
** <dd>The SQLITE_CONFIG_SORTERREF_SIZE option accepts a single parameter
** of type (int) - the new value of the sorter-reference size threshold.
** Usually, when SQLite uses an external sort to order records according
** to an ORDER BY clause, all fields required by the caller are present in the
** sorted records. However, if SQLite determines based on the declared type
** of a table column that its values are likely to be very large - larger
** than the configured sorter-reference size threshold - then a reference
** is stored in each sorted record and the required column values loaded
** from the database as records are returned in sorted order. The default
** value for this option is to never use this optimization. Specifying a
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -1959,6 +1977,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */
#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -2095,6 +2114,21 @@ struct sqlite3_mem_methods {
** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if
** it is not disabled, 1 if it is.
** </dd>
**
** <dt>SQLITE_DBCONFIG_RESET_DATABASE</dt>
** <dd> Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run
** [VACUUM] in order to reset a database back to an empty database
** with no schema and no content. The following process works even for
** a badly corrupted database file:
** <ol>
** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
** <li> [sqlite3_exec](db, "[VACUUM]", 0, 0, 0);
** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
** </ol>
** Because resetting a database is destructive and irreversible, the
** process requires the use of this obscure API and multiple steps to help
** ensure that it does not happen by accident.
** </dd>
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2106,7 +2140,8 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */
#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
#define SQLITE_DBCONFIG_MAX 1008 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
#define SQLITE_DBCONFIG_MAX 1009 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -5492,6 +5527,41 @@ SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory;
*/
SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory;
/*
** CAPI3REF: Win32 Specific Interface
**
** These interfaces are available only on Windows. The
** [sqlite3_win32_set_directory] interface is used to set the value associated
** with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to
** zValue, depending on the value of the type parameter. The zValue parameter
** should be NULL to cause the previous value to be freed via [sqlite3_free];
** a non-NULL value will be copied into memory obtained from [sqlite3_malloc]
** prior to being used. The [sqlite3_win32_set_directory] interface returns
** [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported,
** or [SQLITE_NOMEM] if memory could not be allocated. The value of the
** [sqlite3_data_directory] variable is intended to act as a replacement for
** the current directory on the sub-platforms of Win32 where that concept is
** not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and
** [sqlite3_win32_set_directory16] interfaces behave exactly the same as the
** sqlite3_win32_set_directory interface except the string parameter must be
** UTF-8 or UTF-16, respectively.
*/
SQLITE_API int sqlite3_win32_set_directory(
unsigned long type, /* Identifier for directory being set or reset */
void *zValue /* New value for directory being set or reset */
);
SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue);
SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue);
/*
** CAPI3REF: Win32 Directory Types
**
** These macros are only available on Windows. They define the allowed values
** for the type argument to the [sqlite3_win32_set_directory] interface.
*/
#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1
#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2
/*
** CAPI3REF: Test For Auto-Commit Mode
** KEYWORDS: {autocommit mode}
@@ -6224,6 +6294,10 @@ struct sqlite3_index_info {
/*
** CAPI3REF: Virtual Table Scan Flags
**
** Virtual table implementations are allowed to set the
** [sqlite3_index_info].idxFlags field to some combination of
** these bits.
*/
#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */
@@ -6999,7 +7073,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_ALWAYS 13
#define SQLITE_TESTCTRL_RESERVE 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_ISKEYWORD 16
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */
@@ -7013,6 +7087,189 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
#define SQLITE_TESTCTRL_LAST 26 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking
**
** These routines provide access to the set of SQL language keywords
** recognized by SQLite. Applications can uses these routines to determine
** whether or not a specific identifier needs to be escaped (for example,
** by enclosing in double-quotes) so as not to confuse the parser.
**
** The sqlite3_keyword_count() interface returns the number of distinct
** keywords understood by SQLite.
**
** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and
** makes *Z point to that keyword expressed as UTF8 and writes the number
** of bytes in the keyword into *L. The string that *Z points to is not
** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns
** SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z
** or L are NULL or invalid pointers then calls to
** sqlite3_keyword_name(N,Z,L) result in undefined behavior.
**
** The sqlite3_keyword_check(Z,L) interface checks to see whether or not
** the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero
** if it is and zero if not.
**
** The parser used by SQLite is forgiving. It is often possible to use
** a keyword as an identifier as long as such use does not result in a
** parsing ambiguity. For example, the statement
** "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and
** creates a new table named "BEGIN" with three columns named
** "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid
** using keywords as identifiers. Common techniques used to avoid keyword
** name collisions include:
** <ul>
** <li> Put all identifier names inside double-quotes. This is the official
** SQL way to escape identifier names.
** <li> Put identifier names inside &#91;...&#93;. This is not standard SQL,
** but it is what SQL Server does and so lots of programmers use this
** technique.
** <li> Begin every identifier with the letter "Z" as no SQL keywords start
** with "Z".
** <li> Include a digit somewhere in every identifier name.
** </ul>
**
** Note that the number of keywords understood by SQLite can depend on
** compile-time options. For example, "VACUUM" is not a keyword if
** SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also,
** new keywords may be added to future releases of SQLite.
*/
SQLITE_API int sqlite3_keyword_count(void);
SQLITE_API int sqlite3_keyword_name(int,const char**,int*);
SQLITE_API int sqlite3_keyword_check(const char*,int);
/*
** CAPI3REF: Dynamic String Object
** KEYWORDS: {dynamic string}
**
** An instance of the sqlite3_str object contains a dynamically-sized
** string under construction.
**
** The lifecycle of an sqlite3_str object is as follows:
** <ol>
** <li> ^The sqlite3_str object is created using [sqlite3_str_new()].
** <li> ^Text is appended to the sqlite3_str object using various
** methods, such as [sqlite3_str_appendf()].
** <li> ^The sqlite3_str object is destroyed and the string it created
** is returned using the [sqlite3_str_finish()] interface.
** </ol>
*/
typedef struct sqlite3_str sqlite3_str;
/*
** CAPI3REF: Create A New Dynamic String Object
** CONSTRUCTOR: sqlite3_str
**
** ^The [sqlite3_str_new(D)] interface allocates and initializes
** a new [sqlite3_str] object. To avoid memory leaks, the object returned by
** [sqlite3_str_new()] must be freed by a subsequent call to
** [sqlite3_str_finish(X)].
**
** ^The [sqlite3_str_new(D)] interface always returns a pointer to a
** valid [sqlite3_str] object, though in the event of an out-of-memory
** error the returned object might be a special singleton that will
** silently reject new text, always return SQLITE_NOMEM from
** [sqlite3_str_errcode()], always return 0 for
** [sqlite3_str_length()], and always return NULL from
** [sqlite3_str_finish(X)]. It is always safe to use the value
** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter
** to any of the other [sqlite3_str] methods.
**
** The D parameter to [sqlite3_str_new(D)] may be NULL. If the
** D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum
** length of the string contained in the [sqlite3_str] object will be
** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead
** of [SQLITE_MAX_LENGTH].
*/
SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*);
/*
** CAPI3REF: Finalize A Dynamic String
** DESTRUCTOR: sqlite3_str
**
** ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X
** and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()]
** that contains the constructed string. The calling application should
** pass the returned value to [sqlite3_free()] to avoid a memory leak.
** ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any
** errors were encountered during construction of the string. ^The
** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the
** string in [sqlite3_str] object X is zero bytes long.
*/
SQLITE_API char *sqlite3_str_finish(sqlite3_str*);
/*
** CAPI3REF: Add Content To A Dynamic String
** METHOD: sqlite3_str
**
** These interfaces add content to an sqlite3_str object previously obtained
** from [sqlite3_str_new()].
**
** ^The [sqlite3_str_appendf(X,F,...)] and
** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf]
** functionality of SQLite to append formatted text onto the end of
** [sqlite3_str] object X.
**
** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S
** onto the end of the [sqlite3_str] object X. N must be non-negative.
** S must contain at least N non-zero bytes of content. To append a
** zero-terminated string in its entirety, use the [sqlite3_str_appendall()]
** method instead.
**
** ^The [sqlite3_str_appendall(X,S)] method appends the complete content of
** zero-terminated string S onto the end of [sqlite3_str] object X.
**
** ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the
** single-byte character C onto the end of [sqlite3_str] object X.
** ^This method can be used, for example, to add whitespace indentation.
**
** ^The [sqlite3_str_reset(X)] method resets the string under construction
** inside [sqlite3_str] object X back to zero bytes in length.
**
** These methods do not return a result code. ^If an error occurs, that fact
** is recorded in the [sqlite3_str] object and can be recovered by a
** subsequent call to [sqlite3_str_errcode(X)].
*/
SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...);
SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list);
SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N);
SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn);
SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C);
SQLITE_API void sqlite3_str_reset(sqlite3_str*);
/*
** CAPI3REF: Status Of A Dynamic String
** METHOD: sqlite3_str
**
** These interfaces return the current status of an [sqlite3_str] object.
**
** ^If any prior errors have occurred while constructing the dynamic string
** in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return
** an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns
** [SQLITE_NOMEM] following any out-of-memory error, or
** [SQLITE_TOOBIG] if the size of the dynamic string exceeds
** [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors.
**
** ^The [sqlite3_str_length(X)] method returns the current length, in bytes,
** of the dynamic string under construction in [sqlite3_str] object X.
** ^The length returned by [sqlite3_str_length(X)] does not include the
** zero-termination byte.
**
** ^The [sqlite3_str_value(X)] method returns a pointer to the current
** content of the dynamic string under construction in X. The value
** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X
** and might be freed or altered by any subsequent method on the same
** [sqlite3_str] object. Applications must not used the pointer returned
** [sqlite3_str_value(X)] after any subsequent method call on the same
** object. ^Applications may change the content of the string returned
** by [sqlite3_str_value(X)] as long as they do not write into any bytes
** outside the range of 0 to [sqlite3_str_length(X)] and do not read or
** write any byte after any subsequent sqlite3_str method call.
*/
SQLITE_API int sqlite3_str_errcode(sqlite3_str*);
SQLITE_API int sqlite3_str_length(sqlite3_str*);
SQLITE_API char *sqlite3_str_value(sqlite3_str*);
/*
** CAPI3REF: SQLite Runtime Status
**
@@ -8282,11 +8539,11 @@ SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
** method of a [virtual table], then it returns true if and only if the
** column is being fetched as part of an UPDATE operation during which the
** column value will not change. Applications might use this to substitute
** a lighter-weight value to return that the corresponding [xUpdate] method
** understands as a "no-change" value.
** a return value that is less expensive to compute and that the corresponding
** [xUpdate] method understands as a "no-change" value.
**
** If the [xColumn] method calls sqlite3_vtab_nochange() and finds that
** the column is not changed by the UPDATE statement, they the xColumn
** the column is not changed by the UPDATE statement, then the xColumn
** method can optionally return without setting a result, without calling
** any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces].
** In that case, [sqlite3_value_nochange(X)] will return true for the
@@ -8781,7 +9038,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
** been a prior call to [sqlite3_deserialize(D,S,...)] with the same
** values of D and S.
** The size of the database is written into *P even if the
** SQLITE_SERIALIZE_NOCOPY bit is set but no contigious copy
** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy
** of the database exists.
**
** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the

View File

@@ -2,12 +2,13 @@
if(NOT TOKEN_AUTH_ONLY)
endif()
set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
find_package(Qt5 5.6 COMPONENTS Core Network Xml Concurrent REQUIRED)
if (Qt5Core_VERSION VERSION_LESS 5.9.0)
message(STATUS "For HTTP/2 support, compile with Qt 5.9 or higher.")
endif()
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
message(STATUS "Using Qt ${Qt5Core_VERSION} (${QT_QMAKE_EXECUTABLE})")
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5Keychain REQUIRED)

View File

@@ -16,13 +16,11 @@ if(UNIX AND NOT APPLE)
endif()
if(NOT BUILD_LIBRARIES_ONLY)
add_executable(${cmd_NAME} ${cmd_SRC})
set_target_properties(${cmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
set_target_properties(${cmd_NAME} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
add_executable(${cmd_NAME} ${cmd_SRC})
set_target_properties(${cmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
target_link_libraries(${cmd_NAME} ocsync ${synclib_NAME} Qt5::Core Qt5::Network)
target_link_libraries(${cmd_NAME} "${csync_NAME}" "${synclib_NAME}" Qt5::Core Qt5::Network)
# Need tokenizer for netrc parser
target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer)

View File

@@ -272,10 +272,12 @@ bool FileSystem::openAndSeekFileSharedRead(QFile *file, QString *errorOrNull, qi
int fd = _open_osfhandle((intptr_t)fileHandle, _O_RDONLY);
if (fd == -1) {
error = "could not make fd from handle";
CloseHandle(fileHandle);
return false;
}
if (!file->open(fd, QIODevice::ReadOnly, QFile::AutoCloseHandle)) {
error = file->errorString();
_close(fd); // implicitly closes fileHandle
return false;
}

View File

@@ -27,7 +27,7 @@ static const char letters[] = " WDNVCKRSMm";
template <typename Char>
void RemotePermissions::fromArray(const Char *p)
{
_value = p ? notNullMask : 0;
_value = notNullMask;
if (!p)
return;
while (*p) {
@@ -37,17 +37,7 @@ void RemotePermissions::fromArray(const Char *p)
}
}
RemotePermissions::RemotePermissions(const char *p)
{
fromArray(p);
}
RemotePermissions::RemotePermissions(const QString &s)
{
fromArray(s.isEmpty() ? nullptr : s.utf16());
}
QByteArray RemotePermissions::toString() const
QByteArray RemotePermissions::toDbValue() const
{
QByteArray result;
if (isNull())
@@ -64,4 +54,25 @@ QByteArray RemotePermissions::toString() const
return result;
}
QByteArray RemotePermissions::toString() const
{
return toDbValue();
}
RemotePermissions RemotePermissions::fromDbValue(const QByteArray &value)
{
if (value.isEmpty())
return RemotePermissions();
RemotePermissions perm;
perm.fromArray(value.constData());
return perm;
}
RemotePermissions RemotePermissions::fromServerString(const QString &value)
{
RemotePermissions perm;
perm.fromArray(value.utf16());
return perm;
}
} // namespace OCC

View File

@@ -57,11 +57,22 @@ public:
// (by setting forceRemoteDiscovery in SyncJournalDb::checkConnect)
PermissionsCount = IsMountedSub
};
RemotePermissions() = default;
explicit RemotePermissions(const char *);
explicit RemotePermissions(const QString &);
/// null permissions
RemotePermissions() = default;
/// array with one character per permission, "" is null, " " is non-null but empty
QByteArray toDbValue() const;
/// output for display purposes, no defined format (same as toDbValue in practice)
QByteArray toString() const;
/// read value that was written with toDbValue()
static RemotePermissions fromDbValue(const QByteArray &);
/// read a permissions string received from the server, never null
static RemotePermissions fromServerString(const QString &);
bool hasPermission(Permissions p) const
{
return _value & (1 << static_cast<int>(p));

View File

@@ -58,7 +58,7 @@ static void fillFileRecordFromGetQuery(SyncJournalFileRecord &rec, SqlQuery &que
rec._type = static_cast<ItemType>(query.intValue(3));
rec._etag = query.baValue(4);
rec._fileId = query.baValue(5);
rec._remotePerm = RemotePermissions(query.baValue(6).constData());
rec._remotePerm = RemotePermissions::fromDbValue(query.baValue(6));
rec._fileSize = query.int64Value(7);
rec._serverHasIgnoredFiles = (query.intValue(8) > 0);
rec._checksumHeader = query.baValue(9);
@@ -717,6 +717,15 @@ bool SyncJournalDb::updateMetadataTableStructure()
commitInternal("update database structure: add contentChecksum col for uploadinfo");
}
if (!tableColumns("conflicts").contains("basePath")) {
SqlQuery query(_db);
query.prepare("ALTER TABLE conflicts ADD COLUMN basePath TEXT;");
if (!query.exec()) {
sqlFail("updateMetadataTableStructure: add basePath column", query);
re = false;
}
}
return re;
}
@@ -1895,13 +1904,14 @@ void SyncJournalDb::setConflictRecord(const ConflictRecord &record)
auto &query = _setConflictRecordQuery;
ASSERT(query.initOrReset(QByteArrayLiteral(
"INSERT OR REPLACE INTO conflicts "
"(path, baseFileId, baseModtime, baseEtag) "
"VALUES (?1, ?2, ?3, ?4);"),
"(path, baseFileId, baseModtime, baseEtag, basePath) "
"VALUES (?1, ?2, ?3, ?4, ?5);"),
_db));
query.bindValue(1, record.path);
query.bindValue(2, record.baseFileId);
query.bindValue(3, record.baseModtime);
query.bindValue(4, record.baseEtag);
query.bindValue(5, record.initialBasePath);
ASSERT(query.exec());
}
@@ -1913,7 +1923,7 @@ ConflictRecord SyncJournalDb::conflictRecord(const QByteArray &path)
if (!checkConnect())
return entry;
auto &query = _getConflictRecordQuery;
ASSERT(query.initOrReset(QByteArrayLiteral("SELECT baseFileId, baseModtime, baseEtag FROM conflicts WHERE path=?1;"), _db));
ASSERT(query.initOrReset(QByteArrayLiteral("SELECT baseFileId, baseModtime, baseEtag, basePath FROM conflicts WHERE path=?1;"), _db));
query.bindValue(1, path);
ASSERT(query.exec());
if (!query.next())
@@ -1923,6 +1933,7 @@ ConflictRecord SyncJournalDb::conflictRecord(const QByteArray &path)
entry.baseFileId = query.baValue(0);
entry.baseModtime = query.int64Value(1);
entry.baseEtag = query.baValue(2);
entry.initialBasePath = query.baValue(3);
return entry;
}

View File

@@ -108,7 +108,7 @@ public:
}
int _chunk;
int _transferid;
quint64 _size; //currently unused
qint64 _size;
qint64 _modtime;
int _errorCount;
bool _valid;

View File

@@ -29,9 +29,20 @@ SyncJournalFileRecord::SyncJournalFileRecord()
{
}
QByteArray SyncJournalFileRecord::numericFileId() const
QByteArray SyncJournalFileRecord::legacyDeriveNumericFileId() const
{
// Use the id up until the first non-numeric character
// The id property which is stored in _fileId is
// leftpad_with_zero(fileid, 8) + instanceid
// so if it starts with a 0 we know the first 8 bytes
// can be taken.
if (_fileId.startsWith('0')) {
return _fileId.left(8);
}
// Otherwise we don't know exactly how long it is,
// use every digit until the first letter. The instanceid of
// oc >= 6 starts with "oc". This will break for older instances
// that have a digit as the first character of the instance id.
for (int i = 0; i < _fileId.size(); ++i) {
if (_fileId[i] < '0' || _fileId[i] > '9') {
return _fileId.left(i);

View File

@@ -45,13 +45,18 @@ public:
return !_path.isEmpty();
}
/** Returns the numeric part of the full id in _fileId.
/** Returns a guess for the numeric part of the full id in _fileId.
*
* On the server this is sometimes known as the internal file id.
* On the server this is sometimes known as the internal file id, the "fileid" DAV property.
*
* It is used in the construction of private links.
* It is used in the fallback construction of private links.
*
* New code should not use this function: Request the fileid property from the server.
* In the future we might store the fileid instead of the id, but the migration is complex
* if we don't want to store both.
*/
QByteArray numericFileId() const;
QByteArray legacyDeriveNumericFileId() const;
QDateTime modDateTime() const { return Utility::qDateTimeFromTime_t(_modtime); }
QByteArray _path;
@@ -146,6 +151,17 @@ public:
*/
QByteArray baseEtag;
/**
* The path of the original file at the time the conflict was created
*
* Note that in nearly all cases one should query the db by baseFileId and
* thus retrieve the *current* base path instead!
*
* maybe be empty if not available
*/
QByteArray initialBasePath;
bool isValid() const { return !path.isEmpty(); }
};
}

View File

@@ -45,7 +45,6 @@ if(NOT BUILD_LIBRARIES_ONLY)
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON)
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTORCC ON)
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
target_link_libraries(${CRASHREPORTER_EXECUTABLE}
crashreporter-gui
Qt5::Core Qt5::Widgets

View File

@@ -69,36 +69,35 @@ endif()
configure_file(csync_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/csync_version.h)
set(CSYNC_LIBRARY ocsync)
add_library(${CSYNC_LIBRARY} SHARED ${common_SOURCES} ${csync_SRCS})
add_library("${csync_NAME}" SHARED ${common_SOURCES} ${csync_SRCS})
target_include_directories(
${CSYNC_LIBRARY}
"${csync_NAME}"
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/std
)
find_package(SQLite3 3.8.0 REQUIRED)
if (USE_OUR_OWN_SQLITE3)
# make sure that the path for the local sqlite3 is before the system one
target_include_directories(${CSYNC_LIBRARY} BEFORE PRIVATE ${SQLITE3_INCLUDE_DIR})
target_include_directories("${csync_NAME}" BEFORE PRIVATE ${SQLITE3_INCLUDE_DIR})
else()
target_include_directories(${CSYNC_LIBRARY} PRIVATE ${SQLITE3_INCLUDE_DIR})
target_include_directories("${csync_NAME}" PRIVATE ${SQLITE3_INCLUDE_DIR})
endif()
generate_export_header(${CSYNC_LIBRARY}
generate_export_header("${csync_NAME}"
EXPORT_MACRO_NAME OCSYNC_EXPORT
EXPORT_FILE_NAME ocsynclib.h
)
target_link_libraries(${CSYNC_LIBRARY}
target_link_libraries("${csync_NAME}"
${CSYNC_REQUIRED_LIBRARIES}
${SQLITE3_LIBRARIES}
Qt5::Core Qt5::Concurrent
)
if(ZLIB_FOUND)
target_link_libraries(${CSYNC_LIBRARY} ZLIB::ZLIB)
target_link_libraries("${csync_NAME}" ZLIB::ZLIB)
endif(ZLIB_FOUND)
@@ -106,11 +105,11 @@ endif(ZLIB_FOUND)
if (APPLE)
find_library(FOUNDATION_LIBRARY NAMES Foundation)
find_library(CORESERVICES_LIBRARY NAMES CoreServices)
target_link_libraries(${CSYNC_LIBRARY} ${FOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY})
target_link_libraries("${csync_NAME}" ${FOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY})
endif()
set_target_properties(
${CSYNC_LIBRARY}
"${csync_NAME}"
PROPERTIES
VERSION
${LIBRARY_VERSION}
@@ -122,7 +121,7 @@ set_target_properties(
if(BUILD_OWNCLOUD_OSX_BUNDLE)
INSTALL(
TARGETS
${CSYNC_LIBRARY}
"${csync_NAME}"
LIBRARY DESTINATION
${LIB_INSTALL_DIR}
ARCHIVE DESTINATION
@@ -133,13 +132,13 @@ if(BUILD_OWNCLOUD_OSX_BUNDLE)
else()
INSTALL(
TARGETS
${CSYNC_LIBRARY}
"${csync_NAME}"
LIBRARY DESTINATION
${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE}
${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION
${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE}
${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION
${CMAKE_INSTALL_BINDIR}/${APPLICATION_EXECUTABLE}
${CMAKE_INSTALL_BINDIR}
)
endif()

View File

@@ -244,7 +244,7 @@ int csync_s::reinitialize() {
renames.folder_renamed_to.clear();
status = CSYNC_STATUS_INIT;
SAFE_FREE(error_string);
error_string.clear();
rc = 0;
return rc;
@@ -252,7 +252,6 @@ int csync_s::reinitialize() {
csync_s::~csync_s() {
SAFE_FREE(local.uri);
SAFE_FREE(error_string);
}
void *csync_get_userdata(CSYNC *ctx) {
@@ -298,11 +297,6 @@ CSYNC_STATUS csync_get_status(CSYNC *ctx) {
return ctx->status_code;
}
const char *csync_get_status_string(CSYNC *ctx)
{
return csync_vio_get_status_string(ctx);
}
void csync_request_abort(CSYNC *ctx)
{
if (ctx != NULL) {

View File

@@ -307,15 +307,6 @@ int OCSYNC_EXPORT csync_walk_local_tree(CSYNC *ctx, const csync_treewalk_visit_f
*/
int OCSYNC_EXPORT csync_walk_remote_tree(CSYNC *ctx, const csync_treewalk_visit_func &visitor);
/**
* @brief Get the csync status string.
*
* @param ctx The csync context.
*
* @return A const pointer to a string with more precise status info.
*/
const char OCSYNC_EXPORT *csync_get_status_string(CSYNC *ctx);
/**
* @brief Aborts the current sync run as soon as possible. Can be called from another thread.
*

View File

@@ -180,7 +180,10 @@ struct OCSYNC_EXPORT csync_s {
/* csync error code */
enum csync_status_codes_e status_code = CSYNC_STATUS_OK;
char *error_string = nullptr;
/* Some additional string information which is added to the error message corresponding to the error code in errno.
* Usually a filename
*/
QString error_string;
int status = CSYNC_STATUS_INIT;
volatile bool abort = false;

View File

@@ -210,7 +210,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
/* First, check that the file is NOT in our tree (another file with the same name was added) */
if (our_tree->findFile(basePath)) {
other = nullptr;
qCDebug(lcReconcile, "Origin found in our tree : %s", basePath.constData());
qCInfo(lcReconcile, "Origin found in our tree : %s", basePath.constData());
} else {
/* Find the potential rename source file in the other tree.
* If the renamed file could not be found in the opposite tree, that is because it
@@ -218,7 +218,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
* The journal is cleaned up later after propagation.
*/
other = other_tree->findFile(basePath);
qCDebug(lcReconcile, "Rename origin in other tree (%s) %s",
qCInfo(lcReconcile, "Rename origin in other tree (%s) %s",
basePath.constData(), other ? "found" : "not found");
}
@@ -229,7 +229,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
// Some other EVAL_RENAME already claimed other.
// We do nothing: maybe a different candidate for
// other is found as well?
qCDebug(lcReconcile, "Other has already been renamed to %s",
qCInfo(lcReconcile, "Other has already been renamed to %s",
other->rename_path.constData());
} else if (cur->type == ItemTypeDirectory
// The local replica is reconciled first, so the remote tree would
@@ -241,13 +241,17 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
|| other->instruction == CSYNC_INSTRUCTION_NONE
|| other->instruction == CSYNC_INSTRUCTION_UPDATE_METADATA
|| other->instruction == CSYNC_INSTRUCTION_REMOVE) {
qCDebug(lcReconcile, "Switching %s to RENAME to %s",
qCInfo(lcReconcile, "Switching %s to RENAME to %s",
other->path.constData(), cur->path.constData());
other->instruction = CSYNC_INSTRUCTION_RENAME;
other->rename_path = cur->path;
if( !cur->file_id.isEmpty() ) {
other->file_id = cur->file_id;
}
if (ctx->current == LOCAL_REPLICA) {
// Keep the local mtime.
other->modtime = cur->modtime;
}
other->inode = cur->inode;
cur->instruction = CSYNC_INSTRUCTION_NONE;
// We have consumed 'other': exit this loop to not consume another one.
@@ -261,7 +265,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
// Local: The remote reconcile will be able to deal with this.
// Remote: The local replica has already dealt with this.
// See the EVAL_RENAME case when other was found directly.
qCDebug(lcReconcile, "File in a renamed directory, other side's instruction: %d",
qCInfo(lcReconcile, "File in a renamed directory, other side's instruction: %d",
other->instruction);
cur->instruction = CSYNC_INSTRUCTION_NONE;
} else {
@@ -269,7 +273,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
// and the instruction in the local tree is NEW while cur has EVAL_RENAME
// due to a remote move of the same file. In these scenarios we just
// want the instruction to stay NEW.
qCDebug(lcReconcile, "Other already has instruction %d",
qCInfo(lcReconcile, "Other already has instruction %d",
other->instruction);
}
};
@@ -277,7 +281,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
if (ctx->current == LOCAL_REPLICA) {
/* use the old name to find the "other" node */
OCC::SyncJournalFileRecord base;
qCDebug(lcReconcile, "Finding rename origin through inode %" PRIu64 "",
qCInfo(lcReconcile, "Finding rename origin through inode %" PRIu64 "",
cur->inode);
ctx->statedb->getFileRecordByInode(cur->inode, &base);
renameCandidateProcessing(base._path);
@@ -290,7 +294,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
// line.
auto basePath = csync_rename_adjust_full_path_source(ctx, cur->path);
if (basePath != cur->path) {
qCDebug(lcReconcile, "Trying rename origin by csync_rename mapping %s",
qCInfo(lcReconcile, "Trying rename origin by csync_rename mapping %s",
basePath.constData());
// We go through getFileRecordsByFileId to ensure the basePath
// computed in this way also has the expected fileid.
@@ -303,7 +307,7 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
// Also feed all the other files with the same fileid if necessary
if (!processedRename) {
qCDebug(lcReconcile, "Finding rename origin through file ID %s",
qCInfo(lcReconcile, "Finding rename origin through file ID %s",
cur->file_id.constData());
ctx->statedb->getFileRecordsByFileId(cur->file_id,
[&](const OCC::SyncJournalFileRecord &base) { renameCandidateProcessing(base._path); });
@@ -370,7 +374,8 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
auto remoteNode = ctx->current == REMOTE_REPLICA ? cur : other;
auto localNode = ctx->current == REMOTE_REPLICA ? other : cur;
remoteNode->instruction = CSYNC_INSTRUCTION_NONE;
localNode->instruction = up._modtime == localNode->modtime ? CSYNC_INSTRUCTION_UPDATE_METADATA : CSYNC_INSTRUCTION_SYNC;
localNode->instruction = up._modtime == localNode->modtime && up._size == localNode->size ?
CSYNC_INSTRUCTION_UPDATE_METADATA : CSYNC_INSTRUCTION_SYNC;
// Update the etag and other server metadata in the journal already
// (We can't use a typical CSYNC_INSTRUCTION_UPDATE_METADATA because
@@ -460,6 +465,16 @@ static void _csync_merge_algorithm_visitor(csync_file_stat_t *cur, CSYNC * ctx)
}
}
// We *never* propagate a local NEW virtual file to the server
// This can happen if we had EVAL_RENAME but something else happened on the remote
// and the rename doesn't go through.
if ((cur->type == ItemTypeVirtualFile || cur->type == ItemTypeVirtualFileDownload)
&& ctx->current == LOCAL_REPLICA
&& cur->instruction == CSYNC_INSTRUCTION_NEW) {
qCInfo(lcReconcile) << "Downgrading NEW to IGNORE for local virtual file" << cur->path;
cur->instruction = CSYNC_INSTRUCTION_IGNORE;
}
//hide instruction NONE messages when log level is set to debug,
//only show these messages on log level trace
const char *repo = ctx->current == REMOTE_REPLICA ? "server" : "client";

View File

@@ -126,12 +126,12 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
* This code should probably be in csync_exclude, but it does not have the fs parameter.
* Keep it here for now */
if (ctx->ignore_hidden_files && (fs->is_hidden)) {
qCDebug(lcUpdate, "file excluded because it is a hidden file: %s", fs->path.constData());
qCInfo(lcUpdate, "file excluded because it is a hidden file: %s", fs->path.constData());
excluded = CSYNC_FILE_EXCLUDE_HIDDEN;
}
} else {
/* File is ignored because it's matched by a user- or system exclude pattern. */
qCDebug(lcUpdate, "%s excluded (%d)", fs->path.constData(), excluded);
qCInfo(lcUpdate, "%s excluded (%d)", fs->path.constData(), excluded);
if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE) {
return 1;
}
@@ -156,7 +156,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
*/
QTextEncoder encoder(localCodec, QTextCodec::ConvertInvalidToNull);
if (encoder.fromUnicode(QString::fromUtf8(fs->path)).contains('\0')) {
qCDebug(lcUpdate, "cannot encode %s to local encoding %d",
qCInfo(lcUpdate, "cannot encode %s to local encoding %d",
fs->path.constData(), localCodec->mibEnum());
excluded = CSYNC_FILE_EXCLUDE_CANNOT_ENCODE;
}
@@ -164,7 +164,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
if (fs->type == ItemTypeFile ) {
if (fs->modtime == 0) {
qCDebug(lcUpdate, "file: %s - mtime is zero!", fs->path.constData());
qCInfo(lcUpdate, "file: %s - mtime is zero!", fs->path.constData());
}
}
@@ -269,7 +269,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
checksumIdentical = fs->checksumHeader == base._checksumHeader;
}
if (checksumIdentical) {
qCDebug(lcUpdate, "NOTE: Checksums are identical, file did not actually change: %s", fs->path.constData());
qCInfo(lcUpdate, "NOTE: Checksums are identical, file did not actually change: %s", fs->path.constData());
fs->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
goto out;
}
@@ -293,7 +293,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
* The metadata comparison ensure that we fetch all the file id or permission when
* upgrading owncloud
*/
qCDebug(lcUpdate, "Reading from database: %s", fs->path.constData());
qCInfo(lcUpdate, "Reading from database: %s", fs->path.constData());
ctx->remote.read_from_db = true;
}
/* If it was remembered in the db that the remote dir has ignored files, store
@@ -304,7 +304,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
}
if (metadata_differ) {
/* file id or permissions has changed. Which means we need to update them in the DB. */
qCDebug(lcUpdate, "Need to update metadata for: %s", fs->path.constData());
qCInfo(lcUpdate, "Need to update metadata for: %s", fs->path.constData());
fs->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
} else {
fs->instruction = CSYNC_INSTRUCTION_NONE;
@@ -312,7 +312,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
} else {
/* check if it's a file and has been renamed */
if (ctx->current == LOCAL_REPLICA) {
qCDebug(lcUpdate, "Checking for rename based on inode # %" PRId64 "", (uint64_t) fs->inode);
qCInfo(lcUpdate, "Checking for rename based on inode # %" PRId64 "", (uint64_t) fs->inode);
OCC::SyncJournalFileRecord base;
if(!ctx->statedb->getFileRecordByInode(fs->inode, &base)) {
@@ -324,10 +324,15 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
fs->instruction = CSYNC_INSTRUCTION_NEW;
bool isRename =
base.isValid() && base._type == fs->type
&& ((base._modtime == fs->modtime && base._fileSize == fs->size) || fs->type == ItemTypeDirectory)
base.isValid()
&& (base._type == fs->type
// The file could be scheduled for download and renamed
|| (base._type == ItemTypeVirtualFileDownload && fs->type == ItemTypeVirtualFile))
&& ((base._modtime == fs->modtime && base._fileSize == fs->size)
// Directories and virtual files don't need size/mtime equality
|| fs->type == ItemTypeDirectory || fs->type == ItemTypeVirtualFile)
#ifdef NO_RENAME_EXTENSION
&& _csync_sameextension(base._path, fs->path)
&& _csync_sameextension(base._path, fs->path)
#endif
;
@@ -339,22 +344,69 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
_rel_to_abs(ctx, fs->path), base._checksumHeader,
ctx->callbacks.checksum_userdata);
if (!fs->checksumHeader.isEmpty()) {
qCDebug(lcUpdate, "checking checksum of potential rename %s %s <-> %s", fs->path.constData(), fs->checksumHeader.constData(), base._checksumHeader.constData());
qCInfo(lcUpdate, "checking checksum of potential rename %s %s <-> %s", fs->path.constData(), fs->checksumHeader.constData(), base._checksumHeader.constData());
isRename = fs->checksumHeader == base._checksumHeader;
}
}
if (isRename) {
qCDebug(lcUpdate, "pot rename detected based on inode # %" PRId64 "", (uint64_t) fs->inode);
qCInfo(lcUpdate, "pot rename detected based on inode # %" PRId64 "", (uint64_t) fs->inode);
/* inode found so the file has been renamed */
fs->instruction = CSYNC_INSTRUCTION_EVAL_RENAME;
if (fs->type == ItemTypeDirectory) {
csync_rename_record(ctx, base._path, fs->path);
}
goto out;
}
if (fs->type == ItemTypeVirtualFile) {
// It's allowed to rename "abc" -> "abc.owncloud": In that case the file
// becomes a placeholder by being drained of contents.
if (base.isValid()
&& base._type == ItemTypeFile
&& fs->size == base._fileSize
&& fs->modtime == base._modtime
&& fs->path.left(fs->path.size() - ctx->virtual_file_suffix.size()) == base._path) {
qCInfo(lcUpdate) << "Base file was renamed to virtual file:" << fs->path;
// Wipe the base db entry to make sure the base file isn't removed
// from the server later!
// WARNING: Side effect on database during update phase:
// Makes local/remote discovery order dependent!
ctx->statedb->deleteFileRecord(base._path);
// Wipe the placeholder file such that the remote discovery will
// note it must be recreated with the right size and flags.
QFile::remove(QString::fromUtf8(ctx->local.uri) + "/" + fs->path);
// Also set up the expected db entry
// WARNING: Side effect on database during update phase again
base._path = fs->path;
base._type = ItemTypeVirtualFile;
ctx->statedb->setFileRecord(base);
return 0; // Don't add as entry into local files
}
// Remove the spurious file if it looks like a placeholder file
// (we know placeholder files contain " ")
if (fs->size <= 1) {
QFile::remove(QString::fromUtf8(ctx->local.uri) + "/" + fs->path);
qCWarning(lcUpdate) << "Wiping virtual file without db entry for" << fs->path;
return 0; // Don't add as entry into local files
} else {
fs->instruction = CSYNC_INSTRUCTION_IGNORE;
qCWarning(lcUpdate) << "Virtual file without db entry for" << fs->path
<< "but looks odd, keeping";
}
}
goto out;
} else {
qCInfo(lcUpdate, "Checking for rename based on fileid %s", fs->file_id.constData());
/* Remote Replica Rename check */
fs->instruction = CSYNC_INSTRUCTION_NEW;
@@ -408,7 +460,7 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
csync_rename_record(ctx, base._path, fs->path);
}
qCDebug(lcUpdate, "remote rename detected based on fileid %s --> %s", base._path.constData(), fs->path.constData());
qCInfo(lcUpdate, "remote rename detected based on fileid %s --> %s", base._path.constData(), fs->path.constData());
fs->instruction = CSYNC_INSTRUCTION_EVAL_RENAME;
done = true;
};
@@ -510,13 +562,22 @@ int csync_walker(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> fs) {
}
switch (fs->type) {
case ItemTypeFile:
case ItemTypeFile:
if (ctx->current == REMOTE_REPLICA) {
qCDebug(lcUpdate, "file: %s [file_id=%s size=%" PRIu64 "]", fs->path.constData(), fs->file_id.constData(), fs->size);
} else {
qCDebug(lcUpdate, "file: %s [inode=%" PRIu64 " size=%" PRIu64 "]", fs->path.constData(), fs->inode, fs->size);
}
break;
case ItemTypeVirtualFile:
// This can happen when locally a virtual file is seen that doen't have
// a matching database entry.
if (ctx->current == REMOTE_REPLICA) {
qCDebug(lcUpdate, "virtual file: %s [file_id=%s size=%" PRIu64 "]", fs->path.constData(), fs->file_id.constData(), fs->size);
} else {
qCDebug(lcUpdate, "virtual file: %s [inode=%" PRIu64 " size=%" PRIu64 "]", fs->path.constData(), fs->inode, fs->size);
}
break;
case ItemTypeDirectory: /* enter directory */
if (ctx->current == REMOTE_REPLICA) {
qCDebug(lcUpdate, "directory: %s [file_id=%s]", fs->path.constData(), fs->file_id.constData());
@@ -525,11 +586,11 @@ int csync_walker(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> fs) {
}
break;
case ItemTypeSoftLink:
qCDebug(lcUpdate, "symlink: %s - not supported", fs->path.constData());
qCInfo(lcUpdate, "symlink: %s - not supported", fs->path.constData());
break;
default:
qCInfo(lcUpdate, "item: %s - item type %d not iterated", fs->path.constData(), fs->type);
return 0;
break;
}
rc = _csync_detect_update(ctx, std::move(fs));
@@ -552,7 +613,7 @@ static bool fill_tree_from_db(CSYNC *ctx, const char *uri, bool singleFile = fal
* their correct etags again and we don't run into this case.
*/
if (rec._etag == "_invalid_") {
qCDebug(lcUpdate, "%s selective sync excluded", rec._path.constData());
qCInfo(lcUpdate, "%s selective sync excluded", rec._path.constData());
skipbase = rec._path;
skipbase += '/';
return;
@@ -677,7 +738,6 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
ctx->status_code = CSYNC_STATUS_ABORTED;
goto error;
}
int asp = 0;
/* permission denied */
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_OPENDIR_ERROR);
if (errno == EACCES) {
@@ -686,8 +746,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
return 0;
}
} else if(errno == ENOENT) {
asp = asprintf( &ctx->error_string, "%s", uri);
ASSERT(asp >= 0);
ctx->error_string = QString::fromUtf8(uri);
}
// 403 Forbidden can be sent by the server if the file firewall is active.
// A file or directory should be ignored and sync must continue. See #3490
@@ -714,11 +773,25 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
goto error;
}
while ((dirent = csync_vio_readdir(ctx, dh))) {
while (true) {
// Get the next item in the directory
errno = 0;
dirent = csync_vio_readdir(ctx, dh);
if (!dirent) {
if (errno != 0) {
// Note: Windows vio converts any error into EACCES
qCWarning(lcUpdate, "readdir failed for file in %s - errno %d", uri, errno);
goto error;
}
// Normal case: End of items in directory
break;
}
/* Conversion error */
if (dirent->path.isEmpty() && !dirent->original_path.isEmpty()) {
ctx->status_code = CSYNC_STATUS_INVALID_CHARACTERS;
ctx->error_string = c_strdup(dirent->original_path);
ctx->error_string = QString::fromUtf8(dirent->original_path);
dirent->original_path.clear();
goto error;
}
@@ -748,12 +821,12 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
&& filename.endsWith(ctx->virtual_file_suffix)) {
QByteArray db_uri = fullpath.mid(strlen(ctx->local.uri) + 1);
if( ! fill_tree_from_db(ctx, db_uri.constData(), true) ) {
qCWarning(lcUpdate) << "Virtual file without db entry for" << filename;
QFile::remove(fullpath);
}
if (fill_tree_from_db(ctx, db_uri.constData(), true))
continue;
continue;
// We didn't find this file in the database: Let this proceed into
// rename detection as a virtual file.
dirent->type = ItemTypeVirtualFile;
}
/* if the filename starts with a . we consider it a hidden file
@@ -823,7 +896,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
}
csync_vio_closedir(ctx, dh);
qCDebug(lcUpdate, " <= Closing walk for %s with read_from_db %d", uri, read_from_db);
qCInfo(lcUpdate, " <= Closing walk for %s with read_from_db %d", uri, read_from_db);
return rc;

View File

@@ -90,9 +90,3 @@ std::unique_ptr<csync_file_stat_t> csync_vio_readdir(CSYNC *ctx, csync_vio_handl
return NULL;
}
char *csync_vio_get_status_string(CSYNC *ctx) {
if(ctx->error_string) {
return ctx->error_string;
}
return 0;
}

View File

@@ -35,8 +35,4 @@ typedef struct fhandle_s {
csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name);
int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle);
std::unique_ptr<csync_file_stat_t> csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle);
char *csync_vio_get_status_string(CSYNC *ctx);
#endif /* _CSYNC_VIO_H */

View File

@@ -156,6 +156,7 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *d
// might be error, check!
int dwError = GetLastError();
if (dwError != ERROR_NO_MORE_FILES) {
qCWarning(lcCSyncVIOLocal, "FindNextFile error %d", dwError);
errno = EACCES; // no more files is fine. Otherwise EACCESS
}
return nullptr;
@@ -181,7 +182,7 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *d
}
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE
|| handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE
|| handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) {
) {
file_stat->type = ItemTypeSkip;
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
file_stat->type = ItemTypeDirectory;

View File

@@ -137,9 +137,16 @@ IF( APPLE )
list(APPEND client_SRCS systray.mm)
if(SPARKLE_FOUND)
# Define this, we need to check in updater.cpp
add_definitions( -DHAVE_SPARKLE )
list(APPEND updater_SRCS updater/sparkleupdater_mac.mm updater/sparkleupdater.h)
# Define this, we need to check in updater.cpp
add_definitions(-DHAVE_SPARKLE)
list(APPEND updater_SRCS updater/sparkleupdater_mac.mm updater/sparkleupdater.h)
list(APPEND updater_DEPS ${SPARKLE_LIBRARY})
# Sparkle.framework is installed from here because macdeployqt's CopyFramework breaks on this bundle
# as its logic is tightly tailored around Qt5 frameworks
install(DIRECTORY "${SPARKLE_LIBRARY}"
DESTINATION "${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks" USE_SOURCE_PERMISSIONS)
endif()
ENDIF()
@@ -221,7 +228,7 @@ if(APPLE)
file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-sidebar*")
MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}")
endif()
ecm_add_app_icon(final_src ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASE "${APPLICATION_ICON_NAME}")
ecm_add_app_icon(final_src ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASENAME "${APPLICATION_ICON_NAME}")
if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
@@ -268,15 +275,12 @@ else()
endif()
add_library(updater STATIC ${updater_SRCS})
target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml)
target_link_libraries(updater ${synclib_NAME} ${updater_DEPS} Qt5::Widgets Qt5::Network Qt5::Xml)
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
)
# Only relevant for Linux? On OS X it by default properly checks in the bundle directory next to the exe
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Network Qt5::Xml)
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )

View File

@@ -96,7 +96,7 @@ protected:
auto pos = folderList->mapFromGlobal(QCursor::pos());
auto index = folderList->indexAt(pos);
if (model->classify(index) == FolderStatusModel::RootFolder
&& (FolderStatusDelegate::errorsListRect(folderList->visualRect(index)).contains(pos)
&& (FolderStatusDelegate::errorsListRect(folderList->visualRect(index), index).contains(pos)
|| FolderStatusDelegate::optionsButtonRect(folderList->visualRect(index),folderList->layoutDirection()).contains(pos))) {
shape = Qt::PointingHandCursor;
}
@@ -162,7 +162,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
QAction *syncNowWithRemoteDiscovery = new QAction(this);
syncNowWithRemoteDiscovery->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F6));
connect(syncNowWithRemoteDiscovery, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery);
connect(syncNowWithRemoteDiscovery, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolderForceFullDiscovery);
addAction(syncNowWithRemoteDiscovery);
@@ -287,6 +287,9 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
bool folderPaused = _model->data(index, FolderStatusDelegate::FolderSyncPaused).toBool();
bool folderConnected = _model->data(index, FolderStatusDelegate::FolderAccountConnected).toBool();
auto folderMan = FolderMan::instance();
QPointer<Folder> folder = folderMan->folder(alias);
if (!folder)
return;
QMenu *menu = new QMenu(tv);
@@ -295,7 +298,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
QAction *ac = menu->addAction(tr("Open folder"));
connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentFolder);
if (!ui->_folderList->isExpanded(index)) {
if (!ui->_folderList->isExpanded(index) && !folder->useVirtualFiles()) {
ac = menu->addAction(tr("Choose what to sync"));
ac->setEnabled(folderConnected);
connect(ac, &QAction::triggered, this, &AccountSettings::doExpand);
@@ -340,7 +343,7 @@ void AccountSettings::slotFolderListClicked(const QModelIndex &indx)
slotCustomContextMenuRequested(pos);
return;
}
if (FolderStatusDelegate::errorsListRect(tv->visualRect(indx)).contains(pos)) {
if (FolderStatusDelegate::errorsListRect(tv->visualRect(indx), indx).contains(pos)) {
emit showIssuesList(_model->data(indx, FolderStatusDelegate::FolderAliasRole).toString());
return;
}
@@ -359,6 +362,7 @@ void AccountSettings::slotAddFolder()
folderMan->setSyncEnabled(false); // do not start more syncs.
FolderWizard *folderWizard = new FolderWizard(_accountState->account(), this);
folderWizard->setAttribute(Qt::WA_DeleteOnClose);
connect(folderWizard, &QDialog::accepted, this, &AccountSettings::slotFolderWizardAccepted);
connect(folderWizard, &QDialog::rejected, this, &AccountSettings::slotFolderWizardRejected);
@@ -563,10 +567,12 @@ void AccountSettings::slotScheduleCurrentFolder()
}
}
void AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery()
void AccountSettings::slotScheduleCurrentFolderForceFullDiscovery()
{
FolderMan *folderMan = FolderMan::instance();
if (auto folder = folderMan->folder(selectedFolderAlias())) {
folder->slotWipeErrorBlacklist();
folder->slotNextSyncFullLocalDiscovery();
folder->journalDb()->forceRemoteDiscoveryNextSync();
folderMan->scheduleFolder(folder);
}
@@ -582,6 +588,8 @@ void AccountSettings::slotForceSyncCurrentFolder()
folderMan->scheduleFolder(current);
}
selectedFolder->slotWipeErrorBlacklist(); // issue #6757
// Insert the selected folder at the front of the queue
folderMan->scheduleFolderNext(selectedFolder);
}
@@ -651,7 +659,7 @@ void AccountSettings::slotAccountStateChanged()
if (state == AccountState::Connected) {
QStringList errors;
if (account->serverVersionUnsupported()) {
errors << tr("The server version %1 is old and unsupported! Proceed at your own risk.").arg(account->serverVersion());
errors << tr("The server version %1 is unsupported! Proceed at your own risk.").arg(account->serverVersion());
}
showConnectionLabel(tr("Connected to %1.").arg(serverWithUser), errors);
} else if (state == AccountState::ServiceUnavailable) {
@@ -695,9 +703,6 @@ void AccountSettings::slotAccountStateChanged()
if (ui->_folderList->isExpanded(_model->index(i)))
ui->_folderList->setExpanded(_model->index(i), false);
}
} else if (_model->isDirty()) {
// If we connect and have pending changes, show the list.
doExpand();
}
// Disabling expansion of folders might require hiding the selective
@@ -756,8 +761,6 @@ AccountSettings::~AccountSettings()
void AccountSettings::refreshSelectiveSyncStatus()
{
bool shouldBeVisible = _model->isDirty() && _accountState->isConnected();
QString msg;
int cnt = 0;
foreach (Folder *folder, FolderMan::instance()->map().values()) {
@@ -788,10 +791,20 @@ void AccountSettings::refreshSelectiveSyncStatus()
}
}
// Some selective sync ui (either normal editing or big folder) will show
// if this variable ends up true.
bool shouldBeVisible = false;
if (msg.isEmpty()) {
// Show the ui if the model is dirty only
shouldBeVisible = _model->isDirty() && _accountState->isConnected();
ui->selectiveSyncButtons->setVisible(true);
ui->bigFolderUi->setVisible(false);
} else {
// There's a reason the big folder ui should be shown
shouldBeVisible = _accountState->isConnected();
ConfigFile cfg;
QString info = !cfg.confirmExternalStorage()
? tr("There are folders that were not synchronized because they are too big: ")
@@ -802,7 +815,6 @@ void AccountSettings::refreshSelectiveSyncStatus()
ui->selectiveSyncNotification->setText(info + msg);
ui->selectiveSyncButtons->setVisible(false);
ui->bigFolderUi->setVisible(true);
shouldBeVisible = true;
}
ui->selectiveSyncApply->setEnabled(_model->isDirty() || !msg.isEmpty());
@@ -812,6 +824,7 @@ void AccountSettings::refreshSelectiveSyncStatus()
if (shouldBeVisible) {
ui->selectiveSyncStatus->setMaximumHeight(0);
ui->selectiveSyncStatus->setVisible(true);
doExpand();
}
auto anim = new QPropertyAnimation(ui->selectiveSyncStatus, "maximumHeight", ui->selectiveSyncStatus);
anim->setEndValue(shouldBeVisible ? hint.height() : 0);

View File

@@ -73,7 +73,7 @@ protected slots:
void slotAddFolder();
void slotEnableCurrentFolder();
void slotScheduleCurrentFolder();
void slotScheduleCurrentFolderForceRemoteDiscovery();
void slotScheduleCurrentFolderForceFullDiscovery();
void slotForceSyncCurrentFolder();
void slotRemoveCurrentFolder();
void slotOpenCurrentFolder(); // sync folder

View File

@@ -314,10 +314,10 @@ void AccountState::slotInvalidCredentials()
if (account()->credentials()->ready()) {
account()->credentials()->invalidateToken();
if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
if (creds->refreshAccessToken())
return;
}
}
if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
if (creds->refreshAccessToken())
return;
}
account()->credentials()->askFromUser();
}

View File

@@ -135,11 +135,6 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
const QString elidedAction = fm.elidedText(actionText, Qt::ElideRight, actionTextBox.width());
painter->drawText(actionTextBox, elidedAction);
int atPos = accountRole.indexOf(QLatin1Char('@'));
if (atPos > -1) {
accountRole.remove(0, atPos + 1);
}
QString timeStr;
if (accountOnline) {
timeStr = tr("%1 on %2").arg(timeText, accountRole);

View File

@@ -84,6 +84,11 @@ ActivityWidget::ActivityWidget(QWidget *parent)
connect(_model, &ActivityListModel::activityJobStatusCode,
this, &ActivityWidget::slotAccountActivityStatus);
connect(AccountManager::instance(), &AccountManager::accountRemoved, this, [this](AccountState *ast) {
if (_accountsWithoutActivities.remove(ast->account()->displayName()))
showLabels();
});
_copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
_copyBtn->setToolTip(tr("Copy the activity list to the clipboard."));
connect(_copyBtn, &QAbstractButton::clicked, this, &ActivityWidget::copyToClipboard);
@@ -290,11 +295,6 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
QString host = activity._accName;
// store the name of the account that sends the notification to be
// able to add it to the tray notification
// remove the user name from the account as that is not accurate here.
int indx = host.indexOf(QChar('@'));
if (indx > -1) {
host.remove(0, 1 + indx);
}
if (!host.isEmpty()) {
if (accNotified.contains(host)) {
accNotified[host] = accNotified[host] + 1;

View File

@@ -72,7 +72,7 @@ namespace {
" --logexpire <hours> : removes logs older than <hours> hours.\n"
" (to be used with --logdir)\n"
" --logflush : flush the log file after every write.\n"
" --logdebug : also output debug-level messages in the log (equivalent to setting the env var QT_LOGGING_RULES=\"qt.*=true;*.debug=true\").\n"
" --logdebug : also output debug-level messages in the log.\n"
" --confdir <dirname> : Use the given configuration folder.\n";
QString applicationTrPath()
@@ -186,7 +186,8 @@ Application::Application(int &argc, char **argv)
setAttribute(Qt::AA_UseHighDpiPixmaps, true);
auto confDir = ConfigFile().configPath();
if (!QFileInfo(confDir).exists()) {
if (confDir.endsWith('/')) confDir.chop(1); // macOS 10.11.x does not like trailing slash for rename/move.
if (!QFileInfo(confDir).isDir()) {
// Migrate from version <= 2.4
setApplicationName(_theme->appNameGUI());
#ifndef QT_WARNING_DISABLE_DEPRECATED // Was added in Qt 5.9
@@ -197,6 +198,7 @@ Application::Application(int &argc, char **argv)
// We need to use the deprecated QDesktopServices::storageLocation because of its Qt4
// behavior of adding "data" to the path
QString oldDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
if (oldDir.endsWith('/')) oldDir.chop(1); // macOS 10.11.x does not like trailing slash for rename/move.
QT_WARNING_POP
setApplicationName(_theme->appName());
if (QFileInfo(oldDir).isDir()) {
@@ -540,20 +542,12 @@ void Application::parseOptions(const QStringList &options)
// Helpers for displaying messages. Note that there is no console on Windows.
#ifdef Q_OS_WIN
// Format as <pre> HTML
static inline void toHtml(QString &t)
static void displayHelpText(const QString &t) // No console on Windows.
{
t.replace(QLatin1Char('&'), QLatin1String("&amp;"));
t.replace(QLatin1Char('<'), QLatin1String("&lt;"));
t.replace(QLatin1Char('>'), QLatin1String("&gt;"));
t.insert(0, QLatin1String("<html><pre>"));
t.append(QLatin1String("</pre></html>"));
}
static void displayHelpText(QString t) // No console on Windows.
{
toHtml(t);
QMessageBox::information(0, Theme::instance()->appNameGUI(), t);
QString spaces(80, ' '); // Add a line of non-wrapped space to make the messagebox wide enough.
QString text = QLatin1String("<qt><pre style='white-space:pre-wrap'>")
+ t.toHtmlEscaped() + QLatin1String("</pre><pre>") + spaces + QLatin1String("</pre></qt>");
QMessageBox::information(0, Theme::instance()->appNameGUI(), text);
}
#else

View File

@@ -22,6 +22,7 @@
#include <QJsonDocument>
#include "theme.h"
#include "networkjobs.h"
#include "creds/httpcredentials.h"
namespace OCC {
@@ -85,6 +86,8 @@ void OAuth::start()
QString basicAuth = QString("%1:%2").arg(
Theme::instance()->oauthClientId(), Theme::instance()->oauthClientSecret());
req.setRawHeader("Authorization", "Basic " + basicAuth.toUtf8().toBase64());
// We just added the Authorization header, don't let HttpCredentialsAccessManager tamper with it
req.setAttribute(HttpCredentials::DontAddCredentialsAttribute, true);
auto requestBody = new QBuffer;
QUrlQuery arguments(QString(
@@ -150,7 +153,6 @@ void OAuth::start()
});
}
});
QTimer::singleShot(5 * 60 * 1000, this, [this] { result(Error); });
}
QUrl OAuth::authorisationLink() const

View File

@@ -297,6 +297,9 @@ public slots:
*/
void downloadVirtualFile(const QString &relativepath);
/** Ensures that the next sync performs a full local discovery. */
void slotNextSyncFullLocalDiscovery();
private slots:
void slotSyncStarted();
void slotSyncFinished(bool);
@@ -325,9 +328,6 @@ private slots:
*/
void slotScheduleThisFolder();
/** Ensures that the next sync performs a full local discovery. */
void slotNextSyncFullLocalDiscovery();
/** Adjust sync result based on conflict data from IssuesWidget.
*
* This is pretty awkward, but IssuesWidget just keeps better track

View File

@@ -1306,25 +1306,45 @@ QString FolderMan::trayTooltipStatusString(
return folderMessage;
}
QString FolderMan::checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl, bool forNewDirectory) const
static QString checkPathValidityRecursive(const QString &path)
{
if (path.isEmpty()) {
return tr("No valid folder selected!");
return FolderMan::tr("No valid folder selected!");
}
QFileInfo selFile(path);
if (!selFile.exists()) {
return checkPathValidityForNewFolder(selFile.dir().path(), serverUrl, true);
return checkPathValidityRecursive(selFile.dir().path());
}
if (!selFile.isDir()) {
return tr("The selected path is not a folder!");
return FolderMan::tr("The selected path is not a folder!");
}
if (!selFile.isWritable()) {
return tr("You have no permission to write to the selected folder!");
return FolderMan::tr("You have no permission to write to the selected folder!");
}
return QString();
}
// QFileInfo::canonicalPath returns an empty string if the file does not exist.
// This function also works with files that does not exist and resolve the symlinks in the
// parent directories.
static QString canonicalPath(const QString &path)
{
QFileInfo selFile(path);
if (!selFile.exists()) {
return canonicalPath(selFile.dir().path()) + '/' + selFile.fileName();
}
return selFile.canonicalFilePath();
}
QString FolderMan::checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl) const
{
QString recursiveValidity = checkPathValidityRecursive(path);
if (!recursiveValidity.isEmpty())
return recursiveValidity;
// check if the local directory isn't used yet in another ownCloud sync
Qt::CaseSensitivity cs = Qt::CaseSensitive;
@@ -1332,57 +1352,28 @@ QString FolderMan::checkPathValidityForNewFolder(const QString &path, const QUrl
cs = Qt::CaseInsensitive;
}
const QString userDir = QDir::cleanPath(canonicalPath(path)) + '/';
for (auto i = _folderMap.constBegin(); i != _folderMap.constEnd(); ++i) {
Folder *f = static_cast<Folder *>(i.value());
QString folderDir = QDir(f->path()).canonicalPath();
if (folderDir.isEmpty()) {
continue;
}
if (!folderDir.endsWith(QLatin1Char('/'), cs))
folderDir.append(QLatin1Char('/'));
QString folderDir = QDir::cleanPath(canonicalPath(f->path())) + '/';
const QString folderDirClean = QDir::cleanPath(folderDir) + '/';
const QString userDirClean = QDir::cleanPath(path) + '/';
// folderDir follows sym links, path not.
bool differentPathes = !Utility::fileNamesEqual(QDir::cleanPath(folderDir), QDir::cleanPath(path));
if (!forNewDirectory && differentPathes && folderDirClean.startsWith(userDirClean, cs)) {
bool differentPaths = QString::compare(folderDir, userDir, cs) != 0;
if (differentPaths && folderDir.startsWith(userDir, cs)) {
return tr("The local folder %1 already contains a folder used in a folder sync connection. "
"Please pick another one!")
.arg(QDir::toNativeSeparators(path));
}
// QDir::cleanPath keeps links
// canonicalPath() remove symlinks and uses the symlink targets.
QString absCleanUserFolder = QDir::cleanPath(QDir(path).canonicalPath()) + '/';
if ((forNewDirectory || differentPathes) && userDirClean.startsWith(folderDirClean, cs)) {
if (differentPaths && userDir.startsWith(folderDir, cs)) {
return tr("The local folder %1 is already contained in a folder used in a folder sync connection. "
"Please pick another one!")
.arg(QDir::toNativeSeparators(path));
}
// both follow symlinks.
bool cleanUserEqualsCleanFolder = Utility::fileNamesEqual(absCleanUserFolder, folderDirClean);
if (differentPathes && absCleanUserFolder.startsWith(folderDirClean, cs) && !cleanUserEqualsCleanFolder) {
return tr("The local folder %1 is a symbolic link. "
"The link target is already contained in a folder used in a folder sync connection. "
"Please pick another one!")
.arg(QDir::toNativeSeparators(path));
}
if (differentPathes && folderDirClean.startsWith(absCleanUserFolder, cs) && !cleanUserEqualsCleanFolder && !forNewDirectory) {
return tr("The local folder %1 contains a symbolic link. "
"The link target contains an already synced folder "
"Please pick another one!")
.arg(QDir::toNativeSeparators(path));
}
// if both pathes are equal, the server url needs to be different
// otherwise it would mean that a new connection from the same local folder
// to the same account is added which is not wanted. The account must differ.
if (serverUrl.isValid() && Utility::fileNamesEqual(absCleanUserFolder, folderDir)) {
if (serverUrl.isValid() && !differentPaths) {
QUrl folderUrl = f->accountState()->account()->url();
QString user = f->accountState()->account()->credentials()->user();
folderUrl.setUserName(user);

View File

@@ -138,11 +138,9 @@ public:
*
* Note that different accounts are allowed to sync to the same folder.
*
* \a forNewDirectory is internal and is used for recursion.
*
* @returns an empty string if it is allowed, or an error if it is not allowed
*/
QString checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl = QUrl(), bool forNewDirectory = false) const;
QString checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl = QUrl()) const;
/**
* Attempts to find a non-existing, acceptable path for creating a new sync folder.

View File

@@ -77,16 +77,13 @@ QSize FolderStatusDelegate::sizeHint(const QStyleOptionViewItem &option,
int h = rootFolderHeightWithoutErrors(fm, aliasFm);
// this already includes the bottom margin
// add some space to show an conflict indicator.
// add some space for the message boxes.
int margin = fm.height() / 4;
if (!qvariant_cast<QStringList>(index.data(FolderConflictMsg)).isEmpty()) {
QStringList msgs = qvariant_cast<QStringList>(index.data(FolderConflictMsg));
h += margin + 2 * margin + msgs.count() * fm.height();
}
// add some space to show an error condition.
if (!qvariant_cast<QStringList>(index.data(FolderErrorMsg)).isEmpty()) {
QStringList errMsgs = qvariant_cast<QStringList>(index.data(FolderErrorMsg));
h += margin + 2 * margin + errMsgs.count() * fm.height();
for (auto role : {FolderConflictMsg, FolderErrorMsg, FolderInfoMsg}) {
auto msgs = qvariant_cast<QStringList>(index.data(role));
if (!msgs.isEmpty()) {
h += margin + 2 * margin + msgs.count() * fm.height();
}
}
return QSize(0, h);
@@ -156,6 +153,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
QString remotePath = qvariant_cast<QString>(index.data(FolderSecondPathRole));
QStringList conflictTexts = qvariant_cast<QStringList>(index.data(FolderConflictMsg));
QStringList errorTexts = qvariant_cast<QStringList>(index.data(FolderErrorMsg));
QStringList infoTexts = qvariant_cast<QStringList>(index.data(FolderInfoMsg));
int overallPercent = qvariant_cast<int>(index.data(SyncProgressOverallPercent));
QString overallString = qvariant_cast<QString>(index.data(SyncProgressOverallString));
@@ -290,6 +288,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
drawTextBox(conflictTexts, QColor(0xba, 0xba, 0x4d));
if (!errorTexts.isEmpty())
drawTextBox(errorTexts, QColor(0xbb, 0x4d, 0x4d));
if (!infoTexts.isEmpty())
drawTextBox(infoTexts, QColor(0x4d, 0xba, 0x4d));
// Sync File Progress Bar: Show it if syncFile is not empty.
if (showProgess) {
@@ -375,13 +375,22 @@ QRect FolderStatusDelegate::optionsButtonRect(QRect within, Qt::LayoutDirection
return QStyle::visualRect(direction, within, r);
}
QRect FolderStatusDelegate::errorsListRect(QRect within)
QRect FolderStatusDelegate::errorsListRect(QRect within, const QModelIndex &index)
{
QFont font = QFont();
QFont aliasFont = makeAliasFont(font);
QFontMetrics fm(font);
QFontMetrics aliasFm(aliasFont);
within.setTop(within.top() + FolderStatusDelegate::rootFolderHeightWithoutErrors(fm, aliasFm));
int margin = fm.height() / 4;
int h = 0;
for (auto role : {FolderConflictMsg, FolderErrorMsg}) {
auto msgs = qvariant_cast<QStringList>(index.data(role));
if (!msgs.isEmpty()) {
h += margin + 2 * margin + msgs.count() * fm.height();
}
}
within.setHeight(h);
return within;
}

View File

@@ -35,6 +35,7 @@ public:
FolderSecondPathRole,
FolderConflictMsg,
FolderErrorMsg,
FolderInfoMsg,
FolderSyncPaused,
FolderStatusIconRole,
FolderAccountConnected,
@@ -57,7 +58,7 @@ public:
* return the position of the option button within the item
*/
static QRect optionsButtonRect(QRect within, Qt::LayoutDirection direction);
static QRect errorsListRect(QRect within);
static QRect errorsListRect(QRect within, const QModelIndex &);
static int rootFolderHeightWithoutErrors(const QFontMetrics &fm, const QFontMetrics &aliasFm);
private:

View File

@@ -210,6 +210,10 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
: QStringList();
case FolderStatusDelegate::FolderErrorMsg:
return f->syncResult().errorStrings();
case FolderStatusDelegate::FolderInfoMsg:
return f->useVirtualFiles()
? QStringList(tr("New files are being created as virtual files."))
: QStringList();
case FolderStatusDelegate::SyncRunning:
return f->syncResult().status() == SyncResult::SyncRunning;
case FolderStatusDelegate::HeaderRole:
@@ -358,6 +362,8 @@ int FolderStatusModel::rowCount(const QModelIndex &parent) const
auto info = infoForIndex(parent);
if (!info)
return 0;
if (info->_folder && info->_folder->useVirtualFiles())
return 0;
if (info->hasLabel())
return 1;
return info->_subs.count();
@@ -513,6 +519,9 @@ bool FolderStatusModel::hasChildren(const QModelIndex &parent) const
if (!info)
return false;
if (info->_folder && info->_folder->useVirtualFiles())
return false;
if (!info->_fetched)
return true;
@@ -538,6 +547,10 @@ bool FolderStatusModel::canFetchMore(const QModelIndex &parent) const
// Keep showing the error to the user, it will be hidden when the account reconnects
return false;
}
if (info->_folder && info->_folder->useVirtualFiles()) {
// Selective sync is hidden in that case
return false;
}
return true;
}
@@ -740,10 +753,11 @@ void FolderStatusModel::slotLscolFinishedWithError(QNetworkReply *r)
if (parentInfo) {
qCDebug(lcFolderStatus) << r->errorString();
parentInfo->_lastErrorString = r->errorString();
auto error = r->error();
parentInfo->resetSubs(this, idx);
if (r->error() == QNetworkReply::ContentNotFoundError) {
if (error == QNetworkReply::ContentNotFoundError) {
parentInfo->_fetched = true;
} else {
ASSERT(!parentInfo->hasLabel());
@@ -809,7 +823,7 @@ void FolderStatusModel::slotApplySelectiveSync()
auto oldBlackList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
if (!ok) {
qCWarning(lcFolderStatus) << "Could not read selective sync list from db.";
return;
continue;
}
QStringList blackList = createBlackList(&_folders[i], oldBlackList);
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
@@ -842,6 +856,8 @@ void FolderStatusModel::slotApplySelectiveSync()
foreach (const auto &it, changes) {
folder->journalDb()->avoidReadFromDbOnNextSync(it);
}
// Also make sure we see the local file that had been ignored before
folder->slotNextSyncFullLocalDiscovery();
FolderMan::instance()->scheduleFolder(folder);
}
}
@@ -1155,6 +1171,8 @@ void FolderStatusModel::slotSyncAllPendingBigFolders()
foreach (const auto &it, undecidedList) {
folder->journalDb()->avoidReadFromDbOnNextSync(it);
}
// Also make sure we see the local file that had been ignored before
folder->slotNextSyncFullLocalDiscovery();
FolderMan::instance()->scheduleFolder(folder);
}
@@ -1226,7 +1244,11 @@ bool FolderStatusModel::SubFolderInfo::hasLabel() const
void FolderStatusModel::SubFolderInfo::resetSubs(FolderStatusModel *model, QModelIndex index)
{
_fetched = false;
delete _fetchingJob;
if (_fetchingJob) {
disconnect(_fetchingJob, nullptr, model, nullptr);
_fetchingJob->deleteLater();
_fetchingJob.clear();
}
if (hasLabel()) {
model->beginRemoveRows(index, 0, 0);
_fetchingLabel = false;

View File

@@ -67,8 +67,10 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr &account)
connect(_ui.localFolderChooseBtn, &QAbstractButton::clicked, this, &FolderWizardLocalPath::slotChooseLocalFolder);
_ui.localFolderChooseBtn->setToolTip(tr("Click to select a local folder to sync."));
QUrl serverUrl = _account->url();
serverUrl.setUserName(_account->credentials()->user());
QString defaultPath = QDir::homePath() + QLatin1Char('/') + Theme::instance()->appName();
defaultPath = FolderMan::instance()->findGoodPathForNewSyncFolder(defaultPath, account->url());
defaultPath = FolderMan::instance()->findGoodPathForNewSyncFolder(defaultPath, serverUrl);
_ui.localFolderLineEdit->setText(QDir::toNativeSeparators(defaultPath));
_ui.localFolderLineEdit->setToolTip(tr("Enter the path to the local folder."));
@@ -483,9 +485,12 @@ FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account)
_selectiveSync = new SelectiveSyncWidget(account, this);
layout->addWidget(_selectiveSync);
if (ConfigFile().showExperimentalOptions()) {
if (Theme::instance()->showVirtualFilesOption()) {
_virtualFilesCheckBox = new QCheckBox(tr("Use virtual files instead of downloading content immediately (experimental)"));
connect(_virtualFilesCheckBox, &QCheckBox::clicked, this, &FolderWizardSelectiveSync::virtualFilesCheckboxClicked);
connect(_virtualFilesCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
_selectiveSync->setEnabled(state == Qt::Unchecked);
});
layout->addWidget(_virtualFilesCheckBox);
}
}
@@ -514,8 +519,9 @@ void FolderWizardSelectiveSync::initializePage()
bool FolderWizardSelectiveSync::validatePage()
{
wizard()->setProperty("selectiveSyncBlackList", QVariant(_selectiveSync->createBlackList()));
wizard()->setProperty("useVirtualFiles", QVariant(_virtualFilesCheckBox && _virtualFilesCheckBox->isChecked()));
bool useVirtualFiles = _virtualFilesCheckBox && _virtualFilesCheckBox->isChecked();
wizard()->setProperty("selectiveSyncBlackList", useVirtualFiles ? QVariant() : QVariant(_selectiveSync->createBlackList()));
wizard()->setProperty("useVirtualFiles", QVariant(useVirtualFiles));
return true;
}

View File

@@ -54,17 +54,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
_ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
connect(_ui->autostartCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotToggleLaunchOnStartup);
// setup about section
QString about = Theme::instance()->about();
if (about.isEmpty()) {
_ui->aboutGroupBox->hide();
} else {
_ui->aboutLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
_ui->aboutLabel->setText("<qt><style> p{padding-bottom:0; margin-bottom:0;padding-top:2; margin-top: 2; font-size:smaller;};</style>"+about+"</qt>");
_ui->aboutLabel->setWordWrap(true);
_ui->aboutLabel->setOpenExternalLinks(true);
}
loadMiscSettings();
slotUpdateInfo();
@@ -101,6 +90,18 @@ GeneralSettings::GeneralSettings(QWidget *parent)
// accountAdded means the wizard was finished and the wizard might change some options.
connect(AccountManager::instance(), &AccountManager::accountAdded, this, &GeneralSettings::loadMiscSettings);
// Only our standard brandings currently support beta channel
Theme *theme = Theme::instance();
if (theme->appName() != QLatin1String("ownCloud") && theme->appName() != QLatin1String("testpilotcloud") ) {
#ifdef Q_OS_MAC
// Because we don't have any statusString from the SparkleUpdater anyway we can hide the whole thing
_ui->updatesGroupBox->hide();
#else
_ui->updateChannelLabel->hide();
_ui->updateChannel->hide();
#endif
}
}
GeneralSettings::~GeneralSettings()
@@ -148,7 +149,7 @@ void GeneralSettings::slotUpdateInfo()
_ui->restartButton->setVisible(ocupdater->downloadState() == OCUpdater::DownloadComplete);
}
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
else if (SparkleUpdater *sparkleUpdater = qobject_cast<SparkleUpdater *>(Updater::instance())) {
_ui->updateStateLabel->setText(sparkleUpdater->statusString());
_ui->restartButton->setVisible(false);
@@ -157,12 +158,13 @@ void GeneralSettings::slotUpdateInfo()
// Channel selection
_ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0);
connect(_ui->updateChannel, &QComboBox::currentTextChanged,
connect(_ui->updateChannel, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection);
}
void GeneralSettings::slotUpdateChannelChanged(const QString &channel)
void GeneralSettings::slotUpdateChannelChanged(int index)
{
QString channel = index == 0 ? QStringLiteral("stable") : QStringLiteral("beta");
if (channel == ConfigFile().updateChannel())
return;
@@ -192,7 +194,7 @@ void GeneralSettings::slotUpdateChannelChanged(const QString &channel)
updater->setUpdateUrl(Updater::updateUrl());
updater->checkForUpdate();
}
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
else if (SparkleUpdater *updater = qobject_cast<SparkleUpdater *>(Updater::instance())) {
updater->setUpdateUrl(Updater::updateUrl());
updater->checkForUpdate();

View File

@@ -45,7 +45,7 @@ private slots:
void slotToggleOptionalDesktopNotifications(bool);
void slotShowInExplorerNavigationPane(bool);
void slotUpdateInfo();
void slotUpdateChannelChanged(const QString &channel);
void slotUpdateChannelChanged(int index);
void slotIgnoreFilesEditor();
void loadMiscSettings();

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>785</width>
<height>533</height>
<height>390</height>
</rect>
</property>
<property name="windowTitle">
@@ -48,28 +48,6 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="aboutGroupBox">
<property name="title">
<string>About</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="aboutLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>About</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="updatesGroupBox">
<property name="title">
<string>Updates</string>
@@ -160,7 +138,7 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

View File

@@ -140,6 +140,7 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList()
// ignored (because the remote etag did not change) (issue #3172)
foreach (Folder *folder, folderMan->map()) {
folder->journalDb()->forceRemoteDiscoveryNextSync();
folder->slotNextSyncFullLocalDiscovery();
folderMan->scheduleFolder(folder);
}
}

View File

@@ -190,8 +190,10 @@ void IssuesWidget::addItem(QTreeWidgetItem *item)
return;
int count = _ui->_treeWidget->topLevelItemCount();
if (count >= maxIssueCount)
if (count >= maxIssueCount) {
delete item;
return;
}
_ui->_treeWidget->setSortingEnabled(false);
_reenableSorting.start();

View File

@@ -25,6 +25,7 @@ OcsShareJob::OcsShareJob(AccountPtr account)
: OcsJob(account)
{
setPath("ocs/v1.php/apps/files_sharing/api/v1/shares");
addParam(QString::fromLatin1("reshares"), QString::fromLatin1("true"));
connect(this, &OcsJob::jobFinished, this, &OcsShareJob::jobDone);
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-@APPLICATION_EXECUTABLE@">
<mime-type type="application/vnd.@APPLICATION_EXECUTABLE@">
<comment>@APPLICATION_NAME@ virtual files</comment>
<glob pattern="*.@APPLICATION_VIRTUALFILE_SUFFIX@"/>
</mime-type>

View File

@@ -38,6 +38,8 @@
#include <QDesktopServices>
#include <QDir>
#include <QMessageBox>
#include <QDialog>
#include <QHBoxLayout>
#if defined(Q_OS_X11)
#include <QX11Info>
@@ -50,18 +52,13 @@ const char propertyAccountC[] = "oc_account";
ownCloudGui::ownCloudGui(Application *parent)
: QObject(parent)
, _tray(0)
,
#if defined(Q_OS_MAC)
_settingsDialog(new SettingsDialogMac(this))
,
, _settingsDialog(new SettingsDialogMac(this))
#else
_settingsDialog(new SettingsDialog(this))
,
, _settingsDialog(new SettingsDialog(this))
#endif
_logBrowser(0)
, _contextMenuVisibleOsx(false)
, _logBrowser(0)
, _recentActionsMenu(0)
, _qdbusmenuWorkaround(false)
, _app(parent)
{
_tray = new Systray();
@@ -117,7 +114,7 @@ void ownCloudGui::slotOpenSettingsDialog()
void ownCloudGui::slotTrayClicked(QSystemTrayIcon::ActivationReason reason)
{
if (_qdbusmenuWorkaround) {
if (_workaroundFakeDoubleClick) {
static QElapsedTimer last_click;
if (last_click.isValid() && last_click.elapsed() < 200) {
return;
@@ -199,7 +196,7 @@ void ownCloudGui::slotTrayMessageIfServerUnsupported(Account *account)
if (account->serverVersionUnsupported()) {
slotShowTrayMessage(
tr("Unsupported Server Version"),
tr("The server on account %1 runs an old and unsupported version %2. "
tr("The server on account %1 runs an unsupported version %2. "
"Using this client with unsupported server versions is untested and "
"potentially dangerous. Proceed at your own risk.")
.arg(account->displayName(), account->serverVersion()));
@@ -402,17 +399,19 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
void ownCloudGui::slotContextMenuAboutToShow()
{
// For some reason on OS X _contextMenu->isVisible returns always false
_contextMenuVisibleOsx = true;
_contextMenuVisibleManual = true;
// Update icon in sys tray, as it might change depending on the context menu state
slotComputeOverallSyncStatus();
if (!_workaroundNoAboutToShowUpdate) {
updateContextMenu();
}
}
void ownCloudGui::slotContextMenuAboutToHide()
{
// For some reason on OS X _contextMenu->isVisible returns always false
_contextMenuVisibleOsx = false;
_contextMenuVisibleManual = false;
// Update icon in sys tray, as it might change depending on the context menu state
slotComputeOverallSyncStatus();
@@ -420,11 +419,11 @@ void ownCloudGui::slotContextMenuAboutToHide()
bool ownCloudGui::contextMenuVisible() const
{
#ifdef Q_OS_MAC
return _contextMenuVisibleOsx;
#else
// On some platforms isVisible doesn't work and always returns false,
// elsewhere aboutToHide is unreliable.
if (_workaroundManualVisibility)
return _contextMenuVisibleManual;
return _contextMenu->isVisible();
#endif
}
static bool minimalTrayMenu()
@@ -447,12 +446,36 @@ static bool updateWhileVisible()
}
}
static QByteArray forceQDBusTrayWorkaround()
static QByteArray envForceQDBusTrayWorkaround()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_QDBUS_TRAY_WORKAROUND");
return var;
}
static QByteArray envForceWorkaroundShowAndHideTray()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_TRAY_SHOW_HIDE");
return var;
}
static QByteArray envForceWorkaroundNoAboutToShowUpdate()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_TRAY_NO_ABOUT_TO_SHOW");
return var;
}
static QByteArray envForceWorkaroundFakeDoubleClick()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_TRAY_FAKE_DOUBLE_CLICK");
return var;
}
static QByteArray envForceWorkaroundManualVisibility()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_TRAY_MANUAL_VISIBILITY");
return var;
}
void ownCloudGui::setupContextMenu()
{
if (_contextMenu) {
@@ -471,55 +494,73 @@ void ownCloudGui::setupContextMenu()
// The tray menu is surprisingly problematic. Being able to switch to
// a minimal version of it is a useful workaround and testing tool.
if (minimalTrayMenu()) {
if (! Theme::instance()->about().isEmpty()) {
_contextMenu->addSeparator();
_contextMenu->addAction(_actionAbout);
}
_contextMenu->addAction(_actionQuit);
return;
}
// Enables workarounds for bugs introduced in Qt 5.5.0
// In particular QTBUG-47863 #3672 (tray menu fails to update and
// becomes unresponsive) and QTBUG-48068 #3722 (click signal is
// emitted several times)
// The Qt version check intentionally uses 5.0.0 (where platformMenu()
// was introduced) instead of 5.5.0 to avoid issues where the Qt
// version used to build is different from the one used at runtime.
// If we build with 5.6.1 or newer, we can skip this because the
// bugs should be fixed there.
#ifdef Q_OS_LINUX
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
if (qVersion() == QByteArray("5.5.0")) {
QObject *platformMenu = reinterpret_cast<QObject *>(_tray->contextMenu()->platformMenu());
if (platformMenu
&& platformMenu->metaObject()->className() == QLatin1String("QDBusPlatformMenu")) {
_qdbusmenuWorkaround = true;
qCWarning(lcApplication) << "Enabled QDBusPlatformMenu workaround";
}
}
#endif
#endif
auto applyEnvVariable = [](bool *sw, const QByteArray &value) {
if (value == "1")
*sw = true;
if (value == "0")
*sw = false;
};
if (forceQDBusTrayWorkaround() == "1") {
_qdbusmenuWorkaround = true;
} else if (forceQDBusTrayWorkaround() == "0") {
_qdbusmenuWorkaround = false;
// This is an old compound flag that people might still depend on
bool qdbusmenuWorkarounds = false;
applyEnvVariable(&qdbusmenuWorkarounds, envForceQDBusTrayWorkaround());
if (qdbusmenuWorkarounds) {
_workaroundFakeDoubleClick = true;
_workaroundNoAboutToShowUpdate = true;
_workaroundShowAndHideTray = true;
}
// When the qdbusmenuWorkaround is necessary, we can't do on-demand updates
// because the workaround is to hide and show the tray icon.
if (_qdbusmenuWorkaround) {
connect(&_workaroundBatchTrayUpdate, &QTimer::timeout, this, &ownCloudGui::updateContextMenu);
_workaroundBatchTrayUpdate.setInterval(30 * 1000);
_workaroundBatchTrayUpdate.setSingleShot(true);
} else {
// Update the context menu whenever we're about to show it
// to the user.
#ifdef Q_OS_MAC
// https://bugreports.qt.io/browse/QTBUG-54633
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow()));
connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide()));
#else
connect(_contextMenu.data(), &QMenu::aboutToShow, this, &ownCloudGui::updateContextMenu);
// https://bugreports.qt.io/browse/QTBUG-54633
_workaroundNoAboutToShowUpdate = true;
_workaroundManualVisibility = true;
#endif
#ifdef Q_OS_LINUX
// For KDE sessions if the platform plugin is missing,
// neither aboutToShow() updates nor the isVisible() call
// work. At least aboutToHide is reliable.
// https://github.com/owncloud/client/issues/6545
static QByteArray xdgCurrentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
static QByteArray desktopSession = qgetenv("DESKTOP_SESSION");
bool isKde =
xdgCurrentDesktop.contains("KDE")
|| desktopSession.contains("plasma")
|| desktopSession.contains("kde");
QObject *platformMenu = reinterpret_cast<QObject *>(_tray->contextMenu()->platformMenu());
if (isKde && platformMenu && platformMenu->metaObject()->className() == QLatin1String("QDBusPlatformMenu")) {
_workaroundManualVisibility = true;
_workaroundNoAboutToShowUpdate = true;
}
#endif
applyEnvVariable(&_workaroundNoAboutToShowUpdate, envForceWorkaroundNoAboutToShowUpdate());
applyEnvVariable(&_workaroundFakeDoubleClick, envForceWorkaroundFakeDoubleClick());
applyEnvVariable(&_workaroundShowAndHideTray, envForceWorkaroundShowAndHideTray());
applyEnvVariable(&_workaroundManualVisibility, envForceWorkaroundManualVisibility());
qCInfo(lcApplication) << "Tray menu workarounds:"
<< "noabouttoshow:" << _workaroundNoAboutToShowUpdate
<< "fakedoubleclick:" << _workaroundFakeDoubleClick
<< "showhide:" << _workaroundShowAndHideTray
<< "manualvisibility:" << _workaroundManualVisibility;
connect(&_delayedTrayUpdateTimer, &QTimer::timeout, this, &ownCloudGui::updateContextMenu);
_delayedTrayUpdateTimer.setInterval(2 * 1000);
_delayedTrayUpdateTimer.setSingleShot(true);
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow()));
// unfortunately aboutToHide is unreliable, it seems to work on OSX though
connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide()));
// Populate the context menu now.
updateContextMenu();
@@ -531,13 +572,21 @@ void ownCloudGui::updateContextMenu()
return;
}
if (_qdbusmenuWorkaround) {
// If it's visible, we can't update live, and it won't be updated lazily: reschedule
if (contextMenuVisible() && !updateWhileVisible() && _workaroundNoAboutToShowUpdate) {
if (!_delayedTrayUpdateTimer.isActive()) {
_delayedTrayUpdateTimer.start();
}
return;
}
if (_workaroundShowAndHideTray) {
// To make tray menu updates work with these bugs (see setupContextMenu)
// we need to hide and show the tray icon. We don't want to do that
// while it's visible!
if (contextMenuVisible()) {
if (!_workaroundBatchTrayUpdate.isActive()) {
_workaroundBatchTrayUpdate.start();
if (!_delayedTrayUpdateTimer.isActive()) {
_delayedTrayUpdateTimer.start();
}
return;
}
@@ -650,37 +699,38 @@ void ownCloudGui::updateContextMenu()
}
_contextMenu->addAction(_actionLogin);
}
if (! Theme::instance()->about().isEmpty()) {
_contextMenu->addSeparator();
_contextMenu->addAction(_actionAbout);
}
_contextMenu->addAction(_actionQuit);
if (_qdbusmenuWorkaround) {
if (_workaroundShowAndHideTray) {
_tray->show();
}
}
void ownCloudGui::updateContextMenuNeeded()
{
// For the workaround case updating while visible is impossible. Instead
// occasionally update the menu when it's invisible.
if (_qdbusmenuWorkaround) {
if (!_workaroundBatchTrayUpdate.isActive()) {
_workaroundBatchTrayUpdate.start();
}
// if it's visible and we can update live: update now
if (contextMenuVisible() && updateWhileVisible()) {
// Note: don't update while visible on OSX
// https://bugreports.qt.io/browse/QTBUG-54845
updateContextMenu();
return;
}
#ifdef Q_OS_MAC
// https://bugreports.qt.io/browse/QTBUG-54845
// We cannot update on demand or while visible -> update when invisible.
if (!contextMenuVisible()) {
updateContextMenu();
// if we can't lazily update: update later
if (_workaroundNoAboutToShowUpdate) {
// Note: don't update immediately even in the invisible case
// as that can lead to extremely frequent menu updates
if (!_delayedTrayUpdateTimer.isActive()) {
_delayedTrayUpdateTimer.start();
}
return;
}
#else
if (updateWhileVisible() && contextMenuVisible())
updateContextMenu();
#endif
// If no update was done here, we might update it on-demand due to
// the aboutToShow() signal.
}
void ownCloudGui::slotShowTrayMessage(const QString &title, const QString &msg)
@@ -737,6 +787,8 @@ void ownCloudGui::setupActions()
QObject::connect(_actionNewAccountWizard, &QAction::triggered, this, &ownCloudGui::slotNewAccountWizard);
_actionHelp = new QAction(tr("Help"), this);
QObject::connect(_actionHelp, &QAction::triggered, this, &ownCloudGui::slotHelp);
_actionAbout = new QAction(tr("About %1").arg(Theme::instance()->appNameGUI()), this);
QObject::connect(_actionAbout, &QAction::triggered, this, &ownCloudGui::slotAbout);
_actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
QObject::connect(_actionQuit, SIGNAL(triggered(bool)), _app, SLOT(quit()));
@@ -1073,7 +1125,7 @@ void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &l
w = _shareDialogs[localPath];
} else {
qCInfo(lcApplication) << "Opening share dialog" << sharePath << localPath << maxSharingPermissions;
w = new ShareDialog(accountState, sharePath, localPath, maxSharingPermissions, fileRecord.numericFileId(), startPage);
w = new ShareDialog(accountState, sharePath, localPath, maxSharingPermissions, fileRecord.legacyDeriveNumericFileId(), startPage);
w->setAttribute(Qt::WA_DeleteOnClose, true);
_shareDialogs[localPath] = w;
@@ -1093,5 +1145,28 @@ void ownCloudGui::slotRemoveDestroyedShareDialogs()
}
}
void ownCloudGui::slotAbout()
{
QString title = tr("About %1").arg(Theme::instance()->appNameGUI());
QString about = Theme::instance()->about();
QMessageBox *msgBox = new QMessageBox(this->_settingsDialog);
#ifdef Q_OS_MAC
// From Qt doc: "On macOS, the window title is ignored (as required by the macOS Guidelines)."
msgBox->setText(title);
#else
msgBox->setWindowTitle(title);
#endif
msgBox->setAttribute(Qt::WA_DeleteOnClose, true);
msgBox->setTextFormat(Qt::RichText);
msgBox->setTextInteractionFlags(Qt::TextBrowserInteraction);
msgBox->setInformativeText("<qt>"+about+"</qt>");
msgBox->setStandardButtons(QMessageBox::Ok);
QIcon appIcon = Theme::instance()->applicationIcon();
// Assume icon is always small enough to fit an about dialog?
qDebug() << appIcon.availableSizes().last();
msgBox->setIconPixmap(appIcon.pixmap(appIcon.availableSizes().last()));
msgBox->show();
}
} // end namespace

View File

@@ -108,6 +108,7 @@ private slots:
void slotUnpauseAllFolders();
void slotPauseAllFolders();
void slotNewAccountWizard();
void slotAbout();
private:
void setPauseOnAllFoldersHelper(bool pause);
@@ -124,14 +125,19 @@ private:
// tray's menu
QScopedPointer<QMenu> _contextMenu;
// Manually tracking whether the context menu is visible, but only works
// on OSX because aboutToHide is not reliable everywhere.
bool _contextMenuVisibleOsx;
// Manually tracking whether the context menu is visible via aboutToShow
// and aboutToHide. Unfortunately aboutToHide isn't reliable everywhere
// so this only gets used with _workaroundManualVisibility (when the tray's
// isVisible() is unreliable)
bool _contextMenuVisibleManual = false;
QMenu *_recentActionsMenu;
QVector<QMenu *> _accountMenus;
bool _qdbusmenuWorkaround;
QTimer _workaroundBatchTrayUpdate;
bool _workaroundShowAndHideTray = false;
bool _workaroundNoAboutToShowUpdate = false;
bool _workaroundFakeDoubleClick = false;
bool _workaroundManualVisibility = false;
QTimer _delayedTrayUpdateTimer;
QMap<QString, QPointer<ShareDialog>> _shareDialogs;
QAction *_actionLogin;
@@ -143,6 +149,7 @@ private:
QAction *_actionEstimate;
QAction *_actionRecent;
QAction *_actionHelp;
QAction *_actionAbout;
QAction *_actionQuit;
QAction *_actionCrash;

View File

@@ -141,7 +141,7 @@ void ProtocolItem::openContextMenu(QPoint globalPos, QTreeWidgetItem *item, QWid
// "Open in Browser" action
auto openInBrowser = menu->addAction(ProtocolWidget::tr("Open in browser"));
QObject::connect(openInBrowser, &QAction::triggered, parent, [parent, account, rec]() {
fetchPrivateLinkUrl(account, rec._path, rec.numericFileId(), parent,
fetchPrivateLinkUrl(account, rec._path, rec.legacyDeriveNumericFileId(), parent,
[parent](const QString &url) {
Utility::openBrowser(url, parent);
});

View File

@@ -492,6 +492,8 @@ void SelectiveSyncDialog::accept()
foreach (const auto &it, changes) {
_folder->journalDb()->avoidReadFromDbOnNextSync(it);
}
// Also make sure we see the local file that had been ignored before
_folder->slotNextSyncFullLocalDiscovery();
folderMan->scheduleFolder(_folder);
}

View File

@@ -229,6 +229,7 @@ void SettingsDialog::accountAdded(AccountState *s)
_actionGroup->addAction(accountAction);
_actionGroupWidgets.insert(accountAction, accountSettings);
_actionForAccount.insert(s->account().data(), accountAction);
accountAction->trigger();
connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotFoldersChanged);
connect(accountSettings, &AccountSettings::openFolderAlias,

View File

@@ -166,6 +166,7 @@ void SettingsDialogMac::accountAdded(AccountState *s)
connect(s, &AccountState::isConnectedChanged, this, &SettingsDialogMac::slotRefreshActivityAccountStateSender);
slotRefreshActivity(s);
setCurrentPanelIndex(0);
}
void SettingsDialogMac::accountRemoved(AccountState *s)

View File

@@ -539,7 +539,7 @@ void ShareLinkWidget::emailShareLink(const QUrl &url)
{
QString fileName = _sharePath.mid(_sharePath.lastIndexOf('/') + 1);
Utility::openEmailComposer(
QString("I shared %1 with you").arg(fileName),
tr("I shared %1 with you").arg(fileName),
url.toString(),
this);
}

View File

@@ -580,7 +580,7 @@ void SocketApi::fetchPrivateLinkUrlHelper(const QString &localFile, const std::f
fetchPrivateLinkUrl(
fileData.folder->accountState()->account(),
fileData.serverRelativePath,
record.numericFileId(),
record.legacyDeriveNumericFileId(),
this,
targetFun);
}
@@ -621,6 +621,41 @@ void SocketApi::command_DOWNLOAD_VIRTUAL_FILE(const QString &filesArg, SocketLis
}
}
/* Go over all the files ans replace them by a virtual file */
void SocketApi::command_REPLACE_VIRTUAL_FILE(const QString &filesArg, SocketListener *)
{
QStringList files = filesArg.split(QLatin1Char('\x1e')); // Record Separator
auto suffix = QStringLiteral(APPLICATION_DOTVIRTUALFILE_SUFFIX);
for (const auto &file : files) {
QString relativePath;
auto folder = FolderMan::instance()->folderForPath(file, &relativePath);
if (!folder)
continue;
if (file.endsWith(suffix))
continue;
QFileInfo fi(file);
if (fi.isDir()) {
folder->journalDb()->getFilesBelowPath(relativePath.toUtf8(), [&](const SyncJournalFileRecord &rec) {
if (rec._type != ItemTypeFile || rec._path.endsWith(APPLICATION_DOTVIRTUALFILE_SUFFIX))
return;
QString file = folder->path() + '/' + QString::fromUtf8(rec._path);
if (!FileSystem::rename(file, file + suffix)) {
qCWarning(lcSocketApi) << "Unable to rename " << file;
}
});
continue;
}
SyncJournalFileRecord record;
if (!folder->journalDb()->getFileRecord(relativePath, &record) || !record.isValid())
continue;
if (!FileSystem::rename(file, file + suffix)) {
qCWarning(lcSocketApi) << "Unable to rename " << file;
}
FolderMan::instance()->scheduleFolder(folder);
}
}
void SocketApi::emailPrivateLink(const QString &link)
{
Utility::openEmailComposer(
@@ -763,12 +798,23 @@ void SocketApi::command_GET_MENU_ITEMS(const QString &argument, OCC::SocketListe
if (folder) {
auto virtualFileSuffix = QStringLiteral(APPLICATION_DOTVIRTUALFILE_SUFFIX);
bool hasVirtualFile = false;
bool hasNormalFiles = false;
bool hasDir = false;
for (const auto &file : files) {
if (file.endsWith(virtualFileSuffix) || (folder->useVirtualFiles() && QFileInfo(file).isDir()))
if (QFileInfo(file).isDir()) {
hasDir = true;
} else if (file.endsWith(virtualFileSuffix)) {
hasVirtualFile = true;
} else if (!hasNormalFiles) {
bool isOnTheServer = FileData::get(file).journalRecord().isValid();
hasNormalFiles = isOnTheServer;
}
}
if (hasVirtualFile)
if (hasVirtualFile || (hasDir && folder->useVirtualFiles()))
listener->sendMessage(QLatin1String("MENU_ITEM:DOWNLOAD_VIRTUAL_FILE::") + tr("Download file(s)", "", files.size()));
if ((hasNormalFiles || hasDir) && folder->useVirtualFiles())
listener->sendMessage(QLatin1String("MENU_ITEM:REPLACE_VIRTUAL_FILE::") + tr("Replace file(s) by virtual file", "", files.size()));
}
listener->sendMessage(QString("GET_MENU_ITEMS:END"));

View File

@@ -108,6 +108,7 @@ private:
Q_INVOKABLE void command_EMAIL_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
Q_INVOKABLE void command_OPEN_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
Q_INVOKABLE void command_DOWNLOAD_VIRTUAL_FILE(const QString &filesArg, SocketListener *listener);
Q_INVOKABLE void command_REPLACE_VIRTUAL_FILE(const QString &filesArg, SocketListener *listener);
// Fetch the private link and call targetFun
void fetchPrivateLinkUrlHelper(const QString &localFile, const std::function<void(const QString &url)> &targetFun);

View File

@@ -192,8 +192,30 @@ void OCUpdater::slotStartInstaller()
settings.setValue(autoUpdateAttemptedC, true);
settings.sync();
qCInfo(lcUpdater) << "Running updater" << updateFile;
QProcess::startDetached(updateFile, QStringList() << "/S"
<< "/launch");
if(updateFile.endsWith(".exe")) {
QProcess::startDetached(updateFile, QStringList() << "/S"
<< "/launch");
} else if(updateFile.endsWith(".msi")) {
// When MSIs are installed without gui they cannot launch applications
// as they lack the user context. That is why we need to run the client
// manually here. We wrap the msiexec and client invocation in a powershell
// script because owncloud.exe will be shut down for installation.
// | Out-Null forces powershell to wait for msiexec to finish.
auto preparePathForPowershell = [](QString path) {
path.replace("'", "''");
return QDir::toNativeSeparators(path);
};
QString msiLogFile = cfg.configPath() + "msi.log";
QString command = QString("&{msiexec /norestart /passive /i '%1' /L*V '%2'| Out-Null ; &'%3'}")
.arg(preparePathForPowershell(updateFile))
.arg(preparePathForPowershell(msiLogFile))
.arg(preparePathForPowershell(QCoreApplication::applicationFilePath()));
QProcess::startDetached("powershell.exe", QStringList{"-Command", command});
}
}
void OCUpdater::checkForUpdate()
@@ -274,11 +296,19 @@ void NSISUpdater::slotDownloadFinished()
QUrl url(reply->url());
_file->close();
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
// remove previously downloaded but not used installer
QFile oldTargetFile(settings.value(updateAvailableC).toString());
if (oldTargetFile.exists()) {
oldTargetFile.remove();
}
QFile::copy(_file->fileName(), _targetFile);
setDownloadState(DownloadComplete);
qCInfo(lcUpdater) << "Downloaded" << url.toString() << "to" << _targetFile;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
settings.setValue(updateTargetVersionC, updateInfo().version());
settings.setValue(updateAvailableC, _targetFile);
}
@@ -303,7 +333,7 @@ void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
showDialog(info);
}
if (!url.isEmpty()) {
_targetFile = cfg.configPath() + url.mid(url.lastIndexOf('/'));
_targetFile = cfg.configPath() + url.mid(url.lastIndexOf('/')+1);
if (QFile(_targetFile).exists()) {
setDownloadState(DownloadComplete);
} else {

View File

@@ -115,6 +115,7 @@ signals:
void requestRestart();
public slots:
// FIXME Maybe this should be in the NSISUpdater which should have been called WindowsUpdater
void slotStartInstaller();
protected slots:

View File

@@ -57,6 +57,10 @@ QUrl Updater::updateUrl()
urlQuery.addQueryItem(QLatin1String("sparkle"), QLatin1String("true"));
#endif
#if defined(Q_OS_WIN)
urlQuery.addQueryItem(QLatin1String("msi"), QLatin1String("true"));
#endif
updateBaseUrl.setQuery(urlQuery);
return updateBaseUrl;
@@ -126,9 +130,10 @@ Updater *Updater::create()
#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
return new SparkleUpdater(url);
#elif defined(Q_OS_WIN32)
// the best we can do is notify about updates
// Also for MSI
return new NSISUpdater(url);
#else
// the best we can do is notify about updates
return new PassiveUpdateNotifier(url);
#endif
}

View File

@@ -51,7 +51,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
registerField(QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);
_ui.resultLayout->addWidget(_progressIndi);
_ui.errorScrollContents->layout()->addWidget(_progressIndi);
stopSpinner();
setupCustomization();
@@ -105,7 +105,12 @@ void OwncloudAdvancedSetupPage::initializePage()
{
WizardCommon::initErrorLabel(_ui.errorLabel);
if (!ConfigFile().showExperimentalOptions()) {
auto labelSizeHint = _ui.errorLabel->minimumSizeHint();
_ui.errorScroll->setMinimumSize(
labelSizeHint.width(),
qMax<int>(1.3 * labelSizeHint.height(), _progressIndi->height()));
if (!Theme::instance()->showVirtualFilesOption()) {
// If the layout were wrapped in a widget, the auto-grouping of the
// radio buttons no longer works and there are surprising margins.
// Just manually hide the button and remove the layout.
@@ -137,6 +142,7 @@ void OwncloudAdvancedSetupPage::initializePage()
if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) {
_selectiveSyncBlacklist = QStringList("/");
setRadioChecked(_ui.rSelectiveSync);
QTimer::singleShot(0, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
}
@@ -181,8 +187,6 @@ void OwncloudAdvancedSetupPage::updateStatus()
}
_ui.syncModeLabel->setText(t);
_ui.syncModeLabel->setFixedHeight(_ui.syncModeLabel->sizeHint().height());
wizard()->resize(wizard()->sizeHint());
setErrorString(errorStr);
emit completeChanged();
}
@@ -195,14 +199,12 @@ bool OwncloudAdvancedSetupPage::dataChanged()
void OwncloudAdvancedSetupPage::startSpinner()
{
_ui.resultLayout->setEnabled(true);
_progressIndi->setVisible(true);
_progressIndi->startAnimation();
}
void OwncloudAdvancedSetupPage::stopSpinner()
{
_ui.resultLayout->setEnabled(false);
_progressIndi->setVisible(false);
_progressIndi->stopAnimation();
}

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>912</width>
<height>635</height>
<width>917</width>
<height>604</height>
</rect>
</property>
<property name="sizePolicy">
@@ -454,13 +454,6 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="errorLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="syncModeLabel">
<property name="text">
@@ -478,7 +471,54 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="resultLayout"/>
<widget class="QScrollArea" name="errorScroll">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="errorScrollContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>899</width>
<height>68</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="errorLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="bottomLabel">

View File

@@ -13,6 +13,8 @@
*/
#include <QVariant>
#include <QMenu>
#include <QClipboard>
#include "wizard/owncloudoauthcredspage.h"
#include "theme.h"
@@ -45,9 +47,20 @@ OwncloudOAuthCredsPage::OwncloudOAuthCredsPage()
connect(_ui.openLinkButton, &QCommandLinkButton::clicked, [this] {
_ui.errorLabel->hide();
qobject_cast<OwncloudWizard *>(wizard())->account()->clearCookieJar(); // #6574
if (_asyncAuth)
_asyncAuth->openBrowser();
});
_ui.openLinkButton->setContextMenuPolicy(Qt::CustomContextMenu);
QObject::connect(_ui.openLinkButton, &QWidget::customContextMenuRequested, [this](const QPoint &pos) {
auto menu = new QMenu(_ui.openLinkButton);
menu->addAction(tr("Copy link to clipboard"), this, [this] {
if (_asyncAuth)
QApplication::clipboard()->setText(_asyncAuth->authorisationLink().toString(QUrl::FullyEncoded));
});
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->popup(_ui.openLinkButton->mapToGlobal(pos));
});
}
void OwncloudOAuthCredsPage::initializePage()

View File

@@ -221,12 +221,19 @@ QString OwncloudSetupPage::url() const
bool OwncloudSetupPage::validatePage()
{
if (!_authTypeKnown) {
QString u = url();
QUrl qurl(u);
if (!qurl.isValid() || qurl.host().isEmpty()) {
setErrorString(tr("Invalid URL"), false);
return false;
}
setErrorString(QString(), false);
_checking = true;
startSpinner();
emit completeChanged();
emit determineAuthType(url());
emit determineAuthType(u);
return false;
} else {
// connecting is running

View File

@@ -62,9 +62,6 @@ namespace WizardCommon {
errorLabel->setStyleSheet(style);
errorLabel->setWordWrap(true);
auto sizePolicy = errorLabel->sizePolicy();
sizePolicy.setRetainSizeWhenHidden(true);
errorLabel->setSizePolicy(sizePolicy);
errorLabel->setVisible(false);
}

View File

@@ -16,10 +16,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
if(SPARKLE_FOUND AND NOT BUILD_LIBRARIES_ONLY)
list (APPEND OS_SPECIFIC_LINK_LIBRARIES ${SPARKLE_LIBRARY})
endif()
set(libsync_SRCS
account.cpp
bandwidthmanager.cpp
@@ -90,7 +86,7 @@ ENDIF(NOT APPLE)
add_library(${synclib_NAME} SHARED ${libsync_SRCS})
target_link_libraries(${synclib_NAME}
ocsync
"${csync_NAME}"
${OS_SPECIFIC_LINK_LIBRARIES}
Qt5::Core Qt5::Network
)
@@ -122,8 +118,6 @@ set_target_properties( ${synclib_NAME} PROPERTIES
SOVERSION ${MIRALL_SOVERSION}
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
)
set_target_properties( ${synclib_NAME} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
install(TARGETS ${synclib_NAME}
@@ -133,10 +127,6 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
)
else()
install(TARGETS ${synclib_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
if (SPARKLE_FOUND)
install(DIRECTORY "${SPARKLE_LIBRARY}"
DESTINATION "${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks" USE_SOURCE_PERMISSIONS)
endif (SPARKLE_FOUND)
endif()

View File

@@ -463,7 +463,8 @@ bool Account::serverVersionUnsupported() const
// not detected yet, assume it is fine.
return false;
}
return serverVersionInt() < makeServerVersion(9, 1, 0);
// Older version which is not "end of life" according to https://github.com/owncloud/core/wiki/Maintenance-and-Release-Schedule
return serverVersionInt() < makeServerVersion(10, 0, 0) || serverVersion().endsWith("Nextcloud");
}
void Account::setServerVersion(const QString &version)

View File

@@ -379,11 +379,12 @@ bool HttpCredentials::refreshAccessToken()
QJsonParseError jsonParseError;
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString accessToken = json["access_token"].toString();
if (reply->error() != QNetworkReply::NoError || jsonParseError.error != QJsonParseError::NoError || json.isEmpty()) {
// Network error maybe?
if (jsonParseError.error != QJsonParseError::NoError || json.isEmpty()) {
// Invalid or empty JSON: Network error maybe?
qCWarning(lcHttpCredentials) << "Error while refreshing the token" << reply->errorString() << jsonData << jsonParseError.errorString();
} else if (accessToken.isEmpty()) {
// The token is no longer valid.
// If the json was valid, but the reply did not contain an access token, the token
// is considered expired. (Usually the HTTP reply code is 400)
qCDebug(lcHttpCredentials) << "Expired refresh token. Logging out";
_refreshToken.clear();
} else {

View File

@@ -90,7 +90,7 @@ int DiscoveryJob::isInSelectiveSyncBlackListCallback(void *data, const QByteArra
bool DiscoveryJob::checkSelectiveSyncNewFolder(const QString &path, RemotePermissions remotePerm)
{
if (_syncOptions._confirmExternalStorage
if (_syncOptions._confirmExternalStorage && !_syncOptions._newFilesAreVirtual
&& remotePerm.hasPermission(RemotePermissions::IsMounted)) {
// external storage.
@@ -113,7 +113,7 @@ bool DiscoveryJob::checkSelectiveSyncNewFolder(const QString &path, RemotePermis
}
auto limit = _syncOptions._newBigFolderSizeLimit;
if (limit < 0) {
if (limit < 0 || _syncOptions._newFilesAreVirtual) {
// no limit, everything is allowed;
return false;
}
@@ -331,7 +331,7 @@ static void propertyMapToFileStat(const QMap<QString, QString> &map, csync_file_
} else if (property == "dDC") {
file_stat->directDownloadCookies = value.toUtf8();
} else if (property == "permissions") {
file_stat->remotePerm = RemotePermissions(value);
file_stat->remotePerm = RemotePermissions::fromServerString(value);
} else if (property == "checksums") {
file_stat->checksumHeader = findBestChecksum(value.toUtf8());
} else if (property == "share-types" && !value.isEmpty()) {
@@ -355,12 +355,16 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, con
// The first entry is for the folder itself, we should process it differently.
_ignoredFirst = true;
if (map.contains("permissions")) {
RemotePermissions perm(map.value("permissions"));
auto perm = RemotePermissions::fromServerString(map.value("permissions"));
emit firstDirectoryPermissions(perm);
_isExternalStorage = perm.hasPermission(RemotePermissions::IsMounted);
}
if (map.contains("data-fingerprint")) {
_dataFingerprint = map.value("data-fingerprint").toUtf8();
if (_dataFingerprint.isEmpty()) {
// Placeholder that means that the server supports the feature even if it did not set one.
_dataFingerprint = "[empty]";
}
}
} else {
// Remove <webDAV-Url>/folder/ from <webDAV-Url>/folder/subfile.txt
@@ -377,13 +381,11 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, con
std::unique_ptr<csync_file_stat_t> file_stat(new csync_file_stat_t);
file_stat->path = file.toUtf8();
file_stat->size = -1;
file_stat->modtime = -1;
propertyMapToFileStat(map, file_stat.get());
if (file_stat->type == ItemTypeDirectory)
file_stat->size = 0;
if (file_stat->type == ItemTypeSkip
|| file_stat->size == -1
|| file_stat->modtime == -1
|| file_stat->remotePerm.isNull()
|| file_stat->etag.isEmpty()
|| file_stat->file_id.isEmpty()) {
@@ -663,7 +665,7 @@ csync_vio_handle_t *DiscoveryJob::remote_vio_opendir_hook(const char *url,
qCDebug(lcDiscovery) << directoryResult->code << "when opening" << url << "msg=" << directoryResult->msg;
errno = directoryResult->code;
// save the error string to the context
discoveryJob->_csync_ctx->error_string = qstrdup(directoryResult->msg.toUtf8().constData());
discoveryJob->_csync_ctx->error_string = directoryResult->msg;
return NULL;
}

View File

@@ -423,7 +423,7 @@ void CheckServerJob::onTimedOut()
QString CheckServerJob::version(const QJsonObject &info)
{
return info.value(QLatin1String("version")).toString();
return info.value(QLatin1String("version")).toString() + "-" + info.value(QLatin1String("productname")).toString();
}
QString CheckServerJob::versionString(const QJsonObject &info)

View File

@@ -695,6 +695,7 @@ bool OwncloudPropagator::createConflict(const SyncFileItemPtr &item,
ConflictRecord conflictRecord;
conflictRecord.path = conflictFileName.toUtf8();
conflictRecord.baseModtime = item->_previousModtime;
conflictRecord.initialBasePath = item->_file.toUtf8();
SyncJournalFileRecord baseRecord;
if (_journal->getFileRecord(item->_originalFile, &baseRecord) && baseRecord.isValid()) {

View File

@@ -36,6 +36,9 @@ public:
QPixmap wizardHeaderLogo() const Q_DECL_OVERRIDE;
#endif
// For owncloud-brandings *do* show the virtual files option.
bool showVirtualFilesOption() const override { return true; }
private:
};
}

View File

@@ -147,6 +147,7 @@ void GETFileJob::newReplyHook(QNetworkReply *reply)
connect(reply, &QNetworkReply::metaDataChanged, this, &GETFileJob::slotMetaDataChanged);
connect(reply, &QIODevice::readyRead, this, &GETFileJob::slotReadyRead);
connect(reply, &QNetworkReply::finished, this, &GETFileJob::slotReadyRead);
connect(reply, &QNetworkReply::downloadProgress, this, &GETFileJob::downloadProgress);
}
@@ -165,6 +166,9 @@ void GETFileJob::slotMetaDataChanged()
// If the status code isn't 2xx, don't write the reply body to the file.
// For any error: handle it when the job is finished, not here.
if (httpStatus / 100 != 2) {
// Disable the buffer limit, as we don't limit the bandwidth for error messages.
// (We are only going to do a readAll() at the end.)
reply()->setReadBufferSize(0);
_device->close();
return;
}
@@ -268,7 +272,7 @@ void GETFileJob::slotReadyRead()
int bufferSize = qMin(1024 * 8ll, reply()->bytesAvailable());
QByteArray buffer(bufferSize, Qt::Uninitialized);
while (reply()->bytesAvailable() > 0) {
while (reply()->bytesAvailable() > 0 && _saveBodyToFile) {
if (_bandwidthChoked) {
qCWarning(lcGetJob) << "Download choked";
break;
@@ -292,7 +296,7 @@ void GETFileJob::slotReadyRead()
return;
}
if (_device->isOpen() && _saveBodyToFile) {
if (_device->isOpen()) {
qint64 w = _device->write(buffer.constData(), r);
if (w != r) {
_errorString = _device->errorString();
@@ -304,7 +308,7 @@ void GETFileJob::slotReadyRead()
}
}
if (reply()->isFinished() && reply()->bytesAvailable() == 0) {
if (reply()->isFinished() && (reply()->bytesAvailable() == 0 || !_saveBodyToFile)) {
qCDebug(lcGetJob) << "Actually finished!";
if (_bandwidthManager) {
_bandwidthManager->unregisterDownloadJob(this);
@@ -351,10 +355,13 @@ void PropagateDownloadFile::start()
if (_item->_type == ItemTypeVirtualFile) {
auto fn = propagator()->getFilePath(_item->_file);
qCDebug(lcPropagateDownload) << "creating virtual file" << fn;
// NOTE: Other places might depend on contents of placeholder files (like csync_update)
QFile file(fn);
file.open(QFile::ReadWrite | QFile::Truncate);
file.write(" ");
file.close();
FileSystem::setModTime(fn, _item->_modtime);
updateMetadata(false);
return;
}
@@ -660,10 +667,11 @@ void PropagateDownloadFile::slotGetFinished()
// the database yet!)
if (job->reply()->rawHeader("OC-Conflict") == "1") {
_conflictRecord.path = _item->_file.toUtf8();
_conflictRecord.initialBasePath = job->reply()->rawHeader("OC-ConflictInitialBasePath");
_conflictRecord.baseFileId = job->reply()->rawHeader("OC-ConflictBaseFileId");
_conflictRecord.baseEtag = _job->reply()->rawHeader("OC-ConflictBaseEtag");
_conflictRecord.baseEtag = job->reply()->rawHeader("OC-ConflictBaseEtag");
auto mtimeHeader = _job->reply()->rawHeader("OC-ConflictBaseMtime");
auto mtimeHeader = job->reply()->rawHeader("OC-ConflictBaseMtime");
if (!mtimeHeader.isEmpty())
_conflictRecord.baseModtime = mtimeHeader.toLongLong();

View File

@@ -88,11 +88,20 @@ void PropagateRemoteMove::start()
return;
}
QString source = propagator()->_remoteFolder + _item->_file;
QString destination = QDir::cleanPath(propagator()->account()->url().path() + QLatin1Char('/')
+ propagator()->account()->davPath() + propagator()->_remoteFolder + _item->_renameTarget);
_job = new MoveJob(propagator()->account(),
propagator()->_remoteFolder + _item->_file,
destination, this);
if (_item->_type == ItemTypeVirtualFile || _item->_type == ItemTypeVirtualFileDownload) {
auto suffix = propagator()->syncOptions()._virtualFileSuffix;
ASSERT(source.endsWith(suffix) && destination.endsWith(suffix));
if (source.endsWith(suffix) && destination.endsWith(suffix)) {
source.chop(suffix.size());
destination.chop(suffix.size());
}
}
qCDebug(lcPropagateRemoteMove) << source << destination;
_job = new MoveJob(propagator()->account(), source, destination, this);
connect(_job.data(), &MoveJob::finishedSignal, this, &PropagateRemoteMove::slotMoveJobFinished);
propagator()->_activeJobList.append(this);
_job->start();

View File

@@ -564,6 +564,8 @@ void PropagateUploadFileCommon::slotJobDestroyed(QObject *job)
// This function is used whenever there is an error occuring and jobs might be in progress
void PropagateUploadFileCommon::abortWithError(SyncFileItem::Status status, const QString &error)
{
if (_aborting)
return;
abort(AbortType::Synchronous);
done(status, error);
}
@@ -599,6 +601,8 @@ QMap<QByteArray, QByteArray> PropagateUploadFileCommon::headers()
auto conflictRecord = propagator()->_journal->conflictRecord(_item->_file.toUtf8());
if (conflictRecord.isValid()) {
headers["OC-Conflict"] = "1";
if (!conflictRecord.initialBasePath.isEmpty())
headers["OC-ConflictInitialBasePath"] = conflictRecord.initialBasePath;
if (!conflictRecord.baseFileId.isEmpty())
headers["OC-ConflictBaseFileId"] = conflictRecord.baseFileId;
if (conflictRecord.baseModtime != -1)
@@ -634,6 +638,10 @@ void PropagateUploadFileCommon::abortNetworkJobs(
PropagatorJob::AbortType abortType,
const std::function<bool(AbstractNetworkJob *)> &mayAbortJob)
{
if (_aborting)
return;
_aborting = true;
// Count the number of jobs that need aborting, and emit the overall
// abort signal when they're all done.
QSharedPointer<int> runningCount(new int(0));

View File

@@ -209,6 +209,14 @@ protected:
QVector<AbstractNetworkJob *> _jobs; /// network jobs that are currently in transit
bool _finished BITFIELD(1); /// Tells that all the jobs have been finished
bool _deleteExisting BITFIELD(1);
/** Whether an abort is currently ongoing.
*
* Important to avoid duplicate aborts since each finishing PUTFileJob might
* trigger an abort on error.
*/
bool _aborting BITFIELD(1);
QByteArray _transmissionChecksumHeader;
public:
@@ -216,6 +224,7 @@ public:
: PropagateItemJob(propagator, item)
, _finished(false)
, _deleteExisting(false)
, _aborting(false)
{
}

View File

@@ -83,7 +83,8 @@ void PropagateUploadFileNG::doStartUpload()
propagator()->_activeJobList.append(this);
const SyncJournalDb::UploadInfo progressInfo = propagator()->_journal->getUploadInfo(_item->_file);
if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime) {
if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime
&& progressInfo._size == qint64(_item->_size)) {
_transferId = progressInfo._transferid;
auto url = chunkUrl();
auto job = new LsColJob(propagator()->account(), url, this);
@@ -239,6 +240,7 @@ void PropagateUploadFileNG::startNewUpload()
pi._transferid = _transferId;
pi._modtime = _item->_modtime;
pi._contentChecksum = _item->_checksumHeader;
pi._size = _item->_size;
propagator()->_journal->setUploadInfo(_item->_file, pi);
propagator()->_journal->commit("Upload info");
QMap<QByteArray, QByteArray> headers;

View File

@@ -43,7 +43,7 @@ void PropagateUploadFileV1::doStartUpload()
const SyncJournalDb::UploadInfo progressInfo = propagator()->_journal->getUploadInfo(_item->_file);
if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime
if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime && progressInfo._size == qint64(_item->_size)
&& (progressInfo._contentChecksum == _item->_checksumHeader || progressInfo._contentChecksum.isEmpty() || _item->_checksumHeader.isEmpty())) {
_startChunk = progressInfo._chunk;
_transferId = progressInfo._transferid;
@@ -59,6 +59,7 @@ void PropagateUploadFileV1::doStartUpload()
pi._modtime = _item->_modtime;
pi._errorCount = 0;
pi._contentChecksum = _item->_checksumHeader;
pi._size = _item->_size;
propagator()->_journal->setUploadInfo(_item->_file, pi);
propagator()->_journal->commit("Upload info");
}
@@ -285,6 +286,7 @@ void PropagateUploadFileV1::slotPutFinished()
pi._modtime = _item->_modtime;
pi._errorCount = 0; // successful chunk upload resets
pi._contentChecksum = _item->_checksumHeader;
pi._size = _item->_size;
propagator()->_journal->setUploadInfo(_item->_file, pi);
propagator()->_journal->commit("Upload info");
startNextChunk();

Some files were not shown because too many files have changed in this diff Show More