1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-03 18:11:32 +02:00

Compare commits

...

452 Commits

Author SHA1 Message Date
Markus Goetz
107baf2947 VERSION.cmake: 2.5.0-alpha1
The 2.5.0-alpha was having a showstopper bug #6553
2018-05-30 13:51:33 +02:00
Olivier Goffart
40d432ecdd .desktop file: the MimeType entry must ends with a semi colon
Also remove some comments
2018-05-30 13:38:45 +02:00
Olivier Goffart
1753ce651b Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2018-05-30 11:57:57 +02:00
Markus Goetz
104f8c9ba2 NSIS: SVG imageformats plugin DLL #6515 2018-05-30 11:56:41 +02:00
Markus Goetz
7a776dbb6a NSIS: SVG DLL #6515 2018-05-30 11:56:41 +02:00
Christian Kamm
3a7a6b0b9e Virtual files: Wipe virtual after download completes, not before
Otherwise a interrupted or unsuccessful download would mean that the
download-intend was forgotten. The next sync would reestablish the
virtual file instead.
2018-05-30 11:50:14 +02:00
Olivier Goffart
d7792dc951 Rename SocketApi::FileData::accountRelativePath to serverRelativePath
As discussed in issue #6552
2018-05-30 10:51:44 +02:00
Olivier Goffart
1434fa5139 Share dialog: use the original name and not the virtual file name
When sharing a virtual file, we should actually use the original file name
not the virtual file name

Issue: #6461
2018-05-30 10:51:17 +02:00
Christian Kamm
252484e875 Virtual files: Only remove virtual file once on download
With thanks to @ogoffart for spotting the problem.
2018-05-30 10:39:49 +02:00
Olivier Goffart
94535a75d9 Update submodule 2018-05-30 09:10:27 +02:00
Jenkins for ownCloud
91044fee81 [tx-robot] updated from transifex 2018-05-30 02:18:42 +02:00
Olivier Goffart
47aa1ade71 Fix make doc-man in shadow build
Issue #6555
2018-05-29 16:12:58 +02:00
Olivier Goffart
7ba48849c6 Windows Shell extention: Fix clicking on the menu entries
Issue #6553
2018-05-29 14:51:28 +02:00
Jenkins for ownCloud
ce1aa6af53 [tx-robot] updated from transifex 2018-05-29 02:18:40 +02:00
Olivier Goffart
7aded05f40 Fix compilation warning
propagateuploadng.cpp:500:10: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
2018-05-28 14:55:34 +02:00
Jenkins for ownCloud
f7b5665bce [tx-robot] updated from transifex 2018-05-28 02:18:41 +02:00
Jenkins for ownCloud
1a4ce88afb [tx-robot] updated from transifex 2018-05-27 02:18:39 +02:00
Jenkins for ownCloud
11ae820db1 [tx-robot] updated from transifex 2018-05-26 02:18:49 +02:00
Olivier Goffart
46077f0de2 Merge remote-tracking branch 'owncloud/master' into 2.5 2018-05-25 18:09:56 +02:00
Dominik Schmidt
13d0595296 Update libcrashreporter-qt to build it with msvc
(cherry picked from commit b9323bd191)
2018-05-25 15:36:54 +02:00
Markus Goetz
88abf43bda ChangeLog: More entries 2018-05-25 15:32:16 +02:00
Christian Kamm
de77514671 AccountWizard: Reserve space for error label #6546 2018-05-25 08:44:03 +02:00
Jenkins for ownCloud
5c69130300 [tx-robot] updated from transifex 2018-05-25 02:18:51 +02:00
Markus Goetz
74e412c789 owncloudsynclog: 1 MB -> 10 MB #6420 2018-05-24 16:02:52 +02:00
Christian Kamm
5811c74f9c Settings migration: Preserve future settings where possible
See discussion in #6506
2018-05-24 12:18:44 +02:00
Christian Kamm
57a2881906 Config: Add version flags to accounts and folders
Also, if there is too-new configuration, backup the file, show a
warning message asking the user whether it's ok to discard the
configuration from the future.

See #6504
2018-05-24 12:18:44 +02:00
Olivier Goffart
c625d8e3b7 Credentials: Retry fetching from the keychain in case the keychain is still starting
When owncloud is restored, at boot time, it might be started before the
crendential manager. So if we detect an error, wait 10 seconds and hopefully
it'd be loaded by then.

Issues: #4274, #6522
2018-05-24 12:10:55 +02:00
Christian Kamm
53f52b4cf5 Settings: Add warning when switching update channel 2018-05-24 12:09:40 +02:00
Christian Kamm
293c2b4f79 Updater: Make sparkle updater respect release channel 2018-05-24 12:09:40 +02:00
Markus Goetz
29349d4b3a Auto Updater: Show UI element also on macOS
(cherry picked from commit dfdc2e1e87f99d387a042f4983c999fbb7fcf3d9)
2018-05-24 12:09:40 +02:00
Christian Kamm
7790953a2c Settings: Add update channel combobox #6259 2018-05-24 12:09:40 +02:00
Jenkins for ownCloud
e3083d6791 [tx-robot] updated from transifex 2018-05-24 02:18:53 +02:00
Dominik Schmidt
b9323bd191 Update libcrashreporter-qt to build it with msvc 2018-05-23 16:59:34 +02:00
Christian Kamm
8f9f2b5462 Rename Placeholders to Virtual Files in code #6531 2018-05-23 09:57:00 +02:00
Jenkins for ownCloud
70b1deb226 [tx-robot] updated from transifex 2018-05-23 02:18:39 +02:00
Jenkins for ownCloud
2b112b8dcf [tx-robot] updated from transifex 2018-05-22 02:18:40 +02:00
Jenkins for ownCloud
9350b4458c [tx-robot] updated from transifex 2018-05-21 02:18:39 +02:00
Jenkins for ownCloud
2870715fff [tx-robot] updated from transifex 2018-05-20 02:18:40 +02:00
Jenkins for ownCloud
b0aa3a1da0 [tx-robot] updated from transifex 2018-05-19 02:18:42 +02:00
Christian Kamm
0cd2540a69 Add to and rearrange the Changelog for 2.5 2018-05-18 07:43:43 +02:00
Jenkins for ownCloud
e680b3f3c8 [tx-robot] updated from transifex 2018-05-18 02:19:19 +02:00
Christian Kamm
2493cbe491 SyncJournal: Explain added file-exists check 2018-05-17 15:02:52 +02:00
Christian Kamm
394ef439e0 Merge branch 'master' into 2.5 2018-05-17 13:23:20 +02:00
Markus Goetz
309c53ca8f macOS: Don't use WAL for sqlite3 in /Volumes
For #6049
2018-05-17 13:19:30 +02:00
Christian Kamm
2638332dc6 Upload: Adjust timeout for final job based on size #6527
Some servers have virus scanners and the like that can delay the
response of the final chunked upload assembly significantly, often
breaking the current 5min (!) timeout. See owncloud/enterprise#2480
for details.
2018-05-17 13:14:37 +02:00
Christian Kamm
5308fc4148 Propagation: Connection closed is a normal error #6516
Because it sometimes appears in conjunction with server bugs and we
don't want to halt all syncing for other files in these cases.
2018-05-17 13:14:20 +02:00
Christian Kamm
ad5fbfe05b Wizard: Add a "(recommended)" to the main option #6470 2018-05-17 13:14:03 +02:00
Christian Kamm
b1224cff0c SyncJournal: Check file existence even for open dbs #6049
With WAL mode sqlite seems to occasionally crash when the
underlying filesystem goes away.
2018-05-17 13:08:42 +02:00
Jenkins for ownCloud
ce06c96135 [tx-robot] updated from transifex 2018-05-17 02:19:19 +02:00
Christian Kamm
1c4592339a Rename "placeholder" feature 2018-05-16 12:52:32 +02:00
Markus Goetz
0365653055 Sparkle: Delegate calls work now with 1.18.1 (maybe even before)
We can extend on this to give UI feedback.
2018-05-16 11:29:27 +02:00
Jenkins for ownCloud
d8078d43fb [tx-robot] updated from transifex 2018-05-16 02:19:12 +02:00
Olivier Goffart
fabc706e43 SyncRunFileLog: Add the requestid
https://github.com/owncloud/client/pull/6427#issuecomment-383879509
2018-05-15 18:11:01 +02:00
Olivier Goffart
e7e8a62bb7 Blacklist: remember the X-Request-ID
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
2018-05-15 18:11:01 +02:00
Christian Kamm
f396f2f41d IgnoreEditor: Preserve comments, add #!readonly
Useful in case we ever want to make use of directives inside the ignore
list.
2018-05-15 14:26:35 +02:00
Christian Kamm
8d14f4357a Placeholder: Stop adding ignore pattern
Because we can't make older clients preserve the version directive that
was attached to it.

See #6504 and #6498
2018-05-15 14:26:35 +02:00
Christian Kamm
34d40e6c67 Placeholder: Don't contain "stub" 2018-05-15 14:26:35 +02:00
Christian Kamm
c80ee0ea48 Placeholders: Save to key that's invisible to <2.5 clients #6504 2018-05-15 14:26:35 +02:00
Olivier Goffart
fb71a90756 FolderWizard: fix crash when experimental feature are disabled
The _placeholderCheckBox only exists if the experimental features are enabled

Found via the crash reporter
https://sentry.io/owncloud/desktop-win-and-mac/issues/556407777/
2018-05-15 12:33:09 +02:00
Olivier Goffart
41dc87c748 Update binary submodule 2018-05-15 12:18:54 +02:00
Christian Kamm
8b952d3741 TestChunkingNG: Remove unneeded test code 2018-05-15 09:42:54 +02:00
Christian Kamm
33b0726390 PropagateUpload: Fix miscount in abort() #6516
Previously it tried to abort even jobs that had already finished, which
was not going to work as they wouldn't emit finished() again.

Also, in some cases the abortCount would never go to zero and that case
wasn't well documented.
2018-05-15 09:42:54 +02:00
Christian Kamm
40e23d3da7 PropagateUpload: Remove unused PropagateUploadFileCommon::abort 2018-05-15 09:42:54 +02:00
Jenkins for ownCloud
97ff3dccb8 [tx-robot] updated from transifex 2018-05-15 02:18:53 +02:00
Dominik Schmidt
fd18ece619 Use newer craft cache 2018-05-14 13:40:12 +02:00
Dominik Schmidt
fe5e5fcb32 Fix for png2ico 2018-05-14 13:40:12 +02:00
Dominik Schmidt
0f57326057 Fix create_windows_icon_and_rc invocation for png2ico 2018-05-14 13:40:12 +02:00
Dominik Schmidt
886f31456a Add FindIcoTool.cmake 2018-05-14 13:40:12 +02:00
Dominik Schmidt
2d7841204c Support icotool in ECMAddAppIcon macro 2018-05-14 13:40:12 +02:00
Olivier Goffart
5f6f5f5789 Merge remote-tracking branch 'origin/2.5' 2018-05-14 09:46:15 +02:00
Olivier Goffart
64e351c6d3 Merge remote-tracking branch 'origin/2.5' 2018-05-14 09:44:42 +02:00
Christian Kamm
5e4aca8988 ShareLink: Preserve password when unrelated ui changes #6512 2018-05-14 09:44:21 +02:00
Christian Kamm
d917f52779 Remove debug code 2018-05-14 09:37:28 +02:00
Jenkins for ownCloud
cca7914204 [tx-robot] updated from transifex 2018-05-14 02:18:41 +02:00
Jenkins for ownCloud
974b6a8845 [tx-robot] updated from transifex 2018-05-13 02:18:40 +02:00
Jenkins for ownCloud
52aa5754c3 [tx-robot] updated from transifex 2018-05-12 02:18:39 +02:00
Jenkins for ownCloud
2bfcd60d18 [tx-robot] updated from transifex 2018-05-11 02:18:42 +02:00
Jenkins for ownCloud
2e64b291da [tx-robot] updated from transifex 2018-05-10 02:18:42 +02:00
Jenkins for ownCloud
ce42080cc7 [tx-robot] updated from transifex 2018-05-09 02:18:31 +02:00
Matthew Setter
600a98e2e9 Merge pull request #6502 from owncloud/correct-osx-ui-nomenclature
Correct incorrect reference to OSX Menu bar
2018-05-08 14:17:37 +02:00
Matthew Setter
a547e228d3 Correct incorrect reference to OSX Menu bar
This fixes https://github.com/owncloud/documentation/issues/4109.
2018-05-08 14:17:12 +02:00
Jenkins for ownCloud
369d833610 [tx-robot] updated from transifex 2018-05-08 02:18:32 +02:00
Jenkins for ownCloud
80e0f03f1b [tx-robot] updated from transifex 2018-05-07 02:18:30 +02:00
Jenkins for ownCloud
63935f086d [tx-robot] updated from transifex 2018-05-06 02:18:33 +02:00
Jenkins for ownCloud
905877ecc0 [tx-robot] updated from transifex 2018-05-05 02:18:31 +02:00
Jenkins for ownCloud
af4e40c3fc [tx-robot] updated from transifex 2018-05-04 02:18:32 +02:00
Christian Kamm
e9ac35b2e5 Doc: Adjust step-by-step guide for creating log files #6442 2018-05-03 11:13:03 +02:00
Matthew Setter
ce260909a8 Merge pull request #6505 from owncloud/integrate-external-themes-repo
Integrate external themes repository
2018-05-03 10:18:12 +02:00
Samuel Alfageme
d1304b2c05 Set copyright's upper bound dynamically based on the compilation date
Ref. https://github.com/owncloud/client/pull/6505\#discussion_r185712624
2018-05-03 09:39:56 +02:00
Samuel Alfageme
6b3f9ee4c9 Remove the outdated submodule reference from the git tree
This completes the rename started in 0ce287d96d
	- As suggested in https://github.com/owncloud/client/pull/6505\#discussion_r185496084

Also, fixes its reference on CMakeLists.txt so the whole thing builds again
2018-05-03 09:20:45 +02:00
Jenkins for ownCloud
b7eb9b2040 [tx-robot] updated from transifex 2018-05-03 02:18:34 +02:00
Matthew Setter
0ce287d96d Use external theme in documentation 2018-05-02 21:40:49 +02:00
Samuel Alfageme
5e13d519d9 Use HTTPS rather than SSH schema for the _shared_assets submodule 2018-05-02 16:56:44 +02:00
Samuel Alfageme
2c53025b0a Removed CMake-generated files and referenced the right themes path
- i.e. Makefile and conf.py (generated via pyconfigure's conf.py.in) - included both into local .gitignore
- Fixed the reference to _shared_assets in the CMake script and the copyright used in the metadata.
2018-05-02 13:49:49 +02:00
Samuel Alfageme
0d51b32722 Fix broken LTS link to point to Ubuntu's release policy
- To fix make's client/doc/installing.rst:39: ERROR: Unknown target name: 'lts' on build.
- Also removed references to wizard's last page after https://github.com/owncloud/client/pull/5729
2018-05-02 13:12:04 +02:00
Matthew Setter
489342018f Use external theme in documentation 2018-05-02 12:06:32 +02:00
Matthew Setter
e5dd54d4f4 Add the docs-themes repository as a submodule
This provides a simpler way of integrating the external theme.
Relates to:

- owncloud/client#6163
- owncloud/client#6169
- #3240
- owncloud/client#6497
2018-05-02 12:04:14 +02:00
Jenkins for ownCloud
f470b045d7 [tx-robot] updated from transifex 2018-05-02 02:18:34 +02:00
Jenkins for ownCloud
2b7a726acf [tx-robot] updated from transifex 2018-05-01 02:18:33 +02:00
Jenkins for ownCloud
7cac493a6e [tx-robot] updated from transifex 2018-04-30 02:18:31 +02:00
Jenkins for ownCloud
ad917d038f [tx-robot] updated from transifex 2018-04-29 02:18:35 +02:00
Jenkins for ownCloud
7710b66498 [tx-robot] updated from transifex 2018-04-28 02:18:31 +02:00
Jenkins for ownCloud
0a14fce639 [tx-robot] updated from transifex 2018-04-27 02:18:33 +02:00
Christian Kamm
642ed1bb70 Merge remote-tracking branch 'origin/master' into 2.5 2018-04-26 10:16:45 +02:00
Christian Kamm
3f9c10e641 Proxy settings: Fix bad behavior with empty host
Fixes f6a075ef54 for #5885

When no host is given it shouldn't just *appear* that there is no
proxy, there actually shouldn't be a proxy set then.
2018-04-26 10:07:05 +02:00
Jenkins for ownCloud
4327fede32 [tx-robot] updated from transifex 2018-04-26 02:18:37 +02:00
Markus Goetz
8b45fbfdab Share Dialog: Disable workaround for macOS too #6185 2018-04-25 19:32:01 +02:00
Olivier Goffart
2696c520bd Wizard: fix a layout glitch 2018-04-25 14:47:56 +02:00
Olivier Goffart
1ab3a9fc13 Nautilus: Fix Python3 and remove many debug
Use b'\n' in the call to rfind, as the _remainder is bytes, not a string.

Remove most of the debug message which happens during normal operation.
They are mostly spamming the nautilus console, and can also cause bug
as they may throw exception in case of wrong encoding.

Relates to issue: #6406
2018-04-25 13:58:45 +02:00
Markus Goetz
9d4ece4b3a ShareDialog: macOS grey odditiy #5774 2018-04-25 13:56:19 +02:00
Christian Kamm
e9db52a378 Issues: Show link to conflicts doc if there are some #6396
The link url is themed.
2018-04-25 13:31:49 +02:00
Christian Kamm
fc73cde10c Merge branch 'master' into 2.5 2018-04-25 12:30:31 +02:00
Christian Kamm
44071f0892 Nautilus shell integration: Print python version on startup #6406 2018-04-25 12:26:18 +02:00
Jenkins for ownCloud
529649254b [tx-robot] updated from transifex 2018-04-25 02:18:37 +02:00
Samuel Alfageme
1ec5d5b0cf Fix 'client/doc/conffile.rst:36: ERROR: Malformed table' 2018-04-24 16:13:45 +02:00
Olivier Goffart
7053a9c3d9 Update installing.rst 2018-04-24 13:33:56 +02:00
Jürgen Weigert
5ccf5fd9a1 update supported linux platforms 2018-04-24 13:33:56 +02:00
Adrien
6520263244 Fix #6394 2018-04-24 13:27:33 +02:00
Christian Kamm
9555f8d75c Show a tray message when a folder watcher becomes unreliable #6119 2018-04-24 13:06:50 +02:00
Olivier Goffart
073de7a8e0 Merge remote-tracking branch 'origin/2.5' 2018-04-24 13:02:37 +02:00
Thomas Boerger
397206134f Dropped .travis.yml from repo 2018-04-24 12:54:22 +02:00
Thomas Boerger
a12986a952 Build clang and gcc on drone 2018-04-24 12:54:22 +02:00
Thomas Boerger
5270b76520 Dropped .travis.yml from repo 2018-04-24 12:52:27 +02:00
Thomas Boerger
f0dae03d06 Build clang and gcc on drone 2018-04-24 12:52:27 +02:00
Christian Kamm
4268f793fb Share dialog: Don't hide account settings before showing #6185
At least on windows and linux. OSX would need tests first since
the addition was originally supposed to help with OSX problems,
see #3783.
2018-04-24 10:09:23 +02:00
Olivier Goffart
1ef7ca1b09 sqlite: Update bundled version to 3.23.1
For OS X and Windows.
2018-04-24 09:16:06 +02:00
Jenkins for ownCloud
dd5265a5f8 [tx-robot] updated from transifex 2018-04-24 02:18:31 +02:00
Jenkins for ownCloud
84a692435e [tx-robot] updated from transifex 2018-04-23 15:28:10 +02:00
Olivier Goffart
c1fb5e6b20 Wizard: Move the 'Skip folder configuration' in a radio button
Issue #3664
2018-04-23 13:29:01 +02:00
Olivier Goffart
e0b554ada9 Fix a bunch of warning with clang
The option -Wno-discarded-qualifiers only exists with GCC, clang warns that
it has no effects.

Also it warns when some virtual fuction are marked with override but not
all of them.
2018-04-23 13:22:01 +02:00
Christian Kamm
1508b562ad SocketAPI: Allow opening share dialog if contents still syncing #4608
With the previous changes the "Share..." action was shown but it didn't
work yet.
2018-04-23 12:24:32 +02:00
Christian Kamm
4390bbf838 SocketAPI: Remove SHARE_STATUS
It was never used by a shell integration.
2018-04-23 12:24:32 +02:00
Jenkins for ownCloud
a4d049464b [tx-robot] updated from transifex 2018-04-23 02:18:31 +02:00
Jenkins for ownCloud
0073b7581f [tx-robot] updated from transifex 2018-04-22 02:18:33 +02:00
Jenkins for ownCloud
1ce3e4c27a [tx-robot] updated from transifex 2018-04-21 02:18:32 +02:00
Markus Goetz
69e5d55956 Logging: Avoid the word "Error"
The old code printed "QNetworkReply::NoError"
2018-04-20 15:26:34 +02:00
Christian Kamm
7cce30942e CMake: Add a default placeholder_suffix
To make themes work that don't define it explicitly.
2018-04-20 15:08:08 +02:00
Jenkins for ownCloud
71db7fef77 [tx-robot] updated from transifex 2018-04-20 02:18:32 +02:00
Markus Goetz
b6f1ba38a6 Placeholders: Support for macOS #6290 2018-04-19 19:24:29 +02:00
Christian Kamm
f6a075ef54 Network settings: If no proxy host given, show "no proxy" #5885
What happens internally is that a proxy without a hostname gets treated
as no proxy.
2018-04-19 17:04:56 +02:00
Olivier Goffart
c5701f635a Fix test: QTemporaryDir::filePath was added in Qt 5.9 2018-04-19 17:01:31 +02:00
Olivier Goffart
2bf1f27c80 More Button: Use SVG and fix size so it renders good in highdpi
When the more button was changed from using a text to an icon,
the size computation was not adjusted proerly to that of a button
with an icon.

And using svg allows it to be rendered correctly with high-dpi

It looks much much nicer now
2018-04-19 16:44:11 +02:00
Christian Kamm
a5271b529b LocalDiscoveryTracker: Add unit test #6120 2018-04-19 10:58:46 +02:00
Christian Kamm
7c558394c1 LocalDiscoveryTracker: Separate from Folder and move to libsync
To allow relevant code to be closer together and for testing in
unittests without having to get a gui Folder.

See #6120
2018-04-19 10:58:46 +02:00
Jenkins for ownCloud
d2d5439c5c [tx-robot] updated from transifex 2018-04-19 02:18:39 +02:00
Olivier Goffart
c82aa10a66 ChangeLog: update for 2.5 2018-04-18 15:04:56 +02:00
Olivier Goffart
38f1c5b7d2 Logger: Guard zlib usage by ZLIB_FOUND
Similar to the use for the checksum.
I know that zlib is required in principle, but i don't have it
in one of my test building environment, and it is easier to just
disable it.
2018-04-18 15:01:30 +02:00
Christian Kamm
985a657f48 Merge remote-tracking branch 'origin/master' 2018-04-18 11:14:08 +02:00
Christian Kamm
9e8464e114 Merge branch 'placeholder-prototype' 2018-04-18 11:02:53 +02:00
Olivier Goffart
02b818af04 Download: Use the <s:message> from the reply in the error message if any
Issue: #6459
2018-04-18 10:57:16 +02:00
Olivier Goffart
0fdfb2cba3 Add a test for resuming downloads 2018-04-18 10:57:16 +02:00
Christian Kamm
a9561f494b Doc: Add showExperimentalOptions to conffile.rst 2018-04-18 10:27:51 +02:00
Christian Kamm
b7412a4f09 Wizards: Show placeholder option only if showExperimentalOptions is set
This config file option will also control other features in the future.
2018-04-18 10:27:51 +02:00
Christian Kamm
ba1309b3a4 Wizards: Add placeholder option and warning to account wizard
Also add the warning dialog to the option in the folder wizard.
2018-04-18 10:27:51 +02:00
Christian Kamm
70b4dc99dc NSIS: Register placeholder extension
Also change the placeholder suffix config option to not include the dot,
the dotless form is needed in the nsis script.
2018-04-18 10:27:51 +02:00
Christian Kamm
65a2b1aa8a Placeholders: Fix migration issues
Some edgecases weren't covered and didn't have tests yet.
2018-04-18 10:27:51 +02:00
Christian Kamm
fb3e3edcbd SyncOptions: Add default placeholder suffix
Otherwise each test has to set this up anew.
2018-04-18 10:27:51 +02:00
Christian Kamm
c2f84d7c3e Placeholders: Ignore placeholder files in older clients
To do this, we add the placeholder extension to the user exclude file
automatically. However, newer clients shouldn't use that exclude
pattern: so we also add version directives that allow making exclude
patterns dependent on the client version.
2018-04-18 10:27:51 +02:00
Christian Kamm
8358dabbfd Folder: Simplify relative path computation
It was done manually in several places after folderForPath() calls.
2018-04-18 10:27:51 +02:00
Christian Kamm
8b6ae04155 Placeholders: Download from shell integration 2018-04-18 10:27:51 +02:00
Olivier Goffart
87433bfe87 Placeholder: The extension is now a branding option 2018-04-18 10:27:51 +02:00
Olivier Goffart
9bd583b0e5 Placeholders: Fixup clicking on placeholder after previous change
Now that the name in the db is the name of the placeholder file,
we need to adjust the call to downloadPlaceholder
2018-04-18 10:27:51 +02:00
Christian Kamm
01bb241e48 Placeholders: Safe migration to older client versions
Now the db entries for placeholders will have the full placeholder
paths. That way older clients will, on remote discovery, delete the
placeholders and download the real files.
2018-04-18 10:27:51 +02:00
Christian Kamm
e2f2c9a153 Placeholders: Deal with conflicts when a placeholder exists
So "foo.owncloud" exists but the user adds a new "foo".
2018-04-18 10:27:51 +02:00
Olivier Goffart
a41d385607 Placeholders: install mimetype on linux 2018-04-18 10:27:51 +02:00
Olivier Goffart
a8b4526d65 Placeholders: Add an checkbox in the FolderWizard to enable the placeholder feature 2018-04-18 10:27:51 +02:00
Olivier Goffart
a2191474eb Placeholders: Move the placeholder option from the account to the folder 2018-04-18 10:27:51 +02:00
Olivier Goffart
cc8497916d PlaceHolders: Trigger a download of the placeholder and open it 2018-04-18 10:27:51 +02:00
Christian Kamm
798e60c9f6 On-demand downloading: Placeholder-file based prototype
- Controled by an option.
- New remote files start out as ItemTypePlaceholder, are created with a
  .owncloud extension.
- When their db entry is set to ItemTypePlaceholderDownload the next
  sync run will download them.
- Files that aren't in the placeholder state sync as usual.
- See test cases in testsyncplaceholders.

Missing:
- User ui for triggering placeholder file download
- Maybe: Going back from file to placeholder?
2018-04-18 10:27:51 +02:00
Christian Kamm
57044c1e02 Silence warning by removing unnecessary this capture 2018-04-18 10:26:22 +02:00
Jenkins for ownCloud
daa26d0c81 [tx-robot] updated from transifex 2018-04-18 02:18:35 +02:00
Markus Goetz
9ed937a6d3 Documentation: Update building.rst #6154 #5594 2018-04-17 19:03:08 +02:00
Markus Goetz
5509cd2504 Notifications: Also have clickable link #6236 2018-04-17 16:57:38 +02:00
Christian Kamm
fa6ac9da23 Upload: Add more chunk resuming unit tests #6405 2018-04-17 13:48:13 +02:00
Jenkins for ownCloud
78e80e5d46 [tx-robot] updated from transifex 2018-04-17 02:18:37 +02:00
Olivier Goffart
2c18ea0a89 Uploads: Don't delete unexisting chunks
Since commit 4dc49ff3, we store an entry in the upload info table even
for non chunked uploads. However, if this fails we don't want to remove
non-existant stale chunks if the upload fails.

Without this commit, we would send a DELETE command to clean non-existant
chunks in the dav/uploads/ namespace.
2018-04-16 12:00:12 +02:00
Christian Kamm
93d8810414 SocketApi/Sharing: Add "copy public link" to menu #6356
* The new menu option will fetch shares and create a new link share if
  no "context menu share" currently exists.
* Various cleanup of common operations in socketapi happened as well,
  in particular there's now FileData::get() that calculates all the
  relevant paths that are useful for most socketapi actions.
2018-04-16 08:37:44 +02:00
Markus Goetz
aaa00c1f30 Q_UNUSED: Sprinkle around 2018-04-13 17:15:37 +02:00
Markus Goetz
2728c49649 Notifications: Lower hiding timeout
With the 4.5sec timeout, it was very easy to accidently hit the wrong notification
when the previous one dissapeared so late.
2018-04-13 16:55:55 +02:00
Jenkins for ownCloud
1449426aee [tx-robot] updated from transifex 2018-04-13 02:18:37 +02:00
Markus Goetz
aceff1f863 macOS: Implement new dynamic Finder menu items #6328 2018-04-12 13:12:42 +02:00
Christian Kamm
113f56fdc5 Logging: Add persistent auto-logdir option #6442 2018-04-12 12:38:17 +02:00
Christian Kamm
bd9ec3dbee LogDir: Compress log when switching files #6442 2018-04-12 12:38:17 +02:00
Christian Kamm
6fcff62e95 LogDir: Go to new file on Problem/Abort too #6442 2018-04-12 12:38:17 +02:00
Jenkins for ownCloud
abc3667048 [tx-robot] updated from transifex 2018-04-12 02:18:34 +02:00
Markus Goetz
894686e66a macOS: Unload the Finder extension on exit #5382 #3819 2018-04-11 13:37:34 +02:00
Christian Kamm
db64b217b8 Doc: Explaining conflict files and resolving them #6396 2018-04-11 09:02:15 +02:00
Jenkins for ownCloud
7e5edac9ce [tx-robot] updated from transifex 2018-04-11 02:18:33 +02:00
Christian Kamm
ca36da6037 Doc: Remove out of date changelog copy 2018-04-10 09:20:22 +02:00
Christian Kamm
73777beb00 Doc: fix for new conflict tag 2018-04-10 09:17:05 +02:00
Christian Kamm
eef275a1e4 Folders: Use "Problem" icon for unresolved conflicts #6277 2018-04-10 08:38:59 +02:00
Jenkins for ownCloud
1114b8ce0a [tx-robot] updated from transifex 2018-04-10 02:18:37 +02:00
Olivier Goffart
716be66234 SyncJournalDb::setSelectiveSyncList: Always use a transaction
Issue #6431
2018-04-09 12:22:52 +02:00
Christian Kamm
2298ecca7c Share link: Update permission wording #6192 2018-04-09 12:16:40 +02:00
Jenkins for ownCloud
0f5a43797a [tx-robot] updated from transifex 2018-04-09 02:18:33 +02:00
Jenkins for ownCloud
268eae1da6 [tx-robot] updated from transifex 2018-04-08 02:18:31 +02:00
Jenkins for ownCloud
d128608f21 [tx-robot] updated from transifex 2018-04-07 02:18:31 +02:00
Jenkins for ownCloud
cbcd3a05e7 [tx-robot] updated from transifex 2018-04-06 02:18:37 +02:00
Olivier Goffart
42b254785e Theme: unify ownCloudTheme and Theme classes
The goal is to avoid confusion described in issue #6422 by removing
duplicates between the Theme and owncloudTheme.

 - Use the about from ownCloudTheme everywhere
 - Create default applicationIcons() and condifFileName() that should work
   everywhere
 - trayFolderIcon was removed as it is not used
 - the helpUrl from the default Theme now points to the owncloud client
   documentation. Before there was no help entry by default for branded
   client if the function was not overriden.
 - Do not merge functions that would otherwise break compatibility with
   theme that did not override them. For example colors or customMedia.
2018-04-05 18:37:29 +02:00
Jenkins for ownCloud
d6b16c3c06 [tx-robot] updated from transifex 2018-04-05 02:18:31 +02:00
Markus Goetz
55414d4c1d macOS: Don't hardcode path in Installer source 2018-04-04 16:45:42 +02:00
Markus Goetz
3bafa1ec89 macOS: Offer only standard installation in installer 2018-04-04 16:23:18 +02:00
Markus Goetz
dfc0545994 create_mac.sh: Also name properly in source dir 2018-04-04 15:46:16 +02:00
Markus Goetz
71de396a5d macosx.pkgproj; This is a .cmake preprocessed file 2018-04-04 15:42:31 +02:00
Jenkins for ownCloud
f9299826b1 [tx-robot] updated from transifex 2018-04-04 02:18:36 +02:00
Markus Goetz
e9646364a0 macdeployqt: Adjust minimum version based on our Qt #5932 2018-04-03 21:31:02 +02:00
Markus Goetz
75241c6cd6 Remove admin/osx/sign_dmg.sh
We don't do dmh anymore.
2018-04-03 19:27:20 +02:00
Joss Brown
fc4582ddf6 postinstall macOS: check if Finder is running
Some users have disabled Finder, and the postinstall will always reenable Finder, unless it checks Finder status first.
2018-04-03 16:00:08 +02:00
Christian Kamm
02a2056543 Notify if an explicitly excluded folder is created #6222 2018-04-03 14:03:46 +02:00
Christian Kamm
afec3ccf6e Conflicts: Change tags to be more user friendly #6365
From "_conflict-user-yyyymmdd-hhmmss"
to   " (conflicted copy user yyyy-mm-dd hhmmss)"
2018-04-03 14:03:03 +02:00
Jenkins for ownCloud
49b1a32251 [tx-robot] updated from transifex 2018-04-03 02:18:32 +02:00
Jenkins for ownCloud
a450859789 [tx-robot] updated from transifex 2018-04-02 02:18:31 +02:00
Jenkins for ownCloud
8b1b572935 [tx-robot] updated from transifex 2018-04-01 02:18:34 +02:00
Jenkins for ownCloud
cc4149c125 [tx-robot] updated from transifex 2018-03-31 02:18:33 +02:00
Jenkins for ownCloud
073fda3d03 [tx-robot] updated from transifex 2018-03-30 02:18:32 +02:00
Jenkins for ownCloud
6f44cc3d98 [tx-robot] updated from transifex 2018-03-29 02:18:50 +02:00
Christian Kamm
9f346037ee Nautilus integration: Not a ColumnProvider
The nautilus plugin doesn't actually define get_columns(), so pretending
to be a ColumnProvider lead to a critical warning on startup.
2018-03-28 15:30:05 +02:00
Olivier Goffart
39d909b05a csync_update: add the checksum in the discovery log
Issue #6414
2018-03-28 13:42:54 +02:00
Christian Kamm
28f68369be Blacklist: Add unittest #6411 2018-03-28 11:25:32 +02:00
Christian Kamm
2641a6af21 Rename local discovery option for clarity
It's using full relative filepaths, not just dir paths.
2018-03-28 11:25:32 +02:00
Olivier Goffart
d69936e065 FolderStatusModel: fix potential assert
OCC::FolderStatusModel::slotUpdateDirectories: ASSERT: "parentInfo->_fetching" in file /home/olivier/kdegit/owncloud/mirall/src/gui/folderstatusmodel.cpp, line 599

This can happen if the structure of a folder is change while the user
expands the root folder. In this case, resetSubs() is called which
resets _fetching to false.
Instead, we need to keep a pointer to the job so we can abort it by
deleting it.
2018-03-28 10:19:05 +02:00
Christian Kamm
1ac45be94e Readme: Update list of maintainers 2018-03-28 10:11:40 +02:00
Christian Kamm
3d002468ae Readme: Fix link to binary downloads 2018-03-28 10:11:40 +02:00
Christian Kamm
5e75d224ee Blacklisting must prevent parent etag updates #6411 2018-03-28 10:01:33 +02:00
Jenkins for ownCloud
8e7f7cfec8 [tx-robot] updated from transifex 2018-03-28 02:18:35 +02:00
Markus Goetz
31f13c8846 SslButton: Improve speed (especially on macOS) #6031
From 1+n*450msec to 1*450msec
2018-03-27 17:43:57 +02:00
Christian Kamm
25deaed9e5 Excludes: Expand doc, Desktop.ini only in root folder
The Desktop.ini exclude was added for 2.4 because we add such a file to
the synced folder on Windows. It doesn't need to cover subdirectories.
2018-03-27 12:43:53 +02:00
Christian Kamm
17342031d7 Upload: Simplify 'finished' flag
* Sometimes there was 'finished' and '_finished'
* Make each done() call automatically set _finished to true
2018-03-27 12:42:48 +02:00
Olivier Goffart
26b991c0c0 Folder: normalize the local path.
We otherwise normalize all path in the C form, so we must have
the Folder's path normalized the same. Or all comparizon will fail
(such as knowing if a file from the SocketAPI or the FilesystemWatcher
are part of the folder)

Issue #4424
2018-03-27 10:54:10 +02:00
Olivier Goffart
3f4d504c34 propagateuploadv1: don't finalize after a done()
Should fix an assert when "Server does not support X-OC-MTime"
(Which only happens with owncloud 5)

Issue #6403
2018-03-27 10:50:40 +02:00
Olivier Goffart
6a4486df3b Merge pull request #6402 from whitequark/patch-1
Dolphin plugin: fall back if $XDG_RUNTIME_DIR is empty
2018-03-27 10:32:12 +02:00
Jenkins for ownCloud
9516519165 [tx-robot] updated from transifex 2018-03-27 02:18:34 +02:00
Markus Goetz
7739157bfc SslButton: Add HTTP/2 info #3146 2018-03-26 22:49:54 +02:00
Markus Goetz
b34878c16d macOS: Put Qt version in .pkg name 2018-03-26 19:21:27 +02:00
Jenkins for ownCloud
962c38583f [tx-robot] updated from transifex 2018-03-26 02:18:32 +02:00
whitequark
9bd30cf003 Dolphin plugin: fall back if $XDG_RUNTIME_DIR is empty
As per XDG Base Directories specification:
> If $XDG_RUNTIME_DIR is not set applications should fall back
> to a replacement directory [...]

In practice, the ownCloud client has the fallback, but the plugin
helper does not, and if $XDG_RUNTIME_DIR is not set, the plugin
mysteriously does not work.
2018-03-24 08:12:25 +00:00
Jenkins for ownCloud
20881cd004 [tx-robot] updated from transifex 2018-03-24 02:18:32 +01:00
Jenkins for ownCloud
e5b93c7584 [tx-robot] updated from transifex 2018-03-23 02:18:33 +01:00
Markus Goetz
24e2c809e4 macOS: Fix .app icon 2018-03-22 16:30:22 +01:00
Markus Goetz
75a269acb6 About section: Try to lower height #6075 #6215 2018-03-22 15:37:04 +01:00
Jenkins for ownCloud
8357f1ea9a [tx-robot] updated from transifex 2018-03-22 02:18:32 +01:00
Markus Goetz
20bd943a87 macdeployqt: Qt 5.10.1 #5932 2018-03-21 19:20:50 +01:00
Olivier Goffart
424898603a mirall.desktop.in: Remove all the Translations comments
Relates to #5767
2018-03-21 15:03:45 +01:00
Jenkins for ownCloud
c1592e34c7 [tx-robot] updated from transifex 2018-03-21 11:56:01 +01:00
Christian Kamm
edacaae15f Merge remote-tracking branch 'origin/2.4' 2018-03-21 11:47:29 +01:00
Dominik Schmidt
d69e9ebf46 Apply branding to crashreporter resources file 2018-03-16 16:59:01 +01:00
Dominik Schmidt
24bf1b3629 Define APPLICATION_ICON_NAME fallback only in one place 2018-03-16 16:59:01 +01:00
Dominik Schmidt
94b0c9f78e Fix crash reporter icon 2018-03-16 16:59:01 +01:00
Christian Kamm
a89508ba26 Minor header fixup
To make the IDE happy.
2018-03-16 13:41:57 +01:00
Olivier Goffart
0bf0f92949 OwnSql: Fixup after feedback for #6388 2018-03-15 19:30:21 +01:00
Olivier Goffart
04f8d0f2bc OwnSql: Put the SQL queries next to their use.
This avoid haivng to modify 4 places when we want to add a query
2018-03-15 19:30:21 +01:00
Olivier Goffart
4584e5d3c5 OwnSql: Some refactoring
Use QByteArray for the query so we don't have to convert twice.
Automatically finish the query when the DB close, so we don't
have to call reset
2018-03-15 19:30:21 +01:00
Olivier Goffart
bbf1843865 SyncEngine: remove the "CSync" wording from the error messages
They are confusing for the user.
Example in issue #6274
2018-03-14 10:25:45 +01:00
Olivier Goffart
b6aaa6fd2b CSync: Remove unused error codes
None of the removed ERRNO code were ever set.
So none of the removed error hapenned anymore
2018-03-14 10:25:45 +01:00
Olivier Goffart
0031e09410 CSync: reconcile never returns an error 2018-03-14 10:25:45 +01:00
Olivier Goffart
0071011ebf csync: remove CSYNC_PARAM_ERROR
It does not make sense to report such error to the user.
Its goal was to show invalid use of the csync API, but this is now done
with asserts.
2018-03-14 10:25:45 +01:00
Olivier Goffart
978a129eed csync: Simplify csync_walk_local_tree/csync_walk_remote_tree
Small refactoring
2018-03-14 10:25:45 +01:00
Christian Kamm
86b30e36c2 Merge remote-tracking branch 'origin/2.4' 2018-03-12 10:24:25 +01:00
Jürgen Weigert
7132e88f8e removed germano0 as co-maintainer. 2018-03-11 12:53:39 +01:00
Dominik Schmidt
50c8ec8fd9 Bump Qt to 5.10.1 and openssl to 1.1.0g on AppVeyor 2018-03-09 12:19:44 +01:00
Michael Stingl
2e2ffca9e2 fixed 2.4.1 release date in ChangeLog 2018-03-08 16:16:40 +01:00
Christian Kamm
427bb83f0d IssuesWidget: addItem performance improvement
Ensure adding a new item isn't usually O(n) by keeping track of which
items have associated issues.
2018-03-06 13:02:54 +01:00
Christian Kamm
faec059a9b IssuesWidget: Don't allow two issues for the same file/folder
This is intended to safeguard against invalidation bugs that cause the
same error to be added again for every sync run.
2018-03-06 13:02:54 +01:00
Christian Kamm
641eddfbdf INSTRUCTION_IGNORE now carries a direction
This allows IssuesWidget to selectively wipe only the 'Up' ignores
during selective local discovery.
2018-03-06 13:02:54 +01:00
Christian Kamm
61869bb65e ProtocolItem: Adjust the way data is stored again
The struct makes it easy to pack data and should consume less memory
overall.
2018-03-06 13:02:54 +01:00
Christian Kamm
797473ba1f SyncResult: Make sure the number of conflicts is correct #6226
If the SyncResult incorrectly believes that there are no conflicts, the
tray icon won't be correct and there will be no warning about unresolved
conflicts on the account.

Nevertheless, it's pretty awkward that the IssuesWidget is better
informed about pending conflicts than the Folder itself. This kind of
backwards data flow is very confusing.

Unfortunately the only alternative I see is to either keep track of
this information in two places (also in Folder), or create a common
data-holding class that can serve as a model instance for the issues
view as well as provide data directly to the Folder - which would
have been a much larger change.
2018-03-06 13:02:54 +01:00
Christian Kamm
f82d61ea19 SyncEngine: Make "local discovery?" question available
Also fix the minor bug that was mentioned and add tests.
2018-03-06 13:02:54 +01:00
Christian Kamm
ec281654ae Issues tab: Invalidate issues selectively #6226
Everything is invalidated later: after discovery, not before. In
addition entries that should only be invalidated when new local
discovery is done have that behavior now.
2018-03-06 13:02:54 +01:00
Christian Kamm
52dfe589ba ProgressInfo: Add information for local vs remote discovery 2018-03-06 13:02:54 +01:00
Christian Kamm
a5aebac6a7 slotFolderDiscovered: Fix 'local' always being false
It was unused, so no harm done.
2018-03-06 13:02:54 +01:00
Christian Kamm
13eb64584f Discovery: Error if properties are missing #6317 2018-03-06 13:01:53 +01:00
Jürgen Weigert
2041f1ace8 Update release_template.md 2018-03-05 15:58:56 +01:00
Jürgen Weigert
08f402d264 Update release_template.md 2018-03-05 15:36:33 +01:00
Jürgen Weigert
d8084e2b18 Update release_template.md 2018-03-05 15:29:09 +01:00
Jürgen Weigert
7d03e47fea Update release_template.md 2018-03-05 14:52:43 +01:00
Markus Goetz
f5f68c0bc0 ChangeLog: 2.4.1 had been released (..in branch) 2018-03-05 14:28:18 +01:00
Markus Goetz
7606184b31 Update release_template.md 2018-03-01 17:22:21 +01:00
Markus Goetz
5ff2b5b0a3 Update release_template.md 2018-03-01 17:13:39 +01:00
Olivier Goffart
7397565274 Propagator: remove a bunch of code related to the 'Shared' directory
This no longer exists since the owncloud server 7.0 which we no longer
allow to connect to
2018-03-01 14:48:00 +01:00
Olivier Goffart
4a19a8d644 ConnectionValidator: change the minimum server version
Forbit connection with server older than 7.0. These server did not have
permission.

Also warn for anything older than 9.1. 9.0 is end of life according to
https://github.com/owncloud/core/wiki/Maintenance-and-Release-Schedule
2018-03-01 14:48:00 +01:00
Olivier Goffart
302c60fe15 ConnectionValidator::Status use Q_ENUM
So no need to have a manual conversion to QString
This is only used in debug message anyway.
2018-02-26 16:11:46 +01:00
Olivier Goffart
22c7002d59 Move ClientProxy and ConnecitonValidator to gui
They are using the ConfigFile and are used to control
when to sync rather than for the sync itself
2018-02-26 16:11:46 +01:00
Olivier Goffart
9968142976 owncloudcmd: Do not overwrite the http timeout for json jobs
The AbstractNetworkJob already has a sensible timeout that depends
on an environment variable.
No need to overwrite that with some arbitrary value. (The connection
validator does that because it could cause problems if two connection
validator were to run at the same time. Not a problem here)
2018-02-26 16:11:46 +01:00
Olivier Goffart
75a6783a79 owncloudcmd: Do not read the proxy settings from the gui's config file
The proxy settings for the owncloudcmd client can be set via the
--httpproxy command line argument. owncloudcmd should not depends
on the gui's config
2018-02-26 16:11:46 +01:00
Olivier Goffart
18afe6a395 Folder: remove unused member 2018-02-26 16:11:46 +01:00
Olivier Goffart
f6331951eb cmake: Remove references of now unused WITH_TESTING
Issue #6318
2018-02-21 11:28:31 +01:00
Olivier Goffart
7897b386b6 Utility::fsCasePreserving: remove UNIT_TESTING ifdef
Since the release package will be build with unit test, we don't
want to query the env variable at every call to fsCasePreserving.
So only test the env variable at startup.
And the testutility can still change the value.

(The env variable is still used from t8.pl and maybe smashbox)

Issue #6318
2018-02-21 11:28:31 +01:00
Markus Goetz
159899d3ba Update release_template.md 2018-02-20 20:30:32 +01:00
Christian Kamm
48dd8ed6c2 Partial local discovery: Fix scheduling logic
A recent patch that touched the condition for deciding whether a
periodic full local discovery is necessary accidentally inverted the
condition.
2018-02-20 18:07:28 +01:00
Christian Kamm
ed2dfcf399 Conflicts with user name: Fix tests 2018-02-20 10:36:07 +01:00
Christian Kamm
6fc3bfc265 Conflicts: Add user name to conflict file name #6325
For the case of uploading conflict files only.
2018-02-20 10:10:34 +01:00
Christian Kamm
129b814931 SyncEngine: Use separate state for two unicode conversions
It's unlikely that there were interaction effects but still seems safer
to use different conversion state for the path and rename_path.
2018-02-20 10:01:47 +01:00
Dominik Schmidt
aee72ae098 Merge pull request #6362 from dschmidt/fix-appveyor
Fix appveyor
2018-02-19 18:02:08 +01:00
Dominik Schmidt
766f8c2006 Pin craftmaster cache to qt version 2018-02-19 13:45:45 +01:00
Dominik Schmidt
d43439ebd9 Explicitly add owncloud blueprint repository 2018-02-19 10:58:42 +01:00
Dominik Schmidt
f7caf13873 Do not store artifacts on appveyor for now 2018-02-19 10:58:42 +01:00
Christian Kamm
6c1a73b67a SyncJournal: Clear etag filter before sync
Before, we only cleared the _avoidReadFromDbOnNextSyncFilter *after* a
sync which meant that we had to sync twice after selective sync setup.

Now, we clear the filter *before* a sync as well which allows the actual
next sync to write the correct etags to the db again - instead of only
the sync after that one.

Also expand on comments and rename _avoidReadFromDbOnNextSyncFilter to
_etagStorageFilter.
2018-02-16 11:39:19 +01:00
Christian Kamm
4a47f7e438 Merge remote-tracking branch 'origin/2.4' 2018-02-16 10:17:19 +01:00
Markus Goetz
c4543c58ea Release template: Add @Germano0 2018-02-13 15:09:52 +01:00
Markus Goetz
7860876b54 libcrashreporter-qt: Update submodule 2018-02-07 15:31:42 +01:00
Markus Goetz
3aeeb11135 Fix submodule URL 2018-02-06 15:51:11 +01:00
Markus Goetz
e338739d83 Fix compile for libcrashreporter-qt on macOS 2018-02-06 15:22:19 +01:00
Markus Goetz
cedf72825b NO_SHIBBOLETH: Fix warning 2018-02-02 19:47:26 +01:00
Oleg Solovyov
ec26388826 - doc: linux-only setting 2018-01-29 09:41:42 +01:00
Oleg Solovyov
f0822d648d - add description for moveToTrash variable 2018-01-29 09:41:42 +01:00
Christian Kamm
14f60a4238 FolderStatusModel: Refresh folders on Problem sync #6337
We don't want to refresh too frequently. But Problem is very close to
Success and very common.
2018-01-29 09:36:35 +01:00
Christian Kamm
f8022bb248 Fix compiler warning
Stray semicolon
2018-01-29 09:31:31 +01:00
Christian Kamm
d1aacac294 Tray: Change icon for unresolved conflicts #6277 2018-01-26 13:33:33 +01:00
Olivier Goffart
e322bd706f SocketAPI: "Open in browser" and disable Share entries when sharing is disabled.
This adds "Open in browser" entry in the menu (Issue #5903)

Also mark the entries as disabled when the file is not yet on the server.
If re-sharing is not allowed for that file, a disabled explaination
entry is added to the menu.
If sharing is disabled globaly in the branding or in the server,
the share entry will not be present.
(Issues #4205 and #4608)

Meta issue #6292
2018-01-26 09:19:26 +01:00
Olivier Goffart
de929eb566 Adjust the Move To Trash patch
(PR #6265)

 - Remove the UI completely
 - Move the #ifdef inside the FileSystem::moveToTrash function, so it is easier to
   implement on other platforms
 - Q_OS_UNIX includes mac, so we need to disable it. (not using Q_OS_LINUX because of
   other BSD that uses XDG spec as well
 - Translate the error messages
 - Add a couple of doc comments
2018-01-25 14:42:11 +01:00
Oleg Solovyov
c5d37dfedc Move remote-deleted files to trash
Squashed from https://github.com/owncloud/client/pull/6265

Linux only, Hidden option, disabled by default
2018-01-25 14:40:16 +01:00
Olivier Goffart
eae00f9969 Use std::chrono::milliseconds to represent milliseconds 2018-01-25 14:07:08 +01:00
Olivier Goffart
02988229b1 FolderStatusModel: don't use deprecated QModelIndex::child
Was deprecated in Qt 5.8.
(IMHO this show that child can be usefull and I am not sure the
deprecation was justified)
2018-01-24 10:23:03 +01:00
Olivier Goffart
72b9beb79c Merge remote-tracking branch 'origin/2.4'
Conflicts:
	shell_integration/nautilus/syncstate.py
2018-01-23 14:08:15 +01:00
Olivier Goffart
883080b557 Windows shell extension: port to the new protocol 2018-01-23 14:02:56 +01:00
Christian Kamm
ebfac84c69 Shell integration: Make nautilus work with multiselections
Previously no menu would ever be shown if more than one file is
selected. Now the GET_MENU_ITEMS command is sent with all selected files
as an argument - similar to what is done for the dolphin integration.
2018-01-23 14:02:56 +01:00
Christian Kamm
3c2622d2de Shell integration: Update nautilus for GET_MENU_ITEMS 2018-01-23 14:02:56 +01:00
Olivier Goffart
982c591ec9 SocketApi: add a way to disable menu entries 2018-01-23 14:02:56 +01:00
Olivier Goffart
1782ae3c08 SocketAPI: Make it easier to add or remove item in the action menu
By making it dynamic.
So far only the dolphin shell extension have been ported
2018-01-23 14:02:56 +01:00
Christian Kamm
59f2e0634e Protocol: Correct sorting by size #6326
Previously we were sorting by size string, where
"6 MB" < "3 KB".
2018-01-23 12:02:16 +01:00
Christian Kamm
32bb1e6763 ProtocolItem: Use accessors over magic numbers 2018-01-23 12:02:16 +01:00
Christian Kamm
e2b89c5afe TextXmlParse: Add truncated-xml testcase #6317 2018-01-22 14:05:08 +01:00
Olivier Goffart
5a97ddde5a Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/gui/updater/updater.cpp
2018-01-19 13:41:29 +01:00
Olivier Goffart
b8539eb329 Get rid of the StopWatch in the PropagateUpload job
For issue #6318

The StopWatch is using memory, and we are not really using it.
2018-01-19 13:37:48 +01:00
Christian Kamm
b9c7aa8df3 Sync: Deal with file/folder conflicts #6312
Previously conflicts with a different type on both ends lead to sync
errors. Now they are handled in the expected way: the local item gets
renamed and the remote item gets propagated downwards.

This also adds a unittest for the TYPE_CHANGE case. That one looks like
parts of it might be unified with CONFLICT cases.
2018-01-19 09:47:49 +01:00
Dominik Schmidt
127e675838 Merge pull request #6310 from owncloud/appveyor
Enable appveyor builds
2018-01-18 18:08:09 +01:00
Christian Kamm
c1b5412c16 Exclude regex: Use named captures
My benchmarks show no performance difference.
2018-01-18 10:24:24 +01:00
Dominik Schmidt
217c6bbcaf Add AppVeyor badge 2018-01-18 09:46:06 +01:00
Olivier Goffart
926609bd74 Partially revert "shell_integration/dolphin: Silence some warnings"
This partially reverts commit 1c721e9422.

This caused the overlay plugin to be installed at the wrong place
because the kcoreaddons_add_plugin macto still use deprecated
${PLUGIN_INSTALL_DIR}.

I guess we'll have to live with the warnings.
2018-01-17 17:34:27 +01:00
Dominik Schmidt
486ccaff56 Enable tests in appveyor builds 2018-01-17 16:25:03 +01:00
Dominik Schmidt
e0cc93c047 Enable appveyor builds 2018-01-17 16:21:09 +01:00
Christian Kamm
4337e8532e Exclude matching: Speedup the full-path traversal case
Previously we'd use the full regex when the bname triggered a full-path
matching to take place. Now we have a simplified full-traversal regex
for this case that can be significantly faster to apply.

Triggered by #5017 but doesn't actually solve it.
2018-01-17 15:05:50 +01:00
Dominik Schmidt
4895b848c8 Merge pull request #6308 from dschmidt/fix-linux-icons
Fix Linux icons
2018-01-17 12:53:32 +01:00
Dominik Schmidt
fe3c68b9dd Fix Linux icons 2018-01-17 12:18:31 +01:00
Olivier Goffart
2a14ba5582 Folder: remove declaration of non-existing method 2018-01-15 15:43:13 +01:00
Olivier Goffart
2a842a5745 Application: remove declaration of non-existing functions 2018-01-15 15:07:09 +01:00
Olivier Goffart
cfe9909560 admin/linux/Dockerfile: Add comments 2018-01-15 13:56:35 +01:00
Olivier Goffart
8331f04b5b Merge pull request #6244 from owncloud/cleanuo
Modernize makefiles and remove dead code
2018-01-15 13:49:57 +01:00
Dominik Schmidt
7839c4d4e1 Revert "Disable stack protection for mingw win32 builds in 2.4"
This reverts commit 298f1ab570.

We're shipping libssp-0.dll now with mingw builds. We would
have enough time to test this for 2.5.0 now anyway, but we
also will most likely switch to MSVC for that release.
2018-01-14 14:39:29 +01:00
Dominik Schmidt
969d90d15b Fix UIC detection in windows cross env 2018-01-14 00:57:40 +01:00
Dominik Schmidt
d8a279c671 Fix windows cross build of the updater and bump libcrashreporter-qt revision 2018-01-14 00:45:02 +01:00
Dominik Schmidt
6d56f30d9b Fix incorrect target_include_directories usage for crash reporter 2018-01-13 23:49:58 +01:00
Dominik Schmidt
86ea5876cd Use standard png2ico in our cross env too 2018-01-13 23:28:52 +01:00
Dominik Schmidt
bb8468c627 Add Linux CI Dockerfile 2018-01-13 23:28:18 +01:00
Dominik Schmidt
fc62e9e9d9 Fix .def and .rc files not being compiled into windows shell extensions 2018-01-13 21:01:09 +01:00
Dominik Schmidt
15967b1219 Install all dlls to BINDIR so craft does not ignore them 2018-01-13 13:58:17 +01:00
Dominik Schmidt
0656c77da8 Set CMAKE_CXX_STANDARD to 14 2018-01-13 13:58:17 +01:00
Dominik Schmidt
81c20352e1 Use new ECMAddAppIcon macro for application icons.
cmake/modules/ECMAddAppIcon.cmake is heavily patched to support sidebar icons, OUTFILE_BASE parameter and to not include 64 and 64@2x icons on macOS which are not supported. All changes are made in a way that we can upstream this.
2018-01-13 13:58:17 +01:00
Dominik Schmidt
4e52ee9ebd Build Explorer extension if building with MSVC 2018-01-13 13:58:17 +01:00
Dominik Schmidt
6ee87a77cc Fix macOS updater build without deprecated Qt apis 2018-01-13 13:58:17 +01:00
Dominik Schmidt
539d6fd92e Link client against QtMacExtras as it bundles qtmacgoodies 2018-01-13 13:58:17 +01:00
Dominik Schmidt
da98e2aa28 Fix building sqlite on macOS and Windows 2018-01-13 13:58:17 +01:00
Dominik Schmidt
1f9763eda9 Package libssp-0.dll in NSIS installer.
It's needed since 586fd346ea activated stack-protector-strong
2018-01-13 13:58:17 +01:00
Dominik Schmidt
cbf470f17b Fix csync installation on windows 2018-01-13 13:58:17 +01:00
Dominik Schmidt
1f12d6344b Fix sqlite compilation (on OSX) 2018-01-13 13:58:17 +01:00
Olivier Goffart
437d45981e Remove unused c_strlist 2018-01-13 13:58:17 +01:00
Olivier Goffart
3ae327ea8e Modernize out CMakeLists.txt
Mainly uses target_include_directories instead of include_directories
so libraries public include directory get automatically added when adding
the target in target_link_library
2018-01-13 13:58:17 +01:00
Olivier Goffart
1c721e9422 shell_integration/dolphin: Silence some warnings 2018-01-13 13:58:17 +01:00
Olivier Goffart
5d0aa5f039 Remove unused c_path 2018-01-13 13:58:17 +01:00
Olivier Goffart
41798cef18 Csync: remove some unused build system stuff 2018-01-13 13:58:17 +01:00
Olivier Goffart
1c11778693 Remove the unusued csync_file_locked_or_open test in csync_reconcile
It is unused. Also remove the corresponding error code
2018-01-13 13:58:17 +01:00
Olivier Goffart
3ddd4b6f16 Get rid of csync_log
We use Qt's debugging code everywhere
2018-01-13 13:58:17 +01:00
Olivier Goffart
d948ed11a1 Csync: use QElapsedTimer and qCInfo instead of CSYNC_LOG and its own csync time function
This allow to remove all the csync time manipulation routne which are now unused
2018-01-13 13:58:17 +01:00
Olivier Goffart
257d8142b1 Build system: Get rid of QtVersionAbstraction.cmake
Use modern cmake with target_link_libraries and Qt5:: that
automatically add the include path and compile flags
2018-01-13 13:58:17 +01:00
Olivier Goffart
48c55b7d29 csync/std: don't build in a separate library
There is no need to create a static library for the csync/std file, just
put everything together in csync
2018-01-13 13:58:17 +01:00
Olivier Goffart
776bbbf7b1 Don't include sqlite3.h from headers
So that sqlite is not part of the public interface of csync
(and that the sqlite include path don't need to be passed when compiling
libsync or gui)
2018-01-13 13:58:17 +01:00
Dominik Schmidt
f326bf371d Merge pull request #6299 from dschmidt/linux-docker-ci
Use docker for Linux CI
2018-01-13 13:46:04 +01:00
Dominik Schmidt
01f3b82ea5 Move pulling docker images to their own stages 2018-01-12 17:19:22 +01:00
Dominik Schmidt
dbf15fb8dc Make setLaunchOnStartup debug output more meaningful 2018-01-11 16:11:23 +01:00
Dominik Schmidt
a253129fd6 Fix running tests until #6210 is fixed 2018-01-11 16:11:06 +01:00
Dominik Schmidt
a8ba3ee9e1 Use docker for Linux CI 2018-01-11 16:10:31 +01:00
Olivier Goffart
9613f6437d Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libsync/networkjobs.cpp
2018-01-11 10:46:50 +01:00
Jürgen Weigert
9dc765142c Update updater.cpp
depricate suffix nightly, promote suffix daily
2018-01-10 16:19:08 +01:00
Christian Kamm
585d2b20bd Exclude regex: Restore old matching on Windows #6245
Unfortunately matching behaved differently on Windows. This patch
restores the previous matching behavior but still uses the new regular
expression based matching.

Further work will hopefully unify the behavior between platforms without
breaking backwards compatibility.
2018-01-09 11:09:05 +01:00
Christian Kamm
d0e7f61db6 owncloudcmd: Set proxy earlier #6281
In particular before the capability call.

Also warn if no proxy is set because the command line doesn't follow the
strict format requirements.
2018-01-05 10:23:29 +01:00
Christian Kamm
0f8790d993 owncloudcmd: Remove some dead code 2018-01-05 10:12:25 +01:00
Christian Kamm
86377aa37a Folder: Remove unused 'dirty proxy' setting 2018-01-05 09:44:20 +01:00
Christian Kamm
3988f3ad77 GCC: Fix implicit-fallthrough warnings 2018-01-05 09:43:53 +01:00
Christian Kamm
ab9d6285c6 Proxy: Hostname validation and reconnection on setting change
Where 'validation' currently just means "check whether it's empty".

Code adapted from wiggiBe's original PR #6140
2018-01-04 14:30:24 +01:00
Jürgen Weigert
6e445033c7 OBS publishing details added
OBS has two pubishing swithces: one per package and one per project, 
we always only switch per project! we have too many dependency packages to keep that in sync manually!
2017-12-27 12:37:02 +01:00
Olivier Goffart
a642d99d4b Merge remote-tracking branch 'origin/2.4'
Conflicts:
	VERSION.cmake
        src/CMakeLists.txt
2017-12-21 12:51:01 +01:00
Hefee
844e03d000 Also disable fstack-protector for alpha plattform.
This fixes #6211.

(cherry picked from commit 69e81e8f65)
2017-12-16 14:08:08 +01:00
Olivier Goffart
1940c2f9bf Exclude: Use Qt to load the exclude file
fopen does not work well with relative path tand forward slashes on windows
This fix the windows textexcludedfiles test.
And also make the code simpler.

Note that the 'trimmed' might be a behavior change, but i think it is ok
2017-12-15 19:16:20 +01:00
Christian Kamm
83e94c3ec7 Fix compile after rebase 2017-12-15 18:05:44 +01:00
Christian Kamm
a7c0cfc8eb Upload conflict files #4557
If the server has the 'uploadConflictFiles' capability conflict
files will be uploaded instead of ignored.

Uploaded conflict files have the following headers set during upload
  OC-Conflict: 1
  OC-ConflictBaseFileId: 172489174instanceid
  OC-ConflictBaseMtime: 1235789213
  OC-ConflictBaseEtag: myetag
when the data is available. Downloads accept the same headers in return
when downloading a conflict file.

In the absence of server support clients will identify conflict files
through the file name pattern and attempt to deduce the base fileid.
Base etag and mtime can't be deduced though.

The upload job for a new conflict file will be triggered directly from
the job that created the conflict file now. No second sync run is
necessary anymore.

This commit does not yet introduce a 'username' like identifier that
automatically gets added to conflict file filenames (to name the files
foo_conflict-Fred-1345.txt instead of just foo_conflict-1345.txt).
2017-12-15 18:03:53 +01:00
Christian Kamm
7ae8ba35de Remove unused csync test file
Now found at
test/csync/csync_tests/check_csync_update.cpp
2017-12-15 18:02:04 +01:00
Christian Kamm
8eebc53728 Unify item type enum
Previously, there was csync_ftw_type_e and SyncFileItem::Type. Having
two enums lead to a bug where Type::Unknown == Type::File that went
unnoticed for a good while.

This patch keeps only a single enum.
2017-12-15 18:02:04 +01:00
Olivier Goffart
ee366df58f Fix the TestFolderMan on Windows 2017-12-15 14:51:00 +01:00
Olivier Goffart
482ee875a1 Fix TestSyncEngine on windows 2017-12-15 14:39:01 +01:00
Olivier Goffart
b10edfecfc Workaround MSVC bug with enum in bitfield
MSVC stores the enum as signed in the bitfield (contrary to the C++ spec)
Which means that once we store a value such as SyncFileItem::DetailError
in a bitfield, we get a negative value back, then of course, further
comparison fails.
2017-12-15 14:18:45 +01:00
Klaas Freitag
3b96097cf6 Config: Look for exclude file in a relative path.
If the application binary is not installed in /usr/bin the client
with this patch considers to check the relative location
../../etc/owncloud-client/ to find the system exclude.

This is an important bit for AppImage based packages of the client,
as this runs from a temporar mountpoint and the system file can not
be found under /etc.
2017-12-15 09:54:40 +01:00
Olivier Goffart
4dc49ff3b0 SyncEngine: Recover when the PUT reply (or chunkin's MOVE) is lost
This can happen if the upload of a file is finished, but we just got
disconnected right before recieving the reply containing the etag.
So nothing was save din the DB, and we are not sure if the server
recieved the file properly or not. Further local update of the file
will cause a conflict.

In order to fix this, store the checksum of the uploading file in
the uploadinfo table of the local db (even if there is no chunking
involved).  And when we have a conflict, check that it is not because
of this situation by checking the entry in the uploadinfo table.

Issue #5106
2017-12-14 11:56:12 +01:00
Olivier Goffart
4369853ddb TestSystem: Add QIODevice in the serverOverride function, and add a DelayedReply
Preparing to add test that needs the QIODevice.
Also make the DelayedReply so we can generalize the existing delay on FakeChunkMoveReply
to any reply.
2017-12-14 11:56:12 +01:00
Christian Kamm
d870729709 Require Qt >= 5.6 #6241 2017-12-14 11:31:30 +01:00
Christian Kamm
f40cceaf04 Share link: Adjust design of folder sharing permissions #6192 2017-12-14 08:34:44 +01:00
rockihack
8a963a67f2 stack-protector is not supported on hppa. 2017-12-13 11:27:48 +01:00
rockihack
586fd346ea Enable stack-protector-strong on Windows and macOS. 2017-12-13 11:27:48 +01:00
Christian Kamm
e5ed8fc90a Merge remote-tracking branch 'origin/2.4' 2017-12-13 11:03:24 +01:00
Olivier Goffart
02283fc686 Merge pull request #6224 from owncloud/deprecated
Remove use of deprecated Qt API
2017-12-12 11:48:04 +01:00
Martin
cd2057fc04 Update Overlay Icon naming 2017-12-12 10:18:00 +01:00
Olivier Goffart
bae00358b9 Merge pull request #6219 from owncloud/config
Move config and remove most dependencies form the sync engine.
2017-12-11 17:10:18 +01:00
Olivier Goffart
58e8a25869 Enable deprecated warnings 2017-12-08 16:16:06 +01:00
Olivier Goffart
d517d92f6c FolderWizard: don't use deprecated API 2017-12-08 16:16:06 +01:00
Olivier Goffart
71dcf7fc37 SSLButton: Removes some call to deprecated functions 2017-12-08 16:16:02 +01:00
Olivier Goffart
0a59faf03d OcsJob: Use QUrlQuery
Qurl::setEncodedQueryItems is deprecated.
2017-12-08 16:15:48 +01:00
Olivier Goffart
7bd48b1327 cmd: remove usage of deprecated qInstallMsgHandler 2017-12-08 16:15:48 +01:00
Olivier Goffart
8c652e061d Remove uses of deprecated QString::fromAscii 2017-12-08 16:15:48 +01:00
Olivier Goffart
a4816d6a8c Updater: use QUrlQuery
QUrl::addQueryItem is deprecated
2017-12-08 16:15:47 +01:00
Olivier Goffart
1a503d54f6 Remove usage of deprecated qSort 2017-12-08 16:15:47 +01:00
Olivier Goffart
263668b1cb Remove use of deprecated translate call 2017-12-08 16:15:38 +01:00
Olivier Goffart
3df65460f5 Remove usage of QString::null
Replaces by "QString()"
2017-12-08 16:15:22 +01:00
Olivier Goffart
74672d493d Utility: use QUrlQuery
For QUrl::setQuery is deprecated in Qt5
2017-12-08 16:15:17 +01:00
Olivier Goffart
f1b7d506ae csync_exclude: fix compilation of non-test builds 2017-12-08 09:43:26 +01:00
Olivier Goffart
4581d708ff Account: remove dependency with ConfigFile
Part of #6213
2017-12-07 17:39:16 +01:00
Olivier Goffart
e0a14cac5b ConfigFile: use QStandardPaths::AppConfigLocation for the config file
Also use appName instead of appNameGui in order to compute the path

Issue: #2245

The reason is to respect the XDG spec on Unix (#1601) and might help
on windows roaming profiles (#684)
2017-12-07 17:39:16 +01:00
Olivier Goffart
ac844a2a45 AbstractNetworkJob: move the httpTimeout from the propagator to the network job
Remove one dependency from the config file for the sync engine.
Part of issue #6213
2017-12-07 17:39:16 +01:00
Olivier Goffart
7230fa6b4f SyncOptions: move to its own file
It does not really belong in the discoveryphase.h as it is used also for
propagator option.

Also use C++11 style member initializer
2017-12-07 17:35:38 +01:00
Olivier Goffart
e25af4f0dc csync_exclude: Fix compile
csync_exclude.cpp:428:17: error: assigning to 'char *' from incompatible type 'const char *'
        bname = path;
                ^~~~

The C library's strrchr always return 'char*'
Only the C++'s std::strrchr has two overloads
2017-12-07 17:34:14 +01:00
Christian Kamm
287670c9d6 Excludes: Remove fnmatch codepath
Now all exclude patterns can be translated to regular expressions.
2017-12-07 14:38:21 +01:00
Christian Kamm
994f3bb644 Excludes: fnmatch doesn't treat '{' as special
Neither the documentation at
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13
nor the fnmatch source code in <glibc>/posix/fnmatch_loop.c points
toward { causing special matching behavior.
2017-12-07 14:38:21 +01:00
Christian Kamm
e5c780ee19 Excludes: Translate full-path patterns to regex
Improves full matches by more than an order of magnitude
and also improves speed of traversal matches by roughly 20%,
judging by the check_csync_exclude performance test.
2017-12-07 14:38:21 +01:00
Christian Kamm
1c3d5ab158 Excludes: Introduce dir-only regex matches 2017-12-07 14:38:21 +01:00
Christian Kamm
5d668eca40 Excludes: Optimize Desktop.ini check 2017-12-07 14:38:21 +01:00
Christian Kamm
7ab127ad53 Excludes: Refactor for pending improvements
Make ExcludedFiles something that is instantiated outside of
the CSYNC context and then given to it as a hook.

ExcludedFiles still lives in csync_exclude and the internal
workings haven't been touched.
2017-12-07 14:38:21 +01:00
Olivier Goffart
dd91f4a86e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/csync/csync.cpp
2017-12-07 09:37:50 +01:00
Hefee
32f38dc5f8 fix typo error: occured-> occurred 2017-12-06 20:02:53 +01:00
Christian Kamm
79fe71db58 Hide selective sync buttons while disconnected #5809
The choices or big folder warnings will pop up again on reconnection.
2017-12-06 16:41:28 +01:00
Olivier Goffart
ed5385faa3 Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libsync/connectionvalidator.cpp
     	src/libsync/networkjobs.cpp
2017-12-05 15:58:13 +01:00
Markus Goetz
fe234499dd Update release_template.md 2017-12-05 09:22:23 +01:00
Christian Kamm
8c94601ef2 User shares: Further avatar tweaks 2017-11-21 16:33:03 +01:00
Christian Kamm
f27ceb7fab User shares: Use background color, remove permission frame #6176 2017-11-21 16:33:03 +01:00
Christian Kamm
60bde048c6 User shares: Fix missing label when there are only link shares
The "not shared with users or groups" label only appeared if there were
no shares at all.
2017-11-21 16:33:03 +01:00
Christian Kamm
3b961204e1 Avatars in user share dialog: Minor tweaks 2017-11-21 16:33:03 +01:00
Christian Kamm
e9907bc8ae AvatarJob improvements
* Drop AvatarJob2
* Allow AvatarJob to retrieve different sizes and users
* Make creating a circular avatar into a function
  (maybe all avatars should be made into that shape in the first place)
2017-11-21 16:33:03 +01:00
Roeland Jago Douma
6b9b5252de User shares: Show avatars
[Sharing] Show placeholders for avatars

Just like on the web show placeholders for avatars in the sharing dialog

[Sharing] Show avatars!

[Sharing] Show same avatar placeholder for group/federated shares as on
web
2017-11-21 16:33:03 +01:00
Christian Kamm
d949ec6877 Protocol: Introduce context menu with "open in browser" #6121
To do this conveniently a bunch of functionality that's common to
IssueWidget and ProtocolWidget is moved to ProtocolItem.

Also the convenience function to asynchronously retrieve the private
link url is moved from the socket api to the network jobs.
2017-11-21 12:42:10 +01:00
Jürgen Weigert
0abe7a77fb Update release_template.md 2017-11-20 18:12:18 +01:00
Jürgen Weigert
ad408c5717 post release checks added
this fixes https://github.com/owncloud/client/issues/5836
2017-11-20 18:12:18 +01:00
Christian Kamm
aafe7c4732 Merge remote-tracking branch 'origin/2.4' 2017-11-20 11:54:56 +01:00
Michael Stingl
d832312acc Add 2.3.3 System Requirements to client repo (#5996)
I would like to maintain the System Requirements in the client repo.
2017-11-17 15:05:42 +01:00
Jürgen Weigert
d903afc4bf Adding post-release checks to template (#6109)
copied 3 items from https://github.com/owncloud/client/issues/5889
2017-11-02 16:57:02 +01:00
Christian Kamm
c743cc171a Client certs: Improve error message #6128
"Could not load certificate" can very well just be a bad password.
2017-11-02 11:30:44 +01:00
Christian Kamm
05c1bfb6cf Merge remote-tracking branch 'origin/2.4' 2017-10-27 10:29:31 +02:00
Jürgen Weigert
17126de5c7 APPLICATION_NAME may contain whitespace
Need some quotes to survive in makensis.
2017-10-26 18:44:38 +02:00
Jocelyn Turcotte
d9f6468310 Windows: Remove navigation pane entries when uninstalling
Issue #5295
2017-10-24 16:10:53 +02:00
Jocelyn Turcotte
10c6951438 Windows: Add a setting to enable/disable the explorer navigation pane integration
Issue #5295
2017-10-24 16:10:53 +02:00
Jocelyn Turcotte
56e38e6f80 Windows: Add sync folders to Explorer's navigation pane
This is only the navigation pane, the SyncRootManager entries aren't handled yet.

This follows the instructions from:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn889934%28v=vs.85%29.aspx

Issue #5295
2017-10-24 16:10:53 +02:00
Christian Kamm
e85a339d94 Local discovery: Use db instead of filesystem
We mostly trust the file watchers meaning that we don't re-scan the
local tree if we have done that recently and no file watcher events
have arrived. If the file watchers invalidate a subtree, we rescan
only that subtree.

Since we're not entirely sure the file watchers are reliable, we still
do full local discoveries regularly (1h by default). There is a config
file setting as well as an environment variable to control the interval.
2017-10-24 10:00:20 +02:00
Christian Kamm
66f0ce6616 FolderWatcher: reliability and data-loss signal
Add state and signal to catch the following two known problems:
* Linux: inotify user watch pool is exhausted. Folder watcher becomes
unreliable.
* Windows: buffer is too small, some notifications are lost but watching
stays reliable.
2017-10-24 10:00:20 +02:00
Christian Kamm
fb2d31c9ce Folder: Move FolderWatcher to Folder
This makes it unnecessary for FolderMan to manage the list and removes
the need for some forwarders.

This is done in preparation for follow-up commits that want to add
diagnostics to FolderWatcher that shall be available from within Folder.
2017-10-24 10:00:20 +02:00
Christian Kamm
8865405a32 Version: master branch is future 2.5 now 2017-10-24 09:56:16 +02:00
Dominik Schmidt
7f51803d04 Only use $(MAKE) in doc target if make is used as generator
The old behavior broke builds with other CMake generators like Ninja as it obviously has no concept of $(MAKE)
2017-10-17 12:50:34 +02:00
355 changed files with 45735 additions and 31772 deletions

92
.drone.yml Normal file
View File

@@ -0,0 +1,92 @@
#
# We are building GCC with make and 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.
#
workspace:
base: /drone
path: src/github.com/owncloud/client
branches:
- master
- 2.5
- 2.4
clone:
git:
image: plugins/git
pull: true
tags: false
pipeline:
prepare-clang:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- mkdir clang-build
- cd clang-build
- cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 ..
building-clang:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- cd clang-build
- ninja -j4
testing-clang:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- cd clang-build
- useradd -m -s /bin/bash tester
- chown -R tester:tester .
- su-exec tester ctest --output-on-failure
prepare-gcc:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- mkdir gcc-build
- cd gcc-build
- cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 ..
building-gcc:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- cd gcc-build
- make -j4
testing-gcc:
image: owncloudci/client:latest
pull: true
environment:
- LC_ALL=C.UTF-8
commands:
- cd gcc-build
- useradd -m -s /bin/bash tester
- chown -R tester:tester .
- su-exec tester ctest --output-on-failure
notify-slack:
image: plugins/slack
pull: true
secrets: [ slack_webhook ]
channel: desktop
when:
local: false
status: [ changed, failure ]
event: [ push ]

View File

@@ -16,6 +16,7 @@ Some weeks before the release:
* [ ] Ensure Windows Overlay DLLs are rebuilt
* [ ] Check nightly builds are up and running, that is Jenkins jobs ownCloud-client-linux, ownCloud-client-osx and ownCloud-client-win32 all green.
* [ ] Ensure Linux nightlies are built too for all distros https://build.opensuse.org/package/show/isv:ownCloud:community:nightly/owncloud-client
* Check if patches still apply in the linux packages
* [ ] Build branded clients through the scripting machine and smoke test one or two branded clients (especially with predefined url)
* [ ] Upload a nightly build of the windows version to virustotal.com
* Contact AV vendors whom's engine reports a virus
@@ -25,84 +26,94 @@ Some weeks before the release:
* use `git log --format=oneline v<lastrelease>...master` if your memory fails you
* [ ] check if enterprise issues are fixed
One week before the release:
For first Alpha/Beta of a Major or Minor release:
* [ ] branch off master to new version branch (e.g. master -> 2.1, when releasing 2.1)
* [ ] Adjust `VERSION.cmake` in master and count up (e.g. 2.2)
* [ ] Adjust translation jobs for [client](https://ci.owncloud.org/view/translation-sync/job/translation-sync-client/) and [NSIS](https://ci.owncloud.org/view/translation-sync/job/translation-sync-client-nsis/) to point to the release branch (e.g. 2.1).
* [ ] Make sure there is a job for the docs of the new master branch and the current release branch on rotor e.g. http://doc.owncloud.org/desktop/1.X/ exists
For all alphas, betas and RCs (Copy this section for each alpha/beta/rc):
* [ ] Add last updates to Changelog in the client source repository.
* [ ] Branch off a release branch called VERSION-rcX or VERSION-betaX (without v, v is for tags)
* [ ] Edit ```VERSION.cmake``` to set the suffix to beta1, beta2 etc. Commit the result to the release branch only
* [ ] Make sure to increase the version number of the branched of release, e.g. if you release 2.3.2 then you should change VERSION.cmake in 2.3 to 2.3.3 since that branch now will be 2.3.3
* [ ] Create build for using owncloud-client-trigger (uncheck the "nightly build" checkbox, use the proper dropdown for version suffix) for theme 'ownCloud'
* [ ] Create build for using owncloud-client-trigger (uncheck the "nightly build" checkbox, use the proper dropdown for version suffix) for theme 'testpilotcloud'
* [ ] Only now download the last created source .tar.xz and sign it with gpg. Copy the signature into a new .asc file. (timing issue because currently 'testpilotcloud' re-creates the source .tar.xz)
* (no need to copy builds as they are already in testing directory or repository) (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Mac: Perform smoke test (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Win: Perform smoke test (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Linux: Smoke test of one distro package (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Linux: Run @SamuAlfageme 's magic Linux-test-all-packages-script
* [ ] Create a signed tag using ```git tag -u E94E7B37 tagname``` (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Create a pull request to the owncloud.org repository to update the install page (strings.php, page-desktop.php) and the changelog on owncloud.org. From now on download packages from the staging webserver.
* [ ] Inform packagers @dragotin (openSUSE), @hefee (Debian), ??? (Fedora)
* [ ] Announce on https://central.owncloud.org
* [ ] Inform community mailinglists devel@owncloud.org and testpilots@owncloud.org (make sure to mention it is an rc). Link to the central post so discussion happens there.
* [ ] Check crash reporter
One week before the final release:
* [ ] Communicate the release schedule on mailinglist release-coordination@owncloud.com. Give a high level overview of the upcoming new features, changes etc.
* [ ] Ensure marketing is aware (marketing@owncloud.com) and prepared for the release (social, .com website, cust. communications)
* [ ] Inform GCX knows the next version is about 1 week out (gcx@owncloud.com)
For all Betas and RCs:
* [ ] Branch off a release branch called VERSION-rcX or VERSION-betaX (without v, v is for tags)
* [ ] Edit ```VERSION.cmake``` to set the suffix to beta1, beta2 etc. Commit the result to the release branch only
* [ ] Create build for Windows using rotor job owncloud-client-win32 (uncheck the "nightly build" checkbox, check the "sign package" checkboxes) both themes 'ownCloud' and 'testpilotcould'
* [ ] Create build for Mac using rotor, job owncloud-client-osx (uncheck the "nightly build" checkbox, check the "sign package" checkboxes) both themes 'ownCloud' and 'testpilotcould'
* [ ] Create the beta tarball using Jenkins job ownCloud-client-source
* [ ] Create Linux builds using rotor job owncloud-client-linux building (this magically interacts with the ownCloud-client-source job)
* [ ] theme 'ownCloud' -> isv:ownCloud:community:testing
* [ ] theme 'testpilotcould' -> isv:ownCloud:testpilot:testing
* [ ] Copy builds from ```daily``` to ```testing``` on download.owncloud.com, double check the download links.
* [ ] Create a pull request to the owncloud.org repository to update the install page (strings.php, page-desktop.php) and the changelog on owncloud.org. From now on download packages from the staging webserver.
* [ ] Inform community mailinglists devel@owncloud.org and testpilots@owncloud.org
* [ ] Announce on https://central.owncloud.org
* [ ] Create a signed tag using ```git tag -u E94E7B37 tagname``` (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Check crash reporter
For first Beta of a Major or Minor release:
* [ ] branch off master to new version branch (e.g. master -> 2.1, when releasing 2.1)
* [ ] Adjust `VERSION.cmake` in master and count up (e.g. 2.2)
* [ ] Adjust translation jobs for [client](https://ci.owncloud.org/view/translation-sync/job/translation-sync-client/) and [NSIS](https://ci.owncloud.org/view/translation-sync/job/translation-sync-client-nsis/) to point to the release branch (e.g. 2.1).
* [ ] Make sure there is a job for the docs of the new master branch and the current release branch on rotor.
Day before Release:
Day before final Release:
* [ ] Check the translations coming from transifex: All synchronized?
* [ ] Run the tx.pl scripts on the final code tag
* [ ] Run ```make test```
* [ ] Run smashbox on the final code tag
* [ ] Run smashbox
* [ ] Inform product management and marketing that we are 1 day out
On Release Day (for final release):
* [ ] Branch off a release branch called like the version (without v, v is for tags)
* [ ] Double check ```VERSION.cmake```: Check the version number settings and suffix (beta etc.) to be removed. Commit change to release branch only!
* [ ] Make sure to increase the version number of the branched of release, e.g. if you release 2.3.2 then you should change VERSION.cmake in 2.3 to 2.3.3 since that branch now will be 2.3.3
* [ ] Add last updates to Changelog in the client source repository.
* [ ] Create tar ball (automated by `ownCloud-client-source` jenkins job) and **immediately** sign it (asc file). (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Create build for Windows using rotor job owncloud-client-win32 (uncheck the "nightly build" checkbox, check the "sign package" checkboxes) both themes 'ownCloud' and 'testpilotcould'
* [ ] Create build for Mac using rotor, job owncloud-client-osx (uncheck the "nightly build" checkbox, check the "sign package" checkboxes) both themes 'ownCloud' and 'testpilotcould'
* [ ] Stop publishing on OBS
* [ ] Branch isv:ownCloud:desktop to isv:ownCloud:desktop:client-X.Y.Z before overwriting https://github.com/owncloud/administration/blob/master/jenkins/obs_integration/obs-backup-prj.sh
* [ ] Create Linux builds using rotor job owncloud-client-linux (this magically interacts with the ownCloud-client-source job)
* Check if patches still apply in the linux packages
* Update [OBS repository](https://build.opensuse.org/project/show?project=isv%3AownCloud%3Adesktop) `isv:ownCloud:desktop`
* [ ] theme 'ownCloud' -> isv:ownCloud:desktop
* [ ] theme 'testpilotcloud' -> isv:ownCloud:testpilot
* [ ] Linux: Update the testing repository to the latest stable version.
* [ ] Inform GCX that a new tarball is available.
* [ ] Copy builds and source tar ball from ```daily``` to ```stable``` on download.owncloud.com, double check the download links.
* [ ] Check if the following packages are on download.owncloud.com/desktop/stable:
* Windows binary package
* Mac binary package
* source tarballs
* [ ] Create a pull request to the owncloud.org repository to update the install page (strings.php, page-desktop.php) and the changelog on owncloud.org. From now on download packages from the staging webserver.
* [ ] Branch off a release branch called VERSION (without v, v is for tags)
* [ ] Edit ```VERSION.cmake``` to set the suffix to "" etc. Commit the result to the release branch only
* [ ] Create build for using owncloud-client-trigger (uncheck the "nightly build" checkbox, use the proper dropdown for version suffix) for theme 'ownCloud'
* [ ] Create build for using owncloud-client-trigger (uncheck the "nightly build" checkbox, use the proper dropdown for version suffix) for theme 'testpilotcloud'
* [ ] Only now download the last created source .tar.xz and sign it with gpg. Copy the signature into a new .asc file. (timing issue because currently 'testpilotcloud' re-creates the source .tar.xz) (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Branch isv:ownCloud:desktop to isv:ownCloud:desktop:client-X.Y.Z before overwriting https://github.com/owncloud/administration/blob/master/jenkins/obs_integration/obs-backup-prj.sh (the linux packages will land in the :testing repository still)
```obs-backup-prj.sh isv:ownCloud:desktop isv:ownCloud:desktop:client-2.4.1 owncloud-client 2.4.1 # (if not already done)```
* [ ] Re-download Mac builds and check signature. Interactive in installer window
* [ ] Re-download Win build check signature. From Mac or Linux: ```osslsigncode verify ownCloud-version-setup.exe```
* [ ] Mac: Perform smoke test (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Win: Perform smoke test (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Linux: Smoke test
* [ ] Linux: Re-enable OBS publishing
* Let obs build and publish exactly once. then
* [ ] disable publishing and rebuild for the owncloud-client package and all its dependencies.
* [ ] double-check that there are no _aggregatepac from other projects, if so disable rebuilding there too.
* [ ] Update ASCII Changelog on http://download.owncloud.com/download/changelog-client
* [ ] Linux: Smoke test of one distro package (Install, make sure it does not explode, and check if all version indicators are correct)
* [ ] Linux: Run @SamuAlfageme 's client-linux-tests Jenkins job (this tests only package installations!) Adjust REPO_URL in https://jenkins.int.owncloud.com/job/client-linux-tests/build (Better: gitlab?)
* [ ] Win/Mac Copy builds from ```testing``` to ```stable``` on download.owncloud.com, double check the download links. (make sure the .asc is there too)
* [ ] Linux: disable publishing on project isv:ownCloud:desktop
* [ ] Linux: Use https://github.com/owncloud/administration/blob/master/jenkins/obs_integration/obs-deepcopy-prj.sh to copy from isv:ownCloud:community:testing to isv:ownCloud:desktop
 ```obs-deepcopy-prj.sh isv:ownCloud:desktop:testing isv:ownCloud:desktop```
 ```obs-deepcopy-prj.sh isv:ownCloud:testpilot:testing isv:ownCloud:testpilot```
* [ ] Linux: Re-enable OBS publishing on the project after official release date and if all distros build (check for accidentially disabled packages too)
* [ ] Linux: Wait until everything is built and published, then disable publishing on project isv:ownCloud:desktop
* [ ] Create git signed tag in client repository using ```git tag -u E94E7B37 tagname``` (https://github.com/owncloud/enterprise/wiki/Desktop-Signing-Knowledge)
* [ ] Create a (draft) release on https://github.com/owncloud/client/releases
* [ ] Update https://owncloud.org/changelog/desktop-client/
* [ ] Update https://owncloud.org/download/#owncloud-desktop-client -> Download ownCloud -> click open 'Desktop Client', edit win/mac/lin, each all three tabs "Production", "Technical Preview" [disabled], "Test pilot"
* [ ] Announce on https://central.owncloud.org
* [ ] Announce on announcements@owncloud.org
* [ ] Create git signed tag in client repository using ```git tag -u E94E7B37 tagname```
* [ ] Announce on announcements@owncloud.org Link to the central post so discussion happens there.
* [ ] Inform packagers @dragotin (openSUSE) @hefee (Debian) @Germano0 (Fedora)
* [ ] Send out Social (tweet, blog, other)
* [ ] Send out customer communication (if any)
* [ ] Inform GCX that the new version is released (gcx@owncloud.com)
* [ ] Inform release-coordination@owncloud.com
* [ ] Ensure marketing is aware (marketing@owncloud.com)
* [ ] Take pride and celebrate!
* [ ] Also update the testpilotcloud builds for that release version and make sure they show up on the download page
* [ ] Days later: Update the updater script ```clientupdater.php``` (check the crash reporter if auto update is a good idea or we need a new release)
* [ ] Tell GCX to increment the minimum supported version for enterprise customers
* [ ] Check if minimum.supported.desktop.version (https://github.com/owncloud/core/blob/master/config/config.sample.php#L1152) needs to be updated in server
15 minutes after after release:
* [ ] Test all advertised download links to have the expected version
* [ ] Check for build errors in OBS, do
```obs-deepcopy-prj.sh isv:ownCloud:desktop isv:ownCloud:desktop:client-2.X.X```
* [ ] disable publishing in OBS to prevent that accidential rebuilds hit the end users.
A few days after the release (for final release)
* [ ] Review changes in the release branch, merge back into master
* [ ] check the crash reporter if auto update is a good idea or we need a new release
* [ ] Update the updater script ```clientupdater.php``` https://github.com/owncloud/enterprise/wiki/How-to-use-the-Client-Updater#updating-the-owncloud-hosted-updater
* [ ] Execute announced deprecations. Disable builds for deprecated platforms. Update accordingly: https://doc.owncloud.org/server/latest/admin_manual/installation/system_requirements.html#desktop
* [ ] Increment version number in nightly builds. Special case: after the last release in a branch, jump forward to the 'next release branch'... That may mean, this is nightly is the same as edge then.
```

3
.gitmodules vendored
View File

@@ -7,3 +7,6 @@
[submodule "src/3rdparty/libcrashreporter-qt"]
path = src/3rdparty/libcrashreporter-qt
url = git://github.com/dschmidt/libcrashreporter-qt.git
[submodule "doc/docs-themes"]
path = doc/docs-themes
url = https://github.com/owncloud/docs-themes.git

View File

@@ -1,37 +0,0 @@
sudo: required
language: cpp
services:
- docker
branches:
only:
- coverity_scan
before_install:
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list"
- sudo sh -c "echo 'deb-src http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list"
- wget http://download.opensuse.org/repositories/isv:ownCloud:desktop/Ubuntu_14.04/Release.key
- sudo apt-key add - < Release.key
- sudo apt-get update
- sudo apt-get -y build-dep owncloud-client
- checkout=$(git show-ref --head --hash head)
- cd ../
- wget https://scan.coverity.com/download/linux-64 --post-data "token=$token&project=owncloud%2Fmirall" -O coverity_tool.tgz
- mkdir coverity
- tar -xvf coverity_tool.tgz -C coverity --strip-components=1
- export PATH=$PATH:$PWD/coverity/bin/
- cd $TRAVIS_BUILD_DIR
install:
- cd ../
- mkdir client-build
- cd client-build
- cmake -DCMAKE_BUILD_TYPE="Debug" $TRAVIS_BUILD_DIR
- cov-build --dir cov-int make
- tar czvf client.tgz cov-int
- curl --form token=$token --form email=lukas@statuscode.ch --form file=@$PWD/client.tgz --form version="$checkout" --form description="$checkout" https://scan.coverity.com/builds?project=owncloud%2Fmirall
# Hack to stop processing
script: true

View File

@@ -1,20 +1,23 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.8.0)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 14)
project(client)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
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()
# 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")
@@ -61,14 +64,6 @@ if(NOT WITH_CRASHREPORTER)
message(STATUS "Build of crashreporter disabled.")
endif()
#####
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
add_definitions( -DUSE_FDO_NOTIFICATIONS)
set(WITH_DBUS ON)
endif()
####
include(GNUInstallDirs)
include(DefineInstallationPaths)
include(GenerateExportHeader)
@@ -77,6 +72,12 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_MESSAGELOGCONTEXT #enable function name and line number in debug output
-DQT_DEPRECATED_WARNINGS
)
# if we cannot get it from git, directly try .tag (packages)
# this will work if the tar balls have been properly created
# via git-archive.
@@ -190,20 +191,11 @@ if(BUILD_CLIENT)
find_package(Sphinx)
find_package(PdfLatex)
find_package(SQLite3 3.8.0 REQUIRED)
# On some OS, we want to use our own, not the system sqlite
if (USE_OUR_OWN_SQLITE3)
include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
if (WIN32)
add_definitions(-DSQLITE_API=__declspec\(dllimport\))
endif()
endif()
find_package(ZLIB REQUIRED)
endif()
if (NOT DEFINED APPLICATION_ICON_NAME)
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
set(APPLICATION_ICON_NAME "${APPLICATION_SHORTNAME}")
endif()
include(OwnCloudCPack.cmake)
@@ -213,22 +205,11 @@ add_definitions(-D_UNICODE)
if( WIN32 )
add_definitions( -D__USE_MINGW_ANSI_STDIO=1 )
add_definitions( -DNOMINMAX )
# Get APIs from from Vista onwards.
add_definitions( -D_WIN32_WINNT=0x0600)
add_definitions( -DWINVER=0x0600)
endif( WIN32 )
include(QtVersionAbstraction)
setup_qt()
if (${Qt5Core_VERSION_MAJOR} EQUAL "5")
if (${Qt5Core_VERSION_MINOR} EQUAL "6" OR ${Qt5Core_VERSION_MINOR} GREATER 6)
else()
message(STATUS "If possible compile me with Qt 5.6 or higher.")
endif()
if (${Qt5Core_VERSION_MINOR} EQUAL "9" OR ${Qt5Core_VERSION_MINOR} GREATER 9)
else()
message(STATUS "For HTTP2 use Qt 5.9.2 or higher.")
endif()
endif()
message("Qt ${Qt5Core_VERSION} at ${Qt5Core_INCLUDE_DIRS}")
if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
@@ -237,9 +218,6 @@ endif()
file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts)
set(TRANSLATIONS ${TRANS_FILES})
# Make sure we set this before recursing into child folders.
set(WITH_TESTING ${UNIT_TESTING})
if(BUILD_CLIENT)
add_subdirectory(src)
if(NOT BUILD_LIBRARIES_ONLY)

View File

@@ -1,7 +1,92 @@
ChangeLog
=========
version 2.4.1 (2018-02-xx)
version 2.5.0 (2018-06-xx)
* Local discovery: Speed up by skipping directories without changes reported by the file system watcher.
* Windows: Add sync folders to Explorer's navigation pane (#5295)
* 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)
* Sharing: Add "copy public link" to menu (#6356)
* Protocol: Introduce context menu with "open in browser" (#6121)
* 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)
* 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)
* Config: Look for exclude file in a relative path.
* Config: Versionize settings
* 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)
* owncloudcmd: Set proxy earlier (#6281)
* 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)
* 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)
* 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)
* 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: 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)
* 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
version 2.4.1 (2018-03-05)
* Ignore files with file names that can't be encoded for the filesystem (#6287, #5676, #5719)
* Issues: Speed up insertion and add hard upper limit (#6272)
* Notifications: Fix "Dismiss" action

83
Jenkinsfile vendored
View File

@@ -6,46 +6,67 @@
// 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 'Qt5'
sh '''rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 -DWITH_TESTING=1 -DCMAKE_PREFIX_PATH=/var/lib/jenkins/qt/5.6.2 ..
make -j4
ctest -V --output-on-failure'''
stage 'Linux - Pull Docker Image'
linux.pull()
stage 'Qt5 - clang'
sh '''rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUNIT_TESTING=1 -DWITH_TESTING=1 -DCMAKE_PREFIX_PATH=/var/lib/jenkins/qt/5.6.2 ..
make -j4
ctest -V --output-on-failure'''
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'
def win32 = docker.image('guruz/docker-owncloud-client-win32:latest')
win32.pull() // make sure we have the latest available from Docker Hub
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 '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

@@ -5,6 +5,7 @@ set( APPLICATION_DOMAIN "owncloud.com" )
set( APPLICATION_VENDOR "ownCloud" )
set( APPLICATION_UPDATE_URL "https://updates.owncloud.com/client/" CACHE string "URL for updater" )
set( APPLICATION_ICON_NAME "owncloud" )
set( APPLICATION_VIRTUALFILE_SUFFIX "owncloud" CACHE STRING "Virtual file suffix (not including the .)")
set( LINUX_PACKAGE_SHORTNAME "owncloud" )

View File

@@ -1,6 +1,7 @@
# 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://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)
## Introduction
@@ -11,7 +12,7 @@ with your computer.
### Binary packages
* Refer to the download page https://owncloud.org/install/#install-clients
* Refer to the download page https://owncloud.org/download/#owncloud-desktop-client
### Source code
@@ -26,18 +27,6 @@ https://github.com/owncloud/client.
[Building the Client](http://doc.owncloud.org/desktop/2.3/building.html)
in the ownCloud Desktop Client manual.
## Maintainers and Contributors
The maintainers of this repository are:
* Klaas Freitag <freitag@owncloud.com>
* Daniel Molkentin <danimo@owncloud.com>
* Markus Goetz <guruz@owncloud.com>
* Olivier Goffart <ogoffart@owncloud.com>
ownCloud Desktop Client is developed by the ownCloud community and receives
patches from a variety of authors.
## Reporting issues and contributing
If you find any bugs or have any suggestion for improvement, please
@@ -55,6 +44,23 @@ If you want to contact us, e.g. before starting a more complex feature,
you can join us at
[#owncloud-client-dev](irc://irc.freenode.net/#owncloud-client-dev).
## Maintainers and Contributors
The current maintainers of this repository are:
* Markus Goetz <guruz@owncloud.com>
* Olivier Goffart <ogoffart@owncloud.com>
* Christian Kamm <mail@ckamm.de>
ownCloud Desktop Client is developed by the ownCloud community and [receives
patches from a variety of authors](https://github.com/owncloud/client/graphs/contributors).
Past maintainers:
* Klaas Freitag <freitag@owncloud.com>
* Daniel Molkentin <daniel@molkentin.de>
* Andreas Schneider <asn@cryptomilk.org>
## License
This program is free software; you can redistribute it and/or modify

View File

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

22
admin/linux/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# This DockerFile is used to create the image used for Jenkins, the CI system (see Jenkinsfile)
# It is not meant to be used to create the production packages.
# Distro with Qt 5.6
FROM ubuntu:yakkety
RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
locales \
build-essential \
clang \
ninja-build \
cmake \
extra-cmake-modules \
libsqlite3-dev \
libssl-dev \
libcmocka-dev \
qt5-default \
qttools5-dev-tools \
libqt5webkit5-dev \
qt5keychain-dev \
kio-dev \
&& apt-get clean

View File

@@ -11,7 +11,8 @@ else()
set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "0")
endif()
configure_file(create_mac_pkg.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh)
configure_file(macosx.pkgproj ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj)
find_package(Qt5 5.6 COMPONENTS Core REQUIRED)
configure_file(create_mac.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh)
configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj)
configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh)
configure_file(post_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/post_install.sh)

View File

@@ -23,7 +23,7 @@ identity="$3"
prjfile=$build_path/admin/osx/macosx.pkgproj
# The name of the installer package
installer="@APPLICATION_SHORTNAME@-@MIRALL_VERSION_FULL@@MIRALL_VERSION_SUFFIX@"
installer="@APPLICATION_SHORTNAME@-qt@Qt5Core_VERSION@-@MIRALL_VERSION_FULL@@MIRALL_VERSION_SUFFIX@"
installer_file="$installer.pkg"
installer_file_tar="$installer.pkg.tar"
installer_file_tar_bz2="$installer.pkg.tar.bz2"

View File

@@ -22,6 +22,7 @@ import subprocess
import commands
import sys
from glob import glob
from distutils.version import LooseVersion
def QueryQMake(attrib):
return subprocess.check_output([qmake_path, '-query', attrib]).rstrip('\n')
@@ -92,6 +93,8 @@ commands.append(['mkdir', '-p', resources_dir])
plugins_dir = os.path.join(bundle_dir, 'Contents', 'PlugIns')
binaries = [i for i in glob(os.path.join(bundle_dir, 'Contents', 'MacOS', "*")) if is_exe(i)];
qt_version = QueryQMake('QT_VERSION')
print "Using Qt", qt_version
fixed_libraries = []
fixed_frameworks = []
@@ -334,9 +337,19 @@ def FindQtPlugin(name):
for binary in binaries:
FixBinary(binary)
if LooseVersion(qt_version) >= LooseVersion("5.10.0"):
QT_PLUGINS.append('styles/libqmacstyle.dylib')
for plugin in QT_PLUGINS:
FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))
if LooseVersion(qt_version) >= LooseVersion("5.10.0"):
args = ['plutil', '-insert', 'LSMinimumSystemVersion', '-string', '10.10.0', os.path.join(bundle_dir, 'Contents', 'Info.plist')]
commands.append(args)
else:
args = ['plutil', '-insert', 'LSMinimumSystemVersion', '-string', '10.7.0', os.path.join(bundle_dir, 'Contents', 'Info.plist')]
commands.append(args)
if len(sys.argv) <= 2:
print 'Will run %d commands:' % len(commands)
for command in commands:

View File

@@ -579,7 +579,9 @@
</dict>
</dict>
<key>INSTALLATION TYPE</key>
<integer>0</integer>
<integer>1</integer>
<key>MODE</key>
<integer>1</integer>
</dict>
<key>INSTALLATION_STEPS</key>
<array>
@@ -699,7 +701,7 @@
<key>BUILD_PATH</key>
<dict>
<key>PATH</key>
<string>../install/.</string>
<string>@CMAKE_INSTALL_PREFIX@/.</string>
<key>PATH_TYPE</key>
<integer>3</integer>
</dict>

View File

@@ -1,12 +1,16 @@
#!/bin/sh
osascript << EOF
# Check if Finder is running (for systems with Finder disabled)
finder_status=`ps aux | grep "/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder" | grep -v "grep"`
if ! [ "$finder_status" == "" ] ; then # Finder is running
osascript << EOF
tell application "Finder"
activate
select the last Finder window
reveal POSIX file "/Applications/@APPLICATION_EXECUTABLE@.app"
end tell
EOF
fi
# Always enable the new 10.10 finder plugin if available
if [ -x "$(command -v pluginkit)" ]; then

View File

@@ -1,40 +0,0 @@
#!/bin/sh -x
[ "$#" -lt 2 ] && echo "Usage: sign_dmg.sh <dmg> <identity>" && exit
src_dmg="$1"
tmp_dmg="writable_$1"
signed_dmg="signed_$1"
identity="$2"
QT_FMWKS=`basename ${TMP_APP}/Contents/Frameworks`/Qt*
QT_FMWK_VERSION="5"
fix_frameworks() {
TMP_APP=$1
QT_FMWK_PATH=$2
QT_FMWKS=$3/Qt*.framework
echo "Patching Qt frameworks..."
for FMWK in $QT_FMWKS; do
FMWK_NAME=`basename -s .framework $FMWK`
FMWK=`basename $FMWK`
FMWK_PATH="${TMP_APP}/Contents/Frameworks/${FMWK}"
mkdir -p "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources/"
cp -avf "${QT_FMWK_PATH}/${FMWK}/Contents/Info.plist" "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources"
(cd "${FMWK_PATH}" && ln -sf "Versions/${QT_FMWK_VERSION}/Resources" "Resources")
perl -pi -e "s/${FMWK_NAME}_debug/${FMWK_NAME}/" "${FMWK_PATH}/Resources/Info.plist"
done
}
mount="/Volumes/$(basename "$src_dmg"|sed 's,-\([0-9]\)\(.*\),,')"
test -e "$tmp_dmg" && rm -rf "$tmp_dmg"
hdiutil convert "$src_dmg" -format UDRW -o "$tmp_dmg"
hdiutil attach "$tmp_dmg"
pushd "$mount"
fix_frameworks "$mount"/*.app `qmake -query QT_INSTALL_LIBS` "$mount"/*.app/Contents/Frameworks
codesign -s "$identity" --deep "$mount"/*.app
popd
diskutil eject "$mount"
test -e "$signed_dmg" && rm -rf "$signed_dmg"
hdiutil convert "$tmp_dmg" -format UDBZ -o "$signed_dmg"

View File

@@ -27,8 +27,8 @@ SET(QT_MKSPECS_DIR ${CMAKE_FIND_ROOT_PATH}/share/qt5/mkspecs)
SET(QT_QT_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include)
# qt tools
SET(QT_QMAKE_EXECUTABLE ${MINGW_PREFIX}-qmake )
SET(QT_MOC_EXECUTABLE ${MINGW_PREFIX}-moc)
SET(QT_RCC_EXECUTABLE ${MINGW_PREFIX}-rcc)
SET(QT_UIC_EXECUTABLE ${MINGW_PREFIX}-uic)
SET(QT_LRELEASE_EXECUTABLE ${MINGW_PREFIX}-lrelease)
SET(QT_QMAKE_EXECUTABLE ${MINGW_PREFIX}-qmake-qt5)
SET(QT_MOC_EXECUTABLE ${MINGW_PREFIX}-moc-qt5)
SET(QT_RCC_EXECUTABLE ${MINGW_PREFIX}-rcc-qt5)
SET(Qt5Widgets_UIC_EXECUTABLE ${MINGW_PREFIX}-uic-qt5)
SET(QT_LRELEASE_EXECUTABLE ${MINGW_PREFIX}-lrelease-qt5)

View File

@@ -1,22 +1,20 @@
FROM opensuse:42.1
MAINTAINER Daniel Molkentin <danimo@owncloud.com>
ENV TERM ansi
ENV HOME /root
ENV REFRESHED_AT 20160421
ENV REFRESHED_AT 20170113
RUN zypper --non-interactive --gpg-auto-import-keys refresh
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_Leap_42.1/windows:mingw.repo
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/isv:ownCloud:toolchains:mingw:win32:2.3/openSUSE_Leap_42.1/isv:ownCloud:toolchains:mingw:win32:2.3.repo
RUN zypper --non-interactive --gpg-auto-import-keys install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
mingw32-headers mingw32-runtime site-config mingw32-libwebp \
mingw32-headers mingw32-runtime site-config mingw32-libwebp mingw32-libssp0 \
mingw32-cross-libqt5-qmake mingw32-cross-libqt5-qttools mingw32-libqt5* \
mingw32-qt5keychain* mingw32-angleproject* \
mingw32-cross-nsis mingw32-libopenssl* \
mingw32-sqlite* kdewin-png2ico \
mingw32-sqlite* png2ico \
osslsigncode wget
# RPM depends on curl for installs from HTTP

View File

@@ -0,0 +1,120 @@
; fileassoc.nsh
; File association helper macros
; Written by Saivert
; See http://nsis.sourceforge.net/FileAssoc
;
; Features automatic backup system and UPDATEFILEASSOC macro for
; shell change notification.
;
; |> How to use <|
; To associate a file with an application so you can double-click it in explorer, use
; the APP_ASSOCIATE macro like this:
;
; Example:
; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "Description of txt files" \
; "$INSTDIR\myapp.exe,0" "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""
;
; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
; to associate an application with a single file and using the
; the "open" verb as default. To add more verbs (actions) to a file
; use the APP_ASSOCIATE_ADDVERB macro.
;
; Example:
; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \
; "$INSTDIR\myapp.exe /edit $\"%1$\""
;
; To have access to more options when registering the file association use the
; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
; standard action (default verb).
;
; And finally: To remove the association from the registry use the APP_UNASSOCIATE
; macro. Here is another example just to wrap it up:
; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
;
; |> Note <|
; When defining your file class string always use the short form of your application title
; then a period (dot) and the type of file. This keeps the file class sort of unique.
; Examples:
; Winamp.Playlist
; NSIS.Script
; Photoshop.JPEGFile
;
; |> Tech info <|
; The registry key layout for a file association is:
; HKEY_CLASSES_ROOT
; <applicationID> = <"description">
; shell
; <verb> = <"menu-item text">
; command = <"command string">
;
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" ""
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
WriteRegStr HKCR "${FILECLASS}\shell" "" "open"
WriteRegStr HKCR "${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" ""
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
StrCmp "${SHELLNEW}" "0" +2
WriteRegStr HKCR ".${EXT}\ShellNew" "NullFile" ""
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
WriteRegStr HKCR "${FILECLASS}\shell" "" `${DEFAULTVERB}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
DeleteRegKey HKCR `${FILECLASS}\shell\${VERB}`
!macroend
!macro APP_UNASSOCIATE EXT FILECLASS
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" `${FILECLASS}_backup`
WriteRegStr HKCR ".${EXT}" "" "$R0"
DeleteRegKey HKCR `${FILECLASS}`
!macroend
!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT
ReadRegStr ${OUTPUT} HKCR ".${EXT}" ""
!macroend
; !defines for use with SHChangeNotify
!ifdef SHCNE_ASSOCCHANGED
!undef SHCNE_ASSOCCHANGED
!endif
!define SHCNE_ASSOCCHANGED 0x08000000
!ifdef SHCNF_FLUSH
!undef SHCNF_FLUSH
!endif
!define SHCNF_FLUSH 0x1000
!macro UPDATEFILEASSOC
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
; can update the shell.
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
!macroend
;EOF

50
appveyor.ini Normal file
View File

@@ -0,0 +1,50 @@
[General]
Branch = master
ShallowClone = True
Command=craft
# Variables defined here override the default value
# The variable names are casesensitive
[Variables]
#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
# Settings applicable for all Crafts matrices
# Settings are Category/key=value
# Category is case sensitive
[GeneralSettings]
General/EMERGE_PKGDSTDIR=${Variables:APPVEYOR_BUILD_FOLDER}/binaries
Paths/python = C:\Python36
Paths/python27 = C:\Python27
Paths/downloaddir = ${Variables:Root}\downloads
ShortPath/Enabled = False
ShortPath/EnableJunctions = True
ShortPath/JunctionDir = C:\CM-SP\
Packager/CacheDir = ${Variables:Root}\cache
Packager/UseCache = ${Variables:UseCache}
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/
Compile/BuildType = RelWithDebInfo
ContinuousIntegration/Enabled = True
[BlueprintSettings]
# don't try to pip install on the ci
python-modules.ignored = True
libs/qt5.version = ${Variables:QtVersion}
win32libs/openssl.version = ${Variables:OpenSslVersion}
craft/craft-core.version = master
[windows-msvc2017_64-cl]
General/ABI = windows-msvc2017_64-cl
[windows-msvc2017_32-cl]
General/ABI = windows-msvc2017_32-cl

43
appveyor.yml Normal file
View File

@@ -0,0 +1,43 @@
version: '{build}-{branch}'
branches:
only:
- master
clone_depth: 50
init:
- ps: |
function craft($target) {
& C:\Python36\python.exe "C:\CraftMaster\CraftMaster\CraftMaster.py" --config "$env:APPVEYOR_BUILD_FOLDER\appveyor.ini" --variables "APPVEYOR_BUILD_FOLDER=$env:APPVEYOR_BUILD_FOLDER" --target $target -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
install:
- ps: |
#use cmd to silence powershell behaviour for stderr
& cmd /C "git clone -q --depth=1 git://anongit.kde.org/craftmaster.git C:\CraftMaster\CraftMaster 2>&1"
craft $env:TARGET -i craft
craft $env:TARGET --add-blueprint-repository [git]https://github.com/owncloud/craft-blueprints-owncloud.git
craft $env:TARGET --install-deps owncloud-client
build_script:
- ps: |
craft $env:TARGET --no-cache --src-dir $env:APPVEYOR_BUILD_FOLDER owncloud-client
after_build:
- ps: |
craft $env:TARGET --src-dir $env:APPVEYOR_BUILD_FOLDER --package owncloud-client
test_script:
- ps: |
craft $env:TARGET --src-dir $env:APPVEYOR_BUILD_FOLDER --test owncloud-client
environment:
matrix:
- TARGET: windows-msvc2017_32-cl
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TARGET: windows-msvc2017_64-cl
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

2
binary

Submodule binary updated: 3425fab2c6...09f12de312

View File

@@ -20,7 +20,7 @@
<file>resources/lock-https.png</file>
<file>resources/lock-https@2x.png</file>
<file>resources/account.png</file>
<file>resources/more.png</file>
<file>resources/more.svg</file>
<file>resources/delete.png</file>
<file>resources/bell.png</file>
</qresource>

View File

@@ -0,0 +1,382 @@
#.rst:
# ECMAddAppIcon
# -------------
#
# Add icons to executable files and packages.
#
# ::
#
# ecm_add_app_icon(<sources_var>
# ICONS <icon> [<icon> [...]]
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.4x
# [OUTFILE_BASE <name>]) # Since 5.4x
# )
#
# The given icons, whose names must match the pattern::
#
# <size>-<other_text>.png
#
# will be added to the executable target whose sources are specified by
# ``<sources_var>`` on platforms that support it (Windows and Mac OS X).
# Other icon files are ignored but on Mac SVG files can be supported and
# it is thus possible to mix those with png files in a single macro call.
#
# ``<size>`` is a numeric pixel size (typically 16, 32, 48, 64, 128 or 256).
# ``<other_text>`` can be any other text. See the platform notes below for any
# recommendations about icon sizes.
#
# ``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.
#
# ``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.
#
#
# 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.
#
# Mac OS X notes
# * The executable target must have the ``MACOSX_BUNDLE`` property set.
# * Icons are added to the bundle.
# * If the ksvg2icns tool from KIconThemes is available, .svg and .svgz
# files are accepted; the first that is converted successfully to .icns
# will provide the application icon. SVG files are ignored otherwise.
# * The tool iconutil (provided by Apple) is required for bitmap icons.
# * Supported sizes: 16, 32, 64, 128, 256 (and 512, 1024 after OS X 10.9).
# * At least a 128x128px (or an SVG) icon is required.
# * Larger sizes are automatically used to substitute for smaller sizes on
# "Retina" (high-resolution) displays. For example, a 32px icon, if
# provided, will be used as a 32px icon on standard-resolution displays,
# and as a 16px-equivalent icon (with an "@2x" tag) on high-resolution
# displays. That is why you should provide 64px and 1024px icons although
# they are not supported anymore directly. Instead they will be used as
# 32px@2x and 512px@2x. ksvg2icns handles this internally.
# * This function sets the ``MACOSX_BUNDLE_ICON_FILE`` variable to the name
# of the generated icns file, so that it will be used as the
# ``MACOSX_BUNDLE_ICON_FILE`` target property when you call
# ``add_executable``.
# * Sidebar icons should typically provided in 16, 32, 64, 128 and 256px.
#
# Since 1.7.0.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2014 Ralf Habacker <ralf.habacker@freenet.de>
# Copyright 2006-2009 Alexander Neundorf, <neundorf@kde.org>
# Copyright 2006, 2007, Laurent Montel, <montel@kde.org>
# Copyright 2007 Matthias Kretz <kretz@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include(CMakeParseArguments)
function(ecm_add_app_icon appsources)
set(options)
set(oneValueArgs OUTFILE_BASE)
set(multiValueArgs ICONS SIDEBAR_ICONS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARG_ICONS)
message(FATAL_ERROR "No ICONS argument given to ecm_add_app_icon")
endif()
if(ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_add_app_icon: ${ARG_UNPARSED_ARGUMENTS}")
endif()
if(APPLE)
find_program(KSVG2ICNS NAMES ksvg2icns)
foreach(icon ${ARG_ICONS})
get_filename_component(icon_full ${icon} ABSOLUTE)
get_filename_component(icon_type ${icon_full} EXT)
# do we have ksvg2icns in the path and did we receive an svg (or compressed svg) icon?
if(KSVG2ICNS AND (${icon_type} STREQUAL ".svg" OR ${icon_type} STREQUAL ".svgz"))
# convert the svg icon to an icon resource
execute_process(COMMAND ${KSVG2ICNS} "${icon_full}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} RESULT_VARIABLE KSVG2ICNS_ERROR)
if(${KSVG2ICNS_ERROR})
message(AUTHOR_WARNING "ksvg2icns could not generate an OS X application icon from ${icon}")
else()
# install the icns file we just created
get_filename_component(icon_name ${icon_full} NAME_WE)
set(MACOSX_BUNDLE_ICON_FILE ${icon_name}.icns PARENT_SCOPE)
set(${appsources} "${${appsources}};${CMAKE_CURRENT_BINARY_DIR}/${icon_name}.icns" PARENT_SCOPE)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${icon_name}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# we're done now
return()
endif()
endif()
endforeach()
endif()
_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")
endif()
set(mac_icons
# Icons: https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW4
${icons_at_16px}
${icons_at_32px}
${icons_at_64px}
${icons_at_128px}
${icons_at_256px}
${icons_at_512px}
${icons_at_1024px}
# Sidebar Icons: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
${sidebar_icons_at_16px}
${sidebar_icons_at_18px}
${sidebar_icons_at_32px}
${sidebar_icons_at_36px}
${sidebar_icons_at_64px})
if (NOT icons_at_128px)
message(AUTHOR_WARNING "No 128px icon provided; this will not work on Mac OS X")
endif()
set(windows_icons_classic ${icons_at_16px}
${icons_at_24px}
${icons_at_32px}
${icons_at_48px}
${icons_at_64px}
${icons_at_128px})
set(windows_icons_modern ${windows_icons_classic}
${icons_at_256px}
${icons_at_512px}
${icons_at_1024px})
if (NOT (windows_icons_modern OR windows_icons_classic))
message(AUTHOR_WARNING "No icons suitable for use on Windows provided")
endif()
if (ARG_OUTFILE_BASE)
set (_outfilebasename "${ARG_OUTFILE_BASE}")
else()
set (_outfilebasename "${appsources}")
endif()
set (_outfilename "${CMAKE_CURRENT_BINARY_DIR}/${_outfilebasename}")
if (WIN32 AND (windows_icons_modern OR windows_icons_classic))
set(saved_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_FIND_MODULE_DIR})
find_package(Png2Ico)
find_package(IcoTool)
set(CMAKE_MODULE_PATH "${saved_CMAKE_MODULE_PATH}")
function(create_windows_icon_and_rc command args deps)
add_custom_command(
OUTPUT "${_outfilename}.ico"
COMMAND ${command}
ARGS ${args}
DEPENDS ${deps}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
# this bit's a little hacky to make the dependency stuff work
file(WRITE "${_outfilename}.rc.in" "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
add_custom_command(
OUTPUT "${_outfilename}.rc"
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${_outfilename}.rc.in" "${_outfilename}.rc"
DEPENDS "${_outfilename}.ico"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
endfunction()
if (IcoTool_FOUND)
set(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
set(maxSize 0)
foreach(size 256 512 1024)
if(icons_at_${size}px)
set(maxSize "${size}")
endif()
endforeach()
foreach(size 16 32 48 64 128 ${maxSize})
if(NOT icons_at_${size}px)
continue()
endif()
set(icotool_icon_arg "")
if(size STREQUAL "${maxSize}")
# maxSize icon needs to be included as raw png
list(APPEND icotool_args "-r")
endif()
foreach(icon ${icons_at_${size}px})
list(APPEND icotool_args "${icons_at_${size}px}")
endforeach()
endforeach()
create_windows_icon_and_rc(IcoTool::IcoTool "${icotool_args}" "${windows_icons_modern}")
set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)
# standard png2ico has no rcfile argument
elseif(Png2Ico_FOUND AND NOT Png2Ico_HAS_RCFILE_ARGUMENT AND windows_icons_classic)
set(png2ico_args)
list(APPEND png2ico_args "${_outfilename}.ico")
list(APPEND png2ico_args "${windows_icons_classic}")
create_windows_icon_and_rc(Png2Ico::Png2Ico "${png2ico_args}" "${windows_icons_classic}")
set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)
# png2ico from kdewin provides rcfile argument
elseif(Png2Ico_FOUND AND windows_icons_classic)
add_custom_command(
OUTPUT "${_outfilename}.rc" "${_outfilename}.ico"
COMMAND Png2Ico::Png2Ico
ARGS
--rcfile "${_outfilename}.rc"
"${_outfilename}.ico"
${windows_icons_classic}
DEPENDS ${windows_icons_classic}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)
# else none of the supported tools was found
else()
message(WARNING "Unable to find the png2ico or icotool utilities or icons in matching sizes - application will not have an application icon!")
endif()
elseif (APPLE AND mac_icons)
# first generate .iconset directory structure, then convert to .icns format using the Mac OS X "iconutil" utility,
# to create retina compatible icon, you need png source files in pixel resolution 16x16, 32x32, 64x64, 128x128,
# 256x256, 512x512, 1024x1024
find_program(ICONUTIL_EXECUTABLE NAMES iconutil)
if (ICONUTIL_EXECUTABLE)
add_custom_command(
OUTPUT "${_outfilename}.iconset"
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory "${_outfilename}.iconset"
)
set(iconset_icons)
macro(copy_icon filename sizename type)
add_custom_command(
OUTPUT "${_outfilename}.iconset/${type}_${sizename}.png"
COMMAND ${CMAKE_COMMAND}
ARGS -E copy
"${filename}"
"${_outfilename}.iconset/${type}_${sizename}.png"
DEPENDS
"${_outfilename}.iconset"
"${filename}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
list(APPEND iconset_icons
"${_outfilename}.iconset/${type}_${sizename}.png")
endmacro()
foreach(size 16 32 128 256 512)
math(EXPR double_size "2 * ${size}")
foreach(file ${icons_at_${size}px})
copy_icon("${file}" "${size}x${size}" "icon")
endforeach()
foreach(file ${icons_at_${double_size}px})
copy_icon("${file}" "${size}x${size}@2x" "icon")
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()
endforeach()
# generate .icns icon file
add_custom_command(
OUTPUT "${_outfilename}.icns"
COMMAND ${ICONUTIL_EXECUTABLE}
ARGS
--convert icns
--output "${_outfilename}.icns"
"${_outfilename}.iconset"
DEPENDS "${iconset_icons}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
# This will register the icon into the bundle
set(MACOSX_BUNDLE_ICON_FILE "${_outfilebasename}.icns" PARENT_SCOPE)
# Append the icns file to the sources list so it will be a dependency to the
# main target
set(${appsources} "${${appsources}};${_outfilename}.icns" PARENT_SCOPE)
# Install the icon into the Resources dir in the bundle
set_source_files_properties("${_outfilename}.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
else()
message(STATUS "Unable to find the iconutil utility - application will not have an application icon!")
endif()
endif()
endfunction()
macro(_ecm_add_app_icon_categorize_icons icons type known_sizes)
set(_${type}_known_sizes)
foreach(size ${known_sizes})
set(${type}_at_${size}px)
list(APPEND _${type}_known_sizes ${size})
endforeach()
foreach(icon ${icons})
get_filename_component(icon_full ${icon} ABSOLUTE)
if (NOT EXISTS "${icon_full}")
message(AUTHOR_WARNING "${icon_full} does not exist, ignoring")
else()
get_filename_component(icon_name ${icon} NAME)
string(REGEX MATCH "([0-9]+)\\-[^/]+\\.([a-z]+)$"
_dummy "${icon_name}")
set(size "${CMAKE_MATCH_1}")
set(ext "${CMAKE_MATCH_2}")
if (NOT (ext STREQUAL "svg" OR ext STREQUAL "svgz"))
if (NOT size)
message(AUTHOR_WARNING "${icon_full} is not named correctly for ecm_add_app_icon - ignoring")
elseif (NOT ext STREQUAL "png")
message(AUTHOR_WARNING "${icon_full} is not a png file - ignoring")
else()
list(FIND _${type}_known_sizes ${size} offset)
if (offset GREATER -1)
list(APPEND ${type}_at_${size}px "${icon_full}")
elseif()
message(STATUS "not found ${type}_at_${size}px ${icon_full}")
endif()
endif()
endif()
endif()
endforeach()
endmacro()

View File

@@ -0,0 +1,297 @@
#.rst:
# ECMFindModuleHelpers
# --------------------
#
# Helper macros for find modules: ecm_find_package_version_check(),
# ecm_find_package_parse_components() and
# ecm_find_package_handle_library_components().
#
# ::
#
# ecm_find_package_version_check(<name>)
#
# Prints warnings if the CMake version or the project's required CMake version
# is older than that required by extra-cmake-modules.
#
# ::
#
# ecm_find_package_parse_components(<name>
# RESULT_VAR <variable>
# KNOWN_COMPONENTS <component1> [<component2> [...]]
# [SKIP_DEPENDENCY_HANDLING])
#
# This macro will populate <variable> with a list of components found in
# <name>_FIND_COMPONENTS, after checking that all those components are in the
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
# an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
# return().
#
# The order of components in <variable> is guaranteed to match the order they
# are listed in the KNOWN_COMPONENTS argument.
#
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
# <name>_<component>_component_deps will be checked for dependent components.
# If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
# dependencies will also be added to <variable>.
#
# ::
#
# ecm_find_package_handle_library_components(<name>
# COMPONENTS <component> [<component> [...]]
# [SKIP_DEPENDENCY_HANDLING])
# [SKIP_PKG_CONFIG])
#
# Creates an imported library target for each component. The operation of this
# macro depends on the presence of a number of CMake variables.
#
# The <name>_<component>_lib variable should contain the name of this library,
# and <name>_<component>_header variable should contain the name of a header
# file associated with it (whatever relative path is normally passed to
# '#include'). <name>_<component>_header_subdir variable can be used to specify
# which subdirectory of the include path the headers will be found in.
# ecm_find_package_components() will then search for the library
# and include directory (creating appropriate cache variables) and create an
# imported library target named <name>::<component>.
#
# Additional variables can be used to provide additional information:
#
# If SKIP_PKG_CONFIG, the <name>_<component>_pkg_config variable is set, and
# pkg-config is found, the pkg-config module given by
# <name>_<component>_pkg_config will be searched for and used to help locate the
# library and header file. It will also be used to set
# <name>_<component>_VERSION.
#
# Note that if version information is found via pkg-config,
# <name>_<component>_FIND_VERSION can be set to require a particular version
# for each component.
#
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
# of the imported target for <component> will be set to contain the imported
# targets for the components listed in <name>_<component>_component_deps.
# <component>_FOUND will also be set to false if any of the compoments in
# <name>_<component>_component_deps are not found. This requires the components
# in <name>_<component>_component_deps to be listed before <component> in the
# COMPONENTS argument.
#
# The following variables will be set:
#
# ``<name>_TARGETS``
# the imported targets
# ``<name>_LIBRARIES``
# the found libraries
# ``<name>_INCLUDE_DIRS``
# the combined required include directories for the components
# ``<name>_DEFINITIONS``
# the "other" CFLAGS provided by pkg-config, if any
# ``<name>_VERSION``
# the value of ``<name>_<component>_VERSION`` for the first component that
# has this variable set (note that components are searched for in the order
# they are passed to the macro), although if it is already set, it will not
# be altered
#
# Note that these variables are never cleared, so if
# ecm_find_package_handle_library_components() is called multiple times with
# different components (typically because of multiple find_package() calls) then
# ``<name>_TARGETS``, for example, will contain all the targets found in any
# call (although no duplicates).
#
# Since pre-1.0.0.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include(CMakeParseArguments)
macro(ecm_find_package_version_check module_name)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake")
endif()
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake")
endif()
endmacro()
macro(ecm_find_package_parse_components module_name)
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
set(ecm_fppc_oneValueArgs RESULT_VAR)
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
if(ECM_FPPC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPPC_RESULT_VAR)
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
endif()
if(${module_name}_FIND_COMPONENTS)
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
# Make sure deps are included
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
if("${ecm_fppc_index}" STREQUAL "-1")
if(NOT ${module_name}_FIND_QUIETLY)
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
endif()
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
endif()
endforeach()
endforeach()
else()
message(STATUS "Skipping dependency handling for ${module_name}")
endif()
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
# This makes sure components are listed in the same order as
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
set(${ECM_FPPC_RESULT_VAR})
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
endif()
endforeach()
# if there are any left, they are unknown components
if(ecm_fppc_requestedComps)
set(ecm_fppc_msgType STATUS)
if(${module_name}_FIND_REQUIRED)
set(ecm_fppc_msgType FATAL_ERROR)
endif()
if(NOT ${module_name}_FIND_QUIETLY)
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
endif()
return()
endif()
else()
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
endif()
endmacro()
macro(ecm_find_package_handle_library_components module_name)
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
set(ecm_fpwc_oneValueArgs)
set(ecm_fpwc_multiValueArgs COMPONENTS)
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
if(ECM_FPWC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPWC_COMPONENTS)
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
endif()
include(FindPackageHandleStandardArgs)
find_package(PkgConfig)
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
set(ecm_fpwc_dep_vars)
set(ecm_fpwc_dep_targets)
if(NOT SKIP_DEPENDENCY_HANDLING)
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
endforeach()
endif()
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
${${module_name}_${ecm_fpwc_comp}_pkg_config})
endif()
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
)
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
)
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
if(NOT ${module_name}_VERSION)
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
endif()
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
FOUND_VAR
${module_name}_${ecm_fpwc_comp}_FOUND
REQUIRED_VARS
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
${ecm_fpwc_dep_vars}
VERSION_VAR
${module_name}_${ecm_fpwc_comp}_VERSION
)
mark_as_advanced(
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
)
if(${module_name}_${ecm_fpwc_comp}_FOUND)
list(APPEND ${module_name}_LIBRARIES
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
list(APPEND ${module_name}_INCLUDE_DIRS
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
set(${module_name}_DEFINITIONS
${${module_name}_DEFINITIONS}
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
)
endif()
list(APPEND ${module_name}_TARGETS
"${module_name}::${ecm_fpwc_comp}")
endif()
endforeach()
if(${module_name}_LIBRARIES)
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
endif()
if(${module_name}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
endif()
if(${module_name}_DEFINITIONS)
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
endif()
if(${module_name}_TARGETS)
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
endif()
endmacro()

View File

@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/../modules/ECMFindModuleHelpers.cmake)

View File

@@ -0,0 +1,27 @@
# Copyright 2017 Vincent Pinon <vpinon@kde.org>
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(IcoTool)
find_program(IcoTool_EXECUTABLE NAMES icotool)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IcoTool
FOUND_VAR
IcoTool_FOUND
REQUIRED_VARS
IcoTool_EXECUTABLE
)
mark_as_advanced(IcoTool_EXECUTABLE)
if (IcoTool_FOUND)
if (NOT TARGET IcoTool::IcoTool)
add_executable(IcoTool::IcoTool IMPORTED)
set_target_properties(IcoTool::IcoTool PROPERTIES
IMPORTED_LOCATION "${IcoTool_EXECUTABLE}"
)
endif()
endif()
include(FeatureSummary)
set_package_properties(IcoTool PROPERTIES
URL "http://www.nongnu.org/icoutils/"
DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file"
)

View File

@@ -0,0 +1,117 @@
#.rst:
# FindPng2Ico
# -----------
#
# Try to find png2ico.
#
# If the png2ico executable is not in your PATH, you can provide
# an alternative name or full path location with the ``Png2Ico_EXECUTABLE``
# variable.
#
# This will define the following variables:
#
# ``Png2Ico_FOUND``
# True if png2ico is available.
#
# ``Png2Ico_EXECUTABLE``
# The png2ico executable.
#
# If ``Png2Ico_FOUND`` is TRUE, it will also define the following imported
# target:
#
# ``Png2Ico::Png2Ico``
# The png2ico executable.
#
# and the following variables:
#
# ``Png2Ico_HAS_COLORS_ARGUMENT``
# Whether png2ico accepts a ``--colors`` argument. `Matthias Benkmann's
# tool <http://www.winterdrache.de/freeware/png2ico/>`_ does, while the
# version of png2ico from the `"KDE On Windows" (kdewin)
# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does not.
#
# ``Png2Ico_HAS_RCFILE_ARGUMENT``
# Whether png2ico accepts an ``--rcfile`` argument. The version of png2ico
# from the `"KDE On Windows" (kdewin)
# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does,
# while `Matthias Benkmann's tool
# <http://www.winterdrache.de/freeware/png2ico/>`_ does not.
#
# Since 1.7.0.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Png2Ico)
# Find png2ico
find_program(Png2Ico_EXECUTABLE NAMES png2ico)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Png2Ico
FOUND_VAR
Png2Ico_FOUND
REQUIRED_VARS
Png2Ico_EXECUTABLE
)
mark_as_advanced(Png2Ico_EXECUTABLE)
if (Png2Ico_FOUND)
execute_process(
COMMAND "${Png2Ico_EXECUTABLE}" --help
OUTPUT_VARIABLE _png2ico_help_text
ERROR_VARIABLE _png2ico_help_text
)
if (_png2ico_help_text MATCHES ".*--rcfile .*")
set(Png2Ico_HAS_RCFILE_ARGUMENT TRUE)
else()
set(Png2Ico_HAS_RCFILE_ARGUMENT FALSE)
endif()
if (_png2ico_help_text MATCHES ".*--colors .*")
set(Png2Ico_HAS_COLORS_ARGUMENT TRUE)
else()
set(Png2Ico_HAS_COLORS_ARGUMENT FALSE)
endif()
unset(_png2ico_help_text)
if (NOT TARGET Png2Ico::Png2Ico)
add_executable(Png2Ico::Png2Ico IMPORTED)
set_target_properties(Png2Ico::Png2Ico PROPERTIES
IMPORTED_LOCATION "${Png2Ico_EXECUTABLE}"
)
endif()
endif()
include(FeatureSummary)
set_package_properties(Png2Ico PROPERTIES
URL "http://www.winterdrache.de/freeware/png2ico/ or https://projects.kde.org/projects/kdesupport/kdewin"
DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file"
)

View File

@@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>@APPLICATION_EXECUTABLE@</string>
<key>CFBundleIconFile</key>
<string>ownCloud.icns</string>
<string>@APPLICATION_EXECUTABLE@.icns</string>
<key>CFBundleIdentifier</key>
<string>@APPLICATION_REV_DOMAIN@</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -27,12 +27,47 @@
<key>CFBundleShortVersionString</key>
<string>@MIRALL_VERSION_STRING@</string>
<key>NSHumanReadableCopyright</key>
<string>(C) 2014-2016 @APPLICATION_VENDOR@</string>
<string>(C) 2014-2018 @APPLICATION_VENDOR@</string>
<key>SUShowReleaseNotes</key>
<false/>
<key>LSMinimumBundleVersion</key>
<string>10.7.0</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>@APPLICATION_REV_DOMAIN@.VIRTUALFILE</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>@APPLICATION_VIRTUALFILE_SUFFIX@</string>
<key>public.mime-type</key>
<string>application/octet-stream</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>@APPLICATION_EXECUTABLE@ Download Virtual File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>@APPLICATION_REV_DOMAIN@.VIRTUALFILE</string>
</array>
</dict>
</array>
</dict>
</plist>

View File

@@ -1,30 +0,0 @@
# - MACRO_ADD_PLUGIN(name [WITH_PREFIX] file1 .. fileN)
#
# Create a plugin from the given source files.
# If WITH_PREFIX is given, the resulting plugin will have the
# prefix "lib", otherwise it won't.
#
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
# Copyright (c) 2006, Andreas Schneider, <asn@cryptomilk.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro (MACRO_ADD_PLUGIN _target_NAME _with_PREFIX)
if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
set(_first_SRC)
else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
set(_first_SRC ${_with_PREFIX})
endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
if (_first_SRC)
set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
endif (_first_SRC)
endmacro (MACRO_ADD_PLUGIN _name _sources)

View File

@@ -1,37 +0,0 @@
# (c) 2014 Copyright ownCloud GmbH
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# - macro_copy_file(_src _dst)
# Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst}
#
# Example:
# macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/.)
# Copies file icon.png to ${CMAKE_CURRENT_BINARY_DIR} directory
#
# Copyright (c) 2006-2007 Wengo
# Copyright (c) 2006-2008 Andreas Schneider <asn@cryptomilk.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING file.
macro (macro_copy_file _src _dst)
# Removes all path containing .svn or CVS or CMakeLists.txt during the copy
if (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
if (CMAKE_VERBOSE_MAKEFILE)
message(STATUS "Copy file from ${_src} to ${_dst}")
endif (CMAKE_VERBOSE_MAKEFILE)
# Creates directory if necessary
get_filename_component(_path ${_dst} PATH)
file(MAKE_DIRECTORY ${_path})
execute_process(
COMMAND
${CMAKE_COMMAND} -E copy_if_different ${_src} ${_dst}
OUTPUT_QUIET
)
endif (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
endmacro (macro_copy_file)

View File

@@ -7,6 +7,8 @@
!define APPLICATION_CMD_EXECUTABLE "@APPLICATION_EXECUTABLE@cmd.exe"
!define APPLICATION_DOMAIN "@APPLICATION_DOMAIN@"
!define APPLICATION_LICENSE "@APPLICATION_LICENSE@"
!define APPLICATION_VIRTUALFILE_SUFFIX "@APPLICATION_VIRTUALFILE_SUFFIX@"
!define APPLICATION_VIRTUALFILE_FILECLASS "@APPLICATION_EXECUTABLE@.@APPLICATION_VIRTUALFILE_SUFFIX@"
!define WIN_SETUP_BITMAP_PATH "@WIN_SETUP_BITMAP_PATH@"
!define CRASHREPORTER_EXECUTABLE "@CRASHREPORTER_EXECUTABLE@"
@@ -100,6 +102,8 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
!include Library.nsh ;Used by the COM registration for shell extensions
!include x64.nsh ;Used to determine the right arch for the shell extensions
!include ${source_path}/admin/win/nsi/lib/fileassoc.nsh
;-----------------------------------------------------------------------------
; Memento selections stored in registry.
;-----------------------------------------------------------------------------
@@ -403,6 +407,8 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${IMAGEFORMATS_DLL_PATH}\qgif.dll"
File "${IMAGEFORMATS_DLL_PATH}\qjpeg.dll"
File "${IMAGEFORMATS_DLL_PATH}\qico.dll"
File "${IMAGEFORMATS_DLL_PATH}\qsvg.dll"
; PNG is built in Qt
SetOutPath "$INSTDIR\sqldrivers"
File "${SQLITE_DLL_PATH}\qsqlite.dll"
@@ -420,6 +426,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${QT_DLL_PATH}\Qt5Gui.dll"
File "${QT_DLL_PATH}\Qt5Network.dll"
File "${QT_DLL_PATH}\Qt5PrintSupport.dll"
File "${QT_DLL_PATH}\Qt5Svg.dll"
File "${QT_DLL_PATH}\Qt5Qml.dll"
File "${QT_DLL_PATH}\Qt5Sql.dll"
File "${QT_DLL_PATH}\Qt5WebKit.dll"
@@ -461,10 +468,14 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${MING_BIN}\libgcc_s_sjlj-1.dll"
File "${MING_BIN}\libstdc++-6.dll"
File "${MING_BIN}\libwinpthread-1.dll"
File "${MING_BIN}\libssp-0.dll"
;CSync configs
File "${SOURCE_PATH}/sync-exclude.lst"
;Add file association
!insertmacro APP_ASSOCIATE "${APPLICATION_VIRTUALFILE_SUFFIX}" "${APPLICATION_VIRTUALFILE_FILECLASS}" "Virtual File for Remote File" "$INSTDIR\${APPLICATION_EXECUTABLE},0" "Download" "$INSTDIR\${APPLICATION_EXECUTABLE} $\"%1$\""
SectionEnd
!ifdef OPTION_SECTION_SC_SHELL_EXT
@@ -603,6 +614,35 @@ Section Uninstall
Abort $UNINSTALL_ABORT
owncloud_installed:
; Delete Navigation Pane entries added for Windows 10.
; On 64bit Windows, the client will be writing to the 64bit registry.
${If} ${RunningX64}
SetRegView 64
${EndIf}
StrCpy $0 0
loop:
; Look at every registered explorer namespace for HKCU and check if it was added by our application
; (we write to a custom "ApplicationName" value there).
EnumRegKey $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace" $0
StrCmp $1 "" done
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$1" "ApplicationName"
StrCmp $R0 "${APPLICATION_NAME}" deleteClsid
; Increment the index when not deleting the enumerated key.
IntOp $0 $0 + 1
goto loop
deleteClsid:
DetailPrint "Removing Navigation Pane CLSID $1"
; Should match FolderMan::updateCloudStorageRegistry
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$1"
DeleteRegKey HKCU "Software\Classes\CLSID\$1"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" $1
goto loop
done:
; Go back to the 32bit registry.
SetRegView lastused
;Delete registry keys.
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild"
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor"
@@ -613,6 +653,9 @@ Section Uninstall
DeleteRegKey HKCR "${APPLICATION_NAME}"
;Remove file association
!insertmacro APP_UNASSOCIATE "${APPLICATION_VIRTUALFILE_SUFFIX}" "${APPLICATION_VIRTUALFILE_FILECLASS}"
;Shell extension
!ifdef OPTION_SECTION_SC_SHELL_EXT
!define LIBRARY_COM

View File

@@ -1,104 +0,0 @@
# (c) 2014 Copyright ownCloud GmbH
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
include (MacroOptionalFindPackage)
include (MacroLogFeature)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Concurrent REQUIRED)
if(UNIT_TESTING)
find_package(Qt5Test REQUIRED)
endif()
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5Widgets REQUIRED)
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif(APPLE)
if(NOT NO_SHIBBOLETH)
find_package(Qt5WebKitWidgets)
find_package(Qt5WebKit)
if(NOT Qt5WebKitWidgets_FOUND)
message(FATAL_ERROR "Qt5WebKit required for Shibboleth. Use -DNO_SHIBBOLETH=1 to disable it.")
endif()
endif()
endif()
# We need this to find the paths to qdbusxml2cpp and co
if (WITH_DBUS)
find_package(Qt5DBus REQUIRED)
include_directories(${Qt5DBus_INCLUDES})
add_definitions(${Qt5DBus_DEFINITIONS})
endif (WITH_DBUS)
include_directories(${Qt5Core_INCLUDES})
add_definitions(${Qt5Core_DEFINITIONS})
if (NOT WIN32) #implied on Win32
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif(NOT WIN32)
# set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(APPLE AND NOT TOKEN_AUTH_ONLY)
include_directories(${Qt5MacExtras_INCLUDE_DIRS})
add_definitions(${Qt5MacExtras_DEFINITIONS})
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5MacExtras_LIBRARIES})
endif()
if(NOT BUILD_LIBRARIES_ONLY)
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
else()
# hack
SET(QT_UIC_EXECUTABLE "")
endif()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5LinguistTools)
if(Qt5LinguistTools_FOUND)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
else()
macro(qt_add_translation)
endmacro()
endif()
else()
macro(qt_add_translation)
endmacro()
endif()
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
macro(qt_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
macro(install_qt_executable)
install_qt5_executable(${ARGN})
endmacro()
macro(setup_qt)
endmacro()
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#Enable deprecated symbols
add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0")
add_definitions("-DQT_USE_QSTRINGBUILDER") #optimize string concatenation
add_definitions("-DQT_MESSAGELOGCONTEXT") #enable function name and line number in debug output

View File

@@ -1,58 +0,0 @@
# - macro_asciidoc2man(inputfile outputfile)
#
# Create a manpage with asciidoc.
# Example: macro_asciidoc2man(foo.txt foo.1)
#
# Copyright (c) 2006, Andreas Schneider, <asn@cryptomilk.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(MacroCopyFile)
macro(MACRO_ASCIIDOC2MAN _a2m_input _a2m_output)
find_program(A2X
NAMES
a2x
)
#message("+++ A2X: ${A2X}")
if (A2X)
#message("+++ ${A2X} --doctype=manpage --format=manpage --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_a2m_input}")
macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_a2m_input} ${CMAKE_CURRENT_BINARY_DIR}/${_a2m_input})
execute_process(
COMMAND
${A2X} --doctype=manpage --format=manpage ${_a2m_input}
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE
A2M_MAN_GENERATED
ERROR_QUIET
)
#message("+++ A2M_MAN_GENERATED: ${A2M_MAN_GENERATED}")
if (A2M_MAN_GENERATED EQUAL 0)
find_file(A2M_MAN_FILE
NAME
${_a2m_output}
PATHS
${CMAKE_CURRENT_BINARY_DIR}
NO_DEFAULT_PATH
)
if (A2M_MAN_FILE)
get_filename_component(A2M_MAN_CATEGORY ${A2M_MAN_FILE} EXT)
string(SUBSTRING ${A2M_MAN_CATEGORY} 1 1 A2M_MAN_CATEGORY)
install(
FILES
${A2M_MAN_FILE}
DESTINATION
${MAN_INSTALL_DIR}/man${A2M_MAN_CATEGORY}
)
endif (A2M_MAN_FILE)
endif (A2M_MAN_GENERATED EQUAL 0)
endif (A2X)
endmacro(MACRO_ASCIIDOC2MAN _a2m_input _a2m_file)

View File

@@ -4,9 +4,14 @@
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long -Wno-gnu-zero-variadic-macro-arguments")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# Fix sqlite compilation on macOS
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types-discards-qualifiers")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# Fix sqlite compilation on MinGW
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)

View File

@@ -18,12 +18,12 @@
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
#cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@"
#cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@"
#cmakedefine APPLICATION_VIRTUALFILE_SUFFIX "@APPLICATION_VIRTUALFILE_SUFFIX@"
#define APPLICATION_DOTVIRTUALFILE_SUFFIX "." APPLICATION_VIRTUALFILE_SUFFIX
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine SHAREDIR "@SHAREDIR@"
#cmakedefine WITH_TESTING 1
#endif

View File

@@ -1,460 +0,0 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "csync_update.cpp"
extern "C" {
#include "torture.h"
#define TESTDB "/tmp/check_csync/journal.db"
static int firstrun = 1;
static void statedb_create_metadata_table(sqlite3 *db)
{
int rc = 0;
if( db ) {
const char *sql = "CREATE TABLE IF NOT EXISTS metadata("
"phash INTEGER(8),"
"pathlen INTEGER,"
"path VARCHAR(4096),"
"inode INTEGER,"
"uid INTEGER,"
"gid INTEGER,"
"mode INTEGER,"
"modtime INTEGER(8),"
"type INTEGER,"
"md5 VARCHAR(32),"
"fileid VARCHAR(128),"
"remotePerm VARCHAR(128),"
"filesize BIGINT,"
"ignoredChildrenRemote INT,"
"contentChecksum TEXT,"
"contentChecksumTypeId INTEGER,"
"PRIMARY KEY(phash));";
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
//const char *msg = sqlite3_errmsg(db);
assert_int_equal( rc, SQLITE_OK );
sql = "CREATE TABLE IF NOT EXISTS checksumtype("
"id INTEGER PRIMARY KEY,"
"name TEXT UNIQUE"
");";
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
assert_int_equal( rc, SQLITE_OK );
}
}
static void statedb_insert_metadata(sqlite3 *db)
{
int rc = 0;
if( db ) {
char *stmt = sqlite3_mprintf("INSERT INTO metadata"
"(phash, pathlen, path, inode, uid, gid, mode, modtime,type,md5) VALUES"
"(%lld, %d, '%q', %d, %d, %d, %d, %lld, %d, '%q');",
(long long signed int)42,
42,
"I_was_wurst_before_I_became_wurstsalat",
619070,
42,
42,
42,
(long long signed int)42,
0,
"4711");
char *errmsg;
rc = sqlite3_exec(db, stmt, NULL, NULL, &errmsg);
sqlite3_free(stmt);
assert_int_equal( rc, SQLITE_OK );
}
}
static int setup(void **state)
{
CSYNC *csync;
int rc;
unlink(TESTDB);
rc = system("mkdir -p /tmp/check_csync");
assert_int_equal(rc, 0);
rc = system("mkdir -p /tmp/check_csync1");
assert_int_equal(rc, 0);
csync_create(&csync, "/tmp/check_csync1");
csync_init(csync, TESTDB);
/* Create a new db with metadata */
sqlite3 *db;
csync->statedb.file = c_strdup(TESTDB);
rc = sqlite3_open(csync->statedb.file, &db);
statedb_create_metadata_table(db);
if( firstrun ) {
statedb_insert_metadata(db);
firstrun = 0;
}
sqlite3_close(db);
rc = csync_statedb_load(csync, TESTDB, &csync->statedb.db);
assert_int_equal(rc, 0);
*state = csync;
return 0;
}
static int setup_ftw(void **state)
{
CSYNC *csync;
int rc;
rc = system("mkdir -p /tmp/check_csync");
assert_int_equal(rc, 0);
rc = system("mkdir -p /tmp/check_csync1");
assert_int_equal(rc, 0);
csync_create(&csync, "/tmp");
csync_init(csync, TESTDB);
sqlite3 *db = NULL;
rc = sqlite3_open_v2(TESTDB, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, NULL);
assert_int_equal(rc, SQLITE_OK);
statedb_create_metadata_table(db);
rc = sqlite3_close(db);
assert_int_equal(rc, SQLITE_OK);
rc = csync_statedb_load(csync, TESTDB, &csync->statedb.db);
assert_int_equal(rc, 0);
csync->statedb.file = c_strdup( TESTDB );
*state = csync;
return 0;
}
static int teardown(void **state)
{
CSYNC *csync = (CSYNC*)*state;
int rc;
unlink( csync->statedb.file);
rc = csync_destroy(csync);
assert_int_equal(rc, 0);
*state = NULL;
return 0;
}
static int teardown_rm(void **state) {
int rc;
teardown(state);
rc = system("rm -rf /tmp/check_csync");
assert_int_equal(rc, 0);
rc = system("rm -rf /tmp/check_csync1");
assert_int_equal(rc, 0);
return 0;
}
/* create a file stat, caller must free memory */
static csync_vio_file_stat_t* create_fstat(const char *name,
ino_t inode,
time_t mtime)
{
csync_vio_file_stat_t *fs = NULL;
time_t t;
fs = csync_vio_file_stat_new();
if (fs == NULL) {
return NULL;
}
if (name && *name) {
fs->name = c_strdup(name);
} else {
fs->name = c_strdup("file.txt");
}
if (fs->name == NULL) {
csync_vio_file_stat_destroy(fs);
return NULL;
}
fs->fields = CSYNC_VIO_FILE_STAT_FIELDS_NONE;
fs->type = CSYNC_VIO_FILE_TYPE_REGULAR;
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
if (inode == 0) {
fs->inode = 619070;
} else {
fs->inode = inode;
}
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_INODE;
fs->size = 157459;
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
if (mtime == 0) {
fs->atime = fs->ctime = fs->mtime = time(&t);
} else {
fs->atime = fs->ctime = fs->mtime = mtime;
}
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ATIME;
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_CTIME;
fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MTIME;
return fs;
}
static int failing_fn(CSYNC *ctx,
const char *file,
const csync_vio_file_stat_t *fs,
int flag)
{
(void) ctx;
(void) file;
(void) fs;
(void) flag;
return -1;
}
/* detect a new file */
static void check_csync_detect_update(void **state)
{
CSYNC *csync = (CSYNC*)*state;
csync_file_stat_t *st;
csync_vio_file_stat_t *fs;
int rc;
fs = create_fstat("file.txt", 0, 1217597845);
assert_non_null(fs);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/file.txt",
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, 0);
/* the instruction should be set to new */
st = (csync_file_stat_t*)c_rbtree_node_data(csync->local.tree->root);
assert_int_equal(st->instruction, CSYNC_INSTRUCTION_NEW);
/* create a statedb */
csync_set_status(csync, 0xFFFF);
csync_vio_file_stat_destroy(fs);
}
/* Test behaviour in case no db is there. For that its important that the
* test before this one uses teardown_rm.
*/
static void check_csync_detect_update_db_none(void **state)
{
CSYNC *csync = (CSYNC*)*state;
csync_file_stat_t *st;
csync_vio_file_stat_t *fs;
int rc;
fs = create_fstat("file.txt", 0, 1217597845);
assert_non_null(fs);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/file.txt",
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, 0);
/* the instruction should be set to new */
st = (csync_file_stat_t*)c_rbtree_node_data(csync->local.tree->root);
assert_int_equal(st->instruction, CSYNC_INSTRUCTION_NEW);
/* create a statedb */
csync_set_status(csync, 0xFFFF);
csync_vio_file_stat_destroy(fs);
}
static void check_csync_detect_update_db_eval(void **state)
{
CSYNC *csync = (CSYNC*)*state;
csync_file_stat_t *st;
csync_vio_file_stat_t *fs;
int rc;
fs = create_fstat("file.txt", 0, 42);
assert_non_null(fs);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/file.txt",
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, 0);
/* the instruction should be set to new */
st = (csync_file_stat_t*)c_rbtree_node_data(csync->local.tree->root);
assert_int_equal(st->instruction, CSYNC_INSTRUCTION_NEW);
/* create a statedb */
csync_set_status(csync, 0xFFFF);
csync_vio_file_stat_destroy(fs);
}
static void check_csync_detect_update_db_rename(void **state)
{
CSYNC *csync = (CSYNC*)*state;
// csync_file_stat_t *st;
csync_vio_file_stat_t *fs;
int rc = 0;
fs = create_fstat("wurst.txt", 0, 42);
assert_non_null(fs);
csync_set_statedb_exists(csync, 1);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/wurst.txt",
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, 0);
/* the instruction should be set to rename */
/*
* temporarily broken.
st = (csync_file_stat_t*)c_rbtree_node_data(csync->local.tree->root);
assert_int_equal(st->instruction, CSYNC_INSTRUCTION_RENAME);
st->instruction = CSYNC_INSTRUCTION_UPDATED;
*/
/* create a statedb */
csync_set_status(csync, 0xFFFF);
csync_vio_file_stat_destroy(fs);
}
static void check_csync_detect_update_db_new(void **state)
{
CSYNC *csync = (CSYNC*)*state;
csync_file_stat_t *st;
csync_vio_file_stat_t *fs;
int rc;
fs = create_fstat("file.txt", 42000, 0);
assert_non_null(fs);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/file.txt",
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, 0);
/* the instruction should be set to new */
st = (csync_file_stat_t*)c_rbtree_node_data(csync->local.tree->root);
assert_int_equal(st->instruction, CSYNC_INSTRUCTION_NEW);
/* create a statedb */
csync_set_status(csync, 0xFFFF);
csync_vio_file_stat_destroy(fs);
}
static void check_csync_detect_update_null(void **state)
{
CSYNC *csync = (CSYNC*)*state;
csync_vio_file_stat_t *fs;
int rc;
fs = create_fstat("file.txt", 0, 0);
assert_non_null(fs);
rc = _csync_detect_update(csync,
NULL,
fs,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, -1);
rc = _csync_detect_update(csync,
"/tmp/check_csync1/file.txt",
NULL,
CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, -1);
csync_vio_file_stat_destroy(fs);
}
static void check_csync_ftw(void **state)
{
CSYNC *csync = (CSYNC*)*state;
int rc;
rc = csync_ftw(csync, "/tmp", csync_walker, MAX_DEPTH);
assert_int_equal(rc, 0);
}
static void check_csync_ftw_empty_uri(void **state)
{
CSYNC *csync = (CSYNC*)*state;
int rc;
rc = csync_ftw(csync, "", csync_walker, MAX_DEPTH);
assert_int_equal(rc, -1);
}
static void check_csync_ftw_failing_fn(void **state)
{
CSYNC *csync = (CSYNC*)*state;
int rc;
rc = csync_ftw(csync, "/tmp", failing_fn, MAX_DEPTH);
assert_int_equal(rc, -1);
}
int torture_run_tests(void)
{
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(check_csync_detect_update, setup, teardown_rm),
cmocka_unit_test_setup_teardown(check_csync_detect_update_db_none, setup, teardown),
cmocka_unit_test_setup_teardown(check_csync_detect_update_db_eval, setup, teardown),
cmocka_unit_test_setup_teardown(check_csync_detect_update_db_rename, setup, teardown),
cmocka_unit_test_setup_teardown(check_csync_detect_update_db_new, setup, teardown_rm),
cmocka_unit_test_setup_teardown(check_csync_detect_update_null, setup, teardown_rm),
cmocka_unit_test_setup_teardown(check_csync_ftw, setup_ftw, teardown_rm),
cmocka_unit_test_setup_teardown(check_csync_ftw_empty_uri, setup_ftw, teardown_rm),
cmocka_unit_test_setup_teardown(check_csync_ftw_failing_fn, setup_ftw, teardown_rm),
};
return cmocka_run_group_tests(tests, NULL, NULL);
}
}

2
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
conf.py
Makefile

View File

@@ -24,7 +24,7 @@ if(SPHINX_FOUND)
add_custom_target(doc DEPENDS doc-html COMMENT "Building documentation...")
endif(WITH_DOC)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc/_shared_assets")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/docs-themes")
add_dependencies(doc doc-html-org)
add_dependencies(doc doc-html-com)
endif()
@@ -38,7 +38,13 @@ if(SPHINX_FOUND)
-D latex_logo=${LATEX_LOGO}
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_PDF_DIR} )
add_custom_target(doc-pdf $(MAKE) -C ${SPHINX_PDF_DIR} all-pdf
set(MAKE "make" CACHE FILEPATH "make to be used for documentation generation if not using make as generator anyway")
if(CMAKE_GENERATOR MATCHES "Makefiles")
set(MAKE "$(MAKE)")
endif()
add_custom_target(doc-pdf ${MAKE} -C ${SPHINX_PDF_DIR} all-pdf
DEPENDS doc-latex )
add_dependencies(doc doc-pdf)
endif(PDFLATEX_FOUND)
@@ -84,4 +90,4 @@ if(SPHINX_FOUND)
${SPHINX_HTMLHELP_DIR} )
add_custom_target( doc-chm pushd ${SPHINX_HTMLHELP_DIR}; ${MSHTML_COMPILER} *.hhp; popd
DEPENDS doc-chm-sphinx )
endif(SPHINX_FOUND)
endif(SPHINX_FOUND)

View File

@@ -1,174 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " pdf to make PDF files"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html: html-org
html-all: html-release html-org html-com
html-release:
$(SPHINXBUILD) -b html -D html_theme='owncloud_release' $(ALLSPHINXOPTS) $(BUILDDIR)/html/release
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/release."
html-org:
$(SPHINXBUILD) -b html -D html_theme='owncloud_org' $(ALLSPHINXOPTS) $(BUILDDIR)/html/org
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/org."
html-com:
$(SPHINXBUILD) -b html -D html_theme='owncloud_com' $(ALLSPHINXOPTS) $(BUILDDIR)/html/com
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/com."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OwncloudDocumentation.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OwncloudDocumentation.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/OwncloudDocumentation"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OwncloudDocumentation"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
@echo
@echo "build finished. the text files are in $(BUILDDIR)/pdf."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "build finished. the text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

View File

@@ -138,8 +138,8 @@ under the original file name.
Example: Assume there is a conflict in message.txt because its contents have
changed both locally and remotely since the last sync run. The local file with
the local changes will be renamed to message_conflict-20160101-153110.txt and
the remote file will be downloaded and saved as message.txt.
the local changes will be renamed to "message (conflicted copy 2016-01-01 153110).txt"
and the remote file will be downloaded and saved as message.txt.
Conflict files are always created on the client and never on the server.
@@ -276,9 +276,15 @@ Some system wide file patterns that are used to exclude or ignore files are incl
By default, the ownCloud Client ignores the following files:
* Files matched by one of the patterns defined in the Ignored Files Editor
* Files containing characters that do not work on certain file systems ``(`\, /, :, ?, *, ", >, <, |`)``.
* Files starting with ``._sync_xxxxxxx.db`` and the old format ``.csync_journal.db``, as these files are reserved for journalling.
* Files matched by one of the patterns defined in the Ignored Files Editor.
* Files starting with ``._sync_*.db*``, ``.sync_*.db*``, ``.csync_journal.db*``, ``.owncloudsync.log*``, as these files are reserved for journalling.
* Files with a name longer than 254 characters.
* The file ``Desktop.ini`` in the root of a synced folder.
* Files matching the pattern ``*_conflict-*`` unless conflict file uploading is enabled.
* Files matching the pattern ``*(conflicted copy*`` unless conflict file uploading is enabled.
* Windows only: Files containing characters that do not work on typical Windows filesystems ``(`\, /, :, ?, *, ", >, <, |`)``.
* Windows only: Files with a trailing space or dot.
* Windows only: Filenames that are reserved on Windows.
If a pattern selected using a checkbox in the `ignoredFilesEditor-label` (or if
a line in the exclude file starts with the character ``]`` directly followed by

View File

@@ -119,7 +119,7 @@ Preventing Automatic Updates in Linux Environments
Because the Linux client does not provide automatic updating functionality, there is no
need to remove the automatic-update check. However, if you want to disable it edit your desktop
client configuration file, ``$HOME/.local/share/data/ownCloud/owncloud.cfg``.
client configuration file, ``$HOME/.config/ownCloud/owncloud.cfg``.
Add this line to the [General] section::
skipUpdateCheck=true

View File

@@ -13,6 +13,14 @@ desktop client.
These instructions are updated to work with version |version| of the ownCloud Client.
Compiling via ownBrander
------------------------
If you don't want to go through the trouble of doing all the compile work manually,
you can use `ownBrander`_ to create installer images for all platforms.
Getting Source Code
-------------------
@@ -51,8 +59,8 @@ distribution. Make sure the repositories for source packages are enabled.
3. Follow the :ref:`generic-build-instructions`, starting with step 2.
Mac OS X
--------
macOS
-----
In addition to needing XCode (along with the command line tools), developing in
the Mac OS X environment requires extra dependencies. You can install these
@@ -77,29 +85,23 @@ To set up your build environment for development using HomeBrew_:
brew tap owncloud/owncloud
5. Install a Qt5 version with qtwebkit support::
5. Install a Qt5 version, ideally from from 5.10.1::
brew install qt5 --with-qtwebkit
brew install qt5
6. Install any missing dependencies::
brew install $(brew deps owncloud-client)
7. Add Qt from brew to the path::
7. Install qtkeychain from here: git clone https://github.com/frankosterfeld/qtkeychain.git
make sure you make the same install prefix as later while building the client e.g.
``-DCMAKE_INSTALL_PREFIX=/Path/to/client/../install``
export PATH=/usr/local/Cellar/qt5/5.x.y/bin:$PATH
8. For compilation of the client, follow the :ref:`generic-build-instructions`.
Where ``x.y`` is the current version of Qt 5 that brew has installed
on your machine.
8. Install qtkeychain from here: git clone https://github.com/frankosterfeld/qtkeychain.git
make sure you make the same install prefix as later while building the client e.g. -
``DCMAKE_INSTALL_PREFIX=/Path/to/client-install``
9. Install the Packages_ package creation tool.
9. For compilation of the client, follow the :ref:`generic-build-instructions`.
10. Install the Packages_ package creation tool.
11. In the build directory, run ``admin/osx/create_mac.sh <build_dir> <install_dir>``.
10. In the build directory, run ``admin/osx/create_mac.sh <CMAKE_INSTALL_DIR> <build dir> <installer sign identity>``.
If you have a developer signing certificate, you can specify
its Common Name as a third parameter (use quotes) to have the package
signed automatically.
@@ -152,7 +154,7 @@ follow `Windows Installer Build (Cross-Compile)`_ instead.
7. Build the client::
cmake -G "MinGW Makefiles" ../client
cmake -G "MinGW Makefiles" -DNO_SHIBBOLETH=1 ../client
mingw32-make
.. note:: You can try using ninja to build in parallel using
@@ -220,16 +222,14 @@ In order to make setup simple, you can use the provided Dockerfile to build your
Generic Build Instructions
--------------------------
Compared to previous versions, building the desktop sync client has become easier. Unlike
earlier versions, CSync, which is the sync engine library of the client, is now
part of the client source repository and not a separate module.
To build the most up-to-date version of the client:
1. Clone the latest versions of the client from Git_ as follows::
git clone git://github.com/owncloud/client.git
cd client
# master this default, but you can also check out a tag like v2.4.1
git checkout master
git submodule init
git submodule update
@@ -240,19 +240,18 @@ To build the most up-to-date version of the client:
3. Configure the client build::
cmake -DCMAKE_BUILD_TYPE="Debug" ..
.. note:: You must use absolute paths for the ``include`` and ``library``
directories.
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/../install/ -DNO_SHIBBOLETH=1 ..``
.. note:: You must use absolute paths for the ``include`` and ``library``
directories.
.. note:: On Mac OS X, you need to specify ``-DCMAKE_INSTALL_PREFIX=target``,
where ``target`` is a private location, i.e. in parallel to your build
dir by specifying ``../install``.
.. note:: qtkeychain must be compiled with the same prefix e.g ``-DCMAKE_INSTALL_PREFIX=/Users/path/to/client/../install/``
.. note:: On Mac OS X, you need to specify ``-DCMAKE_INSTALL_PREFIX=target``,
where ``target`` is a private location, i.e. in parallel to your build
dir by specifying ``../install``.
.. note:: qtkeychain must be compiled with the same prefix e.g ``CMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ .``
.. note:: Example:: ``cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ -DNO_SHIBBOLETH=1``
4. Call ``make``.
The owncloud binary will appear in the ``bin`` directory.
@@ -264,11 +263,10 @@ The following are known cmake parameters:
* ``QTKEYCHAIN_LIBRARY=/path/to/qtkeychain.dylib -DQTKEYCHAIN_INCLUDE_DIR=/path/to/qtkeychain/``:
Used for stored credentials. When compiling with Qt5, the library is called ``qt5keychain.dylib.``
You need to compile QtKeychain with the same Qt version.
You need to compile QtKeychain with the same Qt version. If you install QtKeychain into the CMAKE_PREFIX_PATH then you don't need to specify the path manually.
* ``WITH_DOC=TRUE``: Creates doc and manpages through running ``make``; also adds install statements,
providing the ability to install using ``make install``.
* ``CMAKE_PREFIX_PATH=/path/to/Qt5.2.0/5.2.0/yourarch/lib/cmake/``: Builds using Qt5.
* ``BUILD_WITH_QT4=ON``: Builds using Qt4 (even if Qt5 is found).
* ``CMAKE_PREFIX_PATH=/path/to/Qt5.10.1/5.10.1/yourarch/lib/cmake/``: Builds using that Qt version.
* ``CMAKE_INSTALL_PREFIX=path``: Set an install prefix. This is mandatory on Mac OS
.. _ownCloud repository from OBS: http://software.opensuse.org/download/package?
@@ -285,3 +283,4 @@ The following are known cmake parameters:
.. _QtKeychain: https://github.com/frankosterfeld/qtkeychain
.. _Packages: http://s.sudre.free.fr/Software/Packages/about.html
.. _Index of repositories: http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/
.. _ownBrander: https://doc.owncloud.org/branded_clients/

View File

@@ -1,292 +0,0 @@
# -*- coding: utf-8 -*-
#
# ownCloud Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 22 23:16:40 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'ownCloud Client Manual'
copyright = u'2013-2016, The ownCloud developers'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.4.0'
# The full version, including alpha/beta/rc tags.
release = '2.4.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build','scripts/*']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
2
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/themes']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'bootstrap'
html_theme = 'default'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
html_short_title = "Client Manual"
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'ownCloudClientManual'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'ownCloudClientManual.tex', u'ownCloud Client Manual',
u'The ownCloud developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = 'logo-blue.pdf'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('owncloud.1', 'owncloud', u'File synchronisation desktop utility.',
[u'The ownCloud developers'], 1),
('owncloudcmd.1', 'owncloudcmd', u'Command line ownCloud client tool.',
[u'The ownCloud developers'], 1),
]
# If true, show URL addresses after external links.
man_show_urls = True
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'ownCloudClientManual', u'ownCloud Client Manual',
u'The ownCloud developers', 'ownCloud', 'The ownCloud Client Manual.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'ownCloud Client Manual'
epub_author = u'The ownCloud developers'
epub_publisher = u'The ownCloud developers'
epub_copyright = u'2013-2016, The ownCloud developers'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
# Include todos?
todo_include_todos = True
rst_epilog = '.. |version| replace:: %s' % version

View File

@@ -12,6 +12,7 @@
# serve to show the default.
import sys, os
from datetime import datetime
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -28,7 +29,7 @@ import sys, os
extensions = ['sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/templates']
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/docs-themes/templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -41,7 +42,7 @@ master_doc = 'index'
# General information about the project.
project = u'ownCloud Client Manual'
copyright = u'2013-2016, The ownCloud developers'
copyright = u'2013-{:%Y}, The ownCloud developers'.format(datetime.now())
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -95,7 +96,7 @@ pygments_style = 'sphinx'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/themes']
html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/docs-themes/themes']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -120,7 +121,7 @@ html_short_title = "Client Manual"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/static']
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/docs-themes/static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@@ -250,7 +251,7 @@ texinfo_documents = [
epub_title = u'ownCloud Client Manual'
epub_author = u'The ownCloud developers'
epub_publisher = u'The ownCloud developers'
epub_copyright = u'2013-2016, The ownCloud developers'
epub_copyright = u'2013-{:%Y}, The ownCloud developers'.format(datetime.now())
# The language of the text. It defaults to the language option
# or en if the language is not set.

View File

@@ -1,13 +1,13 @@
The ownCloud Client reads a configuration file. You can locate this configuration file as follows:
On Linux distributions:
``$HOME/.local/share/data/ownCloud/owncloud.cfg``
``$HOME/.config/ownCloud/owncloud.cfg``
On Microsoft Windows systems:
``%LOCALAPPDATA%\ownCloud\owncloud.cfg``
``%APPDATA%\ownCloud\owncloud.cfg``
On MAC OS X systems:
``$HOME/Library/Application Support/ownCloud/owncloud.cfg``
``$HOME/Library/Preferences/ownCloud/owncloud.cfg``
The configuration file contains settings using the Microsoft Windows .ini file
@@ -27,6 +27,8 @@ Some interesting values that can be set on the configuration file are:
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``forceSyncInterval`` | ``7200000`` | The duration of no activity after which a synchronization run shall be triggered automatically. |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``fullLocalDiscoveryInterval`` | ``3600000`` | The interval after which the next synchronization will perform a full local discovery. |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``notificationRefreshInterval`` | ``300000`` | Specifies the default interval of checking for new server notifications in milliseconds. |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
@@ -44,6 +46,13 @@ Some interesting values that can be set on the configuration file are:
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``timeout`` | ``300`` | The timeout for network connections in seconds. |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``moveToTrash`` | ``false`` | If non-locally deleted files should be moved to trash instead of deleting them completely. |
| | | This option only works on linux |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
| ``showExperimentalOptions`` | ``false`` | Whether to show experimental options that are still undergoing testing in the user interface. |
| | | Turning this on does not enable experimental behavior on its own. It does enable user inferface |
| | | options that can be used to opt in to experimental features. |
+---------------------------------+---------------+--------------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------------------------------------------------------------------------------+

61
doc/conflicts.rst Normal file
View File

@@ -0,0 +1,61 @@
=========
Conflicts
=========
.. index:: conflicts
Overview
--------
The ownCloud desktop client uploads local changes and downloads remote changes.
When a file has changed on the local side and on the remote between synchronization
runs the client will be unable to resolve the situation on its own. It will
create a conflict file with the local version, download the remote version and
notify the user that a conflict occured which needs attention.
Example
-------
Imagine there is a file called ``mydata.txt`` your synchronized folder. It has
not changed for a while and contains the text "contents" locally and remotely.
Now, nearly at the same time you update it locally to say "local contents" while
the file on the server gets updated to contain "remote contents" by someone else.
When attempting to upload your local changes the desktop client will notice that
the server version has also changed. It creates a conflict and you will now have
two files on your local machine:
- ``mydata.txt`` containing "remote contents"
- ``mydata (conflicted copy 2018-04-10 093612).txt`` containing "local contents"
In this situation the file ``mydata.txt`` has the remote changes (and will continue
to be updated with further remote changes when they happen), but your local
adjustments have not been sent to the server (unless the server enables conflict
uploading, see below).
The desktop client notifies you of this situation via system notifications, the
system tray icon and a yellow "unresolved conflicts" badge in the account settings
window. Clicking this badge shows a list that includes the unresolved conflicts
and clicking one of them opens an explorer window pointing at the relevant file.
To resolve this conflict, open both files, compare the differences and copy your
local changes from the "conflicted copy" file into the base file where applicable.
In this example you might change ``mydata.txt`` to say "local and remote contents"
and delete the file with "conflicted copy" in its name. With that, the conflict
is resolved.
Uploading conflicts (experimental)
----------------------------------
By default the conflict file (the file with "conflicted copy" in its name that
contains your local conflicting changes) is not uploaded to the server. The idea
is that you, the author of the changes, are the best person for resolving the
conflict and showing the conflict to other users might create confusion.
However, in some scenarios it makes a lot of sense to upload these conflicting
changes such that local work can become visible even if the conflict won't be
resolved immediately.
In the future there might be a server-wide switch for this behavior. For now it
can already be tested by setting the environment variable
``OWNCLOUD_UPLOAD_CONFLICT_FILES=1``.

1
doc/docs-themes Submodule

Submodule doc/docs-themes added at 90bd26b118

View File

@@ -21,6 +21,25 @@ 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.
There Was A Warning About Changes In Synchronized Folders Not Being Tracked Reliably.
-------------------------------------------------------------------------------------
On linux when the synchronized folder contains very many subfolders the
operating system may not allow for enough inotify watches to monitor the
changes in all of them.
In this case the client will not be able to immediately start the
synchronization process when a file in one of the unmonitored folders changes.
Instead, the client will show the warning and manually scan folders for changes
in a regular interval (two hours by default).
This problem can be solved by setting the fs.inotify.max_user_watches
sysctl to a higher value. This can usually be done either temporarily::
echo 524288 > /proc/sys/fs/inotify/max_user_watches
or permanently by adjusting ``/etc/sysctl.conf``.
I Want To Move My Local Sync Folder
-----------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -9,6 +9,7 @@ ownCloud Desktop Client Manual
introduction
installing
navigating
conflicts
advancedusage
autoupdate
building
@@ -16,4 +17,4 @@ ownCloud Desktop Client Manual
troubleshooting
faq
glossary

View File

@@ -24,6 +24,20 @@ 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.
System Requirements
----------------------------------
- Windows 7+
- Mac OS X 10.7+ (**64-bit only**)
- CentOS 6 & 7 (64-bit only)
- Debian 8.0 & 9.0
- Fedora 25 & 26 & 27
- Ubuntu 16.04 & 17.04 & 17.10
- openSUSE Leap 42.2 & 42.3
.. note::
For Linux distributions, we support, if technically feasible, the latest 2 versions per platform and the previous Ubuntu `LTS`_.
Installation Wizard
-------------------
@@ -53,12 +67,7 @@ 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.
.. image:: images/client-4.png
:alt: A successful server connection, showing a button to connect to your
Web GUI, and one to open your local ownCloud folder
Click the Finish button, and you're all done.
.. Links
.. _ownCloud download page: https://owncloud.com/download/#desktop-clients
.. _LTS: https://wiki.ubuntu.com/LTS

View File

@@ -23,11 +23,3 @@ The |version| release of the ownCloud desktop sync client has many new features
improvements. (See the `complete changelog
<https://owncloud.org/changelog/desktop/>`_.)
* Show server notifications on the client
* Improved sync speed
* Improved handling of Win32 file locks and network files
* Improved user notifications about ignored files and conflicts
* Add warnings for old server versions
* Update of QtKeyChain to support Windows credential store
* Packaging of dolphin overlay icon module for bleeding edge distributions

View File

@@ -5,7 +5,7 @@ Using the Synchronization Client
.. index:: navigating, usage
The ownCloud Desktop Client remains in the background and is visible as an icon
in the system tray (Windows, KDE), status bar (Mac OS X), or notification area
in the system tray (Windows, KDE), menu bar (macOS), or notification area
(Linux).
.. figure:: images/icon.png

View File

@@ -107,14 +107,25 @@ Log Files
Effectively debugging software requires as much relevant information as can be
obtained. To assist the ownCloud support personnel, please try to provide as
many relevant logs as possible. Log output can help with tracking down
many relevant logs as possible. Log output can help with tracking down
problems and, if you report a bug, log output can help to resolve an issue more
quickly.
The client log file is often the most helpful log to provide.
Obtaining the Client Log File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To obtain the client log file:
There are several ways to produce log files. The most commonly useful is enabling
logging to a temporary directory, described first.
Note: Client log files contain file and folder names, metadata, server urls and
other private information. Only upload them if you are comfortable sharing the
information. Logs are often essential for tracking down a problem though, so
please consider providing them to developers privately.
Logging to a Temporary Directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Open the ownCloud Desktop Client.
@@ -124,37 +135,22 @@ To obtain the client log file:
.. image:: images/log_output_window.png
3. Click the 'Save' button.
3. Enable the 'Permanently save logs' checkbox.
The Save Log File window opens.
4. Look at its tooltip and take note of the directory the logs will be saved to.
.. image:: images/save_log_file.png
5. Navigate to this directory.
4. Migrate to a location on your system where you want to save your log file.
6. Select the logs for the timeframe in which the issue occurred.
5. Name the log file and click the 'Save' button.
The log file is saved in the location specified.
Alternatively, you can launch the ownCloud Log Output window using the
``--logwindow`` command. After issuing this command, the Log Output window
opens to show the current log. You can then follow the same procedures
mentioned above to save the log to a file.
.. note:: You can also open a log window for an already running session, by
restarting the client using the following command:
* Windows: ``C:\Program Files (x86)\ownCloud\owncloud.exe --logwindow``
* Mac OS X: ``/Applications/owncloud.app/Contents/MacOS/owncloud --logwindow``
* Linux: ``owncloud --logwindow``
Note that the choice to enable logging will be persist across client restarts.
Saving Files Directly
~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^
The ownCloud client enables you to save log files directly to a predefined file
or directory. This is a useful option for troubleshooting sporadic issues as
it enables you to log large amounts of data and bypasses the limited buffer
settings associated with the log window.
The ownCloud client allows you to save log files directly to a custom file
or directory. This is a useful option for easily reproducible problems, as well
as for cases where you want logs to be saved to a different location.
To save log files to a file or a directory:
@@ -170,6 +166,8 @@ the amount of data that accumulates over time, you can specify the
the client automatically erases saved log data in the directory that is older
than the specified number of hours.
Adding the ``--logdebug`` flag increases the verbosity of the generated log files.
As an example, to define a test where you keep log data for two days, you can
issue the following command:

View File

@@ -7,7 +7,7 @@ if(SPHINX_FOUND)
set(SPHINX_MAN_DIR "${CMAKE_CURRENT_BINARY_DIR}/man1")
install(DIRECTORY ${SPHINX_MAN_DIR} DESTINATION ${CMAKE_INSTALL_MANDIR} OPTIONAL)
add_custom_target( doc-man ${SPHINX_EXECUTABLE}
-c ${CMAKE_SOURCE_DIR}/doc -b man
-c ${CMAKE_BINARY_DIR}/doc -b man
-d ${SPHINX_CACHE_DIR}/man
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_MAN_DIR} )

View File

@@ -8,359 +8,7 @@ GenericName=Folder Sync
Icon=@APPLICATION_EXECUTABLE@
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
X-GNOME-Autostart-Delay=3
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
# Translations
MimeType=application/x-@APPLICATION_EXECUTABLE@;
# Translations
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client
@@ -414,7 +62,7 @@ Icon[eu]=@APPLICATION_EXECUTABLE@
GenericName[fa]=همسان سازی پوشه‌ها
Name[fa]=@APPLICATION_EXECUTABLE@ نسخه‌ی همسان سازی مشتری
Icon[fa]=@APPLICATION_EXECUTABLE@
Comment[fr]=Synchronisez vos dossiers avec un serveur @APPLICATION_NAME@
Comment[fr]=Client de synchronisation @APPLICATION_NAME@
GenericName[fr]=Synchronisation de dossier
Name[fr]=Client de synchronisation @APPLICATION_NAME@
Icon[fr]=@APPLICATION_EXECUTABLE@
@@ -450,9 +98,13 @@ Comment[lo]=@APPLICATION_NAME@ ການປະສານຂໍ້ມູນຄອ
GenericName[lo]=ໂຟນເດີຊິງ
Name[lo]=@APPLICATION_NAME@ ຊິງຄອມພິວເຕີລູກຂ່າຍ
Icon[lo]=@APPLICATION_EXECUTABLE@
Comment[mk]=@APPLICATION_NAME@ десктор клиент за синхронизација
GenericName[mk]=Папка за синхронизација
Name[mk]=@APPLICATION_NAME@ десктор клиент за синхронизација
Icon[mk]=@APPLICATION_EXECUTABLE@
Comment[hu_HU]=@APPLICATION_NAME@ asztali szinkronizációs kliens
GenericName[hu_HU]=Könyvtár szinkronizálás
Name[hu_HU]=@APPLICATION_NAME@ asztali szinkr. kliens
GenericName[hu_HU]=Mappaszinkronizálás
Name[hu_HU]=@APPLICATION_NAME@ asztali szinkronizációs kliens
Icon[hu_HU]=@APPLICATION_EXECUTABLE@
Comment[af_ZA]=@APPLICATION_NAME@ werkskermsinchroniseerkliënt
GenericName[af_ZA]=Vouersinchronisering
@@ -527,9 +179,9 @@ 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@
Comment[th_TH]=@APPLICATION_NAME@ ไคลเอนต์ประสานข้อมูลเดสก์ท็อป
Comment[th_TH]=@APPLICATION_NAME@ ประสานข้อมูลด้วยโปรแกรมบนเดสก์ท็อป
GenericName[th_TH]=ประสานข้อมูลโฟลเดอร์
Name[th_TH]= @APPLICATION_NAME@ ไคลเอนต์ประสานข้อมูลเดสก์ท็อป
Name[th_TH]= @APPLICATION_NAME@ ประสานข้อมูลด้วยโปรแกรมบนเดสก์ท็อป
Icon[th_TH]=@APPLICATION_EXECUTABLE@
Comment[es_MX]=Cliente de escritorio para sincronziación de @APPLICATION_NAME@
GenericName[es_MX]=Sincronización de Carpetas

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

5
resources/more.svg Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
<rect style="color:#000000" fill-opacity="0" height="97.986" width="163.31" y="-32.993" x="-62.897"/>
<path d="m3 6c-1.1046 0-2 0.8954-2 2s0.8954 2 2 2 2-0.8954 2-2-0.8954-2-2-2zm5 0c-1.1046 0-2 0.8954-2 2s0.8954 2 2 2 2-0.8954 2-2-0.8954-2-2-2zm5 0c-1.105 0-2 0.8954-2 2s0.895 2 2 2 2-0.8954 2-2-0.895-2-2-2z" fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 660 B

View File

@@ -21,3 +21,7 @@ if( UNIX AND NOT APPLE )
endif()
endif()
endif()
if(MSVC)
add_subdirectory(windows)
endif()

View File

@@ -1,6 +1,5 @@
if(APPLE)
# Contrary to popular belief, this is called like this no matter what theme/OEM.
set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/ownCloud.icns")
set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/${APPLICATION_ICON_NAME}.icns")
# The bundle identifier and application group need to have compatible values with the client
# to be able to open a Mach port across the extension's sandbox boundary.

View File

@@ -23,6 +23,7 @@
NSMutableSet *_registeredDirectories;
NSString *_shareMenuTitle;
NSMutableDictionary *_strings;
NSMutableArray *_menuItems;
}
@end

View File

@@ -21,7 +21,7 @@
- (instancetype)init
{
self = [super init];
FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
NSBundle *extBundle = [NSBundle bundleForClass:[self class]];
// This was added to the bundle's Info.plist to get it from the build system
@@ -43,7 +43,7 @@
[syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"NEW+SWM"];
[syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE+SWM"];
[syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR+SWM"];
// The Mach port name needs to:
// - Be prefixed with the code signing Team ID
// - Then infixed with the sandbox App Group
@@ -55,12 +55,12 @@
// the sandboxed App Extension needs.
// https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
NSString *serverName = [socketApiPrefix stringByAppendingString:@".socketApi"];
// NSLog(@"FinderSync serverName %@", serverName);
//NSLog(@"FinderSync serverName %@", serverName);
_syncClientProxy = [[SyncClientProxy alloc] initWithDelegate:self serverName:serverName];
_registeredDirectories = [[NSMutableSet alloc] init];
_strings = [[NSMutableDictionary alloc] init];
[_syncClientProxy start];
return self;
}
@@ -74,13 +74,27 @@
NSLog(@"ERROR: Could not determine file type of %@", [url path]);
isDir = NO;
}
NSString* normalizedPath = [[url path] decomposedStringWithCanonicalMapping];
[_syncClientProxy askForIcon:normalizedPath isDirectory:isDir];
}
#pragma mark - Menu and toolbar item support
- (NSString*) selectedPathsSeparatedByRecordSeparator
{
FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
NSMutableString *string = [[NSMutableString alloc] init];
[syncController.selectedItemURLs enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
if (string.length > 0) {
[string appendString:@"\x1e"]; // record separator
}
NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
[string appendString:normalizedPath];
}];
return string;
}
- (NSMenu *)menuForMenuKind:(FIMenuKind)whichMenu
{
FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
@@ -101,54 +115,43 @@
}
}];
NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
// calling this IPC calls us back from client with several MENU_ITEM entries and then our askOnSocket returns again
[_syncClientProxy askOnSocket:paths query:@"GET_MENU_ITEMS"];
id contextMenuTitle = [_strings objectForKey:@"CONTEXT_MENU_TITLE"];
id shareTitle = [_strings objectForKey:@"SHARE_MENU_TITLE"];
id copyLinkTitle = [_strings objectForKey:@"COPY_PRIVATE_LINK_MENU_TITLE"];
id emailLinkTitle = [_strings objectForKey:@"EMAIL_PRIVATE_LINK_MENU_TITLE"];
if (contextMenuTitle && !onlyRootsSelected) {
NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
NSMenu *subMenu = [[NSMenu alloc] initWithTitle:@""];
NSMenuItem *subMenuItem = [menu addItemWithTitle:contextMenuTitle action:nil keyEquivalent:@""];
subMenuItem.submenu = subMenu;
subMenuItem.image = [[NSBundle mainBundle] imageForResource:@"app.icns"];
[subMenu addItemWithTitle:shareTitle action:@selector(shareMenuAction:) keyEquivalent:@""];
[subMenu addItemWithTitle:copyLinkTitle action:@selector(copyLinkMenuAction:) keyEquivalent:@""];
[subMenu addItemWithTitle:emailLinkTitle action:@selector(emailLinkMenuAction:) keyEquivalent:@""];
NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
NSMenu *subMenu = [[NSMenu alloc] initWithTitle:@""];
NSMenuItem *subMenuItem = [menu addItemWithTitle:contextMenuTitle action:nil keyEquivalent:@""];
subMenuItem.submenu = subMenu;
subMenuItem.image = [[NSBundle mainBundle] imageForResource:@"app.icns"];
// There is an annoying bug in macOS (at least 10.13.3), it does not use/copy over the representedObject of a menu item
// So we have to use tag instead.
int idx = 0;
for (NSArray* item in _menuItems) {
NSMenuItem *actionItem = [subMenu addItemWithTitle:[item valueForKey:@"text"]
action:@selector(subMenuActionClicked:)
keyEquivalent:@""];
[actionItem setTag:idx];
[actionItem setTarget:self];
NSString *flags = [item valueForKey:@"flags"]; // e.g. "d"
if ([flags rangeOfString:@"d"].location != NSNotFound) {
[actionItem setEnabled:false];
}
idx++;
}
return menu;
}
return nil;
}
- (IBAction)shareMenuAction:(id)sender
{
NSArray* items = [[FIFinderSyncController defaultController] selectedItemURLs];
[items enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
[_syncClientProxy askOnSocket:normalizedPath query:@"SHARE"];
}];
}
- (IBAction)copyLinkMenuAction:(id)sender
{
NSArray* items = [[FIFinderSyncController defaultController] selectedItemURLs];
[items enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
[_syncClientProxy askOnSocket:normalizedPath query:@"COPY_PRIVATE_LINK"];
}];
}
- (IBAction)emailLinkMenuAction:(id)sender
{
NSArray* items = [[FIFinderSyncController defaultController] selectedItemURLs];
[items enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
[_syncClientProxy askOnSocket:normalizedPath query:@"EMAIL_PRIVATE_LINK"];
}];
- (void)subMenuActionClicked:(id)sender {
long idx = [(NSMenuItem*)sender tag];
NSString *command = [[_menuItems objectAtIndex:idx] valueForKey:@"command"];
NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
[_syncClientProxy askOnSocket:paths query:command];
}
#pragma mark - SyncClientProxyDelegate implementation
@@ -181,6 +184,14 @@
[_strings setObject:value forKey:key];
}
- (void)resetMenuItems
{
_menuItems = [[NSMutableArray alloc] init];
}
- (void)addMenuItem:(NSDictionary *)item {
[_menuItems addObject:item];
}
- (void)connectionDidDie
{
[_strings removeAllObjects];

View File

@@ -21,6 +21,8 @@
- (void)registerPath:(NSString*)path;
- (void)unregisterPath:(NSString*)path;
- (void)setString:(NSString*)key value:(NSString*)value;
- (void)resetMenuItems;
- (void)addMenuItem:(NSDictionary *)item;
- (void)connectionDidDie;
@end

View File

@@ -27,7 +27,7 @@
- (instancetype)initWithDelegate:(id)arg1 serverName:(NSString*)serverName
{
self = [super init];
self.delegate = arg1;
_serverName = serverName;
_remoteEnd = nil;
@@ -41,20 +41,20 @@
{
if (_remoteEnd)
return;
// Lookup the server connection
NSConnection *conn = [NSConnection connectionWithRegisteredName:_serverName host:nil];
if (!conn) {
// Could not connect to the sync client
[self scheduleRetry];
return;
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:conn];
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:conn];
NSDistantObject <ServerProtocol> *server = (NSDistantObject <ServerProtocol> *)[conn rootProxy];
assert(server);
@@ -71,7 +71,7 @@
// The server replied with the distant object that we will use for tx
_remoteEnd = (NSDistantObject <ChannelProtocol> *)tx;
[_remoteEnd setProtocolForProxy:@protocol(ChannelProtocol)];
// Everything is set up, start querying
[self askOnSocket:@"" query:@"GET_STRINGS"];
}
@@ -83,7 +83,7 @@
- (void)connectionDidDie:(NSNotification*)notification
{
#pragma unused(notification)
#pragma unused(notification)
_remoteEnd = nil;
[_delegate connectionDidDie];
@@ -95,11 +95,11 @@
- (void)sendMessage:(NSData*)msg
{
NSString *answer = [[NSString alloc] initWithData:msg encoding:NSUTF8StringEncoding];
// Cut the trailing newline
// Cut the trailing newline. We always only receive one line from the client.
answer = [answer substringToIndex:[answer length] - 1];
NSArray *chunks = [answer componentsSeparatedByString: @":"];
if( [[chunks objectAtIndex:0] isEqualToString:@"STATUS"] ) {
NSString *result = [chunks objectAtIndex:1];
NSString *path = [chunks objectAtIndex:2];
@@ -123,6 +123,18 @@
// BEGIN and END messages, do nothing.
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"STRING"] ) {
[_delegate setString:[chunks objectAtIndex:1] value:[chunks objectAtIndex:2]];
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"GET_MENU_ITEMS"] ) {
if ([[chunks objectAtIndex:1] isEqualToString:@"BEGIN"]) {
[_delegate resetMenuItems];
} else if ([[chunks objectAtIndex:1] isEqualToString:@"END"]) {
// Don't do anything special, the askOnSocket call in FinderSync menuForMenuKind will return after this line
}
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"MENU_ITEM"] ) {
NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
[item setValue:[chunks objectAtIndex:1] forKey:@"command"]; // e.g. "COPY_PRIVATE_LINK"
[item setValue:[chunks objectAtIndex:2] forKey:@"flags"]; // e.g. "d"
[item setValue:[chunks objectAtIndex:3] forKey:@"text"]; // e.g. "Copy private link to clipboard"
[_delegate addMenuItem:item];
} else {
NSLog(@"SyncState: Unknown command %@", [chunks objectAtIndex:0]);
}
@@ -131,7 +143,7 @@
- (void)askOnSocket:(NSString*)path query:(NSString*)verb
{
NSString *query = [NSString stringWithFormat:@"%@:%@\n", verb,path];
@try {
[_remoteEnd sendMessage:[query dataUsingEncoding:NSUTF8StringEncoding]];
} @catch(NSException* e) {

View File

@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
******************************************************************************/
#include <KPluginFactory>
#include <KPluginLoader>
#include <KCoreAddons/KPluginFactory>
#include <KCoreAddons/KPluginLoader>
#include <KIOWidgets/kabstractfileitemactionplugin.h>
#include <QtNetwork/QLocalSocket>
#include <KIOCore/kfileitem.h>
@@ -27,10 +27,12 @@
#include <QtWidgets/QMenu>
#include <QtCore/QDir>
#include <QtCore/QTimer>
#include <QtCore/QEventLoop>
#include "ownclouddolphinpluginhelper.h"
class OwncloudDolphinPluginAction : public KAbstractFileItemActionPlugin
{
Q_OBJECT
public:
explicit OwncloudDolphinPluginAction(QObject* parent, const QList<QVariant>&)
: KAbstractFileItemActionPlugin(parent) { }
@@ -38,22 +40,72 @@ public:
QList<QAction*> actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) Q_DECL_OVERRIDE
{
auto helper = OwncloudDolphinPluginHelper::instance();
QList<QUrl> urls = fileItemInfos.urlList();
if (urls.count() != 1 || !helper->isConnected())
if (!helper->isConnected() || !fileItemInfos.isLocal())
return {};
auto url = urls.first();
if (!url.isLocalFile())
return {};
QDir localPath(url.toLocalFile());
auto localFile = localPath.canonicalPath();
// If any of the url is outside of a sync folder, return an empty menu.
const QList<QUrl> urls = fileItemInfos.urlList();
const auto paths = helper->paths();
if (!std::any_of(paths.begin(), paths.end(), [&](const QString &s) {
return localFile.startsWith(s);
} ))
return {};
QByteArray files;
for (const auto &url : urls) {
QDir localPath(url.toLocalFile());
auto localFile = localPath.canonicalPath();
if (!std::any_of(paths.begin(), paths.end(), [&](const QString &s) {
return localFile.startsWith(s);
}))
return {};
if (!files.isEmpty())
files += '\x1e'; // Record separator
files += localFile.toUtf8();
}
if (helper->version() < "1.1") { // in this case, lexicographic order works
return legacyActions(fileItemInfos, parentWidget);
}
auto menu = new QMenu(parentWidget);
QEventLoop loop;
auto con = connect(helper, &OwncloudDolphinPluginHelper::commandRecieved, this, [&](const QByteArray &cmd) {
if (cmd.startsWith("GET_MENU_ITEMS:END")) {
loop.quit();
} else if (cmd.startsWith("MENU_ITEM:")) {
auto args = QString::fromUtf8(cmd).split(QLatin1Char(':'));
if (args.size() < 4)
return;
auto action = menu->addAction(args.mid(3).join(QLatin1Char(':')));
if (args.value(2).contains(QLatin1Char('d')))
action->setDisabled(true);
auto call = args.value(1).toLatin1();
connect(action, &QAction::triggered, [helper, call, files] {
helper->sendCommand(QByteArray(call + ":" + files + "\n"));
});
}
});
QTimer::singleShot(100, &loop, SLOT(quit())); // add a timeout to be sure we don't freeze dolphin
helper->sendCommand(QByteArray("GET_MENU_ITEMS:" + files + "\n"));
loop.exec(QEventLoop::ExcludeUserInputEvents);
disconnect(con);
if (menu->actions().isEmpty()) {
delete menu;
return {};
}
auto menuaction = new QAction(parentWidget);
menuaction->setText(helper->contextMenuTitle());
menuaction->setMenu(menu);
return { menuaction };
}
QList<QAction *> legacyActions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget)
{
QList<QUrl> urls = fileItemInfos.urlList();
if (urls.count() != 1)
return {};
QDir localPath(urls.first().toLocalFile());
auto localFile = localPath.canonicalPath();
auto helper = OwncloudDolphinPluginHelper::instance();
auto menuaction = new QAction(parentWidget);
menuaction->setText(helper->contextMenuTitle());
auto menu = new QMenu(parentWidget);
@@ -61,8 +113,8 @@ public:
auto shareAction = menu->addAction(helper->shareActionTitle());
connect(shareAction, &QAction::triggered, this, [localFile, helper] {
helper->sendCommand(QByteArray("SHARE:"+localFile.toUtf8()+"\n"));
} );
helper->sendCommand(QByteArray("SHARE:" + localFile.toUtf8() + "\n"));
});
if (!helper->copyPrivateLinkTitle().isEmpty()) {
auto copyPrivateLinkAction = menu->addAction(helper->copyPrivateLinkTitle());
@@ -77,7 +129,6 @@ public:
helper->sendCommand(QByteArray("EMAIL_PRIVATE_LINK:" + localFile.toUtf8() + "\n"));
});
}
return { menuaction };
}

View File

@@ -19,6 +19,7 @@
#include <QtNetwork/QLocalSocket>
#include <qcoreevent.h>
#include <QStandardPaths>
#include <QFile>
#include "ownclouddolphinpluginhelper.h"
#include "config.h"
@@ -59,6 +60,7 @@ void OwncloudDolphinPluginHelper::sendCommand(const char* data)
void OwncloudDolphinPluginHelper::slotConnected()
{
sendCommand("VERSION:\n");
sendCommand("GET_STRINGS:\n");
}
@@ -67,12 +69,14 @@ void OwncloudDolphinPluginHelper::tryConnect()
if (_socket.state() != QLocalSocket::UnconnectedState) {
return;
}
QString runtimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));
runtimeDir.append( QChar('/'));
runtimeDir.append( QLatin1String(APPLICATION_SHORTNAME) );
QString socketPath = QStandardPaths::locate(QStandardPaths::RuntimeLocation,
APPLICATION_SHORTNAME,
QStandardPaths::LocateDirectory);
if(socketPath.isEmpty())
return;
const QString socketPath = runtimeDir + QLatin1String("/socket");
_socket.connectToServer(socketPath);
_socket.connectToServer(socketPath + QLatin1String("/socket"));
}
void OwncloudDolphinPluginHelper::slotReadyRead()
@@ -98,6 +102,16 @@ void OwncloudDolphinPluginHelper::slotReadyRead()
_strings[args[1]] = args.mid(2).join(QLatin1Char(':'));
}
continue;
} else if (line.startsWith("VERSION:")) {
auto args = line.split(':');
auto version = args.value(2);
_version = version;
if (!version.startsWith("1.")) {
// Incompatible version, disconnect forever
_connectTimer.stop();
_socket.disconnectFromServer();
return;
}
}
emit commandRecieved(line);
}

View File

@@ -21,6 +21,7 @@
#include <QObject>
#include <QBasicTimer>
#include <QLocalSocket>
#include <QRegularExpression>
#include "ownclouddolphinpluginhelper_export.h"
class OWNCLOUDDOLPHINPLUGINHELPER_EXPORT OwncloudDolphinPluginHelper : public QObject {
@@ -44,6 +45,8 @@ public:
QString copyPrivateLinkTitle() const { return _strings["COPY_PRIVATE_LINK_MENU_TITLE"]; }
QString emailPrivateLinkTitle() const { return _strings["EMAIL_PRIVATE_LINK_MENU_TITLE"]; }
QByteArray version() { return _version; }
signals:
void commandRecieved(const QByteArray &cmd);
@@ -61,4 +64,5 @@ private:
QBasicTimer _connectTimer;
QMap<QString, QString> _strings;
QByteArray _version;
};

View File

@@ -24,6 +24,7 @@ if python3:
import urllib.parse
import socket
import tempfile
import time
from gi.repository import GObject, Nautilus
@@ -34,6 +35,7 @@ from gi.repository import GObject, Nautilus
appname = 'ownCloud'
print("Initializing "+appname+"-client-nautilus extension")
print("Using python version {}".format(sys.version_info))
def get_local_path(url):
if url[0:7] == 'file://':
@@ -62,8 +64,9 @@ class SocketConnect(GObject.GObject):
self.registered_paths = {}
self._watch_id = 0
self._sock = None
self._listeners = [self._update_registered_paths]
self._listeners = [self._update_registered_paths, self._get_version]
self._remainder = ''.encode('utf-8')
self.protocolVersion = '1.0'
self.nautilusVFSFile_table = {} # not needed in this object actually but shared
# all over the other objects.
@@ -96,48 +99,60 @@ class SocketConnect(GObject.GObject):
self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock_file = os.path.join(get_runtime_dir(), appname, "socket")
try:
print("Socket File: " + sock_file)
self._sock.connect(sock_file) # fails if sock_file doesn't exist
self.connected = True
print("Setting connected to %r." % self.connected )
self._watch_id = GObject.io_add_watch(self._sock, GObject.IO_IN, self._handle_notify)
print("Socket watch id: " + str(self._watch_id))
self.sendCommand('VERSION:\n')
self.sendCommand('GET_STRINGS:\n')
return False # Don't run again
except Exception as e:
print("Could not connect to unix socket. " + str(e))
print("Could not connect to unix socket " + sock_file + ". " + str(e))
except Exception as e: # Bad habbit
print("Connect could not be established, try again later.")
self._sock.close()
return True # Run again, if enabled via timeout_add()
# Reads data that becomes available.
# New responses can be accessed with get_available_responses().
# Returns false if no data was received within timeout
def read_socket_data_with_timeout(self, timeout):
self._sock.settimeout(timeout)
try:
self._remainder += self._sock.recv(1024)
except socket.timeout:
return False
else:
return True
finally:
self._sock.settimeout(None)
# Parses response lines out of collected data, returns list of strings
def get_available_responses(self):
end = self._remainder.rfind(b'\n')
if end == -1:
return []
data = self._remainder[:end]
self._remainder = self._remainder[end+1:]
return data.decode('utf-8').split('\n')
# Notify is the raw answer from the socket
def _handle_notify(self, source, condition):
data = source.recv(1024)
# Prepend the remaining data from last call
if len(self._remainder) > 0:
data = self._remainder + data
self._remainder = ''.encode('utf-8')
# Blocking is ok since we're notified of available data
self._remainder += self._sock.recv(1024)
if len(data) > 0:
# Remember the remainder for next round
lastNL = data.rfind('\n'.encode('utf-8'));
if lastNL > -1 and lastNL < len(data):
self._remainder = data[lastNL+1:]
data = data[:lastNL]
for l in data.split('\n'.encode('utf-8')):
self._handle_server_response(l.decode('utf-8'))
else:
if len(self._remainder) == 0:
return False
for line in self.get_available_responses():
self.handle_server_response(line)
return True # Run again
def _handle_server_response(self, line):
print("Server response: " + line)
def handle_server_response(self, line):
# print("Server response: " + line)
parts = line.split(':')
action = parts[0]
args = parts[1:]
@@ -156,6 +171,10 @@ class SocketConnect(GObject.GObject):
if not self.registered_paths:
self.reconnect()
def _get_version(self, action, args):
if action == 'VERSION':
self.protocolVersion = args[1]
socketConnect = SocketConnect()
@@ -185,29 +204,89 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
def get_file_items(self, window, files):
# Show the menu extension to share a file or folder
#
# Show if file is OK.
# Ignore top level folders.
# Also show extension for folders
# if there is a OK or SYNC underneath.
# This is only
if len(files) != 1:
return
file = files[0]
# Get usable file paths from the uris
all_internal_files = True
for i, file_uri in enumerate(files):
filename = get_local_path(file_uri.get_uri())
filename = get_local_path(file.get_uri())
# Check if its a folder (ends with an /), if yes add a "/"
# otherwise it will not find the entry in the table
isDir = os.path.isdir(filename + os.sep)
if isDir:
filename += os.sep
# Check if its a folder (ends with an /), if yes add a "/"
# otherwise it will not find the entry in the table
isDir = os.path.isdir(filename + os.sep)
if isDir:
filename += os.sep
# Check if toplevel folder, we need to ignore those as they cannot be shared
topLevelFolder, internalFile = self.check_registered_paths(filename)
if topLevelFolder or not internalFile:
# Check if toplevel folder, we need to ignore those as they cannot be shared
topLevelFolder, internalFile = self.check_registered_paths(filename)
if not internalFile:
all_internal_files = False
files[i] = filename
# Don't show a context menu if some selected files aren't in a sync folder
if not all_internal_files:
return []
if socketConnect.protocolVersion >= '1.1': # lexicographic!
return self.ask_for_menu_items(files)
else:
return self.legacy_menu_items(files)
def ask_for_menu_items(self, files):
record_separator = '\x1e'
filesstring = record_separator.join(files)
socketConnect.sendCommand('GET_MENU_ITEMS:{}\n'.format(filesstring))
done = False
start = time.time()
timeout = 0.1 # 100ms
menu_items = []
while not done:
dt = time.time() - start
if dt >= timeout:
break
if not socketConnect.read_socket_data_with_timeout(timeout - dt):
break
for line in socketConnect.get_available_responses():
# Process lines we don't care about
if done or not (line.startswith('GET_MENU_ITEMS:') or line.startswith('MENU_ITEM:')):
socketConnect.handle_server_response(line)
continue
if line == 'GET_MENU_ITEMS:END':
done = True
# don't break - we'd discard other responses
if line.startswith('MENU_ITEM:'):
args = line.split(':')
if len(args) < 4:
continue
menu_items.append([args[1], 'd' not in args[2], ':'.join(args[3:])])
if not done:
return self.legacy_menu_items(files)
if len(menu_items) == 0:
return []
# Set up the 'ownCloud...' submenu
item_owncloud = Nautilus.MenuItem(
name='IntegrationMenu', label=self.strings.get('CONTEXT_MENU_TITLE', appname))
menu = Nautilus.Menu()
item_owncloud.set_submenu(menu)
for action, enabled, label in menu_items:
item = Nautilus.MenuItem(name=action, label=label, sensitive=enabled)
item.connect("activate", self.context_menu_action, action, filesstring)
menu.append_item(item)
return [item_owncloud]
def legacy_menu_items(self, files):
# No legacy menu for a selection of several files
if len(files) != 1:
return []
filename = files[0]
entry = socketConnect.nautilusVFSFile_table.get(filename)
if not entry:
return []
@@ -242,7 +321,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
item = Nautilus.MenuItem(
name='NautilusPython::ShareItem',
label=self.strings.get('SHARE_MENU_TITLE', 'Share...'))
item.connect("activate", self.context_menu_action, 'SHARE', file)
item.connect("activate", self.context_menu_action, 'SHARE', filename)
menu.append_item(item)
# Add permalink menu options, but hide these options for older clients
@@ -250,25 +329,24 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
if 'COPY_PRIVATE_LINK_MENU_TITLE' in self.strings:
item_copyprivatelink = Nautilus.MenuItem(
name='CopyPrivateLink', label=self.strings.get('COPY_PRIVATE_LINK_MENU_TITLE', 'Copy private link to clipboard'))
item_copyprivatelink.connect("activate", self.context_menu_action, 'COPY_PRIVATE_LINK', file)
item_copyprivatelink.connect("activate", self.context_menu_action, 'COPY_PRIVATE_LINK', filename)
menu.append_item(item_copyprivatelink)
if 'EMAIL_PRIVATE_LINK_MENU_TITLE' in self.strings:
item_emailprivatelink = Nautilus.MenuItem(
name='EmailPrivateLink', label=self.strings.get('EMAIL_PRIVATE_LINK_MENU_TITLE', 'Send private link by email...'))
item_emailprivatelink.connect("activate", self.context_menu_action, 'EMAIL_PRIVATE_LINK', file)
item_emailprivatelink.connect("activate", self.context_menu_action, 'EMAIL_PRIVATE_LINK', filename)
menu.append_item(item_emailprivatelink)
return [item_owncloud]
def context_menu_action(self, menu, action, file):
filename = get_local_path(file.get_uri())
print("Context menu: " + action + ' ' + filename)
def context_menu_action(self, menu, action, filename):
# print("Context menu: " + action + ' ' + filename)
socketConnect.sendCommand(action + ":" + filename + "\n")
class SyncStateExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider):
class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider):
def __init__(self):
GObject.GObject.__init__(self)

View File

@@ -0,0 +1,4 @@
add_subdirectory(OCContextMenu)
add_subdirectory(OCOverlays)
add_subdirectory(OCUtil)

View File

@@ -0,0 +1,18 @@
add_library(OCContextMenu MODULE
dllmain.cpp
OCClientInterface.cpp
OCContextMenu.cpp
OCContextMenuFactory.cpp
OCContextMenuRegHandler.cpp
stdafx.cpp
OCContextMenu.rc
OCContextMenu.def
)
target_link_libraries(OCContextMenu
OCUtil)
install(TARGETS OCContextMenu
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -34,7 +34,7 @@ using namespace std;
#define PIPE_TIMEOUT 5*1000 //ms
#define SOCK_BUFFER 4096
OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo(const std::wstring &files)
{
auto pipename = CommunicationSocket::DefaultPipePath();
@@ -45,7 +45,8 @@ OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
if (!socket.Connect(pipename)) {
return {};
}
socket.SendMsg(L"GET_STRINGS\n");
socket.SendMsg(L"GET_STRINGS:CONTEXT_MENU_TITLE\n");
socket.SendMsg((L"GET_MENU_ITEMS:" + files + L"\n").data());
ContextMenuInfo info;
std::wstring response;
@@ -60,16 +61,14 @@ OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
wstring stringName, stringValue;
if (!StringUtil::extractChunks(response, stringName, stringValue))
continue;
if (stringName == L"SHARE_MENU_TITLE")
info.shareMenuTitle = move(stringValue);
else if (stringName == L"CONTEXT_MENU_TITLE")
if (stringName == L"CONTEXT_MENU_TITLE")
info.contextMenuTitle = move(stringValue);
else if (stringName == L"COPY_PRIVATE_LINK_MENU_TITLE")
info.copyLinkMenuTitle = move(stringValue);
else if (stringName == L"EMAIL_PRIVATE_LINK_MENU_TITLE")
info.emailLinkMenuTitle = move(stringValue);
}
else if (StringUtil::begins_with(response, wstring(L"GET_STRINGS:END"))) {
} else if (StringUtil::begins_with(response, wstring(L"MENU_ITEM:"))) {
wstring commandName, flags, title;
if (!StringUtil::extractChunks(response, commandName, flags, title))
continue;
info.menuItems.push_back({ commandName, flags, title });
} else if (StringUtil::begins_with(response, wstring(L"GET_MENU_ITEMS:END"))) {
break; // Stop once we completely received the last sent request
}
}
@@ -81,22 +80,7 @@ OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
return info;
}
void OCClientInterface::RequestShare(const std::wstring &path)
{
SendRequest(L"SHARE", path);
}
void OCClientInterface::RequestCopyLink(const std::wstring &path)
{
SendRequest(L"COPY_PRIVATE_LINK", path);
}
void OCClientInterface::RequestEmailLink(const std::wstring &path)
{
SendRequest(L"EMAIL_PRIVATE_LINK", path);
}
void OCClientInterface::SendRequest(wchar_t *verb, const std::wstring &path)
void OCClientInterface::SendRequest(const wchar_t *verb, const std::wstring &path)
{
auto pipename = CommunicationSocket::DefaultPipePath();

View File

@@ -46,18 +46,14 @@ public:
struct ContextMenuInfo {
std::vector<std::wstring> watchedDirectories;
std::wstring contextMenuTitle;
std::wstring shareMenuTitle;
std::wstring copyLinkMenuTitle;
std::wstring emailLinkMenuTitle;
struct MenuItem
{
std::wstring command, flags, title;
};
std::vector<MenuItem> menuItems;
};
static ContextMenuInfo FetchInfo();
static void RequestShare(const std::wstring &path);
static void RequestCopyLink(const std::wstring &path);
static void RequestEmailLink(const std::wstring &path);
private:
static void SendRequest(wchar_t *verb, const std::wstring &path);
static ContextMenuInfo FetchInfo(const std::wstring &files);
static void SendRequest(const wchar_t *verb, const std::wstring &path);
};
#endif //ABSTRACTSOCKETHANDLER_H

View File

@@ -22,13 +22,8 @@
#include <shellapi.h>
#include <StringUtil.h>
extern HINSTANCE g_hInst;
extern long g_cDllRef;
#define IDM_SHARE 0
#define IDM_COPYLINK 1
#define IDM_EMAILLINK 2
OCContextMenu::OCContextMenu(void)
: m_cRef(1)
{
@@ -40,23 +35,6 @@ OCContextMenu::~OCContextMenu(void)
InterlockedDecrement(&g_cDllRef);
}
void OCContextMenu::OnVerbShare(HWND hWnd)
{
OCClientInterface::RequestShare(std::wstring(m_szSelectedFile));
}
void OCContextMenu::OnVerbCopyLink(HWND hWnd)
{
OCClientInterface::RequestCopyLink(std::wstring(m_szSelectedFile));
}
void OCContextMenu::OnVerbEmailLink(HWND hWnd)
{
OCClientInterface::RequestEmailLink(std::wstring(m_szSelectedFile));
}
#pragma region IUnknown
// Query to the interface the component supported.
@@ -97,12 +75,12 @@ IFACEMETHODIMP_(ULONG) OCContextMenu::Release()
IFACEMETHODIMP OCContextMenu::Initialize(
LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hKeyProgID)
{
m_selectedFiles.clear();
if (!pDataObj) {
return E_INVALIDARG;
}
HRESULT hr = E_FAIL;
FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stm;
@@ -110,14 +88,19 @@ IFACEMETHODIMP OCContextMenu::Initialize(
// Get an HDROP handle.
HDROP hDrop = static_cast<HDROP>(GlobalLock(stm.hGlobal));
if (hDrop) {
// Ignore multi-selections
UINT nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
if (nFiles == 1) {
for (int i = 0; i < nFiles; ++i) {
// Get the path of the file.
if (0 != DragQueryFile(hDrop, 0, m_szSelectedFile, ARRAYSIZE(m_szSelectedFile)))
{
hr = S_OK;
wchar_t buffer[MAX_PATH];
if (!DragQueryFile(hDrop, i, buffer, ARRAYSIZE(buffer))) {
m_selectedFiles.clear();
break;
}
if (i)
m_selectedFiles += L'\x1e';
m_selectedFiles += buffer;
}
GlobalUnlock(stm.hGlobal);
@@ -128,7 +111,7 @@ IFACEMETHODIMP OCContextMenu::Initialize(
// If any value other than S_OK is returned from the method, the context
// menu item is not displayed.
return hr;
return m_selectedFiles.empty() ? E_FAIL : S_OK;
}
#pragma endregion
@@ -153,17 +136,8 @@ IFACEMETHODIMP OCContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(0));
}
OCClientInterface::ContextMenuInfo info = OCClientInterface::FetchInfo();
bool skip = true;
size_t selectedFileLength = wcslen(m_szSelectedFile);
for (const std::wstring path : info.watchedDirectories) {
if (StringUtil::isDescendantOf(m_szSelectedFile, selectedFileLength, path)) {
skip = false;
break;
}
}
if (skip) {
m_info = OCClientInterface::FetchInfo(m_selectedFiles);
if (m_info.menuItems.empty()) {
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(0));
}
@@ -175,7 +149,7 @@ IFACEMETHODIMP OCContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT
mii.fMask = MIIM_SUBMENU | MIIM_FTYPE | MIIM_STRING;
mii.hSubMenu = hSubmenu;
mii.fType = MFT_STRING;
mii.dwTypeData = &info.contextMenuTitle[0];
mii.dwTypeData = &m_info.contextMenuTitle[0];
if (!InsertMenuItem(hMenu, indexMenu++, TRUE, &mii))
return HRESULT_FROM_WIN32(GetLastError());
@@ -183,133 +157,59 @@ IFACEMETHODIMP OCContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT
InsertSeperator(hMenu, indexMenu++);
UINT indexSubMenu = 0;
{
assert(!info.shareMenuTitle.empty());
for (auto &item : m_info.menuItems) {
bool disabled = item.flags.find(L'd') != std::string::npos;
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING;
mii.wID = idCmdFirst + IDM_SHARE;
mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING | MIIM_STATE;
mii.wID = idCmdFirst + indexSubMenu;
mii.fType = MFT_STRING;
mii.dwTypeData = &info.shareMenuTitle[0];
mii.dwTypeData = &item.title[0];
mii.fState = disabled ? MFS_DISABLED : MFS_ENABLED;
if (!InsertMenuItem(hSubmenu, indexSubMenu++, TRUE, &mii))
if (!InsertMenuItem(hSubmenu, indexSubMenu, true, &mii))
return HRESULT_FROM_WIN32(GetLastError());
indexSubMenu++;
}
{
assert(!info.copyLinkMenuTitle.empty());
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING;
mii.wID = idCmdFirst + IDM_COPYLINK;
mii.fType = MFT_STRING;
mii.dwTypeData = &info.copyLinkMenuTitle[0];
if (!InsertMenuItem(hSubmenu, indexSubMenu++, TRUE, &mii))
return HRESULT_FROM_WIN32(GetLastError());
}
{
assert(!info.emailLinkMenuTitle.empty());
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING;
mii.wID = idCmdFirst + IDM_EMAILLINK;
mii.fType = MFT_STRING;
mii.dwTypeData = &info.emailLinkMenuTitle[0];
if (!InsertMenuItem(hSubmenu, indexSubMenu++, TRUE, &mii))
return HRESULT_FROM_WIN32(GetLastError());
}
// Return an HRESULT value with the severity set to SEVERITY_SUCCESS.
// Set the code value to the offset of the largest command identifier
// that was assigned, plus one (1).
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(IDM_EMAILLINK + 1));
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(indexSubMenu));
}
IFACEMETHODIMP OCContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO pici)
{
std::wstring command;
// For the Unicode case, if the high-order word is not zero, the
// command's verb string is in lpcmi->lpVerbW.
if (HIWORD(((CMINVOKECOMMANDINFOEX*)pici)->lpVerbW))
{
// Is the verb supported by this context menu extension?
if (StrCmpIW(((CMINVOKECOMMANDINFOEX*)pici)->lpVerbW, L"ocshare") == 0) {
OnVerbShare(pici->hwnd);
}
else if (StrCmpIW(((CMINVOKECOMMANDINFOEX*)pici)->lpVerbW, L"occopylink") == 0) {
OnVerbCopyLink(pici->hwnd);
}
else if (StrCmpIW(((CMINVOKECOMMANDINFOEX*)pici)->lpVerbW, L"ocemaillink") == 0) {
OnVerbEmailLink(pici->hwnd);
}
else {
// If the verb is not recognized by the context menu handler, it
// must return E_FAIL to allow it to be passed on to the other
// context menu handlers that might implement that verb.
command = ((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW;
} else {
// If the command cannot be identified through the verb string, then
// check the identifier offset.
auto offset = LOWORD(pici->lpVerb);
if (offset >= m_info.menuItems.size())
return E_FAIL;
}
}
// If the command cannot be identified through the verb string, then
// check the identifier offset.
else
{
// Is the command identifier offset supported by this context menu
// extension?
if (LOWORD(pici->lpVerb) == IDM_SHARE) {
OnVerbShare(pici->hwnd);
}
else if (LOWORD(pici->lpVerb) == IDM_COPYLINK) {
OnVerbCopyLink(pici->hwnd);
}
else if (LOWORD(pici->lpVerb) == IDM_EMAILLINK) {
OnVerbEmailLink(pici->hwnd);
}
else {
// If the verb is not recognized by the context menu handler, it
// must return E_FAIL to allow it to be passed on to the other
// context menu handlers that might implement that verb.
return E_FAIL;
}
command = m_info.menuItems[offset].command;
}
OCClientInterface::SendRequest(command.data(), m_selectedFiles);
return S_OK;
}
IFACEMETHODIMP OCContextMenu::GetCommandString(UINT_PTR idCommand,
UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
{
HRESULT hr = E_INVALIDARG;
switch (idCommand) {
case IDM_SHARE:
if (uFlags == GCS_VERBW) {
// GCS_VERBW is an optional feature that enables a caller to
// discover the canonical name for the verb passed in through
// idCommand.
hr = StringCchCopy(reinterpret_cast<PWSTR>(pszName), cchMax,
L"OCShareViaOC");
}
break;
case IDM_COPYLINK:
if (uFlags == GCS_VERBW) {
hr = StringCchCopy(reinterpret_cast<PWSTR>(pszName), cchMax,
L"OCCopyLink");
}
break;
case IDM_EMAILLINK:
if (uFlags == GCS_VERBW) {
hr = StringCchCopy(reinterpret_cast<PWSTR>(pszName), cchMax,
L"OCEmailLink");
}
break;
default:
break;
if (idCommand < m_info.menuItems.size() && uFlags == GCS_VERBW) {
return StringCchCopyW(reinterpret_cast<PWSTR>(pszName), cchMax,
m_info.menuItems[idCommand].command.data());
}
// If the idCommand or uFlags is not supported by this context menu
// extension handler, return E_INVALIDARG.
return hr;
return E_INVALIDARG;
}
#pragma endregion
#pragma endregion

View File

@@ -17,6 +17,8 @@
#pragma once
#include <shlobj.h> // For IShellExtInit and IContextMenu
#include <string>
#include "OCClientInterface.h"
class OCContextMenu : public IShellExtInit, public IContextMenu
{
@@ -43,21 +45,9 @@ private:
// Reference count of component.
long m_cRef;
// The name of the selected file.
wchar_t m_szSelectedFile[MAX_PATH];
// The method that handles the "ocshare" verb.
void OnVerbShare(HWND hWnd);
void OnVerbCopyLink(HWND hWnd);
void OnVerbEmailLink(HWND hWnd);
PWSTR m_pszMenuText;
PCSTR m_pszVerb;
PCWSTR m_pwszVerb;
PCSTR m_pszVerbCanonicalName;
PCWSTR m_pwszVerbCanonicalName;
PCSTR m_pszVerbHelpText;
PCWSTR m_pwszVerbHelpText;
// The name of the selected files (separated by '\x1e')
std::wstring m_selectedFiles;
OCClientInterface::ContextMenuInfo m_info;
};
#endif //OCCONTEXTMENU_H

View File

@@ -0,0 +1,17 @@
add_library(OCOverlays MODULE
DllMain.cpp
OCOverlay.cpp
OCOverlayFactory.cpp
OCOverlayRegistrationHandler.cpp
stdafx.cpp
OCOverlay.rc
OCOverlays.def
)
target_link_libraries(OCOverlays
OCUtil)
install(TARGETS OCOverlays
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -22,7 +22,7 @@
#define OVERLAY_GUID_WARNING L"{0960F096-F328-48A3-B746-276B1E3C3722}"
#define OVERLAY_GUID_WARNING_SHARED L"{0960F097-F328-48A3-B746-276B1E3C3722}"
#define OVERLAY_GENERIC_NAME L"OC Overlay Handler"
#define OVERLAY_GENERIC_NAME L"ownCloud overlay handler"
// two spaces to put us ahead of the competition :/
#define OVERLAY_NAME_ERROR L" OCError"
@@ -47,4 +47,4 @@
#define GET_FILE_OVERLAY_ID L"getFileIconId"
#define PORT 34001
#define PORT 34001

View File

@@ -0,0 +1,17 @@
add_library(OCUtil SHARED
CommunicationSocket.cpp
FileUtil.cpp
RegistryUtil.cpp
RemotePathChecker.cpp
stdafx.cpp
StringUtil.cpp
)
target_include_directories(OCUtil
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
)
install(TARGETS OCUtil
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -1,74 +0,0 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
#include "OCMessage.h"
#include "ParserUtil.h"
#include "UtilConstants.h"
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
OCMessage::OCMessage(void)
{
_command = new wstring();
_value = new wstring();
}
OCMessage::~OCMessage(void)
{
}
bool OCMessage::InitFromMessage(const wstring* message)
{
if(message->length() == 0)
{
return false;
}
if(!ParserUtil::GetItem(COMMAND, message, _command))
{
return false;
}
if(!ParserUtil::GetItem(VALUE, message, _value))
{
return false;
}
return true;
}
std::wstring* OCMessage::GetCommand()
{
return _command;
}
std::wstring* OCMessage::GetValue()
{
return _value;
}
void OCMessage::SetCommand(std::wstring* command)
{
_command = command;
}
void OCMessage::SetValue(std::wstring* value)
{
_value = value;
}

View File

@@ -1,42 +0,0 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
#ifndef OCMESSAGE_H
#define OCMESSAGE_H
#include <string>
#pragma once
class __declspec(dllexport) OCMessage
{
public:
OCMessage(void);
~OCMessage(void);
bool InitFromMessage(const std::wstring*);
std::wstring* GetCommand();
std::wstring* GetValue();
void SetCommand(std::wstring*);
void SetValue(std::wstring*);
private:
std::wstring* _command;
std::wstring* _value;
};
#endif

View File

@@ -1,389 +0,0 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
#include "ParserUtil.h"
#include "UtilConstants.h"
#include <iostream>
using namespace std;
bool ParserUtil::GetItem(const wchar_t* item, const wstring* message, wstring* result)
{
size_t start = message->find(item, 0);
if(start == string::npos)
{
return false;
}
size_t end = message->find(COLON, start);
if(end == string::npos)
{
return false;
}
//Move to next character after :
end += 1;
wchar_t c = message->at(end);
//Move to the next character, which is the start of the value
end += 1;
if(c == '[')
{
return GetList(end - 1, message, result);
}
else
{
return GetValue(end, message, result);
}
}
bool ParserUtil::GetList(size_t start, const wstring* message, wstring* result)
{
size_t end = start + 1;
int openBraceCount = 1;
while(openBraceCount > 0)
{
size_t closeBraceLocation = message->find(CLOSE_BRACE, end);
size_t openBraceLocation = message->find(OPEN_BRACE, end);
if(closeBraceLocation < openBraceLocation)
{
openBraceCount--;
end = closeBraceLocation + 1;
}
else if(openBraceLocation < closeBraceLocation)
{
openBraceCount++;
end = openBraceLocation + 1;
}
}
size_t length = end - start;
return GetString(start, end, message, result);
}
size_t ParserUtil::GetNextStringItemInList(const wstring* message, size_t start, wstring* result)
{
size_t end = string::npos;
size_t commaLocation = message->find(COMMA, start);
if(commaLocation == string::npos)
{
end = message->find(CLOSE_BRACE, start);
if(end == string::npos)
{
end = message->length();
}
else
{
end = end - 1;
}
}
else
{
end = commaLocation - 1;
}
if(!GetString(start + 2, end, message, result))
{
return string::npos;
}
return end + 2;
}
size_t ParserUtil::GetNextOCItemInList(const wstring* message, size_t start, wstring* result)
{
size_t end = message->find(OPEN_CURLY_BRACE, start) + 1;
int openBraceCount = 1;
while(openBraceCount > 0)
{
size_t closeBraceLocation = message->find(CLOSE_CURLY_BRACE, end);
size_t openBraceLocation = message->find(OPEN_CURLY_BRACE, end);
if(closeBraceLocation < openBraceLocation)
{
openBraceCount--;
end = closeBraceLocation + 1;
}
else if(openBraceLocation < closeBraceLocation)
{
openBraceCount++;
end = openBraceLocation + 1;
}
}
size_t length = end - start;
if(!GetString(start, end, message, result))
{
return string::npos;
}
return end;
}
bool ParserUtil::GetValue(size_t start, const wstring* message, wstring* result)
{
if(message->at(start - 1) == '\"')
{
size_t end = message->find(QUOTE, start);
return GetString(start, end, message, result);
}
else
{
start = start - 1;
size_t end = message->find(COMMA, start);
result->append(message->substr(start, end-start));
}
return true;
}
bool ParserUtil::GetString(size_t start, size_t end, const wstring* message, wstring* result)
{
if(end == string::npos)
{
return false;
}
size_t length = end - start;
if(length > 0)
{
result->append(message->substr(start, length));
}
else
{
result->append(L"");
}
return true;
}
bool ParserUtil::IsList(wstring* message)
{
wchar_t c = message->at(0);
if(c == '[')
{
return true;
}
return false;
}
bool ParserUtil::ParseJsonList(wstring* message, vector<wstring*>* items)
{
size_t currentLocation = message->find(OPEN_BRACE, 0);
while(currentLocation < message->size())
{
wstring* item = new wstring();
currentLocation = ParserUtil::GetNextStringItemInList(message, currentLocation, item);
if(currentLocation == string::npos)
{
return false;
}
items->push_back(item);
}
return true;
}
bool ParserUtil::ParseOCList(wstring* message, vector<wstring*>* items)
{
size_t currentLocation = message->find(OPEN_CURLY_BRACE, 0);
while(currentLocation < message->size())
{
wstring* item = new wstring();
currentLocation = ParserUtil::GetNextOCItemInList(message, currentLocation, item);
if(currentLocation == string::npos)
{
return false;
}
items->push_back(item);
}
return true;
}
bool ParserUtil::ParseOCMessageList(wstring* message, vector<OCMessage*>* messages)
{
vector<wstring*>* items = new vector<wstring*>();
if(!ParseOCList(message, items))
{
return false;
}
for(vector<wstring*>::iterator it = items->begin(); it != items->end(); it++)
{
wstring* temp = *it;
OCMessage* message = new OCMessage();
message->InitFromMessage(temp);
messages->push_back(message);
}
return true;
}
bool ParserUtil::SerializeList(std::vector<std::wstring>* list, std::wstring* result, bool escapeQuotes)
{
if(result == 0)
{
return false;
}
result->append(OPEN_BRACE);
for(vector<wstring>::iterator it = list->begin(); it != list->end(); it++)
{
wstring value = *it;
if(escapeQuotes)
{
result->append(BACK_SLASH);
}
result->append(QUOTE);
result->append(value.c_str());
if(escapeQuotes)
{
result->append(BACK_SLASH);
}
result->append(QUOTE);
result->append(COMMA);
}
//Erase last comma
result->erase(result->size() - 1, 1);
result->append(CLOSE_BRACE);
return true;
}
bool ParserUtil::SerializeMessage(std::map<std::wstring*, std::wstring*>* arguments, std::wstring* result, bool escapeQuotes)
{
if(result == 0)
{
return false;
}
result->append(OPEN_CURLY_BRACE);
for(map<wstring*, wstring*>::iterator it = arguments->begin(); it != arguments->end(); it++)
{
wstring key = *it->first;
wstring value = *it->second;
if(escapeQuotes)
{
result->append(BACK_SLASH);
}
result->append(QUOTE);
result->append(key.c_str());
if(escapeQuotes)
{
result->append(BACK_SLASH);
}
result->append(QUOTE);
result->append(COLON);
result->append(value.c_str());
result->append(COMMA);
}
//Erase last comma
result->erase(result->size() - 1, 1);
result->append(CLOSE_CURLY_BRACE);
return true;
}
bool ParserUtil::SerializeMessage(OCMessage* OCMessage, std::wstring* result)
{
if(result == 0)
{
return false;
}
result->append(OPEN_CURLY_BRACE);
result->append(QUOTE);
result->append(COMMAND);
result->append(QUOTE);
result->append(COLON);
result->append(QUOTE);
result->append(OCMessage->GetCommand()->c_str());
result->append(QUOTE);
result->append(COMMA);
result->append(QUOTE);
result->append(VALUE);
result->append(QUOTE);
result->append(COLON);
if(!IsList(OCMessage->GetValue()))
{
result->append(QUOTE);
}
result->append(OCMessage->GetValue()->c_str());
if(!IsList(OCMessage->GetValue()))
{
result->append(QUOTE);
}
result->append(CLOSE_CURLY_BRACE);
return true;
}

View File

@@ -61,6 +61,30 @@ public:
thirdChunk = source.substr(statusEnd + 1);
return true;
}
static bool extractChunks(const std::wstring &source, std::wstring &secondChunk, std::wstring &thirdChunk, std::wstring &forthChunk)
{
auto statusBegin = source.find(L':', 0);
assert(statusBegin != std::wstring::npos);
auto statusEnd = source.find(L':', statusBegin + 1);
if (statusEnd == std::wstring::npos) {
// the command do not contains two colon?
return false;
}
auto thirdColon = source.find(L':', statusEnd + 1);
if (statusEnd == std::wstring::npos) {
// the command do not contains three colon?
return false;
}
// Assume the caller extracted the chunk before the first colon.
secondChunk = source.substr(statusBegin + 1, statusEnd - statusBegin - 1);
thirdChunk = source.substr(statusEnd + 1, thirdColon - statusEnd - 1);
forthChunk = source.substr(thirdColon + 1);
return true;
}
};
#endif // STRINGUTIL_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,11 +4,16 @@ 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()
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5Keychain REQUIRED)
endif()
if(NOT WIN32)
if(NOT MSVC)
if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "^(alpha|parisc|hppa)"))
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector --param=ssp-buffer-size=4")

View File

@@ -7,17 +7,7 @@ set(cmd_SRC
simplesslerrorhandler.cpp
netrcparser.cpp
)
include_directories(${CMAKE_SOURCE_DIR}/src/libsync
${CMAKE_BINARY_DIR}/src/libsync
)
# csync is required.
include_directories(${CMAKE_SOURCE_DIR}/src/csync
${CMAKE_BINARY_DIR}/src/csync
)
# Need tokenizer for netrc parser
include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer)
if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
@@ -27,13 +17,15 @@ endif()
if(NOT BUILD_LIBRARIES_ONLY)
add_executable(${cmd_NAME} ${cmd_SRC})
qt5_use_modules(${cmd_NAME} Network )
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}" )
target_link_libraries(${cmd_NAME} ${synclib_NAME})
target_link_libraries(${cmd_NAME} ocsync ${synclib_NAME} Qt5::Core Qt5::Network)
# Need tokenizer for netrc parser
target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer)
endif()
if(BUILD_OWNCLOUD_OSX_BUNDLE)
@@ -45,7 +37,6 @@ elseif(NOT BUILD_LIBRARIES_ONLY)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
# FIXME: The following lines are dup in src/gui and src/cmd because it needs to be done after both are installed
#FIXME: find a nice solution to make the second if(BUILD_OWNCLOUD_OSX_BUNDLE) unnecessary
# currently it needs to be done because the code right above needs to be executed no matter

View File

@@ -23,17 +23,16 @@
#include <QFileInfo>
#include <QJsonDocument>
#include <QJsonObject>
#include <QNetworkProxy>
#include <qdebug.h>
#include "account.h"
#include "clientproxy.h"
#include "configfile.h" // ONLY ACCESS THE STATIC FUNCTIONS!
#include "creds/httpcredentials.h"
#include "simplesslerrorhandler.h"
#include "syncengine.h"
#include "common/syncjournaldb.h"
#include "config.h"
#include "connectionvalidator.h"
#include "cmd.h"
@@ -53,7 +52,7 @@
using namespace OCC;
static void nullMessageHandler(QtMsgType, const char *)
static void nullMessageHandler(QtMsgType, const QMessageLogContext &, const QString &)
{
}
@@ -83,8 +82,6 @@ struct CmdOptions
// So we have to use a global variable
CmdOptions *opts = 0;
const qint64 timeoutToUseMsec = qMax(1000, ConnectionValidator::DefaultCallingIntervalMsec - 5 * 1000);
class EchoDisabler
{
public:
@@ -327,13 +324,11 @@ int main(int argc, char **argv)
options.restartTimes = 3;
options.uplimit = 0;
options.downlimit = 0;
ClientProxy clientProxy;
parseOptions(app.arguments(), &options);
csync_set_log_level(options.silent ? 1 : 11);
if (options.silent) {
qInstallMsgHandler(nullMessageHandler);
qInstallMessageHandler(nullMessageHandler);
} else {
qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}");
}
@@ -440,8 +435,6 @@ int main(int argc, char **argv)
} else {
qFatal("Could not read httpproxy. The proxy should have the format \"http://hostname:port\".");
}
} else {
clientProxy.setupQtProxyFromConfig();
}
SimpleSslErrorHandler *sslErrorHandler = new SimpleSslErrorHandler;
@@ -464,7 +457,6 @@ int main(int argc, char **argv)
QEventLoop loop;
JsonApiJob *job = new JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/capabilities"));
job->setTimeout(timeoutToUseMsec);
QObject::connect(job, &JsonApiJob::jsonReceived, [&](const QJsonDocument &json) {
auto caps = json.object().value("ocs").toObject().value("data").toObject().value("capabilities").toObject();
qDebug() << "Server capabilities" << caps;
@@ -536,7 +528,7 @@ restart_sync:
engine.excludedFiles().addExcludeFilePath(systemExcludeFile);
}
if (!engine.excludedFiles().reloadExcludes()) {
if (!engine.excludedFiles().reloadExcludeFiles()) {
qFatal("Cannot load system exclude list or list supplied via --exclude");
return EXIT_FAILURE;
}

View File

@@ -11,7 +11,6 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "configfile.h"
#include "common/utility.h"
#include "account.h"
#include "simplesslerrorhandler.h"

View File

@@ -207,6 +207,7 @@ static inline uint64_t c_jhash64(const uint8_t *k, uint64_t length, uint64_t int
/* handle the last 23 bytes */
c += length;
switch(len) {
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
case 23: c+=((uint64_t)k[22]<<56);
case 22: c+=((uint64_t)k[21]<<48);
case 21: c+=((uint64_t)k[20]<<40);

View File

@@ -19,8 +19,11 @@
#include "filesystembase.h"
#include <QDateTime>
#include <QDir>
#include <QUrl>
#include <QFile>
#include <QCryptographicHash>
#include <QCoreApplication>
#include <sys/stat.h>
#include <sys/types.h>
@@ -403,27 +406,6 @@ QByteArray FileSystem::calcAdler32(const QString &filename)
}
#endif
QString FileSystem::makeConflictFileName(const QString &fn, const QDateTime &dt)
{
QString conflictFileName(fn);
// Add _conflict-XXXX before the extension.
int dotLocation = conflictFileName.lastIndexOf('.');
// If no extension, add it at the end (take care of cases like foo/.hidden or foo.bar/file)
if (dotLocation <= conflictFileName.lastIndexOf('/') + 1) {
dotLocation = conflictFileName.size();
}
QString timeString = dt.toString("yyyyMMdd-hhmmss");
// Additional marker
QByteArray conflictFileUserName = qgetenv("CSYNC_CONFLICT_FILE_USERNAME");
if (conflictFileUserName.isEmpty())
conflictFileName.insert(dotLocation, "_conflict-" + timeString);
else
conflictFileName.insert(dotLocation, "_conflict_" + QString::fromUtf8(conflictFileUserName) + "-" + timeString);
return conflictFileName;
}
bool FileSystem::remove(const QString &fileName, QString *errorString)
{
#ifdef Q_OS_WIN
@@ -443,6 +425,83 @@ bool FileSystem::remove(const QString &fileName, QString *errorString)
return true;
}
bool FileSystem::moveToTrash(const QString &fileName, QString *errorString)
{
#if defined Q_OS_UNIX && !defined Q_OS_MAC
QString trashPath, trashFilePath, trashInfoPath;
QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME"));
if (xdgDataHome.isEmpty()) {
trashPath = QDir::homePath() + "/.local/share/Trash/"; // trash path that should exist
} else {
trashPath = xdgDataHome + "/Trash/";
}
trashFilePath = trashPath + "files/"; // trash file path contain delete files
trashInfoPath = trashPath + "info/"; // trash info path contain delete files information
if (!(QDir().mkpath(trashFilePath) && QDir().mkpath(trashInfoPath))) {
*errorString = QCoreApplication::translate("FileSystem", "Could not make directories in trash");
return false; //mkpath will return true if path exists
}
QFileInfo f(fileName);
QDir file;
int suffix_number = 1;
if (file.exists(trashFilePath + f.fileName())) { //file in trash already exists, move to "filename.1"
QString path = trashFilePath + f.fileName() + ".";
while (file.exists(path + QString::number(suffix_number))) { //or to "filename.2" if "filename.1" exists, etc
suffix_number++;
}
if (!file.rename(f.absoluteFilePath(), path + QString::number(suffix_number))) { // rename(file old path, file trash path)
*errorString = QCoreApplication::translate("FileSystem", "Could not move '%1' to '%2'")
.arg(f.absoluteFilePath(), path + QString::number(suffix_number));
return false;
}
} else {
if (!file.rename(f.absoluteFilePath(), trashFilePath + f.fileName())) { // rename(file old path, file trash path)
*errorString = QCoreApplication::translate("FileSystem", "Could not move '%1' to '%2'")
.arg(f.absoluteFilePath(), trashFilePath + f.fileName());
return false;
}
}
// create file format for trash info file----- START
QFile infoFile;
if (file.exists(trashInfoPath + f.fileName() + ".trashinfo")) { //TrashInfo file already exists, create "filename.1.trashinfo"
QString filename = trashInfoPath + f.fileName() + "." + QString::number(suffix_number) + ".trashinfo";
infoFile.setFileName(filename); //filename+.trashinfo // create file information file in /.local/share/Trash/info/ folder
} else {
QString filename = trashInfoPath + f.fileName() + ".trashinfo";
infoFile.setFileName(filename); //filename+.trashinfo // create file information file in /.local/share/Trash/info/ folder
}
infoFile.open(QIODevice::ReadWrite);
QTextStream stream(&infoFile); // for write data on open file
QByteArray info = "[Trash Info]\n";
info += "Path=";
info += QUrl::toPercentEncoding(f.absoluteFilePath(), "~_-./");
info += '\n';
info += "DeletionDate=";
info += QDateTime::currentDateTime().toString(Qt::ISODate).toLatin1();
info += '\n';
stream << info;
infoFile.close();
// create info file format of trash file----- END
return true;
#else
Q_UNUSED(fileName)
*errorString = QCoreApplication::translate("FileSystem", "Moving to the trash is not implemented on this platform");
return false;
#endif
}
bool FileSystem::isFileLocked(const QString &fileName)
{
#ifdef Q_OS_WIN

View File

@@ -109,6 +109,11 @@ namespace FileSystem {
*/
bool OCSYNC_EXPORT remove(const QString &fileName, QString *errorString = 0);
/**
* Move the specified file or folder to the trash. (Only implemented on linux)
*/
bool OCSYNC_EXPORT moveToTrash(const QString &filename, QString *errorString);
/**
* Replacement for QFile::open(ReadOnly) followed by a seek().
* This version sets a more permissive sharing mode on Windows.
@@ -131,11 +136,6 @@ namespace FileSystem {
QByteArray OCSYNC_EXPORT calcAdler32(const QString &fileName);
#endif
/**
* Returns a file name based on \a fn that's suitable for a conflict.
*/
QString OCSYNC_EXPORT makeConflictFileName(const QString &fn, const QDateTime &dt);
/**
* Returns true when a file is locked. (Windows only)
*/

View File

@@ -26,6 +26,7 @@
#include "ownsql.h"
#include "common/utility.h"
#include "common/asserts.h"
#include <sqlite3.h>
#define SQLITE_SLEEP_TIME_USEC 100000
#define SQLITE_REPEAT_COUNT 20
@@ -48,6 +49,12 @@ SqlDatabase::SqlDatabase()
{
}
SqlDatabase::~SqlDatabase()
{
close();
}
bool SqlDatabase::isOpen()
{
return _db != 0;
@@ -183,6 +190,9 @@ QString SqlDatabase::error() const
void SqlDatabase::close()
{
if (_db) {
foreach (auto q, _queries) {
q->finish();
}
SQLITE_DO(sqlite3_close(_db));
if (_errId != SQLITE_OK)
qCWarning(lcSql) << "Closing database failed" << _error;
@@ -216,9 +226,8 @@ sqlite3 *SqlDatabase::sqliteDb()
/* =========================================================================================== */
SqlQuery::SqlQuery(SqlDatabase &db)
: _db(db.sqliteDb())
, _stmt(0)
, _errId(0)
: _sqldb(&db)
, _db(db.sqliteDb())
{
}
@@ -229,18 +238,16 @@ SqlQuery::~SqlQuery()
}
}
SqlQuery::SqlQuery(const QString &sql, SqlDatabase &db)
: _db(db.sqliteDb())
, _stmt(0)
, _errId(0)
SqlQuery::SqlQuery(const QByteArray &sql, SqlDatabase &db)
: _sqldb(&db)
, _db(db.sqliteDb())
{
prepare(sql);
}
int SqlQuery::prepare(const QString &sql, bool allow_failure)
int SqlQuery::prepare(const QByteArray &sql, bool allow_failure)
{
QString s(sql);
_sql = s.trimmed();
_sql = sql.trimmed();
if (_stmt) {
finish();
}
@@ -248,7 +255,7 @@ int SqlQuery::prepare(const QString &sql, bool allow_failure)
int n = 0;
int rc;
do {
rc = sqlite3_prepare_v2(_db, _sql.toUtf8().constData(), -1, &_stmt, 0);
rc = sqlite3_prepare_v2(_db, _sql.constData(), -1, &_stmt, 0);
if ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)) {
n++;
OCC::Utility::usleep(SQLITE_SLEEP_TIME_USEC);
@@ -260,19 +267,32 @@ int SqlQuery::prepare(const QString &sql, bool allow_failure)
_error = QString::fromUtf8(sqlite3_errmsg(_db));
qCWarning(lcSql) << "Sqlite prepare statement error:" << _error << "in" << _sql;
ENFORCE(allow_failure, "SQLITE Prepare error");
} else {
ASSERT(_stmt);
_sqldb->_queries.insert(this);
}
}
return _errId;
}
/**
* There is no overloads to QByteArray::startWith that takes Qt::CaseInsensitive.
* Returns true if 'a' starts with 'b' in a case insensitive way
*/
static bool startsWithInsensitive(const QByteArray &a, const char *b)
{
int len = strlen(b);
return a.size() >= len && qstrnicmp(a.constData(), b, len) == 0;
}
bool SqlQuery::isSelect()
{
return (!_sql.isEmpty() && _sql.startsWith("SELECT", Qt::CaseInsensitive));
return startsWithInsensitive(_sql, "SELECT");
}
bool SqlQuery::isPragma()
{
return (!_sql.isEmpty() && _sql.startsWith("PRAGMA", Qt::CaseInsensitive));
return startsWithInsensitive(_sql, "PRAGMA");
}
bool SqlQuery::exec()
@@ -439,8 +459,13 @@ int SqlQuery::numRowsAffected()
void SqlQuery::finish()
{
if (!_stmt)
return;
SQLITE_DO(sqlite3_finalize(_stmt));
_stmt = 0;
if (_sqldb) {
_sqldb->_queries.remove(this);
}
}
void SqlQuery::reset_and_clear_bindings()
@@ -451,4 +476,18 @@ void SqlQuery::reset_and_clear_bindings()
}
}
bool SqlQuery::initOrReset(const QByteArray &sql, OCC::SqlDatabase &db)
{
ENFORCE(!_sqldb || &db == _sqldb);
_sqldb = &db;
_db = db.sqliteDb();
if (_stmt) {
reset_and_clear_bindings();
return true;
} else {
return prepare(sql) == 0;
}
}
} // namespace OCC

View File

@@ -19,15 +19,19 @@
#ifndef OWNSQL_H
#define OWNSQL_H
#include <sqlite3.h>
#include <QObject>
#include <QVariant>
#include <QSet>
#include "ocsynclib.h"
struct sqlite3;
struct sqlite3_stmt;
namespace OCC {
class SqlQuery;
/**
* @brief The SqlDatabase class
* @ingroup libsync
@@ -37,6 +41,7 @@ class OCSYNC_EXPORT SqlDatabase
Q_DISABLE_COPY(SqlDatabase)
public:
explicit SqlDatabase();
~SqlDatabase();
bool isOpen();
bool openOrCreateReadWrite(const QString &filename);
@@ -61,18 +66,54 @@ private:
sqlite3 *_db;
QString _error; // last error string
int _errId;
friend class SqlQuery;
QSet<SqlQuery *> _queries;
};
/**
* @brief The SqlQuery class
* @ingroup libsync
*
* There is basically 3 ways to initialize and use a query:
*
SqlQuery q1;
[...]
q1.initOrReset(...);
q1.bindValue(...);
q1.exec(...)
*
SqlQuery q2(db);
q2.prepare(...);
[...]
q2.reset_and_clear_bindings();
q2.bindValue(...);
q2.exec(...)
*
SqlQuery q3("...", db);
q3.bindValue(...);
q3.exec(...)
*
*/
class OCSYNC_EXPORT SqlQuery
{
Q_DISABLE_COPY(SqlQuery)
public:
explicit SqlQuery() = default;
explicit SqlQuery(SqlDatabase &db);
explicit SqlQuery(const QString &sql, SqlDatabase &db);
explicit SqlQuery(const QByteArray &sql, SqlDatabase &db);
/**
* Prepare the SqlQuery if it was not prepared yet.
* Otherwise, clear the results and the bindings.
* return false if there is an error
*/
bool initOrReset(const QByteArray &sql, SqlDatabase &db);
/**
* Prepare the SqlQuery.
* If the query was already prepared, this will first call finish(), and re-prepare it.
* This function must only be used if the constructor was setting a SqlDatabase
*/
int prepare(const QByteArray &sql, bool allow_failure = false);
~SqlQuery();
QString error() const;
@@ -81,16 +122,13 @@ public:
/// Checks whether the value at the given column index is NULL
bool nullValue(int index);
QString stringValue(int index);
int intValue(int index);
quint64 int64Value(int index);
QByteArray baValue(int index);
bool isSelect();
bool isPragma();
bool exec();
int prepare(const QString &sql, bool allow_failure = false);
bool next();
void bindValue(int pos, const QVariant &value);
QString lastQuery() const;
@@ -99,11 +137,12 @@ public:
void finish();
private:
sqlite3 *_db;
sqlite3_stmt *_stmt;
SqlDatabase *_sqldb = nullptr;
sqlite3 *_db = nullptr;
sqlite3_stmt *_stmt = nullptr;
QString _error;
int _errId;
QString _sql;
QByteArray _sql;
};
} // namespace OCC

File diff suppressed because it is too large Load Diff

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