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

Compare commits

...

307 Commits

Author SHA1 Message Date
Nextcloud bot
adada8b2ee [tx-robot] updated from transifex 2020-07-09 23:50:49 +00:00
Michael Schuster
8a38e820a6 Merge pull request #2184 from nextcloud/backport/2183/stable-2.6
[stable-2.6] Prevent empty FileMap in local csync to be processed if folder not empty
2020-07-10 01:47:37 +02:00
Dominique Fuchs
475267aff4 Prevent empty FileMap in local csync to be processed if folder not empty
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit d47e570ff3)
(cherry picked from commit f8920f969f)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-10 01:32:09 +02:00
Michael Schuster
cba879e2af Bump version to 2.6.5
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-09 17:58:43 +02:00
Michael Schuster
05e071bafe Merge pull request #2179 from nextcloud/backport/2168/stable-2.6
[stable-2.6] Display the correct default permissions when creating a share.
2020-07-09 06:18:18 +02:00
Camila
7e4846eeda Display the correct default permissions when creating a share.
- The default displayed was not in sync with the server because
the client was setting permissions when creating a share while it
should get the default permissions from the server to display it to the
user first.

Signed-off-by: Camila <hello@camila.codes>
(cherry picked from commit d7a1367292)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-09 06:07:25 +02:00
Nextcloud bot
bc2244679c [tx-robot] updated from transifex 2020-07-08 03:39:42 +00:00
Michael Schuster
6320c60d77 Merge pull request #2170 from nextcloud/backport/2153/stable-2.6
[stable 2.6] Asemmar/issue 2137
2020-07-08 03:37:01 +02:00
asemmar
abc3d6a271 forgot some indent
Signed-off-by: asemmar <anis.semmar@itron.com>
(cherry picked from commit 628a426d22)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-08 03:30:19 +02:00
asemmar
8cc7fa20d3 fixed bad spelling of word 'retreive' except in sqlite dependancy
Signed-off-by: asemmar <anis.semmar@itron.com>
(cherry picked from commit d5587e386c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-08 03:29:39 +02:00
Nextcloud bot
016d21dead [tx-robot] updated from transifex 2020-07-07 03:34:00 +00:00
Michael Schuster
68aa9853c9 Merge pull request #2162 from nextcloud/backport/2127/stable-2.6
[stable-2.6] ConfigFile security: Migrate Proxy password to keychain
2020-07-07 00:23:41 +02:00
Michael Schuster
5db65ad6b8 Cleanup auto pointers and qobject casts, refactor KeychainChunk
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit f4d83d02f6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-07 00:17:41 +02:00
Michael Schuster
6e2e1b3650 ProxyAuthHandler: Add template member function execAwait to avoid code duplication
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit ff631e919f)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 23:10:41 +02:00
Michael Schuster
331778c73b Keychain: Use auto deletion in WebFlowCredentials and ConfigFile
- Also make use of the new KeychainChunk::DeleteJob

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 8503226c44)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 23:10:39 +02:00
Michael Schuster
2a6a7fb9d3 Refactor KeychainChunk to use QEventLoop and add DeleteJob class
- Use QEventLoop for synchronous exec()
- Rename startAwait() to exec()
- Add code for auto deletion
- Add new DeleteJob class
- Cleanup, tweaks

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 42eb3388f8)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 23:04:41 +02:00
Michael Schuster
3766f70e43 Refactor ProxyAuthHandler to use QEventLoop
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit ea95c4bf49)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 23:02:33 +02:00
Michael Schuster
6f33740601 ConfigFile security: Migrate Proxy password to keychain
When specified in the config file, the Proxy password will be migrated
to the keychain, for backward compatibility and to allow admins to
overwrite an existing password by rolling out updated config files.

Once migrated to the keychain, the password will be removed from the
config file.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 81c644e702)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 23:00:10 +02:00
Michael Schuster
03e5fa3d49 KeychainChunk: Add synchronous method startAwait()
Awaits completion with no need to connect some slot to the finished() signal first,
inspired by the ProxyAuthHandler class.

Also add:
- Job dtor to safely erase passwords
- textData() method
- New ctor overloads to work with arbitrary keys (without Account ptrs)

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 18cbbc5052)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 22:54:41 +02:00
Michael Schuster
b36c9e6960 Move KeychainChunk class from gui to libsync
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 2a3ef044be)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 22:54:40 +02:00
Michael Schuster
7f41805bc4 Move QKeychain::NoBackendAvailable error handling to KeychainChunk class
Originally this was in the WebFlowCredentials class. Since we've abstracted everything
from there already, let's also move this in case some other code may use
KeychainChunk::ReadJob prior to WebFlowCredentials.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 203a2ce003)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 22:53:34 +02:00
Nextcloud bot
7c0cf20901 [tx-robot] updated from transifex 2020-07-06 03:23:26 +00:00
Nextcloud bot
babc4aaf3d [tx-robot] updated from transifex 2020-07-05 03:24:11 +00:00
Nextcloud bot
91db96267f [tx-robot] updated from transifex 2020-07-04 03:26:26 +00:00
Nextcloud bot
a59e5689cb [tx-robot] updated from transifex 2020-07-03 03:29:01 +00:00
Camila
0dde3172e6 Don't display quota information when the user has no quota.
- The code handling the api response was not up to date with the latest
api changes.
- Unlimited quota display: use qint64 to avoid data loss
- Change total with quota: total holds the quota total and not the storage total.

Signed-off-by: Camila <hello@camila.codes>
2020-07-02 20:28:46 +02:00
Nextcloud bot
7212bdc02f [tx-robot] updated from transifex 2020-07-02 03:34:39 +00:00
Michael Schuster
4584b78b71 Merge pull request #2147 from nextcloud/backport/2145/stable-2.6
[stable-2.6] Repair and improve logging
2020-07-01 19:45:02 +02:00
Kevin Ottens
7033f16014 Allow to control logFlush from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:41 +00:00
Kevin Ottens
d08485331f Allow to control logDir from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:41 +00:00
Kevin Ottens
d4cbbebd37 Allow to control logExpire from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Kevin Ottens
727c1e9e6c Allow to control log debug from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Kevin Ottens
7a7675379d Have a filter rule capturing all of nextcloud debug
This was half broken before that commit and the previous one since some
of the categories would not be captured.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Kevin Ottens
2bf9742504 Make sure all our logging categories start with nextcloud.
Otherwise it was a bit confusing and annoying for filter rules:
e.g. "nextcloud.sync.*" vs "sync.*".

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Kevin Ottens
5f1158a8a2 Repair the log message pattern
At last it will become useful again...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Kevin Ottens
43e502778f Properly guard io.h since it is Windows only
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:08:40 +00:00
Hannah von Reth
f73a90ce26 [Logger] Ensure log file is flushed before crash 2020-07-01 17:08:40 +00:00
Hannah von Reth
64b0cab524 [Logger] Ensure errors are also printed to an attached console 2020-07-01 17:08:40 +00:00
Olivier Goffart
376522bc34 Logger: Remove the thread pointer from the log.
We don't do discovery in a thread or use many threads anymore so this is
just noise.

Also use of QString::sprintf is deprecated, and C cast.
2020-07-01 17:08:40 +00:00
Hannah von Reth
f2006d50ce [Logger] Correctly handle message priority
This fixes the flodded sys log.

Fixes: #7453
2020-07-01 17:08:40 +00:00
Hannah von Reth
0d6edf1240 Print critical and fatal messages to stderr
That way we might get a reason why the client crashes (dev setup)
2020-07-01 17:08:39 +00:00
Christian Kamm
94d92c73c2 LogDir: Compress last logfile on restart
For #7353
2020-07-01 17:08:39 +00:00
Dominik Schmidt
ea4ae81c08 Make -logfile - work on Windows 2020-07-01 17:08:39 +00:00
Dominik Schmidt
c6a360238f Make qFatal() trigger the crash reporter on Windows 2020-07-01 17:08:39 +00:00
Nextcloud bot
445d4d6892 [tx-robot] updated from transifex 2020-07-01 03:24:38 +00:00
Nextcloud bot
0bc4346f30 [tx-robot] updated from transifex 2020-06-30 03:23:58 +00:00
Nextcloud bot
a505071589 [tx-robot] updated from transifex 2020-06-29 03:24:24 +00:00
Nextcloud bot
cd9de7c340 [tx-robot] updated from transifex 2020-06-26 03:24:40 +00:00
Nextcloud bot
5a6b877695 [tx-robot] updated from transifex 2020-06-25 03:26:03 +00:00
Nextcloud bot
6202df1cd0 [tx-robot] updated from transifex 2020-06-24 03:24:50 +00:00
Nextcloud bot
ae33f10226 [tx-robot] updated from transifex 2020-06-23 03:29:14 +00:00
Michael Schuster
0181debae0 Fix issue #2108: Default system proxy not working with Account Wizard
Discovered on Windows in conjunction with PAC scripts:
- Already configured accounts worked
- Fresh client account setup did not work

Reason:
- Proxy was reset over and over again in Account::setCredentials

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 902963fa10)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-22 15:53:22 +02:00
Nextcloud bot
bd17cb0b86 [tx-robot] updated from transifex 2020-06-21 03:23:11 +00:00
Nextcloud bot
be62480d0f [tx-robot] updated from transifex 2020-06-20 03:25:47 +00:00
Nextcloud bot
5234dea356 [tx-robot] updated from transifex 2020-06-19 03:27:07 +00:00
Michael Schuster
27a453ae1a Fix libsync exports for proxy changes in #1886
Build failed on Windows, missing libsync export for printQNetworkProxy after
moving ClientProxy class from gui to libsync.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 92c8d6836b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 21:38:58 +02:00
Michael Schuster
eb55308949 Improve proxy logging: Log type string instead of abstract ID
The format in the client log was: 3://host:port
Now it is shown like:             HttpProxy://host:port

The old ID display was confusing and misleading users (and people debugging it ;p)

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 0253e98041)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 21:37:26 +02:00
Roeland Jago Douma
9d829b2933 Move the proxyfiles to libsync where they make more sense
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 50dcab5f88)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 21:36:40 +02:00
Marcin Wilk
456e338363 Add photothumb.db to sync-exclude.lst
Add photothumb.db file that is thumbnails generated by Photoscape application (generated in every folder with graphic files).

(cherry picked from commit 299749681d)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 20:29:54 +02:00
Nextcloud bot
24446977c8 [tx-robot] updated from transifex 2020-06-18 03:25:49 +00:00
Nextcloud bot
3a9e12f8c5 [tx-robot] updated from transifex 2020-06-17 03:23:46 +00:00
Nextcloud bot
bdede5cfc4 [tx-robot] updated from transifex 2020-06-15 03:24:41 +00:00
Nextcloud bot
e39a9ba7ae [tx-robot] updated from transifex 2020-06-14 03:22:33 +00:00
Nextcloud bot
23c3885854 [tx-robot] updated from transifex 2020-06-13 03:23:36 +00:00
Nextcloud bot
a186ac6a29 [tx-robot] updated from transifex 2020-06-11 03:24:17 +00:00
Michael Schuster
7c7627995e Merge pull request #2084 from nextcloud/backport/1749/stable-2.6
[stable-2.6] macOS: Use macdeployqt instead of the old admin/osx/macdeployqt.py
2020-06-11 02:55:29 +02:00
Michael Schuster
f62c0f0c0d Merge branch 'stable-2.6' into backport/1749/stable-2.6 2020-06-11 02:54:21 +02:00
Michael Schuster
9a55396cb6 macOS: Build nextcloudcmd after gui and run macdeployqt with the -executable option
- src/CMakeLists.txt: Switch build order to build cmd before gui
- src/gui/CMakeLists.txt: Use the -executable option for a combined run of macdeployqt

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e6389959ce)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-11 02:49:11 +02:00
Dominique Fuchs
24a989532d Copy nextcloudcmd post-build instead of macdeployqt when building macOS bundle
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit a45c2e04e5)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-11 02:38:40 +02:00
Michael Schuster
c3a4bccb30 macOS: Use macdeployqt instead of the old admin/osx/macdeployqt.py
In order to build the new 2.7 releases (new QML dependencies) without manually
modifying the old Python script each time, rely on Qt's standard tool instead.

This should streamline the build systems for upcoming dependency changes.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit acb56be528)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-11 02:35:48 +02:00
Michael Schuster
0da8951a4a Merge pull request #2083 from nextcloud/backport/2077/stable-2.6
[stable-2.6] Simplify nullptr comparisons where appropriate
2020-06-11 02:25:57 +02:00
Michael Schuster
ad524e8a61 Simplify nullptr comparisons where appropriate
Make the codebase consistent, we already have a lot of implicit pointer comparisons.

Exception: Stay explicit on return's, example:
  return _db != nullptr;

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 456c1eadbe)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-11 02:19:57 +02:00
Nextcloud bot
cd9a055053 [tx-robot] updated from transifex 2020-06-10 03:27:12 +00:00
Michael Schuster
513176ae40 Merge pull request #2078 from nextcloud/backport/2057/stable-2.6
[stable-2.6] Replace NULL by nullptr in all C++ files
2020-06-10 04:57:39 +02:00
Michael Schuster
74dda92f88 Fix nullptr regression in RegistryUtil::ReadRegistry
Merging PR #2057 caused the Windows build to fail:

shell_integration\windows\OCUtil\RegistryUtil.cpp(43): error C2664: 'LSTATUS RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY)': cannot convert argument 3 from 'nullptr' to 'DWORD'

The previous implementation prior the PR supplied NULL as the argument 3 to RegOpenKeyEx,
so it was silently accepted and translated to zero, satisfying the DWORD's type requirement.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit bbe1d2e84c0201ce5aba0fedfedf94b23a546111)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-10 04:14:28 +02:00
Stephan Beyer
e6236d4ef5 Replace NULL by nullptr in all C++ files
We keep NULL in the pure C files in src/csync/std and test/csync.

We also replace Doxygen documentation referring to "NULL" to
"\c nullptr" (formatted as code).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit 39198e4116380d577241658920d6ae213c0f5d38)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-10 04:09:44 +02:00
Roeland Jago Douma
ac414c4374 Don't show a message box if the entered url returned an error
BEtter to now just display clickable links etc.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-06-09 13:44:24 +02:00
Nextcloud bot
b4e681d128 [tx-robot] updated from transifex 2020-06-09 03:24:34 +00:00
Michael Schuster
4572f96745 Merge pull request #2072 from nextcloud/stable-2.6-upgrade-qt-5.12.8
[stable-2.6] AppImage: Upgrade to Qt 5.12.8
2020-06-09 04:08:38 +02:00
Michael Schuster
d5b737ab4b [stable-2.6] AppImage: Upgrade to Qt 5.12.8
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 04:06:06 +02:00
Michael Schuster
e06990427b Merge pull request #2071 from nextcloud/lnx-domainname-desktopfiles-stable-2.6
[stable-2.6] Linux/Wayland: Updated .desktop file naming scheme
2020-06-09 04:00:21 +02:00
Dominique Fuchs
4fec80d4de Created wrapper variable LINUX_APPLICATION_ID to clean up code
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

(cherry picked from commit 3ad1c0e7a8)

Solved conflicts (2020-06-09):
- No modifications needed for: admin/linux/build-appimage.sh

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 03:29:20 +02:00
Dominique Fuchs
6cba316ab5 Updated AppImage instructions w/ new desktop file name
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

(cherry picked from commit a8ecf486d1)

Solved conflicts while cherry-picking (2020-06-09):
- Modified to match with master's newer version, so we also don't need to
  cherry-pick 0c4c5c5f8b

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 03:20:22 +02:00
Dominique Fuchs
b642574751 Corrected new .desktop file location in forgotten function
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit 83918619cf)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 03:01:19 +02:00
Dominique Fuchs
8f909a0de4 Updated .desktop file naming scheme
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit 96da4674f9)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 03:00:27 +02:00
Dominique Fuchs
43f2826622 Fixed wrongly formatted define statement
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit e5f0ee3b92)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-09 02:59:39 +02:00
Michael Schuster
7b8b9742f4 Merge pull request #2069 from nextcloud/nicolasfella-autostarticon
[stable-2.6] Use APPLICATION_ICON_NAME for autostart icon
2020-06-09 01:59:59 +02:00
Nicolas Fella
531af5bb31 Use APPLICATION_ICON_NAME for autostart icon
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
(cherry picked from commit bce93b052b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-08 21:48:13 +02:00
Michael Schuster
9357fb981e Merge pull request #2064 from nextcloud/backport/2063/stable-2.6
[stable-2.6] macOS: Opt In to Dark Mode for building against older macOS SDKs < 10.14
2020-06-07 16:40:31 +02:00
Michael Schuster
115bef589b macOS: Opt In to Dark Mode for building against older macOS SDKs < 10.14
Required for our build server that uses an older SDK to support previous macOS versions.

See: https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 14:39:18 +00:00
Michael Schuster
69b9c4715e Merge pull request #2062 from nextcloud/backport/2061/stable-2.6
[stable-2.6] Improve command line version info and help display (gui & cmd)
2020-06-07 15:51:59 +02:00
Michael Schuster
0ff93727b2 Improve command line version info and help display to streamline gui and cmd
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 12:44:09 +00:00
Nextcloud bot
3b28d9471a [tx-robot] updated from transifex 2020-06-07 03:24:21 +00:00
Nextcloud bot
688512cc8c [tx-robot] updated from transifex 2020-06-06 03:26:32 +00:00
Nextcloud bot
c2bb7446aa [tx-robot] updated from transifex 2020-06-05 03:23:27 +00:00
Nextcloud bot
dd03eddb38 [tx-robot] updated from transifex 2020-06-04 03:23:36 +00:00
Nextcloud bot
3ec89ccc5d [tx-robot] updated from transifex 2020-06-03 03:24:04 +00:00
Nextcloud bot
19f2a43ef4 [tx-robot] updated from transifex 2020-06-02 03:23:57 +00:00
Nextcloud bot
0a791acd10 [tx-robot] updated from transifex 2020-06-01 03:23:38 +00:00
Michael Schuster
1976471543 Merge pull request #2052 from nextcloud/backport/2051/stable-2.6
[stable-2.6] Remove Submodule binary (old upstream binaries)
2020-05-31 16:10:02 +02:00
Michael Schuster
4419e7fe2a Remove Submodule binary (old upstream binaries)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-31 14:08:23 +00:00
Nextcloud bot
92e77a186a [tx-robot] updated from transifex 2020-05-31 03:24:09 +00:00
Nextcloud bot
2eb7ba2eb4 [tx-robot] updated from transifex 2020-05-30 03:24:01 +00:00
Nextcloud bot
cdd1e7b69f [tx-robot] updated from transifex 2020-05-29 03:25:37 +00:00
Michael Schuster
b972fd9e19 Merge pull request #2034 from nextcloud/backport/2032/stable-2.6
[stable-2.6] testLaunchOnStartup shouldn't fail on dev setup
2020-05-27 16:15:01 +02:00
Kevin Ottens
fb6f998a7a testLaunchOnStartup shouldn't fail on dev setup
This test was failing locally for me. Indeed, through QStandardPaths it
was finding the user settings of my production client and not having the
initial state it expected. Using QStandardPaths test mode then it starts
from a clean slate every time.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 14:13:25 +00:00
Michael Schuster
f2a8106a57 Merge pull request #2033 from nextcloud/backport/2023/stable-2.6
[stable-2.6] Use the return braced init list pattern
2020-05-27 16:12:23 +02:00
Kevin Ottens
fb428847af Use the return braced init list pattern
This way we avoid repeating the return type while it is already known.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 14:09:38 +00:00
Nextcloud bot
2f20530bf1 [tx-robot] updated from transifex 2020-05-27 03:25:40 +00:00
Michael Schuster
4f988e09ca Merge pull request #2029 from nextcloud/backport/2021/stable-2.6
[stable-2.6] Use = default for trivial ctors and dtors
2020-05-27 05:19:11 +02:00
Kevin Ottens
1e12b9dca8 Use = default for trivial ctors and dtors
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 03:18:10 +00:00
Michael Schuster
ce9fa18976 Merge pull request #2028 from nextcloud/backport/2020/stable-2.6
[stable-2.6] Use make_unique when appropriate
2020-05-27 05:12:32 +02:00
Kevin Ottens
8cd63918a7 Use make_unique when appropriate
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 03:11:35 +00:00
Michael Schuster
a87e90a56f Merge pull request #2027 from nextcloud/backport/2019/stable-2.6
[stable-2.6] Remove redundant void argument list
2020-05-27 05:10:30 +02:00
Kevin Ottens
67276be84f Remove redundant void argument list
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 03:08:41 +00:00
Michael Schuster
d3a71c1f60 Merge pull request #2026 from nextcloud/backport/2018/stable-2.6
[stable-2.6] Use using instead of typedef
2020-05-27 05:06:43 +02:00
Kevin Ottens
f48ebfd0ab Use using instead of typedef
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 03:05:47 +00:00
Michael Schuster
2670fcc0f9 Merge pull request #2025 from nextcloud/backport/2017/stable-2.6
[stable-2.6] Remove redundant initializer
2020-05-27 05:03:16 +02:00
Kevin Ottens
822fcad0c2 Remove redundant initializer
This is the same value than the initializer value in the header, no need
to repeat it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-27 03:02:21 +00:00
Nextcloud bot
9d0b0cb3b6 [tx-robot] updated from transifex 2020-05-25 03:22:45 +00:00
Nextcloud bot
2173abd23f [tx-robot] updated from transifex 2020-05-24 03:23:49 +00:00
Michael Schuster
fb01fda0fb Merge pull request #2007 from nextcloud/backport/2006/stable-2.6
[stable-2.6] Improve URL input field in Wizard
2020-05-23 20:08:08 +02:00
Stephan Beyer
8a938c4af3 Replace "https://..." hint by "https://host:port"
The new hint is a little more verbose and provides more information
than the old one.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-23 18:07:11 +00:00
Stephan Beyer
992ba0321f Show URL placeholder hint in wizard
In owncloudsetupnocredspage.ui, the URL input field leUrl has a
placeholder text saying "https://..." which is a very useful hint
for the user.  However, in the OwncloudSetupPage constructor, the
placeholer text is overwritten by the return string of the theme's
wizardUrlHint() method.  The NextcloudTheme class does not override
this virtual method, so an empty string is used.

To make available the "https://..." hint, it is moved from the
UI file to NextcloudTheme::wizardUrlHint().  Note that, if a
theme is used which does not allow a custom server URL, the
placeholder text is now empty.  This makes sense because the
input field is disabled in that case.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-23 18:07:10 +00:00
Stephan Beyer
fb33e8f84b Change vertical size policy of URL input field in wizard
The input field for the nextcloud server URL is vertically too
big (because of the icon next to it in the same horizontal layout).
This commit solves this issue by changing its vertical size policy
from Ignored to Fixed.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-23 18:07:10 +00:00
Nextcloud bot
ef6f00798f [tx-robot] updated from transifex 2020-05-23 03:26:22 +00:00
Michael Schuster
eb122ffbec Merge pull request #2005 from nextcloud/backport/2001/stable-2.6
[stable-2.6] Use default member initialization
2020-05-22 16:08:47 +02:00
Stephan Beyer
815170728e Use default member initializers in OCC::FolderStatusModel sub-structs
This allows to remove their explicit default constructor definitions.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-22 14:07:27 +00:00
Stephan Beyer
d9d14fd091 Use default member initializers in OCC::SyncJournalErrorBlacklistRecord
This allows to remove its explicit default constructor definition.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-22 14:07:26 +00:00
Stephan Beyer
23902944da Use default member initializers in OCC::SyncJournalDb sub-structs
This allows to remove their explicit default constructor definitions.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-22 14:07:26 +00:00
Stephan Beyer
6f57016120 Use default member initializers in OCC::FolderDefinition
Using default member initializers (available since C++11) in
OCC::FolderDefinition allows to remove its explicit default
constructor, which is favorable.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-22 14:07:26 +00:00
Stephan Beyer
cd69585d4a Remove unused member in OCC::FolderDefinition
OCC::FolderDefinition has a member called isClientSideEncrypted
that was introduced by commit 9318c487b9 but has not been used
in any way since.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-22 14:07:26 +00:00
Kevin Ottens
0fb0fc2d7e Don't use int literals for bools
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
(cherry picked from commit 5543e4d834)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-22 16:05:23 +02:00
Stephan Beyer
40121dd03d Fix leak in OCC::AccountManager stub for FolderManTest
We simply use a static QObject using Q_GLOBAL_STATIC()
instead of allocating a leaking QObject on the heap.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit f275640343)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-22 15:54:57 +02:00
Stephan Beyer
da9e2250d7 Fix leak in CloudProviderManager
The member _map, allocated in the constructor, was leaking.

The ad-hoc way to fix the leak would have been to add a destructor
that deletes _map.  However, there is no good reason why _map has
to be a pointer to a QMap (instead of a QMap).
Hence this commit changes the type of the _map member from a QMap
pointer to a QMap.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit eaf4aa0e5b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-22 15:54:49 +02:00
Stephan Beyer
6aa087a892 Fix leak in CloudProviderWrapper
The member _recentlyChanged, allocated in the constructor, was leaking.

The ad-hoc way to fix the leak would have been to add a destructor
that deletes _recentlyChanged.  However, there is no good reason why
_recentlyChanged has to be a pointer to a QList (instead of a QList).
Hence this commit changes the type of the _recentlyChanged member
from a QList pointer to a QList.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit 71a474129b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-22 15:54:36 +02:00
Nextcloud bot
a6a9df9720 [tx-robot] updated from transifex 2020-05-22 03:28:02 +00:00
Nextcloud bot
aa71623946 [tx-robot] updated from transifex 2020-05-21 03:27:30 +00:00
Nextcloud bot
03c63721a4 [tx-robot] updated from transifex 2020-05-20 03:24:56 +00:00
Michael Schuster
f77b706eb1 Merge pull request #1999 from nextcloud/backport/1989/stable-2.6
[stable-2.6] Remove useless virtual, better use override only
2020-05-20 03:29:04 +02:00
Kevin Ottens
01d47ea60a Remove useless virtual, better use override only
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 01:28:27 +00:00
Stephan Beyer
9cb8c52568 Add -fno-sanitize=vptr for SANITIZE_UNDEFINED=ON
The UndefinedBehaviorSanitizer includes the "vptr" check.  This
check, however, needs typeinfo for OCC::AccountManager because
otherwise its stub for FileManTest leads to undefined references
when linking.  Adding the -frtti flag to enable run-time typeinfo
did not solve the problem.  I do not know another solution, so this
commit disables the vptr check.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit 7f598b181e)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-20 03:12:43 +02:00
Stephan Beyer
69ae63ea50 Make sanitizer options more fine-grained
The SANITIZE_ADDRESS option of our CMake configuration activates the
AddressSanitizer (and UBSan in a non-working way) for the whole project
(although, by the way, its documentation pretends that it is only enabled
for tests).

This commit introduces new options SANITIZE_LEAK, SANITIZE_MEMORY,
SANITIZE_UNDEFINED, SANITIZE_THREAD.  Each of these options (including
SANITIZE_ADDRESS) enables only the corresponding sanitizer.

Moreover, we mark all sanitizer options as advanced options, because these
options are only interesting for developers.

Note that some sanitizers are conflicting, that is, not all options can
be enabled simultaneously.  Also, not all sanitizers are available for
all compilers and versions.  We, however, do not check for this, instead
we let the compiler throw its errors in such cases.

The explicit usage of the Google Linker is removed, because it is not
necessary and can lead to problems with clang.

The commit can be considered a rewrite of cmake/modules/SanitizerFlags.cmake.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
(cherry picked from commit 00574ef8b4)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-20 03:11:45 +02:00
Michael Schuster
acec8a9721 Merge pull request #1998 from nextcloud/backport/1992/stable-2.6
[stable-2.6] Update github links to desktop repository
2020-05-20 03:03:01 +02:00
Reinhold Gschweicher
6bca361351 Update github links to desktop repository
Update the issue and open PR links with the new repository URL.
The old URL is forwarded, but feels not completely right.

Signed-off-by: Reinhold Gschweicher <pyro4hell@gmail.com>
2020-05-20 01:02:19 +00:00
Michael Schuster
1130d3941a Merge pull request #1997 from nextcloud/backport/1988/stable-2.6
[stable-2.6] Use nullptr when appropriate
2020-05-20 02:59:21 +02:00
Michael Schuster
a7ad510e93 Use the default parameter: QUrl::path(QUrl::PrettyDecoded = 0x000000)
Change it to path() to be consistent with the other usages in the project :)

See: https://doc.qt.io/qt-5/qurl.html#path

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-20 00:56:10 +00:00
Kevin Ottens
800624de66 Use nullptr when appropriate
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 00:56:09 +00:00
Michael Schuster
9c80cc2603 Merge pull request #1996 from nextcloud/backport/1986/stable-2.6
[stable-2.6] Properly handle denormalized href
2020-05-20 01:33:57 +02:00
Kevin Ottens
3920f264c4 Properly handle denormalized href
In case of denormalized paths in the dav href (presence of . or .. in
the path) simple string startsWith comparison wasn't enough to know if
said href ended up in the right namespace. That's why we're now using
QUrl (pretending local file since we don't have a full URL in the href)
to normalize the path before comparison.

This could happen with broken proxies for instance where we would
wrongly validate the dav information resulting in potentially surprising
syncing and name collisions.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-19 23:32:25 +00:00
Nextcloud bot
b70243c6ba [tx-robot] updated from transifex 2020-05-19 03:23:16 +00:00
Nextcloud bot
a370d9d9c4 [tx-robot] updated from transifex 2020-05-18 03:21:59 +00:00
Nextcloud bot
0bfe78b8eb [tx-robot] updated from transifex 2020-05-17 03:22:44 +00:00
Nextcloud bot
40b0751db9 [tx-robot] updated from transifex 2020-05-16 03:23:56 +00:00
Nextcloud bot
04404d874f [tx-robot] updated from transifex 2020-05-15 03:23:41 +00:00
Nextcloud bot
e18e38e8b7 [tx-robot] updated from transifex 2020-05-14 03:24:41 +00:00
Nextcloud bot
11c246e052 [tx-robot] updated from transifex 2020-05-13 03:23:25 +00:00
Michael Schuster
c6764ee7b9 Merge pull request #1975 from nextcloud/backport/1974/stable-2.6
[stable-2.6] Don't silently kill debug messages
2020-05-12 19:33:01 +02:00
Kevin Ottens
90e3a580c4 Don't silently kill debug messages
The message handler globally installed by the logger silently drop
messages if the logger is not logging. On top of it, it doesn't log
debug messages by default.

Anything not logged is currently silently discarded. This can come as a
surprise to a developer trying to contribute for the first time and
adding some debug message for some reason.

We're thus trying to strike a middle ground which is that debug messages
get a regular output if the logger isn't interested in them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-12 17:32:10 +00:00
Michael Schuster
9e72888aa3 Merge pull request #1973 from nextcloud/backport/1972/stable-2.6
[stable-2.6] Fix leak in FileUtil::IsChildFile
2020-05-12 17:36:42 +02:00
Kevin Ottens
1c66b08c2b Fix leak in FileUtil::IsChildFile
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-12 15:35:50 +00:00
Nextcloud bot
f411e6e190 [tx-robot] updated from transifex 2020-05-12 03:22:18 +00:00
Nextcloud bot
71205d6b19 [tx-robot] updated from transifex 2020-05-11 03:23:33 +00:00
Nextcloud bot
23ef3329f8 [tx-robot] updated from transifex 2020-05-10 03:24:45 +00:00
Nextcloud bot
a33465c312 [tx-robot] updated from transifex 2020-05-09 03:22:19 +00:00
Nextcloud bot
8d518f0722 [tx-robot] updated from transifex 2020-05-07 03:23:48 +00:00
Michael Schuster
c40961dc38 Merge pull request #1958 from nextcloud/backport/1949/stable-2.6
[stable-2.6] Resolve symlinks when checking for registered paths.
2020-05-04 20:41:02 +02:00
Daniel Vedder
8a23380fe1 Fixed symlink resolution for menu items.
Signed-off-by: Daniel Vedder <d.vedder@web.de>
2020-05-04 18:18:48 +00:00
Daniel Vedder
f366fe75b0 Resolve symlinks when checking for registered paths.
Fixes issue #1948: https://github.com/nextcloud/desktop/issues/1948
The client already resolves symlinks when adding new paths to the
sync-list, but the Nautilus plugin did not do this yet, causing it
to not recognise synced folders if they were accessed via a symlink.

Signed-off-by: Daniel Vedder <d.vedder@web.de>
2020-05-04 18:18:47 +00:00
Michael Schuster
a7653588ae Merge pull request #1954 from hefee/hefee/fix-typos-2.6.4
Fix typos.
2020-05-04 20:07:02 +02:00
Camila San
e4694df69b Update ChangeLog with 2.6 series.
(cherry picked from commit c14761445b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-04 19:52:08 +02:00
Nextcloud bot
1420c080a5 [tx-robot] updated from transifex 2020-05-04 03:21:50 +00:00
Sandro Knauß
051f4c2652 Fix typos.
Debian has a list of known typos in their checking tools.

Signed-off-by: Sandro Knauß <hefee@debian.org>
2020-05-03 23:00:17 +02:00
István Váradi
e159ba5ab8 Merge branch 'stable-2.6' of github.com:nextcloud/desktop into stable-2.6 2020-05-03 16:06:26 +02:00
Nextcloud bot
ff01533581 [tx-robot] updated from transifex 2020-05-03 03:21:50 +00:00
István Váradi
78e3ff0288 Add Groovy build
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-05-02 11:03:27 +02:00
István Váradi
53a7a10abf Allow specifying the base commit and version in the configuration file
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-05-02 11:03:21 +02:00
István Váradi
3a09c9658b Add Groovy build
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-05-02 10:14:40 +02:00
István Váradi
e117d6d0d3 Allow specifying the base commit and version in the configuration file
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-05-02 10:14:33 +02:00
István Váradi
0b7eb9d031 Change Debian build to the new more Debian-y way
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-05-02 10:14:17 +02:00
Nextcloud bot
1c45d8b0e7 [tx-robot] updated from transifex 2020-05-02 03:22:21 +00:00
Dominique Fuchs
9eada70bc8 Merge pull request #1899 from danjpgriffin/stable-2.6
Free IconJob after use
2020-05-01 10:06:41 +02:00
Nextcloud bot
5de080a52f [tx-robot] updated from transifex 2020-05-01 03:26:38 +00:00
Dan Griffin
3630a5e45b Free IconJob after use
Signed-off-by: Dan Griffin <github.mk@xiragon.com>
2020-04-30 17:34:12 +02:00
Nextcloud bot
f286546435 [tx-robot] updated from transifex 2020-04-30 03:26:07 +00:00
Nextcloud bot
2172586e5b [tx-robot] updated from transifex 2020-04-29 03:22:36 +00:00
Nextcloud bot
9ae02a605c [tx-robot] updated from transifex 2020-04-28 03:23:13 +00:00
István Váradi
5bfd5d2260 Add Groovy-specific files
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-04-27 19:10:31 +02:00
István Váradi
069fd53cf6 Generate alpha, beta and stable versions
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-04-27 19:10:26 +02:00
István Váradi
04e53c39a1 Generate more unique and ordered version numbers for Debian builds
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-04-27 19:10:20 +02:00
Nextcloud bot
3bc6d468e9 [tx-robot] updated from transifex 2020-04-27 03:21:35 +00:00
Dominique Fuchs
b09516f0e9 Merge pull request #1909 from heirecka/fix-build-with-qt-5-15
include QPainterPath to maintain compatibility with future Qt versions
2020-04-25 12:26:28 +02:00
Nextcloud bot
8ff738fd43 [tx-robot] updated from transifex 2020-04-24 03:38:36 +00:00
Nextcloud bot
f382309bdb [tx-robot] updated from transifex 2020-04-23 03:28:25 +00:00
Nextcloud bot
50f2ec2e62 [tx-robot] updated from transifex 2020-04-22 03:25:06 +00:00
Nextcloud bot
07cfbd7670 [tx-robot] updated from transifex 2020-04-20 03:22:24 +00:00
Nextcloud bot
93515deb81 [tx-robot] updated from transifex 2020-04-18 03:22:57 +00:00
Michael Schuster
112a8ccdf1 Merge pull request #1934 from nextcloud/backport/1933/stable-2.6
[stable-2.6] Fix build of Dolphin integration
2020-04-17 20:05:46 +02:00
Nicolas Fella
acc59e466c Fix build of Dolphin integration
config.h needs to be included in the header already since we use APPLICATION_ICON_NAME there. This got introduced in 6fc877577c

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-04-17 18:04:54 +00:00
Nextcloud bot
0a501e0469 [tx-robot] updated from transifex 2020-04-17 03:23:11 +00:00
Nextcloud bot
ed6aa3d9b2 [tx-robot] updated from transifex 2020-04-16 03:26:42 +00:00
Michael Schuster
b4a0d6a97d [dolphin] Use CMake env vars for App Name and Icon strings
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 6fc877577c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-04-16 04:09:26 +02:00
Michael Schuster
1fd4c01062 Merge pull request #1932 from nextcloud/backport/1883/stable-2.6
[stable-2.6] [dolphin] Add icon to context menu
2020-04-16 03:14:24 +02:00
Nicolas Fella
fb9f0aa84d [dolphin] Add icon to context menu
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-04-16 00:53:32 +00:00
Michael Schuster
fa85fea347 Merge pull request #1931 from nextcloud/backport/1882/stable-2.6
[stable-2.6] Fix container detaching
2020-04-16 02:40:38 +02:00
Nicolas Fella
e531bb01ff Fix container detaching
Found by clazy

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-04-15 19:29:47 +00:00
Nicolas Fella
fa4711aeb1 Use qEnvironmentVariableIsEmpty
clazy suggests that it is more efficient since it doesn't allocate.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
(cherry picked from commit c1189421c0)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-04-15 17:55:10 +02:00
Nicolas Fella
a5223c692e Remove timeout parameter from showMessage
It it never set by calling code so the default value of 10000 is used. It is only used in the call to QSystemTrayIcon, which uses 10000 as default value too.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
(cherry picked from commit b84a1eeb8d)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-04-15 17:45:01 +02:00
Nicolas Fella
f9fe5dee1e Use LINUX_APPLICATION_ID
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
(cherry picked from commit 29fa924853)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-04-15 17:26:01 +02:00
Nicolas Fella
be0944ee7c Add desktop-entry hint to notifications
This allows the notification server to map a notification to the program's desktop file, which allows the server to do extra things. For example KDE Plasma adds the Nextcloud icon to the notification and allows to configure notifications from Nextcloud.

This is a standard hint from https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#hints

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
(cherry picked from commit 2f54e911b7)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-04-15 17:25:17 +02:00
Nextcloud bot
eb9f8460e5 [tx-robot] updated from transifex 2020-04-15 03:27:16 +00:00
Nextcloud bot
8b6e4e5569 [tx-robot] updated from transifex 2020-04-14 03:26:28 +00:00
Nextcloud bot
a6b3a9d024 [tx-robot] updated from transifex 2020-04-13 03:41:28 +00:00
Nextcloud bot
232d4ef0d0 [tx-robot] updated from transifex 2020-04-12 07:55:42 +00:00
Nextcloud bot
f8803e57c6 [tx-robot] updated from transifex 2020-04-11 03:29:47 +00:00
Nextcloud bot
b6487eb4ca [tx-robot] updated from transifex 2020-04-10 03:30:11 +00:00
Nextcloud bot
5e92562a79 [tx-robot] updated from transifex 2020-04-09 03:30:00 +00:00
Nextcloud bot
bf1643d2e7 [tx-robot] updated from transifex 2020-04-07 03:24:45 +00:00
Nextcloud bot
265c6dc73b [tx-robot] updated from transifex 2020-04-06 03:26:51 +00:00
Nextcloud bot
33b3df1596 [tx-robot] updated from transifex 2020-04-05 03:26:09 +00:00
Nextcloud bot
7572ad63e5 [tx-robot] updated from transifex 2020-04-04 03:26:44 +00:00
Nextcloud bot
03b6de183f [tx-robot] updated from transifex 2020-04-03 03:19:08 +00:00
Heiko Becker
b13a74f03c Fix build with Qt 5.15
QPainterPath is no longer included via qtransform.h (since
5.15.0-beta2, 50d2acdc93b4de2ba56eb67787e2bdcb21dd4bea in
qtbase.git).

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
2020-04-02 17:31:20 +02:00
Nextcloud bot
7159ec8472 [tx-robot] updated from transifex 2020-04-02 03:18:12 +00:00
Nextcloud bot
e51deb72f2 [tx-robot] updated from transifex 2020-04-01 03:18:59 +00:00
Nextcloud bot
29ef166f29 [tx-robot] updated from transifex 2020-03-31 03:30:00 +00:00
Nextcloud bot
89660121c1 [tx-robot] updated from transifex 2020-03-30 03:29:22 +00:00
Nextcloud bot
213adb77a0 [tx-robot] updated from transifex 2020-03-29 03:35:19 +00:00
Nextcloud bot
ffafe746e5 [tx-robot] updated from transifex 2020-03-28 03:29:59 +00:00
Nextcloud bot
bb2663ddd6 [tx-robot] updated from transifex 2020-03-27 03:28:32 +00:00
Nextcloud bot
dc84e91c4f [tx-robot] updated from transifex 2020-03-26 03:25:16 +00:00
Nextcloud bot
6bffac198e [tx-robot] updated from transifex 2020-03-25 03:29:07 +00:00
Nextcloud bot
e47250137a [tx-robot] updated from transifex 2020-03-23 03:26:03 +00:00
Nextcloud bot
35b7ffbf12 [tx-robot] updated from transifex 2020-03-22 03:26:10 +00:00
Nextcloud bot
6a05605f59 [tx-robot] updated from transifex 2020-03-21 03:27:44 +00:00
Nextcloud bot
20ab3ccae6 [tx-robot] updated from transifex 2020-03-20 03:27:29 +00:00
Nextcloud bot
b18b8f67a9 [tx-robot] updated from transifex 2020-03-18 03:29:25 +00:00
Nextcloud bot
00659b163b [tx-robot] updated from transifex 2020-03-17 03:30:59 +00:00
Nextcloud bot
2ec68c7c1d [tx-robot] updated from transifex 2020-03-16 03:32:08 +00:00
Nextcloud bot
714f4b199d [tx-robot] updated from transifex 2020-03-15 03:30:46 +00:00
Nextcloud bot
e892c180f6 [tx-robot] updated from transifex 2020-03-14 03:25:39 +00:00
István Váradi
f08a278525 Provide specific install file for Debian oldstable
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
(cherry picked from commit 8ee6b0dab2)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-13 22:58:23 +01:00
Nextcloud bot
9079d40063 [tx-robot] updated from transifex 2020-03-13 03:25:46 +00:00
Nextcloud bot
0ebc47f323 [tx-robot] updated from transifex 2020-03-12 03:26:30 +00:00
Nextcloud bot
af9b44d338 [tx-robot] updated from transifex 2020-03-11 03:27:30 +00:00
Michael Schuster
197e1b668b Merge pull request #1855 from nextcloud/backport/1848/stable-2.6
[stable-2.6] WebView: Add missing Q_OBJECT macros
2020-03-11 01:48:05 +01:00
Michael Schuster
058bfb2db0 WebView: Add missing Q_OBJECT macros
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-11 00:47:09 +00:00
Michael Schuster
45d30623e1 Merge pull request #1854 from nextcloud/backport/1853/stable-2.6
[stable-2.6] Updater: Fix Tests build (failed with BUILD_UPDATER=NO)
2020-03-10 23:45:36 +01:00
Michael Schuster
a6ff038f7f Updater: Fix Tests build (failed with BUILD_UPDATER=NO)
Also don't build the test for the updater, fix missing updater library.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 22:42:49 +00:00
Michael Schuster
a21ae444e3 Updater: Add CMake option BUILD_UPDATER to make the updater optional
- Default: BUILD_UPDATER = NO

  To ease builds for distro packages and contributors (regardless of the specified update URL)

- Enable updater build for Drone CI and AppImage builds

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e833e86da6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 16:23:51 +01:00
Michael Schuster
ab46b647f8 Fix OCUpdater: Also change status on network error or invalid XML
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit c812d896aa)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 16:12:59 +01:00
Michael Schuster
1d00bac251 Updater UI: Implement auto-update option and update button
- Add checkbox and button to UI
- Add new parameter autoUpdateCheck to ConfigFile

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit c043a4e55c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 16:11:41 +01:00
Michael Schuster
63d9f87e18 Merge pull request #1851 from nextcloud/backport/1843/stable-2.6
[stable-2.6] Enhance Version info display (minimal info, hide details)
2020-03-10 16:01:56 +01:00
Michael Schuster
6fd832bf1d Fix Legal notice dialog: Correct title and header font
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 14:59:45 +00:00
Michael Schuster
e0b37fcd58 Settings dialog: Move detailed version info from About section to Legal notice dialog
- Enlarge dialog widget to show full content
- Implement Dark-/Light-Mode switching (hyperlinks)

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 14:59:45 +00:00
Michael Schuster
1736de6a9f Settings dialog About section: Show minimal version info
- Application name, version number, OS

  Example: Nextcloud Desktop Client
           Version 2.6.4 (macOS)

- Keep previous version info in new method Theme::aboutDetails()

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 14:59:45 +00:00
Michael Schuster
f2414e0ebb Version parameter: Show Qt platform plugin, OS and CPU arch
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 14:59:45 +00:00
Michael Schuster
f2a99f713f Add missing --version parameter to help screen
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-10 14:59:45 +00:00
Nextcloud bot
8c02403aec [tx-robot] updated from transifex 2020-03-10 03:27:09 +00:00
Nextcloud bot
740757f384 [tx-robot] updated from transifex 2020-03-09 03:21:28 +00:00
Nextcloud bot
16c68e19ce [tx-robot] updated from transifex 2020-03-07 03:25:06 +00:00
Nextcloud bot
026f0abb7f [tx-robot] updated from transifex 2020-03-06 03:27:39 +00:00
cclauss
9058602373 Use print() function in both Python 2 and Python 3
Signed-off-by: cclauss <cclauss@me.com>
(cherry picked from commit b34ed01109)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-06 03:00:30 +01:00
Michael Schuster
a083e0513b Merge pull request #1841 from nextcloud/backport/1838/stable-2.6
[stable-2.6] Allow sharing to circles
2020-03-06 02:20:35 +01:00
Roeland Jago Douma
8a46b96b5d Allow sharing to circles
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-03-06 01:18:49 +00:00
Michael Schuster
dadab48b2b Merge pull request #1839 from nextcloud/backport/1836/stable-2.6
[stable-2.6] Added Focal-specific files
2020-03-05 17:44:56 +01:00
István Váradi
16d641d04a Added Focal-specific files
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-03-05 16:43:55 +00:00
Michael Schuster
ea3aa54ae5 Merge pull request #1835 from nextcloud/backport/1832/stable-2.6
[stable-2.6] Added build for Focal
2020-03-05 02:48:34 +01:00
István Váradi
cf79b91503 Added build for Focal
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-03-05 01:46:59 +00:00
Nextcloud bot
677e6e24ac [tx-robot] updated from transifex 2020-03-04 03:25:40 +00:00
Michael Schuster
b45f5fd1a9 Bump version to 2.6.4
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 20:32:31 +01:00
Nextcloud bot
a4317ca50d [tx-robot] updated from transifex 2020-03-03 19:24:11 +00:00
Michael Schuster
6c6eeab479 Merge pull request #1830 from nextcloud/backport/1829/stable-2.6
[stable-2.6] Fix Explorer pinning: Add fallbacks for Shell commands (fixes #1599)
2020-03-03 20:15:57 +01:00
Christian Kamm
7fdbc72991 Windows: Fix context menu handling only own verbs #7004
Previously it'd handle all verbs as if they were our own.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 19:13:31 +00:00
Michael Schuster
2187c6f4fc Fix Explorer pinning: Add fallbacks for Shell commands (fixes #1599)
See: #1599

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 19:13:31 +00:00
Michael Schuster
f3b825f333 Merge pull request #1828 from nextcloud/backport/1827/stable-2.6
[stable-2.6] WebFlowCredentials: Make username comparison case-insensitive (fix #1741)
2020-03-03 06:27:18 +01:00
Michael Schuster
676d4e1308 WebFlowCredentials: Make username comparison case-insensitive (fix #1741)
Fixes issue #1741

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 05:26:20 +00:00
Nextcloud bot
e03309a05e [tx-robot] updated from transifex 2020-03-03 03:27:09 +00:00
Bruno Perel
de15f20006 Fix git merge hiccup
(cherry picked from commit 7378ae6a7f)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 01:39:04 +01:00
Nextcloud bot
7ed1062314 [tx-robot] updated from transifex 2020-03-02 03:25:11 +00:00
Michael Schuster
80138b1cbf Merge pull request #1825 from nextcloud/backport/1823/stable-2.6
[stable-2.6] Disable HTTP/2 for now due to Qt bug, allow enabling it via env var
2020-03-02 03:29:03 +01:00
Michael Schuster
93547ced6d Fix build with older Qt: Disable http2 for now due to Qt bug, add env var (upstream)
Disable http2 for now due to Qt bug but allow enabling it via env var, see: https://github.com/owncloud/client/pull/7620
  and: https://github.com/nextcloud/desktop/pull/1806
Issue: https://github.com/nextcloud/desktop/issues/1503

Co-authored-by: XNG <Milokita@users.noreply.github.com>
Co-authored-by: Hannah von Reth <hannah.vonreth@owncloud.com>

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-02 02:27:55 +00:00
XNG
0aefa58644 Disable http2 for now due to Qt bug
So that user may continue to use http2 on their webpage

Signed-off-by: XNG <Milokita@users.noreply.github.com>
(cherry picked from commit dad95d4e4617211360bf2b4391e29c341e939844)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-02 02:27:55 +00:00
Michael Schuster
992bcf56f5 Merge pull request #1824 from nextcloud/activity-date-time-tooltip
ActivityListModel: Show full date and time as a Tooltip only
2020-03-02 02:56:49 +01:00
Michael Schuster
35de69f7bc ActivityListModel: Show full date and time as a Tooltip only
- Fixes issue #1780
- Limits the visual overhead

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-02 02:47:57 +01:00
Michael Schuster
1c44909254 Merge pull request #1821 from nextcloud/backport/1820/stable-2.6
[stable-2.6] Fix Explorer integration re-save and hide option on non-Windows
2020-03-01 05:45:51 +01:00
Michael Schuster
c3ccb72f2b Fix Explorer integration: Hide option on non-Windows
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 04:44:35 +00:00
Michael Schuster
890bd09ce9 Fix Explorer integration re-save (fixes issue #1807)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 04:44:35 +00:00
Nextcloud bot
b5309c47fc [tx-robot] updated from transifex 2020-03-01 03:27:09 +00:00
Nextcloud bot
d24a09e47f [tx-robot] updated from transifex 2020-02-29 03:26:28 +00:00
Nextcloud bot
bdae4a9be7 [tx-robot] updated from transifex 2020-02-28 03:26:27 +00:00
Nextcloud bot
d9ce9814da [tx-robot] updated from transifex 2020-02-27 03:27:46 +00:00
Nextcloud bot
f6d019af21 [tx-robot] updated from transifex 2020-02-26 03:27:49 +00:00
Nextcloud bot
423ee61817 [tx-robot] updated from transifex 2020-02-25 03:32:56 +00:00
Michael Schuster
4871776a4b Merge pull request #1813 from nextcloud/backport/1810/stable-2.6
[stable-2.6] l10n: Changes to improve source strings
2020-02-24 21:09:18 +01:00
rakekniven
f4e83891e1 l10n: Change spelling of "webdav"
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 20:08:10 +00:00
rakekniven
d589b524e0 l10n: Removed colon from translation
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 20:08:10 +00:00
rakekniven
de0158e2bb l10n: Removed blank before colon
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 20:08:10 +00:00
rakekniven
62856f9001 l10n: Change case of one word
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 20:08:10 +00:00
Nextcloud bot
1313bc573f [tx-robot] updated from transifex 2020-02-24 03:29:29 +00:00
Nextcloud bot
c2838fb8a8 [tx-robot] updated from transifex 2020-02-23 03:29:39 +00:00
Nextcloud bot
ba71bf13f4 [tx-robot] updated from transifex 2020-02-22 03:28:55 +00:00
Michael Schuster
7e36c7ba59 Merge pull request #1803 from nextcloud/backport/1802/stable-2.6
[stable-2.6] Updater: Add query-parameter 'updatesegment' to the update check
2020-02-21 23:42:15 +01:00
Michael Schuster
e9641a3b94 Updater: Add query-parameter 'updatesegment' to the update check
Used to throttle down desktop release rollout in order to keep the update servers alive at peak times.

See: https://github.com/nextcloud/client_updater_server/pull/36

Targeted issues: #1795, #1800

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-02-21 22:40:41 +00:00
Nextcloud bot
7ff1911492 [tx-robot] updated from transifex 2020-02-21 12:43:03 +00:00
Nextcloud bot
57f8b866a5 [tx-robot] updated from transifex 2020-02-21 12:16:08 +00:00
Nextcloud bot
883df2f4fa [tx-robot] updated from transifex 2020-02-21 12:13:24 +00:00
249 changed files with 69849 additions and 43685 deletions

View File

@@ -22,7 +22,7 @@ steps:
source /opt/qt57/bin/qt57-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -59,7 +59,7 @@ steps:
source /opt/qt58/bin/qt58-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -96,7 +96,7 @@ steps:
source /opt/qt59/bin/qt59-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -137,7 +137,7 @@ steps:
source /opt/qt510/bin/qt510-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -178,7 +178,7 @@ steps:
source /opt/qt511/bin/qt511-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -219,7 +219,7 @@ steps:
source /opt/qt511/bin/qt511-env.sh &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -268,7 +268,7 @@ steps:
export PKG_CONFIG_PATH=\$QT_BASE_DIR/lib/pkgconfig:\$PKG_CONFIG_PATH &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&
@@ -317,7 +317,7 @@ steps:
export PKG_CONFIG_PATH=\$QT_BASE_DIR/lib/pkgconfig:\$PKG_CONFIG_PATH &&
mkdir build &&
cd build &&
cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ &&
cmake -D NO_SHIBBOLETH=1 -DBUILD_UPDATER=ON -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ &&
make &&
useradd -m -s /bin/bash test &&
chown -R test:test . &&

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "binary"]
path = binary
url = git://github.com/owncloud/owncloud-client-binary.git
[submodule "src/3rdparty/libcrashreporter-qt"]
path = src/3rdparty/libcrashreporter-qt
url = git://github.com/dschmidt/libcrashreporter-qt.git

View File

@@ -199,6 +199,6 @@ X-GNOME-Autostart-Delay=3
# Translations
Icon[bg_BG]=@APPLICATION_ICON_NAME@
Name[bg_BG]=@APPLICATION_NAME@ клиент за синхронизиране на десктоп
Comment[bg_BG]=@APPLICATION_NAME@ клиент за синхронизиране на десктоп
Name[bg_BG]=@APPLICATION_NAME@ десктоп клиент за синхронизиране
Comment[bg_BG]=@APPLICATION_NAME@ десктоп клиент за синхронизиране
GenericName[bg_BG]=Синхронизиране на папка

View File

@@ -0,0 +1,204 @@
[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
Comment=@APPLICATION_NAME@ desktop synchronization client
GenericName=Folder Sync
Icon=@APPLICATION_ICON_NAME@
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
Icon[br]=@APPLICATION_ICON_NAME@
Name[br]=@APPLICATION_NAME@ burev kempreet an implijer
Comment[br]=@APPLICATION_NAME@ burev kempreet an implijer
GenericName[br]=Tuliad kemprenan

View File

@@ -199,6 +199,6 @@ X-GNOME-Autostart-Delay=3
# Translations
Icon[ca]=@APPLICATION_ICON_NAME@
Name[ca]=@APPLICATION_NAME@ client de sincronització d'escriptori
Comment[ca]=@APPLICATION_NAME@ client de sincronització d'escriptori
Name[ca]=Client de sincronització d'escriptori del @APPLICATION_NAME@
Comment[ca]=Client de sincronització d'escriptori del @APPLICATION_NAME@
GenericName[ca]=Directori de sincronització

View File

@@ -199,6 +199,6 @@ X-GNOME-Autostart-Delay=3
# Translations
Icon[de]=@APPLICATION_ICON_NAME@
Name[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
Comment[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation
GenericName[de]=Synchronisationsordner
Name[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisierung
Comment[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisierung
GenericName[de]=Synchronisierungsordner

View File

@@ -0,0 +1,204 @@
[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
Comment=@APPLICATION_NAME@ desktop synchronization client
GenericName=Folder Sync
Icon=@APPLICATION_ICON_NAME@
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
Icon[et_EE]=@APPLICATION_ICON_NAME@
Name[et_EE]=@APPLICATION_NAME@ töölaua sünkimise klient
Comment[et_EE]=@APPLICATION_NAME@ töölaua sünkroniseerimise klient
GenericName[et_EE]=Kausta Sünkroonimine

View File

@@ -0,0 +1,204 @@
[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
Comment=@APPLICATION_NAME@ desktop synchronization client
GenericName=Folder Sync
Icon=@APPLICATION_ICON_NAME@
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
Icon[fi_FI]=@APPLICATION_ICON_NAME@
Name[fi_FI]=@APPLICATION_NAME@ työpöydän synkronointipääte
Comment[fi_FI]=@APPLICATION_NAME@ työpöydän synkronointipääte
GenericName[fi_FI]=Kansio synkronointi

View File

@@ -0,0 +1,204 @@
[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
Comment=@APPLICATION_NAME@ desktop synchronization client
GenericName=Folder Sync
Icon=@APPLICATION_ICON_NAME@
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
Icon[oc]=@APPLICATION_ICON_NAME@
Name[oc]=@APPLICATION_NAME@ client de sincronizacion
Comment[oc]=@APPLICATION_NAME@ client de sincronizacion
GenericName[oc]=Sincro. dossièr

View File

@@ -201,4 +201,4 @@ X-GNOME-Autostart-Delay=3
Icon[uk]=@APPLICATION_ICON_NAME@
Name[uk]=@APPLICATION_NAME@ клієнт для ПК
Comment[uk]=Клієнт синхронізації @APPLICATION_NAME@ для ПК
GenericName[uk]=Синхронізація каталогів
GenericName[uk]=Синхронізація тек

View File

@@ -198,6 +198,7 @@ X-GNOME-Autostart-Delay=3
# Translations
Icon[zh_TW]=@APPLICATION_ICON_NAME@
Name[zh_TW]=@APPLICATION_NAME@ 桌面同步客戶端
Comment[zh_TW]=@APPLICATION_NAME@ 桌面同步客戶端
GenericName[zh_TW]=資料夾同步

View File

@@ -123,6 +123,15 @@ if(NO_MSG_HANDLER)
add_definitions(-DNO_MSG_HANDLER=1)
endif()
# this option builds the updater
option(BUILD_UPDATER "BUILD_UPDATER" OFF)
if(BUILD_UPDATER)
message("Compiling with updater")
add_definitions(-DBUILD_UPDATER=1)
else()
message("Compiling without updater")
endif()
# this option builds the shell integration
option(BUILD_SHELL_INTEGRATION "BUILD_SHELL_INTEGRATION" ON)
@@ -172,9 +181,9 @@ if(APPLE)
endif()
if(BUILD_CLIENT)
if(APPLE)
if(APPLE AND BUILD_UPDATER)
find_package(Sparkle)
endif(APPLE)
endif()
if(UNIX)
find_package(INotify REQUIRED)
@@ -219,6 +228,8 @@ if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
include(SanitizerFlags)
# Handle Translations, pick all client_* files from trans directory.
file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts)
set(TRANSLATIONS ${TRANS_FILES})

124
ChangeLog
View File

@@ -1,3 +1,127 @@
ChangeLog
====================
For details check https://nextcloud.com/blog/category/release.
2.6 Series ChangeLog
====================
version 2.6.4 (release 2020-03-04)
* Fix Explorer pinning: Add fallbacks for Shell commands (fixes #1599)
* WebFlowCredentials: Make username comparison case-insensitive (fix #1741)
* ActivityListModel: Show full date and time as a Tooltip only
* Disable HTTP/2 for now due to Qt bug, allow enabling it via env var
* Fix Explorer integration re-save and hide option on non-Windows
* l10n: Changes to improve source strings
* Updater: Add query-parameter 'updatesegment' to the update check
* Allow Desktop translation merging and custom backport branches
version 2.6.3 (release 2020-02-17)
* Add UserInfo class and fetch quota via API instead of PropfindJob
* l10n: Changed grammar and triple dots to ellipsis
* l10n: Changed spelling of "user name" to "username"
* Start the client in background if activated by D-Bus
* Do not install files related to cloud providers under Xenial
* Make sure that the libcloudprovider integration is using a valid D-Bus path
* Changed product name to Nextcloud
* Update autoupdate.rst
* Use system proxy by default if no config file is present
* Install libcloudproviders files by default on debian
* Windows 7 is out of support
* BugFix: Handle broken shared file error gracefully
* Fix Explorer integration on Windows and the crash on other systems
* Welcome to 2020
* Updated year in legalnotice.cpp
* apply http2 qt resend patch from owncloud
version 2.6.2 (release 2019-12-24)
* Revert DEFAULT_REMOTE_POLL_INTERVAL back from 5 seconds to 30 seconds
* Use user-provided username in displayName() - Fix #836
* Fix typo
* Build with libcloudproviders on debian and in the AppImage
* Fix tests for Windows platform
* Merge the list of ignored files/symlinks into one Activity notification.
* Fix clang's variadic macro warnings
* Add libdbus-1-dev to the build dependencies
* Compare QDateTime objects more efficient
* Improve the translation of "Share via …"
* Upgrade for Qt 5.12.5 in docker-ci
* Bump Qt 5.12.5 image
* Add timestamp to Mac installer code signing
* MacOS build: Avoid the Get-Task-Allow Entitlement (Notarization)
* Build for Debian stable and oldstable
* Happy new year
* Fall back to old login flow on GS as this is not yet ready
* [stable-2.6] macOS build: Avoid the Get-Task-Allow Entitlement (Notarization)
* Fix remote wipe keychain storage (issue #1592)
* Fix copyright year in MacOSXBundleInfo.plist.in for 2019
* Fix macOS GUI (Qt 5.12)
* Windows: Workaround for storing >= 4k (4096 bit) client-cert SSL keys
* Fix Activity List: Add check to avoid first empty entry
* Fix macOS GUI (Qt 5.12) No. 2 (continuation of #1651)
* Show date and time in activity log (fixes issue #1683)
* Login Flow v2 enhancements
* Activity List: Fix crash and folder opening
* Fix issue #1237: White text on almost-white background
* Heavy refactoring: Windows workaround for >= 4k (4096 bit) client-cert SSL keys and large certs
* Fix date in ActivityWidget and remove unnecessary string conversion
version 2.6.1 (release 2019-11-04)
* Changed max GUI bandwidth limits
* Add sync date next to "Synchronized with local folder"
* Slideshow buttons
* Fix qt warning about registering a URL sheme first.
* Issue #1216: added sync-exclude entry for emacs recovery files
* Race condition in the remote size loading logic
* Review of msvc/gcc warnings -> code cleanup, prevention of implicit casts, variadic macros
* Fix double slashes
* Fixing E2E CSR transmission failure for new connections
* Fixed missing 'translatable' exclusions, added missing window titles
* Checks if exclude file is empty before creating the regular expressions.
* Add server info to menu
* Fixed grammar
* Prevent jumping of tray menu
* Don't run connection wizard when quitting the application
* Avoiding copying in range-based loops
* Add a 'Content-Length: 0' header to initial POST requests
* Remote wipe.
* Pick from upstream: Update qtmacgoodies for an OSX crash fix #6930
* fix for issue no. #1351
* Merge the list of ignored files/symlinks into one Activity notification.
* Update submodules for Qt 5.12.5 (qtmacgoodies)
* Fix duplicate items in Apps menu (a bug introduced in #1477)
* Fix #1182
* Fix remote wipe when a proxy is configured.
* Fix updater message: Download link instead of "use the system's update
version 2.6.0 Login flow v2 (release 2019-09-27)
* Reinstate Debian build in the new Drone config
* Typo
* Marking unused strings as unstranslatable
* Fixes #607
* Fixes issue #878
* Fixes issue #1187
* Displays FileIgnored activities with an info icon
* Minor text change in the link to help in the tab 'General'.
* Update Qt 5.5 compatibility patch for Xenial
* Remove Ubuntu Cosmic and add Eoan package
* Add proper CA to client side certificate connection
* Remove dependency on libgnome-keyring0 on Eoan
* Read .sync_exclude.lst in each subdirectory
* Updates ChangeLog.
* Login flow v2
* Adds SSL client cert storage to webflow + Login Flow v2
* Windows: Workaround for CredWriteW used by QtKeychain
* Integrated registry check on windows when hasDarkSystray is called.
* Logo update
* Updated .gitignore to integrate unwanted files when working with VSC …
* Full-Scaled new logo in Windows 10 start menu tile
* Qt5.5 compatiblity patch for login flow V2 + UI improvement (Use newer digest algorithms in TLS error dialog)
* Fix for #1382 "linux client crashes for no discernable reason"
* UI improvement: Message box: Delete / Keep all files
* Improve wording of the context menu in the file manager extension.
* Changes wording in the share context menu.
* Fix White Window issue on Windows by upgrading to Qt 5.12.5
2.5 Series ChangeLog
====================

View File

@@ -7,11 +7,12 @@ set( APPLICATION_UPDATE_URL "https://updates.nextcloud.org/client/" CACHE STRING
set( APPLICATION_HELP_URL "" CACHE STRING "URL for the help menu" )
set( APPLICATION_ICON_NAME "Nextcloud" )
set( APPLICATION_SERVER_URL "" CACHE STRING "URL for the server to use. If entered the server can only connect to this instance" )
set( APPLICATION_REV_DOMAIN "com.nextcloud.desktopclient" )
set( LINUX_PACKAGE_SHORTNAME "nextcloud" )
set( LINUX_APPLICATION_ID "${APPLICATION_REV_DOMAIN}.${LINUX_PACKAGE_SHORTNAME}")
set( THEME_CLASS "NextcloudTheme" )
set( APPLICATION_REV_DOMAIN "com.nextcloud.desktopclient" )
set( WIN_SETUP_BITMAP_PATH "${CMAKE_SOURCE_DIR}/admin/win/nsi" )
set( MAC_INSTALLER_BACKGROUND_FILE "${CMAKE_SOURCE_DIR}/admin/osx/installer-background.png" CACHE STRING "The MacOSX installer background image")
@@ -23,6 +24,9 @@ option( WITH_CRASHREPORTER "Build crashreporter" OFF )
#set( CRASHREPORTER_SUBMIT_URL "https://crash-reports.owncloud.com/submit" CACHE STRING "URL for crash reporter" )
#set( CRASHREPORTER_ICON ":/owncloud-icon.png" )
## Updater options
option( BUILD_UPDATER "Build updater" OFF )
option( WITH_PROVIDERS "Build with providers list" ON )

View File

@@ -61,14 +61,14 @@ For more info: [Wiki/Daily Builds](https://github.com/nextcloud/desktop/wiki/Dai
### :bomb: Reporting issues
- If you find any bugs or have any suggestion for improvement, please
file an issue at https://github.com/nextcloud/client/issues. Do not
file an issue at https://github.com/nextcloud/desktop/issues. Do not
contact the authors directly by mail, as this increases the chance
of your report being lost. :boom:
### :smiley: :trophy: Pull requests
- If you created a patch :heart_eyes:, please submit a [Pull
Request](https://github.com/nextcloud/client/pulls).
Request](https://github.com/nextcloud/desktop/pulls).
- How to create a pull request? This guide will help you get started: [Opening a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) :heart:

View File

@@ -1,6 +1,6 @@
set( MIRALL_VERSION_MAJOR 2 )
set( MIRALL_VERSION_MINOR 6 )
set( MIRALL_VERSION_PATCH 3 )
set( MIRALL_VERSION_PATCH 5 )
set( MIRALL_VERSION_YEAR 2020 )
set( MIRALL_SOVERSION 0 )

View File

@@ -6,12 +6,15 @@ mkdir /app
mkdir /build
#Set Qt-5.12
export QT_BASE_DIR=/opt/qt5.12.5
export QT_BASE_DIR=/opt/qt5.12.8
export QTDIR=$QT_BASE_DIR
export PATH=$QT_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
#Set APPID for .desktop file processing
export LINUX_APPLICATION_ID=com.nextcloud.desktopclient.nextcloud
#set defaults
export SUFFIX=${DRONE_PULL_REQUEST:=master}
if [ $SUFFIX != "master" ]; then
@@ -35,6 +38,7 @@ mkdir build-client
cd build-client
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D NO_SHIBBOLETH=1 \
-D BUILD_UPDATER=ON \
-D QTKEYCHAIN_LIBRARY=/app/usr/lib/x86_64-linux-gnu/libqt5keychain.so \
-D QTKEYCHAIN_INCLUDE_DIR=/app/usr/include/qt5keychain/ \
-DMIRALL_VERSION_SUFFIX=PR-$DRONE_PULL_REQUEST \
@@ -62,7 +66,7 @@ rm -rf ./usr/share/caja-python/
rm -rf ./usr/share/nautilus-python/
rm -rf ./usr/share/nemo-python/
# Move sync exlucde to right location
# Move sync exclude to right location
mv ./etc/Nextcloud/sync-exclude.lst ./usr/bin/
rm -rf ./etc

View File

@@ -0,0 +1,23 @@
nextcloud-client (2.3.3-1.0~focal1) focal; urgency=medium
* Debian build support for the forked client.
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
nextcloud-client (2.3.1-1.0~focal1) focal; urgency=medium
* New upstream version
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
nextcloud-client (2.3.0-1.0~focal1) focal; urgency=medium
* New upstream version
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
nextcloud-client (2.2.4-1.4~focal1) focal; urgency=medium
* The locale-specific icon names are correct too
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100

View File

@@ -0,0 +1,90 @@
Source: nextcloud-client
Section: contrib/devel
Priority: optional
Maintainer: István Váradi <ivaradi@varadiistvan.hu>
Build-Depends: cmake,
debhelper,
cdbs,
dh-python,
extra-cmake-modules (>= 5.16),
libkf5kio-dev,
libcmocka-dev,
libcloudproviders-dev,
libdbus-1-dev,
libhttp-dav-perl,
libinotify-dev [kfreebsd-any],
libqt5svg5-dev,
libqt5webkit5-dev,
libsqlite3-dev,
libssl-dev (>= 1.1.0),
zlib1g-dev,
optipng,
pkg-kde-tools,
python3-sphinx,
python3-all,
qt5keychain-dev,
qtwebengine5-dev,
qtdeclarative5-dev,
qttools5-dev,
qttools5-dev-tools,
xvfb
Standards-Version: 3.9.8
Homepage: https://github.com/nextcloud/client_theming
#Vcs-Git: git://anonscm.debian.org/collab-maint/nextcloud-client.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/nextcloud-client.git
Package: nextcloud-client
Architecture: any
Depends: libnextcloudsync0 (=${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, nextcloud-client-l10n
Description: Nextcloud desktop sync client
Use the desktop client to keep your files synchronized
between your Nextcloud server and your desktop. Select
one or more directories on your local machine and always
have access to your latest files wherever you are.
Package: libnextcloudsync0
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Nextcloud sync library
Used by the Nextcloud desktop client as the synchronization engine.
Package: libnextcloudsync-dev
Architecture: any
Section: contrib/libdevel
Depends: libnextcloudsync0 (=${binary:Version}), ${misc:Depends}
Description: Nextcloud sync library development files
The headers and development library for the Nextcloud sync library.
Package: nextcloud-client-l10n
Architecture: all
Depends: ${misc:Depends}
Description: Nextcloud client internatialization files
The translation files.
Package: nextcloud-client-nautilus
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python3-nautilus, nautilus, ${misc:Depends}
Description: Nautilus plugin for Nextcloud
This package contains a Nautilus plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-nemo
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nemo | nemo-python, nemo, ${misc:Depends}
Description: Nemo plugin for Nextcloud
This package contains a Nemo plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-caja
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python3-caja, caja, ${misc:Depends}
Description: Caja plugin for Nextcloud
This package contains a Caja plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-dolphin
Architecture: any
Depends: dolphin (>= 4:15.12.1), libnextcloudsync0 (= ${binary:Version}), nextcloud-client, ${misc:Depends}, ${shlibs:Depends}
Description: Dolphin plugin for Nextcloud
This package contains a Dolphin plugin to display
synchronization status icons for Nextcloud files.

View File

@@ -0,0 +1,23 @@
nextcloud-client (2.3.3-1.0~groovy1) groovy; urgency=medium
* Debian build support for the forked client.
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
nextcloud-client (2.3.1-1.0~groovy1) groovy; urgency=medium
* New upstream version
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
nextcloud-client (2.3.0-1.0~groovy1) groovy; urgency=medium
* New upstream version
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
nextcloud-client (2.2.4-1.4~groovy1) groovy; urgency=medium
* The locale-specific icon names are correct too
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100

View File

@@ -0,0 +1,90 @@
Source: nextcloud-client
Section: contrib/devel
Priority: optional
Maintainer: István Váradi <ivaradi@varadiistvan.hu>
Build-Depends: cmake,
debhelper,
cdbs,
dh-python,
extra-cmake-modules (>= 5.16),
libkf5kio-dev,
libcmocka-dev,
libcloudproviders-dev,
libdbus-1-dev,
libhttp-dav-perl,
libinotify-dev [kfreebsd-any],
libqt5svg5-dev,
libqt5webkit5-dev,
libsqlite3-dev,
libssl-dev (>= 1.1.0),
zlib1g-dev,
optipng,
pkg-kde-tools,
python3-sphinx,
python3-all,
qt5keychain-dev,
qtwebengine5-dev,
qtdeclarative5-dev,
qttools5-dev,
qttools5-dev-tools,
xvfb
Standards-Version: 3.9.8
Homepage: https://github.com/nextcloud/client_theming
#Vcs-Git: git://anonscm.debian.org/collab-maint/nextcloud-client.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/nextcloud-client.git
Package: nextcloud-client
Architecture: any
Depends: libnextcloudsync0 (=${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, nextcloud-client-l10n
Description: Nextcloud desktop sync client
Use the desktop client to keep your files synchronized
between your Nextcloud server and your desktop. Select
one or more directories on your local machine and always
have access to your latest files wherever you are.
Package: libnextcloudsync0
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Nextcloud sync library
Used by the Nextcloud desktop client as the synchronization engine.
Package: libnextcloudsync-dev
Architecture: any
Section: contrib/libdevel
Depends: libnextcloudsync0 (=${binary:Version}), ${misc:Depends}
Description: Nextcloud sync library development files
The headers and development library for the Nextcloud sync library.
Package: nextcloud-client-l10n
Architecture: all
Depends: ${misc:Depends}
Description: Nextcloud client internatialization files
The translation files.
Package: nextcloud-client-nautilus
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python3-nautilus, nautilus, ${misc:Depends}
Description: Nautilus plugin for Nextcloud
This package contains a Nautilus plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-nemo
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nemo | nemo-python, nemo, ${misc:Depends}
Description: Nemo plugin for Nextcloud
This package contains a Nemo plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-caja
Architecture: all
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python3-caja, caja, ${misc:Depends}
Description: Caja plugin for Nextcloud
This package contains a Caja plugin to display
synchronization status icons for Nextcloud files.
Package: nextcloud-client-dolphin
Architecture: any
Depends: dolphin (>= 4:15.12.1), libnextcloudsync0 (= ${binary:Version}), nextcloud-client, ${misc:Depends}, ${shlibs:Depends}
Description: Dolphin plugin for Nextcloud
This package contains a Dolphin plugin to display
synchronization status icons for Nextcloud files.

View File

@@ -0,0 +1,4 @@
usr/bin
usr/share/applications
usr/share/icons
debian/101-sync-inotify.conf etc/sysctl.d

View File

@@ -3,12 +3,19 @@
set -xe
shopt -s extglob
env
PPA=ppa:nextcloud-devs/client
PPA_ALPHA=ppa:nextcloud-devs/client-alpha
PPA_BETA=ppa:nextcloud-devs/client-beta
OBS_PROJECT=home:ivaradi
OBS_PROJECT_ALPHA=home:ivaradi:alpha
OBS_PROJECT_BETA=home:ivaradi:beta
OBS_PACKAGE=nextcloud-client
OBS_PACKAGE=nextcloud-desktop
UBUNTU_DISTRIBUTIONS="xenial bionic eoan focal groovy"
DEBIAN_DISTRIBUTIONS="buster stretch"
pull_request=${DRONE_PULL_REQUEST:=master}
@@ -31,13 +38,15 @@ fi
set -x
cd "${DRONE_WORKSPACE}"
read basever kind <<<$(admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable)
read basever revdate kind <<<$(admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable)
cd "${DRONE_DIR}"
echo "$kind" > kind
if test "$kind" = "beta"; then
if test "$kind" = "alpha"; then
repo=nextcloud-devs/client-alpha
elif test "$kind" = "beta"; then
repo=nextcloud-devs/client-beta
else
repo=nextcloud-devs/client
@@ -45,79 +54,60 @@ fi
origsourceopt=""
if ! wget http://ppa.launchpad.net/${repo}/ubuntu/pool/main/n/nextcloud-client/nextcloud-client_${basever}.orig.tar.bz2; then
cp -a ${DRONE_WORKSPACE} nextcloud-client_${basever}
tar cjf nextcloud-client_${basever}.orig.tar.bz2 --exclude .git nextcloud-client_${basever}
origsourceopt="-sa"
fi
cp -a ${DRONE_WORKSPACE} nextcloud-desktop_${basever}-${revdate}
tar cjf nextcloud-desktop_${basever}-${revdate}.orig.tar.bz2 --exclude .git --exclude binary nextcloud-desktop_${basever}-${revdate}
for distribution in xenial bionic disco eoan stable oldstable; do
rm -rf nextcloud-client_${basever}
cp -a ${DRONE_WORKSPACE} nextcloud-client_${basever}
cd "${DRONE_WORKSPACE}"
git config --global user.email "drone@noemail.invalid"
git config --global user.name "Drone User"
cd nextcloud-client_${basever}
for distribution in ${UBUNTU_DISTRIBUTIONS} ${DEBIAN_DISTRIBUTIONS}; do
git checkout -- .
git clean -xdf
cp -a admin/linux/debian/debian .
if test -d admin/linux/debian/debian.${distribution}; then
tar cf - -C admin/linux/debian/debian.${distribution} . | tar xf - -C debian
fi
git fetch origin debian/dist/${distribution}/${DRONE_TARGET_BRANCH}
git checkout origin/debian/dist/${distribution}/${DRONE_TARGET_BRANCH}
admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog ${distribution}
cp /tmp/tmpchangelog debian/changelog
if test -f admin/linux/debian/debian.${distribution}/changelog; then
cat admin/linux/debian/debian.${distribution}/changelog >> debian/changelog
else
cat admin/linux/debian/debian/changelog >> debian/changelog
fi
git merge ${DRONE_COMMIT}
for p in debian/post-patches/*.patch; do
if test -f "${p}"; then
echo "Applying ${p}"
patch -p1 < "${p}"
fi
done
admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog ${distribution} ${revdate}
cat /tmp/tmpchangelog debian/changelog > debian/changelog.new
mv debian/changelog.new debian/changelog
fullver=`head -1 debian/changelog | sed "s:nextcloud-client (\([^)]*\)).*:\1:"`
fullver=`head -1 debian/changelog | sed "s:nextcloud-desktop (\([^)]*\)).*:\1:"`
EDITOR=true dpkg-source --commit . local-changes
dpkg-source --build .
dpkg-genchanges -S ${origsourceopt} > "../nextcloud-client_${fullver}_source.changes"
dpkg-genchanges -S -sa > "../nextcloud-desktop_${fullver}_source.changes"
if test -f ~/.has_ppa_keys; then
debsign -k7D14AA7B -S
fi
cd ..
done
cd ..
ls -al
if test "${pull_request}" = "master"; then
kind=`cat kind`
if test "$kind" = "beta"; then
if test "$kind" = "alpha"; then
PPA=$PPA_ALPHA
OBS_PROJECT=$OBS_PROJECT_ALPHA
elif test "$kind" = "beta"; then
PPA=$PPA_BETA
OBS_PROJECT=$OBS_PROJECT_BETA
fi
if test -f ~/.has_ppa_keys; then
for changes in nextcloud-client_*~+([a-z])1_source.changes; do
case "${changes}" in
*oldstable1*)
;;
*)
dput $PPA $changes > /dev/null
;;
esac
for distribution in ${UBUNTU_DISTRIBUTIONS}; do
changes=$(ls -1 nextcloud-desktop_*~${distribution}1_source.changes)
if test -f "${changes}"; then
dput $PPA "${changes}" > /dev/null
fi
done
for distribution in stable oldstable; do
if test "${distribution}" = "oldstable"; then
pkgsuffix=".${distribution}"
pkgvertag="~${distribution}1"
else
pkgsuffix=""
pkgvertag=""
fi
for distribution in ${DEBIAN_DISTRIBUTIONS}; do
pkgsuffix=".${distribution}"
pkgvertag="~${distribution}1"
package="${OBS_PACKAGE}${pkgsuffix}"
OBS_SUBDIR="${OBS_PROJECT}/${package}"
@@ -129,10 +119,10 @@ if test "${pull_request}" = "master"; then
osc delete ${OBS_SUBDIR}/*
fi
cp ../nextcloud-client*.orig.tar.* ${OBS_SUBDIR}/
cp ../nextcloud-client_*[0-9.][0-9]${pkgvertag}.dsc ${OBS_SUBDIR}/
cp ../nextcloud-client_*[0-9.][0-9]${pkgvertag}.debian.tar* ${OBS_SUBDIR}/
cp ../nextcloud-client_*[0-9.][0-9]${pkgvertag}_source.changes ${OBS_SUBDIR}/
cp ../nextcloud-desktop*.orig.tar.* ${OBS_SUBDIR}/
cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.dsc ${OBS_SUBDIR}/
cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.debian.tar* ${OBS_SUBDIR}/
cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}_source.changes ${OBS_SUBDIR}/
osc add ${OBS_SUBDIR}/*
cd ${OBS_SUBDIR}

View File

@@ -6,3 +6,7 @@
[versionhack]
commit = bc7e65b39552ac458b2adacf76cbf98735ec29a0
tag = v2.4.0-beta
[base]
commit = b45f5fd1a947dc21eb11c69049a99616a2ec950e
version = 2.6.4

View File

@@ -1,5 +1,6 @@
#!//usr/bin/env python2.7
from __future__ import print_function
import subprocess
import re
import sys
@@ -7,6 +8,11 @@ import datetime
import os
import ConfigParser
try:
long
except NameError:
long = int
distribution="yakkety"
versionTagRE = re.compile("^v([0-9]+((\.[0-9]+)+))(-(.+))?$")
@@ -22,39 +28,37 @@ def getCommitVersion(commit):
major=None
minor=None
patch=None
for line in subprocess.check_output(["git", "show",
commit + ":VERSION.cmake"]).splitlines():
m = re.match("set\( MIRALL_VERSION_([A-Z]+) +([0-9])+ *\)", line)
if m is not None:
kind=m.group(1)
version=m.group(2)
if kind=="MAJOR":
major=version
elif kind=="MINOR":
minor=version
elif kind=="PATCH":
patch=version
if major and minor and patch:
return major + "." + minor + "." + patch
else:
try:
for line in subprocess.check_output(["git", "show",
commit + ":VERSION.cmake"]).splitlines():
m = re.match("set\( MIRALL_VERSION_([A-Z]+) +([0-9])+ *\)", line)
if m is not None:
kind=m.group(1)
version=m.group(2)
if kind=="MAJOR":
major=version
elif kind=="MINOR":
minor=version
elif kind=="PATCH":
patch=version
if major and minor and patch:
return major + "." + minor + "." + patch
else:
return None
except:
return None
def collectEntries(baseCommit, baseVersion, kind):
scriptdir = os.path.dirname(__file__)
configPath = os.path.join(scriptdir, "git2changelog.cfg")
def collectEntries(baseCommit, baseVersion, kind, finalRevDate, config):
newVersionCommit = None
newVersionTag = None
newVersionOrigTag = None
if os.path.exists(configPath):
config = ConfigParser.SafeConfigParser()
config.read(configPath)
if config.has_section("versionhack"):
if config.has_option("versionhack", "commit") and \
config.has_option("versionhack", "tag"):
newVersionCommit = config.get("versionhack", "commit")
newVersionTag = config.get("versionhack", "tag")
if config is not None and config.has_section("versionhack"):
if config.has_option("versionhack", "commit") and \
config.has_option("versionhack", "tag"):
newVersionCommit = config.get("versionhack", "commit")
newVersionTag = config.get("versionhack", "tag")
entries = []
@@ -73,9 +77,11 @@ def collectEntries(baseCommit, baseVersion, kind):
words = line.split("\t")
(commit, name, email, date, revdate) = words[0:5]
subject = "\t".join(words[5:])
revdate = datetime.datetime.utcfromtimestamp(long(revdate)).strftime("%Y%m%d.%H%M%S")
kind = "beta"
revdate = datetime.datetime.utcfromtimestamp(long(revdate)).strftime("%Y%m%d.%H%M%S")
revdate += "." + commit
kind = "alpha"
if commit==newVersionCommit:
result = processVersionTag(newVersionTag)
@@ -107,38 +113,63 @@ def collectEntries(baseCommit, baseVersion, kind):
entries.append((commit, name, email, date, revdate, subject,
baseVersion, kind))
if entries:
(commit, name, email, date, revdate, subject, baseVersion, kind) = entries[-1]
if finalRevDate is None:
revdate = datetime.datetime.now().strftime("%Y%m%d.%H%M%S")+ "." + commit
else:
revdate = finalRevDate
entries[-1] = (commit, name, email, date, revdate, subject, baseVersion, kind)
entries.reverse()
return entries
def genChangeLogEntries(f, entries, distribution):
latestBaseVersion = None
latestRevDate = None
latestKind = None
for (commit, name, email, date, revdate, subject, baseVersion, kind) in entries:
if latestBaseVersion is None:
latestBaseVersion = baseVersion
latestRevDate = revdate
latestKind = kind
upstreamVersion = baseVersion + "-" + revdate
if distribution=="stable":
version = upstreamVersion
else:
version = upstreamVersion + "~" + distribution + "1"
print >> f, "nextcloud-client (%s) %s; urgency=medium" % (version, distribution)
print >> f
print >> f, " * " + subject
print >> f
print >> f, " -- %s <%s> %s" % (name, email, date)
print >> f
return (latestBaseVersion, latestKind)
version = upstreamVersion + "-1.0~" + distribution + "1"
print("nextcloud-desktop (%s) %s; urgency=medium" % (version, distribution), file=f)
print(file=f)
print(" * " + subject, file=f)
print(file=f)
print(" -- %s <%s> %s" % (name, email, date), file=f)
print(file=f)
return (latestBaseVersion, latestRevDate, latestKind)
if __name__ == "__main__":
scriptdir = os.path.dirname(__file__)
configPath = os.path.join(scriptdir, "git2changelog.cfg")
baseCommit = "f9b1c724d6ab5431e0cd56b7cd834f2dd48cebb1"
baseVersion = "2.4.0"
config = None
if os.path.exists(configPath):
config = ConfigParser.SafeConfigParser()
config.read(configPath)
if config.has_section("base"):
if config.has_option("base", "commit") and \
config.has_option("base", "version"):
baseCommit = config.get("base", "commit")
baseVersion = config.get("base", "version")
distribution = sys.argv[2]
finalRevDate = sys.argv[3] if len(sys.argv)>3 else None
#entries = collectEntries("8aade24147b5313f8241a8b42331442b7f40eef9", "2.2.4", "release")
entries = collectEntries("f9b1c724d6ab5431e0cd56b7cd834f2dd48cebb1", "2.4.0", "beta")
entries = collectEntries(baseCommit, baseVersion, "alpha", finalRevDate, config)
with open(sys.argv[1], "wt") as f:
(baseVersion, kind) = genChangeLogEntries(f, entries, distribution)
print baseVersion, kind
(baseVersion, revdate, kind) = genChangeLogEntries(f, entries, distribution)
print(baseVersion, revdate, kind)

View File

@@ -1,365 +0,0 @@
#!/usr/bin/python
# This file is part of ownCloud.
# It was inspired in large part by the macdeploy script in Clementine
# and Tomahawk
#
# ownCloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ownCLoud 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ownCloud. If not, see <http://www.gnu.org/licenses/>.
import os
import re
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')
FRAMEWORK_SEARCH_PATH=[
'/Library/Frameworks',
os.path.join(os.environ['HOME'], 'Library/Frameworks')
]
LIBRARY_SEARCH_PATH=['/usr/local/lib', '/usr/local/Qt-5.12.5/lib', '.']
QT_PLUGINS = [
'sqldrivers/libqsqlite.dylib',
'platforms/libqcocoa.dylib',
'styles/libqmacstyle.dylib',
'imageformats/libqgif.dylib',
'imageformats/libqico.dylib',
'imageformats/libqjpeg.dylib',
'imageformats/libqsvg.dylib',
]
QT_PLUGINS_SEARCH_PATH=[
# os.path.join(os.environ['QTDIR'], 'plugins'),
# '/usr/local/Cellar/qt/5.2.1/plugins',
'/usr/local/Qt-5.12.5/plugins',
]
class Error(Exception):
pass
class CouldNotFindQtPluginErrorFindFrameworkError(Error):
pass
class InstallNameToolError(Error):
pass
class CouldNotFindQtPluginError(Error):
pass
class CouldNotFindScriptPluginError(Error):
pass
class CouldNotFindFrameworkError(Error):
pass
if len(sys.argv) < 3:
print 'Usage: %s <bundle.app> <path-to-qmake>' % sys.argv[0]
exit()
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
bundle_dir = sys.argv[1]
qmake_path = sys.argv[2]
bundle_name = os.path.basename(bundle_dir).split('.')[0]
commands = []
binary_dir = os.path.join(bundle_dir, 'Contents', 'MacOS')
frameworks_dir = os.path.join(bundle_dir, 'Contents', 'Frameworks')
commands.append(['mkdir', '-p', frameworks_dir])
resources_dir = os.path.join(bundle_dir, 'Contents', 'Resources')
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 = []
def WriteQtConf():
print "Writing qt.conf..."
with open(os.path.join(resources_dir, 'qt.conf'), 'w') as f:
f.write("[Paths]\nPlugins = PlugIns\n");
f.close()
def GetBrokenLibraries(binary):
#print "Checking libs for binary: %s" % binary
output = subprocess.Popen(['otool', '-L', binary], stdout=subprocess.PIPE).communicate()[0]
broken_libs = {
'frameworks': [],
'libs': []}
for line in [x.split(' ')[0].lstrip() for x in output.split('\n')[1:]]:
#print "Checking line: %s" % line
if not line: # skip empty lines
continue
if os.path.basename(binary) == os.path.basename(line):
#print "mnope %s-%s" % (os.path.basename(binary), os.path.basename(line))
continue
if re.match(r'^\s*/System/', line):
continue # System framework
elif re.match(r'^\s*/usr/lib/', line):
#print "unix style system lib"
continue # unix style system library
elif re.match(r'Breakpad', line):
continue # Manually added by cmake.
elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@loader_path', line):
# Potentially already fixed library
if '.framework' in line:
relative_path = os.path.join(*line.split('/')[3:])
if not os.path.exists(os.path.join(frameworks_dir, relative_path)):
broken_libs['frameworks'].append(relative_path)
else:
relative_path = os.path.join(*line.split('/')[1:])
#print "RELPATH %s %s" % (relative_path, os.path.join(binary_dir, relative_path))
if not os.path.exists(os.path.join(binary_dir, relative_path)):
broken_libs['libs'].append(relative_path)
elif re.search(r'\w+\.framework', line):
broken_libs['frameworks'].append(line)
else:
broken_libs['libs'].append(line)
return broken_libs
def FindFramework(path):
search_pathes = FRAMEWORK_SEARCH_PATH
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
for search_path in search_pathes:
# The following two lines are needed for a custom built Qt from version 5.5 on, possibly not for the one from the Qt SDK.
# Looks like the upstream macdeployqt also had an issue there https://bugreports.qt.io/browse/QTBUG-47868
if path.find( "\@rpath/"):
path = path.replace("@rpath/", "")
abs_path = os.path.join(search_path, path)
if os.path.exists(abs_path):
return abs_path
raise CouldNotFindFrameworkError(path)
def FindLibrary(path):
if os.path.exists(path):
return path
search_pathes = LIBRARY_SEARCH_PATH
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
for search_path in search_pathes:
abs_path = os.path.join(search_path, path)
if os.path.exists(abs_path):
return abs_path
else: # try harder---look for lib name in library folders
newpath = os.path.join(search_path,os.path.basename(path))
if os.path.exists(newpath):
return newpath
return ""
#raise CouldNotFindFrameworkError(path)
def FixAllLibraries(broken_libs):
for framework in broken_libs['frameworks']:
FixFramework(framework)
for lib in broken_libs['libs']:
FixLibrary(lib)
def FixFramework(path):
if path in fixed_libraries:
return
else:
fixed_libraries.append(path)
abs_path = FindFramework(path)
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyFramework(abs_path)
id = os.sep.join(new_path.split(os.sep)[3:])
FixFrameworkId(new_path, id)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixLibrary(path):
if path in fixed_libraries or FindSystemLibrary(os.path.basename(path)) is not None:
return
else:
fixed_libraries.append(path)
abs_path = FindLibrary(path)
if abs_path == "":
print "Could not resolve %s, not fixing!" % path
return
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyLibrary(abs_path)
FixLibraryId(new_path)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixPlugin(abs_path, subdir):
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyPlugin(abs_path, subdir)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixBinary(path):
broken_libs = GetBrokenLibraries(path)
FixAllLibraries(broken_libs)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, path)
def CopyLibrary(path):
new_path = os.path.join(binary_dir, os.path.basename(path))
args = ['ditto', '--arch=x86_64', path, new_path]
commands.append(args)
args = ['chmod', 'u+w', new_path]
commands.append(args)
return new_path
def CopyPlugin(path, subdir):
new_path = os.path.join(plugins_dir, subdir, os.path.basename(path))
args = ['mkdir', '-p', os.path.dirname(new_path)]
commands.append(args)
args = ['ditto', '--arch=x86_64', path, new_path]
commands.append(args)
args = ['chmod', 'u+w', new_path]
commands.append(args)
return new_path
def CopyFramework(source_dylib):
parts = source_dylib.split(os.sep)
print "CopyFramework:", source_dylib
for i, part in enumerate(parts):
matchObj = re.match(r'(\w+\.framework)', part)
if matchObj:
framework = matchObj.group(1)
dylib_name = parts[-1]
source_path = os.path.join('/', *parts[:i+1])
dest_path = os.path.join(frameworks_dir, framework)
dest_dylib_path = os.path.join(frameworks_dir, *parts[i:-1])
break
# if os.path.exists(dest_path):
# print dest_path, "already exists, skipping copy..."
# return os.path.join(dest_dylib_path, dylib_name)
args = ['mkdir', '-p', dest_dylib_path]
commands.append(args)
args = ['ditto', '--arch=x86_64', source_dylib, dest_dylib_path]
commands.append(args)
args = ['chmod', 'u+w', os.path.join(dest_dylib_path, parts[-1])]
commands.append(args)
args = ['ln', '-s', '5', os.path.join(dest_path, 'Versions', 'Current')]
commands.append(args)
args = ['ln', '-s', os.path.join('Versions', 'Current', dylib_name), os.path.join(dest_path, dylib_name)]
commands.append(args)
args = ['ln', '-s', os.path.join('Versions', 'Current', 'Resources'), os.path.join(dest_path, 'Resources')]
commands.append(args)
args = ['cp', '-r', os.path.join(source_path, 'Versions', '5', 'Resources'), os.path.join(dest_path, 'Versions', '5')]
commands.append(args)
args = ['ln', '-s', os.path.join('Versions', 'Current', 'Helpers'), os.path.join(dest_path, 'Helpers')]
commands.append(args)
args = ['cp', '-r', os.path.join(source_path, 'Versions', '5', 'Helpers'), os.path.join(dest_path, 'Versions', '5')]
commands.append(args)
return os.path.join(dest_dylib_path, dylib_name)
def FixId(path, library_name):
id = '@executable_path/../Frameworks/%s' % library_name
args = ['install_name_tool', '-id', id, path]
commands.append(args)
def FixLibraryId(path):
library_name = os.path.basename(path)
FixId(path, library_name)
def FixFrameworkId(path, id):
FixId(path, id)
def FixInstallPath(library_path, library, new_path):
args = ['install_name_tool', '-change', library_path, new_path, library]
commands.append(args)
def FindSystemLibrary(library_name):
for path in ['/lib', '/usr/lib']:
full_path = os.path.join(path, library_name)
if os.path.exists(full_path):
return full_path
return None
def FixLibraryInstallPath(library_path, library):
system_library = FindSystemLibrary(os.path.basename(library_path))
if system_library is None:
new_path = '@executable_path/../MacOS/%s' % os.path.basename(library_path)
FixInstallPath(library_path, library, new_path)
else:
FixInstallPath(library_path, library, system_library)
def FixFrameworkInstallPath(library_path, library):
parts = library_path.split(os.sep)
for i, part in enumerate(parts):
if re.match(r'\w+\.framework', part):
full_path = os.path.join(*parts[i:])
break
new_path = '@executable_path/../Frameworks/%s' % full_path
FixInstallPath(library_path, library, new_path)
def FindQtPlugin(name):
search_path = QT_PLUGINS_SEARCH_PATH
search_path.insert(0, QueryQMake('QT_INSTALL_PLUGINS'))
for path in search_path:
if os.path.exists(path):
if os.path.exists(os.path.join(path, name)):
return os.path.join(path, name)
raise CouldNotFindQtPluginError(name)
for binary in binaries:
FixBinary(binary)
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:
print ' '.join(command)
for command in commands:
p = subprocess.Popen(command)
os.waitpid(p.pid, 0)
WriteQtConf()

View File

@@ -9,6 +9,11 @@ import os
import polib
from optparse import OptionParser
try:
unicode
except NameError:
unicode = str
parser = OptionParser()
parser.add_option("-o", "--output", dest="output",
help="Directory for localized output", default="../Shared/installer/nightly_localized.nsi")
@@ -126,7 +131,7 @@ for root,dirs,files in os.walk(options.podir):
if filename in localeToName:
language = localeToName[filename]
translationCache[language] = collections.OrderedDict()
po = polib.pofile(os.path.join(root,file))
for entry in po.translated_entries():
# Loop through all our labels and add translation (each translation may have multiple labels)
@@ -165,14 +170,14 @@ for language,translations in translationCache.iteritems():
for label,value in translations.iteritems():
NSINewLines.append( tostr('StrCpy $%s "%s"\n' % (label,value)) )
if language.upper() == options.lang.upper():
NSIDeclarations.append( tostr('Var %s\n' % label) )
NSIDeclarations.append( tostr('Var %s\n' % label) )
count += 1
NSIWorkingFile = open('%s/%s.nsh' % (options.output, language),"w")
NSIWorkingFile.writelines(NSINewLines)
NSIWorkingFile.close()
print ( "%i translations merged for language '%s'"%(count,language) )
# Finally, let's write languages.nsh and declarations.nsh
NSIWorkingFile = open('%s/languages.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSILanguages)
@@ -181,5 +186,5 @@ NSIWorkingFile.close()
NSIWorkingFile = open('%s/declarations.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSIDeclarations)
NSIWorkingFile.close()
print ( "NSI Localization Operation Complete" )

1
binary

Submodule binary deleted from 09f12de312

View File

@@ -10,7 +10,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are prefered over the already installed ones
# are preferred over the already installed ones
# since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

View File

@@ -30,6 +30,8 @@
<string>(C) 2014-2020 @APPLICATION_VENDOR@</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
<key>SUShowReleaseNotes</key>
<false/>
<key>SUPublicDSAKeyFile</key>

View File

@@ -0,0 +1,37 @@
# Enable address sanitizer (gcc/clang only)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(SANITIZERS)
set(SANITIZER_EXTRA_FLAGS " -g")
macro(add_sanitizer_option variable flag help)
option(${variable} "Enable ${help}" OFF)
if(${variable})
list(APPEND SANITIZERS ${flag})
string(REPLACE ";" " " optional_args "${ARGN}")
if(optional_args)
string(APPEND SANITIZER_EXTRA_FLAGS " ${optional_args}")
endif()
endif()
mark_as_advanced(${variable})
endmacro()
add_sanitizer_option(SANITIZE_ADDRESS "address"
"AddressSanitizer (detects memory violations, buffer overflows, memory leaks)")
add_sanitizer_option(SANITIZE_LEAK "leak"
"standalone LeakSanitizer (detects memory leaks only)")
add_sanitizer_option(SANITIZE_MEMORY "memory"
"MemorySanitizer (detects reads in uninitialized memory)")
add_sanitizer_option(SANITIZE_UNDEFINED "undefined"
"UndefinedBehaviorSanitizer (detects undefined behavior)"
"-fno-sanitize=vptr")
add_sanitizer_option(SANITIZE_THREAD "thread"
"ThreadSanitizer (detects data races)")
if(SANITIZERS)
string(REPLACE ";" "," SANITIZER_FLAGS "${SANITIZERS}")
set(SANITIZER_FLAGS "-fsanitize=${SANITIZER_FLAGS}${SANITIZER_EXTRA_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS " ${SANITIZER_FLAGS}")
string(APPEND CMAKE_C_FLAGS " ${SANITIZER_FLAGS}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${SANITIZER_FLAGS}")
endif()
endif()

View File

@@ -8,12 +8,12 @@
#cmakedefine CRASHREPORTER_EXECUTABLE "@CRASHREPORTER_EXECUTABLE@"
#define SOCKETAPI_TEAM_IDENTIFIER_PREFIX "@SOCKETAPI_TEAM_IDENTIFIER_PREFIX@"
#cmakedefine APPLICATION_DOMAIN @APPLICATION_DOMAIN@
#cmakedefine THEME_CLASS @THEME_CLASS@
#cmakedefine THEME_INCLUDE @THEME_INCLUDE@
#cmakedefine APPLICATION_NAME "@APPLICATION_NAME@"
#cmakedefine APPLICATION_VENDOR "@APPLICATION_VENDOR@"
#cmakedefine APPLICATION_DOMAIN "@APPLICATION_DOMAIN@"
#cmakedefine APPLICATION_REV_DOMAIN "@APPLICATION_REV_DOMAIN@"
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
@@ -21,6 +21,7 @@
#cmakedefine APPLICATION_HELP_URL "@APPLICATION_HELP_URL@"
#cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@"
#cmakedefine APPLICATION_SERVER_URL "@APPLICATION_SERVER_URL@"
#cmakedefine LINUX_APPLICATION_ID "@LINUX_APPLICATION_ID@"
#cmakedefine APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "@APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR@"
#cmakedefine APPLICATION_WIZARD_HEADER_TITLE_COLOR "@APPLICATION_WIZARD_HEADER_TITLE_COLOR@"
#cmakedefine APPLICATION_WIZARD_USE_CUSTOM_LOGO "@APPLICATION_WIZARD_USE_CUSTOM_LOGO@"

View File

@@ -36,8 +36,7 @@ System Requirements
- openSUSE Leap 42.2 & 42.3
.. note::
For Linux distributions, we support, if technically feasible, the latest 2 versions per platform and the previous `LTS`_.
>>>>>>> b2da03441... update supported linux platforms
For Linux distributions, we support, if technically feasible, the latest 2 versions per platform and the previous LTS.
Installation Wizard
-------------------

View File

@@ -93,6 +93,7 @@ public:
auto menuaction = new QAction(parentWidget);
menuaction->setText(helper->contextMenuTitle());
menuaction->setIcon(QIcon::fromTheme(helper->contextMenuIconName()));
menuaction->setMenu(menu);
return { menuaction };
}

View File

@@ -22,7 +22,6 @@
#include <QStandardPaths>
#include <QFile>
#include "ownclouddolphinpluginhelper.h"
#include "config.h"
OwncloudDolphinPluginHelper* OwncloudDolphinPluginHelper::instance()
{

View File

@@ -23,6 +23,7 @@
#include <QLocalSocket>
#include <QRegularExpression>
#include "ownclouddolphinpluginhelper_export.h"
#include "config.h"
class OWNCLOUDDOLPHINPLUGINHELPER_EXPORT OwncloudDolphinPluginHelper : public QObject {
Q_OBJECT
@@ -35,12 +36,16 @@ public:
QString contextMenuTitle() const
{
return _strings.value("CONTEXT_MENU_TITLE", "Nextcloud");
return _strings.value("CONTEXT_MENU_TITLE", APPLICATION_NAME);
}
QString shareActionTitle() const
{
return _strings.value("SHARE_MENU_TITLE", "Share …");
}
QString contextMenuIconName() const
{
return _strings.value("CONTEXT_MENU_ICON", APPLICATION_ICON_NAME);
}
QString copyPrivateLinkTitle() const { return _strings["COPY_PRIVATE_LINK_MENU_TITLE"]; }
QString emailPrivateLinkTitle() const { return _strings["EMAIL_PRIVATE_LINK_MENU_TITLE"]; }

View File

@@ -191,11 +191,12 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
def check_registered_paths(self, filename):
topLevelFolder = False
internalFile = False
absfilename = os.path.realpath(filename)
for reg_path in socketConnect.registered_paths:
if filename == reg_path:
if absfilename == reg_path:
topLevelFolder = True
break
if filename.startswith(reg_path):
if absfilename.startswith(reg_path):
internalFile = True
# you can't have a registered path below another so it is save to break here
break
@@ -208,6 +209,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
all_internal_files = True
for i, file_uri in enumerate(files):
filename = get_local_path(file_uri.get_uri())
filename = os.path.realpath(filename)
# Check if its a folder (ends with an /), if yes add a "/"
# otherwise it will not find the entry in the table
@@ -296,6 +298,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
state = entry['state']
state_ok = state.startswith('OK')
state_sync = state.startswith('SYNC')
isDir = os.path.isdir(filename + os.sep)
if state_ok:
shareable = True
elif state_sync and isDir:
@@ -446,6 +449,7 @@ class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider):
return
filename = get_local_path(item.get_uri())
filename = os.path.realpath(filename)
if item.is_directory():
filename += os.sep

View File

@@ -81,14 +81,14 @@ IFACEMETHODIMP OCContextMenu::Initialize(
return E_INVALIDARG;
}
FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
FORMATETC fe = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stm;
if (SUCCEEDED(pDataObj->GetData(&fe, &stm))) {
// Get an HDROP handle.
HDROP hDrop = static_cast<HDROP>(GlobalLock(stm.hGlobal));
if (hDrop) {
UINT nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
UINT nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0);
for (UINT i = 0; i < nFiles; ++i) {
// Get the path of the file.
wchar_t buffer[MAX_PATH];
@@ -182,20 +182,38 @@ IFACEMETHODIMP OCContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO pici)
{
std::wstring command;
CMINVOKECOMMANDINFOEX *piciEx = nullptr;
if (pici->cbSize == sizeof(CMINVOKECOMMANDINFOEX))
piciEx = (CMINVOKECOMMANDINFOEX*)pici;
// 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))
{
command = ((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW;
} else {
if (piciEx
&& (piciEx->fMask & CMIC_MASK_UNICODE)
&& HIWORD(((CMINVOKECOMMANDINFOEX*)pici)->lpVerbW)) {
command = piciEx->lpVerbW;
// Verify that we handle the verb
bool handled = false;
for (auto &item : m_info.menuItems) {
if (item.command == command) {
handled = true;
break;
}
}
if (!handled)
return E_FAIL;
} else if (IS_INTRESOURCE(pici->lpVerb)) {
// 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;
command = m_info.menuItems[offset].command;
} else {
return E_FAIL;
}
OCClientInterface::SendRequest(command.data(), m_selectedFiles);

View File

@@ -65,7 +65,7 @@ IFACEMETHODIMP OCContextMenuFactory::CreateInstance(IUnknown *pUnkOuter, REFIID
HRESULT hr = CLASS_E_NOAGGREGATION;
// pUnkOuter is used for aggregation. We do not support it in the sample.
if (pUnkOuter == NULL) {
if (!pUnkOuter) {
hr = E_OUTOFMEMORY;
// Create the COM component.
@@ -88,4 +88,4 @@ IFACEMETHODIMP OCContextMenuFactory::LockServer(BOOL fLock)
InterlockedDecrement(&g_cDllRef);
}
return S_OK;
}
}

View File

@@ -24,16 +24,16 @@ namespace {
HRESULT SetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PCWSTR pszData)
{
HRESULT hr;
HKEY hKey = NULL;
HKEY hKey = nullptr;
// Creates the specified registry key. If the key already exists, the
// function opens it.
hr = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_CLASSES_ROOT, pszSubKey, 0,
NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL));
nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, nullptr));
if (SUCCEEDED(hr))
{
if (pszData != NULL)
if (pszData)
{
// Set the specified value of the key.
DWORD cbData = lstrlen(pszData) * sizeof(*pszData);
@@ -50,7 +50,7 @@ HRESULT SetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PCWSTR
HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR pszData, DWORD cbData)
{
HRESULT hr;
HKEY hKey = NULL;
HKEY hKey = nullptr;
// Try to open the specified registry key.
hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, pszSubKey, 0,
@@ -59,8 +59,8 @@ HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR
if (SUCCEEDED(hr))
{
// Get the data for the specified value name.
hr = HRESULT_FROM_WIN32(RegQueryValueEx(hKey, pszValueName, NULL,
NULL, reinterpret_cast<LPBYTE>(pszData), &cbData));
hr = HRESULT_FROM_WIN32(RegQueryValueEx(hKey, pszValueName, nullptr,
nullptr, reinterpret_cast<LPBYTE>(pszData), &cbData));
RegCloseKey(hKey);
}
@@ -72,7 +72,7 @@ HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR
HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CLSID& clsid, PCWSTR pszFriendlyName, PCWSTR pszThreadModel)
{
if (pszModule == NULL || pszThreadModel == NULL)
if (!pszModule || !pszThreadModel)
{
return E_INVALIDARG;
}
@@ -88,7 +88,7 @@ HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CL
hr = StringCchPrintf(szSubkey, ARRAYSIZE(szSubkey), L"CLSID\\%s", szCLSID);
if (SUCCEEDED(hr))
{
hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, pszFriendlyName);
hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, pszFriendlyName);
// Create the HKCR\CLSID\{<CLSID>}\InprocServer32 key.
if (SUCCEEDED(hr))
@@ -99,7 +99,7 @@ HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CL
{
// Set the default value of the InprocServer32 key to the
// path of the COM module.
hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, pszModule);
hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, pszModule);
if (SUCCEEDED(hr))
{
// Set the threading model of the component.
@@ -136,7 +136,7 @@ HRESULT OCContextMenuRegHandler::UnregisterInprocServer(const CLSID& clsid)
HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
PCWSTR pszFileType, const CLSID& clsid, PCWSTR pszFriendlyName)
{
if (pszFileType == NULL)
if (!pszFileType)
{
return E_INVALIDARG;
}
@@ -154,7 +154,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
if (*pszFileType == L'.')
{
wchar_t szDefaultVal[260];
hr = GetHKCRRegistryKeyAndValue(pszFileType, NULL, szDefaultVal,
hr = GetHKCRRegistryKeyAndValue(pszFileType, nullptr, szDefaultVal,
sizeof(szDefaultVal));
// If the key exists and its default value is not empty, use the
@@ -171,7 +171,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
if (SUCCEEDED(hr))
{
// Set the default value of the key.
hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, szCLSID);
hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, szCLSID);
}
return hr;
@@ -180,7 +180,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
PCWSTR pszFileType, PCWSTR pszFriendlyName)
{
if (pszFileType == NULL)
if (!pszFileType)
{
return E_INVALIDARG;
}
@@ -195,7 +195,7 @@ HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
if (*pszFileType == L'.')
{
wchar_t szDefaultVal[260];
hr = GetHKCRRegistryKeyAndValue(pszFileType, NULL, szDefaultVal,
hr = GetHKCRRegistryKeyAndValue(pszFileType, nullptr, szDefaultVal,
sizeof(szDefaultVal));
// If the key exists and its default value is not empty, use the
@@ -215,4 +215,4 @@ HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
}
return hr;
}
}

View File

@@ -58,8 +58,8 @@ HRESULT RegDelnodeRecurse(HKEY hKeyRoot, LPTSTR lpSubKey)
// Enumerate the keys
dwSize = MAX_PATH;
lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL,
NULL, NULL, &ftWrite);
lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, nullptr,
nullptr, nullptr, &ftWrite);
if (lResult == ERROR_SUCCESS)
{
@@ -73,8 +73,8 @@ HRESULT RegDelnodeRecurse(HKEY hKeyRoot, LPTSTR lpSubKey)
dwSize = MAX_PATH;
lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL,
NULL, NULL, &ftWrite);
lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, nullptr,
nullptr, nullptr, &ftWrite);
} while (lResult == ERROR_SUCCESS);
}

View File

@@ -22,7 +22,7 @@
// {841A0AAD-AA11-4B50-84D9-7F8E727D77D7}
static const GUID CLSID_FileContextMenuExt = { 0x841a0aad, 0xaa11, 0x4b50, { 0x84, 0xd9, 0x7f, 0x8e, 0x72, 0x7d, 0x77, 0xd7 } };
HINSTANCE g_hInst = NULL;
HINSTANCE g_hInst = nullptr;
long g_cDllRef = 0;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
@@ -105,4 +105,4 @@ STDAPI DllUnregisterServer(void)
}
return hr;
}
}

View File

@@ -17,7 +17,7 @@
#include "OCOverlayRegistrationHandler.h"
#include "OCOverlayFactory.h"
HINSTANCE instanceHandle = NULL;
HINSTANCE instanceHandle = nullptr;
long dllReferenceCount = 0;

View File

@@ -82,7 +82,7 @@ IFACEMETHODIMP OCOverlay::QueryInterface(REFIID riid, void **ppv)
else
{
hr = E_NOINTERFACE;
*ppv = NULL;
*ppv = nullptr;
}
if (*ppv)

View File

@@ -43,7 +43,7 @@ IFACEMETHODIMP OCOverlayFactory::QueryInterface(REFIID riid, void **ppv)
else
{
hResult = E_NOINTERFACE;
*ppv = NULL;
*ppv = nullptr;
}
return hResult;
@@ -70,7 +70,7 @@ IFACEMETHODIMP OCOverlayFactory::CreateInstance(
{
HRESULT hResult = CLASS_E_NOAGGREGATION;
if (pUnkOuter != NULL) { return hResult; }
if (pUnkOuter) { return hResult; }
hResult = E_OUTOFMEMORY;
OCOverlay *lrOverlay = new (std::nothrow) OCOverlay(_state);
@@ -90,4 +90,4 @@ IFACEMETHODIMP OCOverlayFactory::LockServer(BOOL fLock)
InterlockedDecrement(&dllReferenceCount);
}
return S_OK;
}
}

View File

@@ -24,9 +24,9 @@ using namespace std;
HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PCWSTR friendlyName)
{
HRESULT hResult;
HKEY shellOverlayKey = NULL;
HKEY shellOverlayKey = nullptr;
// the key may not exist yet
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &shellOverlayKey, NULL));
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &shellOverlayKey, nullptr));
if (!SUCCEEDED(hResult)) {
hResult = RegCreateKey(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, &shellOverlayKey);
if(!SUCCEEDED(hResult)) {
@@ -34,8 +34,8 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
}
}
HKEY syncExOverlayKey = NULL;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(shellOverlayKey, friendlyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &syncExOverlayKey, NULL));
HKEY syncExOverlayKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(shellOverlayKey, friendlyName, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &syncExOverlayKey, nullptr));
if (!SUCCEEDED(hResult)) {
return hResult;
@@ -44,7 +44,7 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
wchar_t stringCLSID[MAX_PATH];
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
LPCTSTR value = stringCLSID;
hResult = RegSetValueEx(syncExOverlayKey, NULL, 0, REG_SZ, (LPBYTE)value, (DWORD)((wcslen(value)+1) * sizeof(TCHAR)));
hResult = RegSetValueEx(syncExOverlayKey, nullptr, 0, REG_SZ, (LPBYTE)value, (DWORD)((wcslen(value)+1) * sizeof(TCHAR)));
if (!SUCCEEDED(hResult)) {
return hResult;
}
@@ -55,14 +55,14 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
{
HRESULT hResult;
HKEY shellOverlayKey = NULL;
HKEY shellOverlayKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, KEY_WRITE, &shellOverlayKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
HKEY syncExOverlayKey = NULL;
HKEY syncExOverlayKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegDeleteKey(shellOverlayKey, friendlyName));
if (!SUCCEEDED(hResult)) {
return hResult;
@@ -73,35 +73,35 @@ HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid)
{
if (modulePath == NULL) {
if (!modulePath) {
return E_FAIL;
}
wchar_t stringCLSID[MAX_PATH];
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
HRESULT hResult;
HKEY hKey = NULL;
HKEY hKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, REGISTRY_CLSID, 0, KEY_WRITE, &hKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
HKEY clsidKey = NULL;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(hKey, stringCLSID, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &clsidKey, NULL));
HKEY clsidKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(hKey, stringCLSID, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &clsidKey, nullptr));
if(!SUCCEEDED(hResult)) {
return hResult;
}
hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, NULL, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, nullptr, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
HKEY inprocessKey = NULL;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &inprocessKey, NULL));
HKEY inprocessKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &inprocessKey, nullptr));
if(!SUCCEEDED(hResult)) {
return hResult;
}
hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, nullptr, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
if(!SUCCEEDED(hResult)) {
return hResult;
@@ -126,13 +126,13 @@ HRESULT OCOverlayRegistrationHandler::UnregisterCOMObject(const CLSID& clsid)
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
HRESULT hResult;
HKEY hKey = NULL;
HKEY hKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, REGISTRY_CLSID, 0, DELETE, &hKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
HKEY clsidKey = NULL;
HKEY clsidKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(hKey, stringCLSID, 0, DELETE, &clsidKey));
if(!SUCCEEDED(hResult)) {
return hResult;
@@ -149,4 +149,4 @@ HRESULT OCOverlayRegistrationHandler::UnregisterCOMObject(const CLSID& clsid)
}
return S_OK;
}
}

View File

@@ -73,7 +73,7 @@ bool CommunicationSocket::Close()
bool CommunicationSocket::Connect(const std::wstring &pipename)
{
_pipe = CreateFile(pipename.data(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
_pipe = CreateFile(pipename.data(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (_pipe == INVALID_HANDLE_VALUE) {
return false;
@@ -87,7 +87,7 @@ bool CommunicationSocket::SendMsg(const wchar_t* message) const
auto utf8_msg = StringUtil::toUtf8(message);
DWORD numBytesWritten = 0;
auto result = WriteFile( _pipe, utf8_msg.c_str(), DWORD(utf8_msg.size()), &numBytesWritten, NULL);
auto result = WriteFile( _pipe, utf8_msg.c_str(), DWORD(utf8_msg.size()), &numBytesWritten, nullptr);
if (result) {
return true;
@@ -123,7 +123,7 @@ bool CommunicationSocket::ReadLine(wstring* response)
DWORD numBytesRead = 0;
DWORD totalBytesAvailable = 0;
if (!PeekNamedPipe(_pipe, NULL, 0, 0, &totalBytesAvailable, 0)) {
if (!PeekNamedPipe(_pipe, nullptr, 0, 0, &totalBytesAvailable, 0)) {
Close();
return false;
}
@@ -131,7 +131,7 @@ bool CommunicationSocket::ReadLine(wstring* response)
return false;
}
if (!ReadFile(_pipe, resp_utf8.data(), DWORD(resp_utf8.size()), &numBytesRead, NULL)) {
if (!ReadFile(_pipe, resp_utf8.data(), DWORD(resp_utf8.size()), &numBytesRead, nullptr)) {
Close();
return false;
}

View File

@@ -39,9 +39,9 @@ bool FileUtil::IsChildFile(const wchar_t* rootFolder, vector<wstring>* files)
bool FileUtil::IsChildFile(const wchar_t* rootFolder, const wchar_t* file)
{
wstring* f = new wstring(file);
const wstring f(file);
size_t found = f->find(rootFolder);
size_t found = f.find(rootFolder);
if(found != string::npos)
{
@@ -83,4 +83,4 @@ bool FileUtil::IsChildFileOfRoot(const wchar_t* filePath)
delete rootFolder;
return needed;
}
}

View File

@@ -38,9 +38,9 @@ bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring
{
HRESULT hResult;
HKEY rootKey = NULL;
HKEY rootKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, NULL, KEY_READ, &rootKey));
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, 0, KEY_READ, &rootKey));
if(!SUCCEEDED(hResult))
{
@@ -49,8 +49,8 @@ bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring
wchar_t value[SIZE];
DWORD value_length = SIZE;
hResult = RegQueryValueEx(rootKey, (LPCWSTR)name, NULL, NULL, (LPBYTE)value, &value_length );
hResult = RegQueryValueEx(rootKey, (LPCWSTR)name, nullptr, nullptr, (LPBYTE)value, &value_length );
if(!SUCCEEDED(hResult))
{

View File

@@ -83,7 +83,7 @@ void RemotePathChecker::workerThreadLoop()
// We don't keep track of all files and can't know which file is currently visible
// to the user, but at least reload the root dir so that any shortcut to the root
// is updated without the user needing to refresh.
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), nullptr);
} else if (StringUtil::begins_with(response, wstring(L"UNREGISTER_PATH:"))) {
wstring responsePath = response.substr(16); // length of UNREGISTER_PATH:
@@ -107,7 +107,7 @@ void RemotePathChecker::workerThreadLoop()
}
}
for (auto& path : removedPaths)
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, path.data(), NULL);
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, path.data(), nullptr);
} else if (StringUtil::begins_with(response, wstring(L"STATUS:")) ||
StringUtil::begins_with(response, wstring(L"BROADCAST:"))) {
@@ -135,7 +135,7 @@ void RemotePathChecker::workerThreadLoop()
it->second = state;
}
if (updateView) {
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), nullptr);
}
}
}
@@ -151,7 +151,7 @@ void RemotePathChecker::workerThreadLoop()
lock.unlock();
// Let explorer know about each invalidated cache entry that needs to get its icon removed.
for (auto it = cache.begin(); it != cache.end(); ++it) {
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, it->first.data(), NULL);
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, it->first.data(), nullptr);
}
}
@@ -168,7 +168,7 @@ RemotePathChecker::RemotePathChecker()
: _stop(false)
, _watchedDirectories(make_shared<const vector<wstring>>())
, _connected(false)
, _newQueries(CreateEvent(NULL, FALSE, FALSE, NULL))
, _newQueries(CreateEvent(nullptr, FALSE, FALSE, nullptr))
, _thread([this]{ this->workerThreadLoop(); })
{
}

View File

@@ -93,7 +93,7 @@ void QProgressIndicator::setColor(const QColor & color)
QSize QProgressIndicator::sizeHint() const
{
return QSize(20,20);
return {20, 20};
}
int QProgressIndicator::heightForWidth(int w) const

View File

@@ -94,7 +94,7 @@ bool QtLockedFile::lock(LockMode mode, bool block)
QString mut_name = QString::fromLatin1(MUTEX_PREFIX)
+ fi.absoluteFilePath().toLower();
m_mutex_hnd = CreateMutexW(NULL, FALSE, (TCHAR*)mut_name.utf16());
m_mutex_hnd = CreateMutexW(nullptr, FALSE, (TCHAR*)mut_name.utf16());
if (m_mutex_hnd == 0) {
qWarning("QtLockedFile::lock(): CreateMutex: %s",
@@ -118,7 +118,7 @@ bool QtLockedFile::lock(LockMode mode, bool block)
if (res == WAIT_TIMEOUT) {
if (i) {
// A failed nonblocking rw locking. Undo changes to semaphore.
if (ReleaseSemaphore(m_semaphore_hnd, i, NULL) == 0) {
if (ReleaseSemaphore(m_semaphore_hnd, i, nullptr) == 0) {
qWarning("QtLockedFile::unlock(): ReleaseSemaphore: %s",
errorCodeToString(GetLastError()).toLatin1().constData());
// Fall through

View File

@@ -123,7 +123,7 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout, bool block)
Sleep(DWORD(ms));
#else
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
nanosleep(&ts, NULL);
nanosleep(&ts, nullptr);
#endif
}
if (!connOk)

View File

@@ -53,7 +53,7 @@ static QString instancesLockFilename(const QString &appSessionId)
QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv)
: QApplication(argc, argv),
firstPeer(-1),
pidPeer(0)
pidPeer(nullptr)
{
this->appId = appId;
@@ -61,7 +61,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
// This shared memory holds a zero-terminated array of active (or crashed) instances
instances = new QSharedMemory(appSessionId, this);
actWin = 0;
actWin = nullptr;
block = false;
// First instance creates the shared memory, later instances attach to it
@@ -71,7 +71,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
qWarning() << "Failed to initialize instances shared memory: "
<< instances->errorString();
delete instances;
instances = 0;
instances = nullptr;
return;
}
}

View File

@@ -70201,7 +70201,7 @@ static int btreeOverwriteContent(
){
int nData = pX->nData - iOffset;
if( nData<=0 ){
/* Overwritting with zeros */
/* Overwriting with zeros */
int i;
for(i=0; i<iAmt && pDest[i]==0; i++){}
if( i<iAmt ){
@@ -91521,7 +91521,7 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){
** the background thread from a sub-tasks previous turn is still running,
** skip it. If the first (pSorter->nTask-1) sub-tasks are all still busy,
** fall back to using the final sub-task. The first (pSorter->nTask-1)
** sub-tasks are prefered as they use background threads - the final
** sub-tasks are preferred as they use background threads - the final
** sub-task uses the main thread. */
for(i=0; i<nWorker; i++){
int iTest = (pSorter->iPrev + i + 1) % nWorker;

View File

@@ -52,8 +52,8 @@ include_directories(
add_subdirectory(csync)
add_subdirectory(libsync)
if (NOT BUILD_LIBRARIES_ONLY)
add_subdirectory(gui)
add_subdirectory(cmd)
add_subdirectory(gui)
if (WITH_CRASHREPORTER)
add_subdirectory(3rdparty/libcrashreporter-qt)

View File

@@ -32,24 +32,17 @@ if(NOT BUILD_LIBRARIES_ONLY)
target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer)
endif()
# OSX: Copy nextcloudcmd to app bundle, src/gui will run macdeployqt
if(BUILD_OWNCLOUD_OSX_BUNDLE)
install(TARGETS ${cmd_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
add_custom_command(TARGET ${cmd_NAME} POST_BUILD
COMMAND "cp"
"$<TARGET_FILE:${cmd_NAME}>"
"${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS"
COMMENT "Copying nextcloudcmd..."
)
elseif(NOT BUILD_LIBRARIES_ONLY)
install(TARGETS ${cmd_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
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
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
install(CODE "
message(STATUS \"Deploying (Qt) dependencies and fixing library paths...\")
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE} ${QT_QMAKE_EXECUTABLE})
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app ${QT_QMAKE_EXECUTABLE})
" COMPONENT RUNTIME)
endif()

View File

@@ -80,7 +80,7 @@ struct CmdOptions
// we can't use csync_set_userdata because the SyncEngine sets it already.
// So we have to use a global variable
CmdOptions *opts = 0;
CmdOptions *opts = nullptr;
class EchoDisabler
{

View File

@@ -150,7 +150,7 @@ QByteArray contentChecksumType()
static bool checksumComputationEnabled()
{
static bool enabled = qgetenv("OWNCLOUD_DISABLE_CHECKSUM_COMPUTATIONS").isEmpty();
static bool enabled = qEnvironmentVariableIsEmpty("OWNCLOUD_DISABLE_CHECKSUM_COMPUTATIONS");
return enabled;
}
@@ -255,21 +255,19 @@ void ValidateChecksumHeader::slotChecksumCalculated(const QByteArray &checksumTy
emit validated(checksumType, checksum);
}
CSyncChecksumHook::CSyncChecksumHook()
{
}
CSyncChecksumHook::CSyncChecksumHook() = default;
QByteArray CSyncChecksumHook::hook(const QByteArray &path, const QByteArray &otherChecksumHeader, void * /*this_obj*/)
{
QByteArray type = parseChecksumHeaderType(QByteArray(otherChecksumHeader));
if (type.isEmpty())
return NULL;
return nullptr;
qCInfo(lcChecksums) << "Computing" << type << "checksum of" << path << "in the csync hook";
QByteArray checksum = ComputeChecksum::computeNow(QString::fromUtf8(path), type);
if (checksum.isNull()) {
qCWarning(lcChecksums) << "Failed to compute checksum" << type << "for" << path;
return NULL;
return nullptr;
}
return makeChecksumHeader(type, checksum);

View File

@@ -147,8 +147,8 @@ bool FileSystem::rename(const QString &originFileName,
if (!success) {
wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string, 0, NULL);
nullptr, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string, 0, nullptr);
error = QString::fromWCharArray(string);
LocalFree((HLOCAL)string);
@@ -216,8 +216,8 @@ bool FileSystem::uncheckedRenameReplace(const QString &originFileName,
if (!ok) {
wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string, 0, NULL);
nullptr, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string, 0, nullptr);
*errorString = QString::fromWCharArray(string);
qCWarning(lcFileSystem) << "Renaming temp file to final failed: " << *errorString;
@@ -248,7 +248,7 @@ bool FileSystem::openAndSeekFileSharedRead(QFile *file, QString *errorOrNull, qi
DWORD creationDisp = OPEN_EXISTING;
// Create the file handle.
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), nullptr, FALSE };
QString fName = longWinPath(file->fileName());
HANDLE fileHandle = CreateFileW(
@@ -258,7 +258,7 @@ bool FileSystem::openAndSeekFileSharedRead(QFile *file, QString *errorOrNull, qi
&securityAtts,
creationDisp,
FILE_ATTRIBUTE_NORMAL,
NULL);
nullptr);
// Bail out on error.
if (fileHandle == INVALID_HANDLE_VALUE) {
@@ -352,8 +352,8 @@ QString FileSystem::fileSystemForPath(const QString &path)
if (!GetVolumeInformationW(
reinterpret_cast<LPCWSTR>(drive.utf16()),
NULL, 0,
NULL, NULL, NULL,
nullptr, 0,
nullptr, nullptr, nullptr,
fileSystemBuffer, fileSystemBufferSize)) {
return QString();
}
@@ -516,9 +516,9 @@ bool FileSystem::isFileLocked(const QString &fileName)
wuri,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
nullptr, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
NULL);
nullptr);
if (win_h == INVALID_HANDLE_VALUE) {
/* could not be opened, so locked? */
@@ -543,7 +543,7 @@ bool FileSystem::isJunction(const QString &filename)
{
#ifdef Q_OS_WIN
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFileEx((const wchar_t *)filename.utf16(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, 0);
HANDLE hFind = FindFirstFileEx((const wchar_t *)filename.utf16(), FindExInfoBasic, &findData, FindExSearchNameMatch, nullptr, 0);
if (hFind != INVALID_HANDLE_VALUE) {
FindClose(hFind);
return false;

View File

@@ -91,7 +91,7 @@ namespace FileSystem {
*/
bool OCSYNC_EXPORT rename(const QString &originFileName,
const QString &destinationFileName,
QString *errorString = NULL);
QString *errorString = nullptr);
/**
* Rename the file \a originFileName to \a destinationFileName, and

View File

@@ -44,7 +44,7 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcSql, "nextcloud.sync.database.sql", QtInfoMsg)
SqlDatabase::SqlDatabase()
: _db(0)
: _db(nullptr)
, _errId(0)
{
}
@@ -57,7 +57,7 @@ SqlDatabase::~SqlDatabase()
bool SqlDatabase::isOpen()
{
return _db != 0;
return _db != nullptr;
}
bool SqlDatabase::openHelper(const QString &filename, int sqliteFlags)
@@ -68,7 +68,7 @@ bool SqlDatabase::openHelper(const QString &filename, int sqliteFlags)
sqliteFlags |= SQLITE_OPEN_NOMUTEX;
SQLITE_DO(sqlite3_open_v2(filename.toUtf8().constData(), &_db, sqliteFlags, 0));
SQLITE_DO(sqlite3_open_v2(filename.toUtf8().constData(), &_db, sqliteFlags, nullptr));
if (_errId != SQLITE_OK) {
qCWarning(lcSql) << "Error:" << _error << "for" << filename;
@@ -196,7 +196,7 @@ void SqlDatabase::close()
SQLITE_DO(sqlite3_close(_db));
if (_errId != SQLITE_OK)
qCWarning(lcSql) << "Closing database failed" << _error;
_db = 0;
_db = nullptr;
}
}
@@ -205,7 +205,7 @@ bool SqlDatabase::transaction()
if (!_db) {
return false;
}
SQLITE_DO(sqlite3_exec(_db, "BEGIN", 0, 0, 0));
SQLITE_DO(sqlite3_exec(_db, "BEGIN", nullptr, nullptr, nullptr));
return _errId == SQLITE_OK;
}
@@ -214,7 +214,7 @@ bool SqlDatabase::commit()
if (!_db) {
return false;
}
SQLITE_DO(sqlite3_exec(_db, "COMMIT", 0, 0, 0));
SQLITE_DO(sqlite3_exec(_db, "COMMIT", nullptr, nullptr, nullptr));
return _errId == SQLITE_OK;
}
@@ -255,7 +255,7 @@ int SqlQuery::prepare(const QByteArray &sql, bool allow_failure)
int n = 0;
int rc;
do {
rc = sqlite3_prepare_v2(_db, _sql.constData(), -1, &_stmt, 0);
rc = sqlite3_prepare_v2(_db, _sql.constData(), -1, &_stmt, nullptr);
if ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)) {
n++;
OCC::Utility::usleep(SQLITE_SLEEP_TIME_USEC);
@@ -462,7 +462,7 @@ void SqlQuery::finish()
if (!_stmt)
return;
SQLITE_DO(sqlite3_finalize(_stmt));
_stmt = 0;
_stmt = nullptr;
if (_sqldb) {
_sqldb->_queries.remove(this);
}

View File

@@ -661,7 +661,7 @@ bool SyncJournalDb::updateMetadataTableStructure()
commitInternal("update database structure: add filesize col");
}
if (1) {
if (true) {
SqlQuery query(_db);
query.prepare("CREATE INDEX IF NOT EXISTS metadata_inode ON metadata(inode);");
if (!query.exec()) {
@@ -671,7 +671,7 @@ bool SyncJournalDb::updateMetadataTableStructure()
commitInternal("update database structure: add inode index");
}
if (1) {
if (true) {
SqlQuery query(_db);
query.prepare("CREATE INDEX IF NOT EXISTS metadata_path ON metadata(path);");
if (!query.exec()) {
@@ -1857,12 +1857,12 @@ QByteArray SyncJournalDb::getChecksumType(int checksumTypeId)
return {};
query.bindValue(1, checksumTypeId);
if (!query.exec()) {
return 0;
return nullptr;
}
if (!query.next()) {
qCWarning(lcDb) << "No checksum type mapping found for" << checksumTypeId;
return 0;
return nullptr;
}
return query.baValue(0);
}

View File

@@ -87,33 +87,19 @@ public:
struct DownloadInfo
{
DownloadInfo()
: _errorCount(0)
, _valid(false)
{
}
QString _tmpfile;
QByteArray _etag;
int _errorCount;
bool _valid;
int _errorCount = 0;
bool _valid = false;
};
struct UploadInfo
{
UploadInfo()
: _chunk(0)
, _transferid(0)
, _size(0)
, _modtime(0)
, _errorCount(0)
, _valid(false)
{
}
int _chunk;
int _transferid;
quint64 _size; //currently unused
qint64 _modtime;
int _errorCount;
bool _valid;
int _chunk = 0;
int _transferid = 0;
quint64 _size = 0; //currently unused
qint64 _modtime = 0;
int _errorCount = 0;
bool _valid = false;
QByteArray _contentChecksum;
/**
* Returns true if this entry refers to a chunked upload that can be continued.

View File

@@ -81,31 +81,22 @@ public:
InsufficientRemoteStorage
};
SyncJournalErrorBlacklistRecord()
: _retryCount(0)
, _errorCategory(Category::Normal)
, _lastTryModtime(0)
, _lastTryTime(0)
, _ignoreDuration(0)
{
}
/// The number of times the operation was unsuccessful so far.
int _retryCount;
int _retryCount = 0;
/// The last error string.
QString _errorString;
/// The error category. Sometimes used for special actions.
Category _errorCategory;
Category _errorCategory = Category::Normal;
qint64 _lastTryModtime;
qint64 _lastTryModtime = 0;
QByteArray _lastTryEtag;
/// The last time the operation was attempted (in s since epoch).
qint64 _lastTryTime;
qint64 _lastTryTime = 0;
/// The number of seconds the file shall be ignored.
qint64 _ignoreDuration;
qint64 _ignoreDuration = 0;
QString _file;
QString _renameTarget;

View File

@@ -215,7 +215,7 @@ qint64 Utility::freeDiskSpace(const QString &path)
#elif defined(Q_OS_WIN)
ULARGE_INTEGER freeBytes;
freeBytes.QuadPart = 0L;
if (GetDiskFreeSpaceEx(reinterpret_cast<const wchar_t *>(path.utf16()), &freeBytes, NULL, NULL)) {
if (GetDiskFreeSpaceEx(reinterpret_cast<const wchar_t *>(path.utf16()), &freeBytes, nullptr, nullptr)) {
return freeBytes.QuadPart;
}
#endif
@@ -298,7 +298,7 @@ namespace {
QString description(quint64 value) const
{
return QCoreApplication::translate("Utility", name, 0, value);
return QCoreApplication::translate("Utility", name, nullptr, value);
}
};
// QTBUG-3945 and issue #4855: QT_TRANSLATE_NOOP does not work with plural form because lupdate
@@ -313,7 +313,7 @@ namespace {
{ QT_TRANSLATE_NOOP("Utility", "%n hour(s)", 0, _), 3600 * 1000LL },
{ QT_TRANSLATE_NOOP("Utility", "%n minute(s)", 0, _), 60 * 1000LL },
{ QT_TRANSLATE_NOOP("Utility", "%n second(s)", 0, _), 1000LL },
{ 0, 0 }
{ nullptr, 0 }
};
} // anonymous namespace
@@ -392,7 +392,7 @@ QString Utility::platformName()
void Utility::crash()
{
volatile int *a = (int *)(NULL);
volatile int *a = (int *)nullptr;
*a = 1;
}

View File

@@ -56,9 +56,9 @@ bool hasLaunchOnStartup_private(const QString &)
CFStringRef appUrlRefString = CFURLGetString(urlRef); // no need for release
for (int i = 0; i < CFArrayGetCount(itemsArray); i++) {
LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(itemsArray, i);
CFURLRef itemUrlRef = NULL;
CFURLRef itemUrlRef = nullptr;
if (LSSharedFileListItemResolve(item, 0, &itemUrlRef, NULL) == noErr && itemUrlRef) {
if (LSSharedFileListItemResolve(item, 0, &itemUrlRef, nullptr) == noErr && itemUrlRef) {
CFStringRef itemUrlString = CFURLGetString(itemUrlRef);
if (CFStringCompare(itemUrlString, appUrlRefString, 0) == kCFCompareEqualTo) {
returnValue = true;
@@ -98,9 +98,9 @@ void setLaunchOnStartup_private(const QString &appName, const QString &guiName,
CFStringRef appUrlRefString = CFURLGetString(urlRef);
for (int i = 0; i < CFArrayGetCount(itemsArray); i++) {
LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(itemsArray, i);
CFURLRef itemUrlRef = NULL;
CFURLRef itemUrlRef = nullptr;
if (LSSharedFileListItemResolve(item, 0, &itemUrlRef, NULL) == noErr && itemUrlRef) {
if (LSSharedFileListItemResolve(item, 0, &itemUrlRef, nullptr) == noErr && itemUrlRef) {
CFStringRef itemUrlString = CFURLGetString(itemUrlRef);
if (CFStringCompare(itemUrlString, appUrlRefString, 0) == kCFCompareEqualTo) {
LSSharedFileListItemRemove(loginItems, item); // remove it!
@@ -120,11 +120,11 @@ static bool hasDarkSystray_private()
{
bool returnValue = false;
CFStringRef interfaceStyleKey = CFSTR("AppleInterfaceStyle");
CFStringRef interfaceStyle = NULL;
CFStringRef interfaceStyle = nullptr;
CFStringRef darkInterfaceStyle = CFSTR("Dark");
interfaceStyle = (CFStringRef)CFPreferencesCopyAppValue(interfaceStyleKey,
kCFPreferencesCurrentApplication);
if (interfaceStyle != NULL) {
if (interfaceStyle) {
returnValue = (kCFCompareEqualTo == CFStringCompare(interfaceStyle, darkInterfaceStyle, 0));
CFRelease(interfaceStyle);
}

View File

@@ -47,14 +47,18 @@ QString getUserAutostartDir_private()
bool hasLaunchOnStartup_private(const QString &appName)
{
QString desktopFileLocation = getUserAutostartDir_private() + appName + QLatin1String(".desktop");
QString desktopFileLocation = getUserAutostartDir_private()
+ QLatin1String(LINUX_APPLICATION_ID)
+ QLatin1String(".desktop");
return QFile::exists(desktopFileLocation);
}
void setLaunchOnStartup_private(const QString &appName, const QString &guiName, bool enable)
{
QString userAutoStartPath = getUserAutostartDir_private();
QString desktopFileLocation = userAutoStartPath + appName + QLatin1String(".desktop");
QString desktopFileLocation = userAutoStartPath
+ QLatin1String(LINUX_APPLICATION_ID)
+ QLatin1String(".desktop");
if (enable) {
if (!QDir().exists(userAutoStartPath) && !QDir().mkpath(userAutoStartPath)) {
qCWarning(lcUtility) << "Could not create autostart folder" << userAutoStartPath;
@@ -72,7 +76,7 @@ void setLaunchOnStartup_private(const QString &appName, const QString &guiName,
<< QLatin1String("GenericName=") << QLatin1String("File Synchronizer") << endl
<< QLatin1String("Exec=") << QCoreApplication::applicationFilePath() << endl
<< QLatin1String("Terminal=") << "false" << endl
<< QLatin1String("Icon=") << appName.toLower() << endl // always use lowercase for icons
<< QLatin1String("Icon=") << APPLICATION_ICON_NAME << endl
<< QLatin1String("Categories=") << QLatin1String("Network") << endl
<< QLatin1String("Type=") << QLatin1String("Application") << endl
<< QLatin1String("StartupNotify=") << "false" << endl

View File

@@ -57,7 +57,7 @@ static void setupFavLink_private(const QString &folder)
/* Use new WINAPI functions */
PWSTR path;
if (SHGetKnownFolderPath(FOLDERID_Links, 0, NULL, &path) == S_OK) {
if (SHGetKnownFolderPath(FOLDERID_Links, 0, nullptr, &path) == S_OK) {
QString links = QDir::fromNativeSeparators(QString::fromWCharArray(path));
linkName = QDir(links).filePath(folderDir.dirName() + QLatin1String(".lnk"));
CoTaskMemFree(path);

View File

@@ -49,11 +49,15 @@ if(NOT BUILD_LIBRARIES_ONLY)
# currently it needs to be done because the code right above needs to be executed no matter
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
if(BUILD_OWNCLOUD_OSX_BUNDLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
install(CODE "
message(STATUS \"Deploying (Qt) dependencies and fixing library paths...\")
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE} ${QT_QMAKE_EXECUTABLE})
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app ${QT_QMAKE_EXECUTABLE})
" COMPONENT RUNTIME)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
add_custom_command(TARGET ${CRASHREPORTER_EXECUTABLE} POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
"$<TARGET_FILE_DIR:${CRASHREPORTER_EXECUTABLE}>/../.."
-always-overwrite
COMMENT "Running macdeployqt..."
)
endif()
endif()

View File

@@ -49,7 +49,7 @@
#include "common/c_jhash.h"
#include "common/syncjournalfilerecord.h"
Q_LOGGING_CATEGORY(lcCSync, "sync.csync.csync", QtInfoMsg)
Q_LOGGING_CATEGORY(lcCSync, "nextcloud.sync.csync.csync", QtInfoMsg)
csync_s::csync_s(const char *localUri, OCC::SyncJournalDb *statedb)
@@ -67,7 +67,7 @@ csync_s::csync_s(const char *localUri, OCC::SyncJournalDb *statedb)
int csync_update(CSYNC *ctx) {
int rc = -1;
if (ctx == NULL) {
if (!ctx) {
errno = EBADF;
return -1;
}
@@ -188,7 +188,7 @@ static int _csync_treewalk_visitor(csync_file_stat_t *cur, CSYNC * ctx, const cs
other_file_it = other_tree->find(renamed_path);
}
csync_file_stat_t *other = (other_file_it != other_tree->cend()) ? other_file_it->second.get() : NULL;
csync_file_stat_t *other = (other_file_it != other_tree->cend()) ? other_file_it->second.get() : nullptr;
ctx->status_code = CSYNC_STATUS_OK;
@@ -234,7 +234,7 @@ int csync_s::reinitialize() {
status_code = CSYNC_STATUS_OK;
remote.read_from_db = 0;
remote.read_from_db = false;
read_remote_from_db = true;
local.files.clear();
@@ -256,14 +256,14 @@ csync_s::~csync_s() {
}
void *csync_get_userdata(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
if (!ctx) {
return nullptr;
}
return ctx->callbacks.userdata;
}
int csync_set_userdata(CSYNC *ctx, void *userdata) {
if (ctx == NULL) {
if (!ctx) {
return -1;
}
@@ -273,15 +273,15 @@ int csync_set_userdata(CSYNC *ctx, void *userdata) {
}
csync_auth_callback csync_get_auth_callback(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
if (!ctx) {
return nullptr;
}
return ctx->callbacks.auth_function;
}
int csync_set_status(CSYNC *ctx, int status) {
if (ctx == NULL || status < 0) {
if (!ctx || status < 0) {
return -1;
}
@@ -291,7 +291,7 @@ int csync_set_status(CSYNC *ctx, int status) {
}
CSYNC_STATUS csync_get_status(CSYNC *ctx) {
if (ctx == NULL) {
if (!ctx) {
return CSYNC_STATUS_ERROR;
}
@@ -305,21 +305,21 @@ const char *csync_get_status_string(CSYNC *ctx)
void csync_request_abort(CSYNC *ctx)
{
if (ctx != NULL) {
if (ctx) {
ctx->abort = true;
}
}
void csync_resume(CSYNC *ctx)
{
if (ctx != NULL) {
if (ctx) {
ctx->abort = false;
}
}
int csync_abort_requested(CSYNC *ctx)
{
if (ctx != NULL) {
if (ctx) {
return ctx->abort;
} else {
return (1 == 0);

View File

@@ -240,7 +240,7 @@ int OCSYNC_EXPORT csync_reconcile(CSYNC *ctx);
*
* @param ctx The csync context.
*
* @return The userdata saved in the context, NULL if an error
* @return The userdata saved in the context, \c nullptr if an error
* occurred.
*/
void *csync_get_userdata(CSYNC *ctx);
@@ -262,7 +262,7 @@ int OCSYNC_EXPORT csync_set_userdata(CSYNC *ctx, void *userdata);
*
* @param ctx The csync context.
*
* @return The authentication callback set or NULL if an error
* @return The authentication callback set or \c nullptr if an error
* occurred.
*/
csync_auth_callback OCSYNC_EXPORT csync_get_auth_callback(CSYNC *ctx);

View File

@@ -133,7 +133,7 @@ bool csync_is_windows_reserved_word(const char *filename)
static CSYNC_EXCLUDE_TYPE _csync_excluded_common(const char *path, bool excludeConflictFiles)
{
const char *bname = NULL;
const char *bname = nullptr;
size_t blen = 0;
int rc = -1;
CSYNC_EXCLUDE_TYPE match = CSYNC_NOT_EXCLUDED;
@@ -261,9 +261,7 @@ ExcludedFiles::ExcludedFiles(QString localPath)
addInTreeExcludeFilePath(fi.absoluteFilePath());
}
ExcludedFiles::~ExcludedFiles()
{
}
ExcludedFiles::~ExcludedFiles() = default;
void ExcludedFiles::addExcludeFilePath(const QString &path)
{
@@ -346,7 +344,8 @@ bool ExcludedFiles::reloadExcludeFiles()
_fullRegexDir.clear();
bool success = true;
for (const auto& basePath : _excludeFiles.keys()) {
const auto keys = _excludeFiles.keys();
for (const auto& basePath : keys) {
for (const auto& file : _excludeFiles.value(basePath)) {
success = loadExcludeFile(basePath, file);
}
@@ -667,7 +666,8 @@ void ExcludedFiles::prepare()
_fullRegexFile.clear();
_fullRegexDir.clear();
for (auto const & basePath : _allExcludes.keys())
const auto keys = _allExcludes.keys();
for (auto const & basePath : keys)
prepare(basePath);
}

View File

@@ -37,7 +37,7 @@ Q_LOGGING_CATEGORY(lcReconcile, "nextcloud.sync.csync.reconciler", QtInfoMsg)
#include "inttypes.h"
/* Check if a file is ignored because one parent is ignored.
* return the node of the ignored directoy if it's the case, or NULL if it is not ignored */
* return the node of the ignored directoy if it's the case, or \c nullptr if it is not ignored */
static csync_file_stat_t *_csync_check_ignored(csync_s::FileMap *tree, const ByteArrayRef &path)
{
/* compute the size of the parent directory */

View File

@@ -63,8 +63,8 @@ static bool _csync_sameextension(const char *p1, const char *p2) {
/* If the found extension contains a '/', it is because the . was in the folder name
* => no extensions */
if (e1 && strchr(e1, '/')) e1 = NULL;
if (e2 && strchr(e2, '/')) e2 = NULL;
if (e1 && strchr(e1, '/')) e1 = nullptr;
if (e2 && strchr(e2, '/')) e2 = nullptr;
/* If none have extension, it is the same extension */
if (!e1 && !e2)
@@ -590,9 +590,9 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
unsigned int depth) {
QByteArray filename;
QByteArray fullpath;
csync_vio_handle_t *dh = NULL;
csync_vio_handle_t *dh = nullptr;
std::unique_ptr<csync_file_stat_t> dirent;
csync_file_stat_t *previous_fs = NULL;
csync_file_stat_t *previous_fs = nullptr;
int read_from_db = 0;
int rc = 0;
@@ -617,7 +617,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
// if the etag of this dir is still the same, its content is restored from the
// database.
if( do_read_from_db ) {
if( ! fill_tree_from_db(ctx, db_uri) ) {
if(!fill_tree_from_db(ctx, db_uri)) {
errno = ENOENT;
ctx->status_code = CSYNC_STATUS_OPENDIR_ERROR;
goto error;
@@ -625,7 +625,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
return 0;
}
if ((dh = csync_vio_opendir(ctx, uri)) == NULL) {
if (!(dh = csync_vio_opendir(ctx, uri))) {
if (ctx->abort) {
qCDebug(lcUpdate, "Aborted!");
ctx->status_code = CSYNC_STATUS_ABORTED;
@@ -783,7 +783,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
error:
ctx->remote.read_from_db = read_from_db;
if (dh != NULL) {
if (dh) {
csync_vio_closedir(ctx, dh);
}
return -1;

View File

@@ -34,7 +34,7 @@
#include "csync_util.h"
#include "vio/csync_vio.h"
Q_LOGGING_CATEGORY(lcCSyncUtils, "sync.csync.utils", QtInfoMsg)
Q_LOGGING_CATEGORY(lcCSyncUtils, "nextcloud.sync.csync.utils", QtInfoMsg)
typedef struct {
@@ -57,7 +57,7 @@ static const _instr_code_struct _instr[] =
{ "INSTRUCTION_ERROR", CSYNC_INSTRUCTION_ERROR },
{ "INSTRUCTION_TYPE_CHANGE", CSYNC_INSTRUCTION_TYPE_CHANGE },
{ "INSTRUCTION_UPDATE_METADATA", CSYNC_INSTRUCTION_UPDATE_METADATA },
{ NULL, CSYNC_INSTRUCTION_ERROR }
{ nullptr, CSYNC_INSTRUCTION_ERROR }
};
struct csync_memstat_s {
@@ -74,7 +74,7 @@ const char *csync_instruction_str(enum csync_instructions_e instr)
{
int idx = 0;
while (_instr[idx].instr_str != NULL) {
while (_instr[idx].instr_str) {
if (_instr[idx].instr_code == instr) {
return _instr[idx].instr_str;
}
@@ -85,14 +85,14 @@ const char *csync_instruction_str(enum csync_instructions_e instr)
}
void csync_memstat_check(void) {
void csync_memstat_check() {
int s = 0;
struct csync_memstat_s m;
FILE* fp;
/* get process memory stats */
fp = fopen("/proc/self/statm","r");
if (fp == NULL) {
if (!fp) {
return;
}
s = fscanf(fp, "%d%d%d%d%d%d%d", &m.size, &m.resident, &m.shared, &m.trs,

View File

@@ -43,7 +43,7 @@
/* Convert a locale String to UTF8 */
QByteArray c_utf8_from_locale(const mbchar_t *wstr)
{
if (wstr == NULL) {
if (!wstr) {
return QByteArray();
}
@@ -53,10 +53,10 @@ QByteArray c_utf8_from_locale(const mbchar_t *wstr)
size_t len;
len = wcslen(wstr);
/* Call once to get the required size. */
size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr, OCC::Utility::convertSizeToInt(len), NULL, 0, NULL, NULL);
size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr, OCC::Utility::convertSizeToInt(len), nullptr, 0, nullptr, nullptr);
if (size_needed > 0) {
dst.resize(size_needed);
WideCharToMultiByte(CP_UTF8, 0, wstr, OCC::Utility::convertSizeToInt(len), dst.data(), size_needed, NULL, NULL);
WideCharToMultiByte(CP_UTF8, 0, wstr, OCC::Utility::convertSizeToInt(len), dst.data(), size_needed, nullptr, nullptr);
}
return dst;
#else
@@ -87,16 +87,16 @@ extern "C" {
/* Convert a an UTF8 string to locale */
mbchar_t* c_utf8_string_to_locale(const char *str)
{
if (str == NULL ) {
return NULL;
if (!str) {
return nullptr;
}
#ifdef _WIN32
mbchar_t *dst = NULL;
mbchar_t *dst = nullptr;
size_t len;
int size_needed;
len = strlen(str);
size_needed = MultiByteToWideChar(CP_UTF8, 0, str, OCC::Utility::convertSizeToInt(len), NULL, 0);
size_needed = MultiByteToWideChar(CP_UTF8, 0, str, OCC::Utility::convertSizeToInt(len), nullptr, 0);
if (size_needed > 0) {
int size_char = (size_needed + 1) * sizeof(mbchar_t);
dst = (mbchar_t*)c_malloc(size_char);
@@ -111,8 +111,8 @@ mbchar_t* c_utf8_string_to_locale(const char *str)
mbchar_t* c_utf8_path_to_locale(const char *str)
{
if( str == NULL ) {
return NULL;
if(!str) {
return nullptr;
} else {
#ifdef _WIN32
size_t strLength = strlen(str);

View File

@@ -83,7 +83,7 @@ extern "C" {
*
* @param str The utf8 string to convert.
*
* @return The malloced converted multibyte string or NULL on error.
* @return The malloced converted multibyte string or \c nullptr on error.
*
* @see c_free_locale_string()
* @see c_utf8_from_locale()

View File

@@ -47,13 +47,13 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
default:
ASSERT(false);
}
return NULL;
return nullptr;
}
int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
int rc = -1;
if (dhandle == NULL) {
if (!dhandle) {
errno = EBADF;
return -1;
}
@@ -87,12 +87,12 @@ std::unique_ptr<csync_file_stat_t> csync_vio_readdir(CSYNC *ctx, csync_vio_handl
ASSERT(false);
}
return NULL;
return nullptr;
}
char *csync_vio_get_status_string(CSYNC *ctx) {
if(ctx->error_string) {
return ctx->error_string;
}
return 0;
return nullptr;
}

View File

@@ -26,6 +26,8 @@
#include <dirent.h>
#include <stdio.h>
#include <memory>
#include "c_private.h"
#include "c_lib.h"
#include "c_string.h"
@@ -35,7 +37,7 @@
#include "vio/csync_vio_local.h"
Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "sync.csync.vio_local", QtInfoMsg)
Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "nextcloud.sync.csync.vio_local", QtInfoMsg)
/*
* directory functions
@@ -49,18 +51,18 @@ typedef struct dhandle_s {
static int _csync_vio_local_stat_mb(const mbchar_t *wuri, csync_file_stat_t *buf);
csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
dhandle_t *handle = NULL;
mbchar_t *dirname = NULL;
dhandle_t *handle = nullptr;
mbchar_t *dirname = nullptr;
handle = (dhandle_t*)c_malloc(sizeof(dhandle_t));
dirname = c_utf8_path_to_locale(name);
handle->dh = _topendir( dirname );
if (handle->dh == NULL) {
if (!handle->dh) {
c_free_locale_string(dirname);
SAFE_FREE(handle);
return NULL;
return nullptr;
}
handle->path = c_strdup(name);
@@ -70,10 +72,10 @@ csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
}
int csync_vio_local_closedir(csync_vio_handle_t *dhandle) {
dhandle_t *handle = NULL;
dhandle_t *handle = nullptr;
int rc = -1;
if (dhandle == NULL) {
if (!dhandle) {
errno = EBADF;
return -1;
}
@@ -89,19 +91,19 @@ int csync_vio_local_closedir(csync_vio_handle_t *dhandle) {
std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
dhandle_t *handle = NULL;
dhandle_t *handle = nullptr;
handle = (dhandle_t *) dhandle;
struct _tdirent *dirent = NULL;
struct _tdirent *dirent = nullptr;
std::unique_ptr<csync_file_stat_t> file_stat;
do {
dirent = _treaddir(handle->dh);
if (dirent == NULL)
if (!dirent)
return {};
} while (qstrcmp(dirent->d_name, ".") == 0 || qstrcmp(dirent->d_name, "..") == 0);
file_stat.reset(new csync_file_stat_t);
file_stat = std::make_unique<csync_file_stat_t>();
file_stat->path = c_utf8_from_locale(dirent->d_name);
QByteArray fullPath = QByteArray() % const_cast<const char *>(handle->path) % '/' % QByteArray() % const_cast<const char *>(dirent->d_name);
if (file_stat->path.isNull()) {

View File

@@ -25,6 +25,8 @@
#include <fcntl.h>
#include <stdio.h>
#include <memory>
#include "windows.h"
#include "c_private.h"
@@ -35,7 +37,7 @@
#include "vio/csync_vio_local.h"
Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "sync.csync.vio_local", QtInfoMsg)
Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "nextcloud.sync.csync.vio_local", QtInfoMsg)
/*
* directory functions
@@ -51,15 +53,15 @@ typedef struct dhandle_s {
static int _csync_vio_local_stat_mb(const mbchar_t *uri, csync_file_stat_t *buf);
csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
dhandle_t *handle = NULL;
mbchar_t *dirname = NULL;
dhandle_t *handle = nullptr;
mbchar_t *dirname = nullptr;
handle = (dhandle_t*)c_malloc(sizeof(dhandle_t));
// the file wildcard has to be attached
size_t len_name = strlen(name);
if( len_name ) {
char *h = NULL;
char *h = nullptr;
// alloc an enough large buffer to take the name + '/*' + the closing zero.
h = (char*)c_malloc(len_name+3);
@@ -83,7 +85,7 @@ csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
errno = EACCES;
}
SAFE_FREE(handle);
return NULL;
return nullptr;
}
handle->firstFind = 1; // Set a flag that there first fileinfo is available.
@@ -95,10 +97,10 @@ csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
}
int csync_vio_local_closedir(csync_vio_handle_t *dhandle) {
dhandle_t *handle = NULL;
dhandle_t *handle = nullptr;
int rc = -1;
if (dhandle == NULL) {
if (!dhandle) {
errno = EBADF;
return -1;
}
@@ -139,7 +141,7 @@ static time_t FileTimeToUnixTime(FILETIME *filetime, DWORD *remainder)
std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
dhandle_t *handle = NULL;
dhandle_t *handle = nullptr;
std::unique_ptr<csync_file_stat_t> file_stat;
DWORD rem;
@@ -166,7 +168,7 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *d
if (path == "." || path == "..")
return csync_vio_local_readdir(dhandle);
file_stat.reset(new csync_file_stat_t);
file_stat = std::make_unique<csync_file_stat_t>();
file_stat->path = path;
if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
@@ -232,9 +234,9 @@ static int _csync_vio_local_stat_mb(const mbchar_t *wuri, csync_file_stat_t *buf
ULARGE_INTEGER FileIndex;
h = CreateFileW( wuri, 0, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
nullptr, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
NULL );
nullptr );
if( h == INVALID_HANDLE_VALUE ) {
qCCritical(lcCSyncVIOLocal, "CreateFileW failed on %ls", wuri);
errno = GetLastError();

View File

@@ -3,7 +3,10 @@ find_package(Qt5 REQUIRED COMPONENTS Widgets)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
add_subdirectory(updater)
IF(BUILD_UPDATER)
add_subdirectory(updater)
endif()
#TODO Move resources files
set(MIRALL_RC_SRC ../../client.qrc)
@@ -49,7 +52,6 @@ set(client_SRCS
accountmanager.cpp
accountsettings.cpp
application.cpp
clientproxy.cpp
connectionvalidator.cpp
folder.cpp
folderman.cpp
@@ -109,7 +111,6 @@ set(client_SRCS
creds/httpcredentialsgui.cpp
creds/oauth.cpp
creds/flow2auth.cpp
creds/keychainchunk.cpp
creds/webflowcredentials.cpp
creds/webflowcredentialsdialog.cpp
wizard/postfixlineedit.cpp
@@ -138,18 +139,20 @@ IF(NOT NO_SHIBBOLETH)
)
endif()
set(updater_SRCS
updater/ocupdater.cpp
updater/updateinfo.cpp
updater/updater.cpp
)
IF(BUILD_UPDATER)
set(updater_SRCS
updater/ocupdater.cpp
updater/updateinfo.cpp
updater/updater.cpp
)
endif()
IF( APPLE )
list(APPEND client_SRCS cocoainitializer_mac.mm)
list(APPEND client_SRCS socketapisocket_mac.mm)
list(APPEND client_SRCS systray.mm)
if(SPARKLE_FOUND)
if(SPARKLE_FOUND AND BUILD_UPDATER)
# Define this, we need to check in updater.cpp
add_definitions( -DHAVE_SPARKLE )
list(APPEND updater_SRCS updater/sparkleupdater_mac.mm)
@@ -297,9 +300,11 @@ else()
install(FILES ${qtkeychain_I18N} DESTINATION ${QM_DIR})
endif()
add_library(updater STATIC ${updater_SRCS})
target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
IF(BUILD_UPDATER)
add_library(updater STATIC ${updater_SRCS})
target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml)
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
endif()
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
@@ -308,9 +313,11 @@ set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Network Qt5::Xml)
target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
target_link_libraries( ${APPLICATION_EXECUTABLE} updater )
IF(BUILD_UPDATER)
target_link_libraries( ${APPLICATION_EXECUTABLE} updater )
endif()
target_link_libraries( ${APPLICATION_EXECUTABLE} ${OS_SPECIFIC_LINK_LIBRARIES} )
IF( LIBCLOUDPROVIDERS_FOUND )
string(TOLOWER "${APPLICATION_VENDOR}" DBUS_VENDOR)
@@ -333,6 +340,7 @@ target_include_directories(${APPLICATION_EXECUTABLE} PRIVATE
${CMAKE_SOURCE_DIR}/src/3rdparty/qtsingleapplication
${CMAKE_SOURCE_DIR}/src/3rdparty/kmessagewidget
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
## handle DBUS for Fdo notifications
@@ -377,18 +385,27 @@ install(TARGETS ${APPLICATION_EXECUTABLE}
#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
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
#
# OSX: Run macdeployqt for src/gui and for src/cmd using the -executable option
if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
install(CODE "
message(STATUS \"Deploying (Qt) dependencies and fixing library paths...\")
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE} ${QT_QMAKE_EXECUTABLE})
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app ${QT_QMAKE_EXECUTABLE})
" COMPONENT RUNTIME)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
set(cmd_NAME ${APPLICATION_EXECUTABLE}cmd)
add_custom_command(TARGET ${APPLICATION_EXECUTABLE} POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
"$<TARGET_FILE_DIR:${APPLICATION_EXECUTABLE}>/../.."
-always-overwrite
-executable="$<TARGET_FILE_DIR:${APPLICATION_EXECUTABLE}>/${cmd_NAME}"
COMMENT "Running macdeployqt..."
)
endif()
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE AND NOT WIN32)
configure_file(${CMAKE_SOURCE_DIR}/mirall.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop DESTINATION ${DATADIR}/applications )
${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop DESTINATION ${DATADIR}/applications )
endif()

View File

@@ -539,7 +539,7 @@ void AccountSettings::slotLockForDecryptionError(const QByteArray& fileId, int h
void AccountSettings::slotEditCurrentIgnoredFiles()
{
Folder *f = FolderMan::instance()->folder(selectedFolderAlias());
if (f == nullptr)
if (!f)
return;
openIgnoredFilesDialog(f->path());
}
@@ -969,7 +969,7 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)
_ui->quotaProgressBar->setVisible(false);
_ui->quotaInfoLabel->setToolTip(QString());
/* -1 means not computed; -2 means unknown; -3 means unlimited (#3940)*/
/* -1 means not computed; -2 means unknown; -3 means unlimited (#owncloud/client/issues/3940)*/
if (total == 0 || total == -1) {
_ui->quotaInfoLabel->setText(tr("Currently there is no storage usage information available."));
} else {

View File

@@ -68,7 +68,7 @@ signals:
public slots:
void slotOpenOC();
void slotUpdateQuota(qint64, qint64);
void slotUpdateQuota(qint64 total, qint64 used);
void slotAccountStateChanged();
void slotStyleChanged();

View File

@@ -55,9 +55,7 @@ AccountState::AccountState(AccountPtr account)
_timeSinceLastETagCheck.invalidate();
}
AccountState::~AccountState()
{
}
AccountState::~AccountState() = default;
AccountState *AccountState::loadFromSettings(AccountPtr account, QSettings & /*settings*/)
{

View File

@@ -139,7 +139,9 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
case ActivityItemDelegate::AccountRole:
return a._accName;
case ActivityItemDelegate::PointInTimeRole:
return QString("%1 (%2)").arg(a._dateTime.toLocalTime().toString(Qt::DefaultLocaleShortDate), Utility::timeAgoInWords(a._dateTime.toLocalTime()));
return Utility::timeAgoInWords(a._dateTime.toLocalTime());
case Qt::ToolTipRole:
return a._dateTime.toLocalTime().toString(Qt::DefaultLocaleShortDate);
case ActivityItemDelegate::AccountConnectedRole:
return (ast && ast->isConnected());
default:

View File

@@ -57,7 +57,7 @@
<item row="1" column="0">
<widget class="QLabel" name="labelPWDCertificate">
<property name="text">
<string>Certificate password :</string>
<string>Certificate password:</string>
</property>
</widget>
</item>

View File

@@ -34,7 +34,11 @@
#include "sharedialog.h"
#include "accountmanager.h"
#include "creds/abstractcredentials.h"
#if defined(BUILD_UPDATER)
#include "updater/ocupdater.h"
#endif
#include "owncloudsetupwizard.h"
#include "version.h"
@@ -52,6 +56,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QDesktopServices>
#include <QGuiApplication>
class QSocket;
@@ -63,8 +68,9 @@ namespace {
static const char optionsC[] =
"Options:\n"
" -h --help : show this help screen.\n"
" --logwindow : open a window to show log output.\n"
" --help, -h : show this help screen.\n"
" --version, -v : show version information.\n"
" --logwindow, -l : open a window to show log output.\n"
" --logfile <filename> : write log output to file <filename>.\n"
" --logdir <name> : write each sync log output in a new file\n"
" in folder <name>.\n"
@@ -123,6 +129,15 @@ Application::Application(int &argc, char **argv)
// TODO: Can't set this without breaking current config paths
// setOrganizationName(QLatin1String(APPLICATION_VENDOR));
setOrganizationDomain(QLatin1String(APPLICATION_REV_DOMAIN));
// setDesktopFilename to provide wayland compatibility (in general: conformance with naming standards)
// but only on Qt >= 5.7, where setDesktopFilename was introduced
#if (QT_VERSION >= 0x050700)
QString desktopFileName = QString(QLatin1String(LINUX_APPLICATION_ID)
+ QLatin1String(".desktop"));
setDesktopFileName(desktopFileName);
#endif
setApplicationName(_theme->appName());
setWindowIcon(_theme->applicationIcon());
setAttribute(Qt::AA_UseHighDpiPixmaps, true);
@@ -245,12 +260,14 @@ Application::Application(int &argc, char **argv)
connect(&_networkConfigurationManager, &QNetworkConfigurationManager::configurationChanged,
this, &Application::slotSystemOnlineConfigurationChanged);
#if defined(BUILD_UPDATER)
// Update checks
UpdaterScheduler *updaterScheduler = new UpdaterScheduler(this);
connect(updaterScheduler, &UpdaterScheduler::updaterAnnouncement,
_gui.data(), &ownCloudGui::slotShowTrayMessage);
connect(updaterScheduler, &UpdaterScheduler::requestRestart,
_folderManager.data(), &FolderMan::slotScheduleAppRestart);
#endif
// Cleanup at Quit.
connect(this, &QCoreApplication::aboutToQuit, this, &Application::slotCleanup);
@@ -392,10 +409,10 @@ void Application::setupLogging()
// might be called from second instance
auto logger = Logger::instance();
logger->setLogFile(_logFile);
logger->setLogDir(_logDir);
logger->setLogExpire(_logExpire);
logger->setLogFlush(_logFlush);
logger->setLogDebug(_logDebug);
logger->setLogDir(!_logDir.isEmpty() ? _logDir : ConfigFile().logDir());
logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire());
logger->setLogFlush(_logFlush || ConfigFile().logFlush());
logger->setLogDebug(_logDebug || ConfigFile().logDebug());
if (!logger->isLoggingToFile() && ConfigFile().automaticLogDir()) {
logger->setupTemporaryFolderLogDir();
}
@@ -479,7 +496,7 @@ void Application::parseOptions(const QStringList &options)
_debugMode = true;
} else if (option == QLatin1String("--background")) {
_backgroundMode = true;
} else if (option == QLatin1String("--version")) {
} else if (option == QLatin1String("--version") || option == QLatin1String("-v")) {
_versionOnly = true;
} else {
showHint("Unrecognized option '" + option.toStdString() + "'");

View File

@@ -51,29 +51,28 @@ void CloudProviderManager::registerSignals()
CloudProviderManager::CloudProviderManager(QObject *parent) : QObject(parent)
{
_map = new QMap<QString, CloudProviderWrapper*>();
_folder_index = 0;
g_bus_own_name (G_BUS_TYPE_SESSION, LIBCLOUDPROVIDERS_DBUS_BUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr);
}
void CloudProviderManager::slotFolderListChanged(const Folder::Map &folderMap)
{
QMapIterator<QString, CloudProviderWrapper*> i(*_map);
QMapIterator<QString, CloudProviderWrapper*> i(_map);
while (i.hasNext()) {
i.next();
if (!folderMap.contains(i.key())) {
cloud_providers_provider_exporter_remove_account(_providerExporter, i.value()->accountExporter());
delete _map->find(i.key()).value();
_map->remove(i.key());
delete _map.find(i.key()).value();
_map.remove(i.key());
}
}
Folder::MapIterator j(folderMap);
while (j.hasNext()) {
j.next();
if (!_map->contains(j.key())) {
if (!_map.contains(j.key())) {
auto *cpo = new CloudProviderWrapper(this, j.value(), _folder_index++, _providerExporter);
_map->insert(j.key(), cpo);
_map.insert(j.key(), cpo);
}
}
}

View File

@@ -35,7 +35,7 @@ public slots:
void slotFolderListChanged(const Folder::Map &folderMap);
private:
QMap<QString, CloudProviderWrapper*> *_map;
QMap<QString, CloudProviderWrapper*> _map;
unsigned int _folder_index;
};

View File

@@ -38,7 +38,6 @@ CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, int
{
GMenuModel *model;
GActionGroup *action_group;
_recentlyChanged = new QList<QPair<QString, QString>>();
QString accountName = QString("Folder/%1").arg(folderId);
_cloudProvider = CLOUD_PROVIDERS_PROVIDER_EXPORTER(cloudprovider);
@@ -108,11 +107,11 @@ void CloudProviderWrapper::slotUpdateProgress(const QString &folder, const Progr
if (f) {
QString fullPath = f->path() + '/' + progress._lastCompletedItem._file;
if (QFile(fullPath).exists()) {
if (_recentlyChanged->length() > 5)
_recentlyChanged->removeFirst();
_recentlyChanged->append(qMakePair(actionText, fullPath));
if (_recentlyChanged.length() > 5)
_recentlyChanged.removeFirst();
_recentlyChanged.append(qMakePair(actionText, fullPath));
} else {
_recentlyChanged->append(qMakePair(actionText, QString("")));
_recentlyChanged.append(qMakePair(actionText, QString("")));
}
}
@@ -151,9 +150,9 @@ void CloudProviderWrapper::slotUpdateProgress(const QString &folder, const Progr
&& shouldShowInRecentsMenu(progress._lastCompletedItem)) {
GMenuItem* item;
g_menu_remove_all (G_MENU(_recentMenu));
if(!_recentlyChanged->isEmpty()) {
if(!_recentlyChanged.isEmpty()) {
QList<QPair<QString, QString>>::iterator i;
for (i = _recentlyChanged->begin(); i != _recentlyChanged->end(); i++) {
for (i = _recentlyChanged.begin(); i != _recentlyChanged.end(); i++) {
QString label = i->first;
QString fullPath = i->second;
item = menu_item_new(label, "cloudprovider.showfile");
@@ -287,7 +286,7 @@ activate_action_open (GSimpleAction *action, GVariant *parameter, gpointer user_
}
if(g_str_equal(name, "showfile")) {
const gchar *path = g_variant_get_string (parameter, NULL);
const gchar *path = g_variant_get_string(parameter, nullptr);
g_print("showfile => %s\n", path);
showInFileManager(QString(path));
}

View File

@@ -57,7 +57,7 @@ private:
Folder *_folder;
CloudProvidersProviderExporter *_cloudProvider;
CloudProvidersAccountExporter *_cloudProviderAccount;
QList<QPair<QString, QString>> *_recentlyChanged;
QList<QPair<QString, QString>> _recentlyChanged;
bool _paused;
GMenu* _mainMenu = nullptr;
GMenu* _recentMenu = nullptr;

View File

@@ -76,7 +76,7 @@ void ConnectionValidator::systemProxyLookupDone(const QNetworkProxy &proxy)
}
if (proxy.type() != QNetworkProxy::NoProxy) {
qCInfo(lcConnectionValidator) << "Setting QNAM proxy to be system proxy" << printQNetworkProxy(proxy);
qCInfo(lcConnectionValidator) << "Setting QNAM proxy to be system proxy" << ClientProxy::printQNetworkProxy(proxy);
} else {
qCInfo(lcConnectionValidator) << "No system proxy set by OS";
}

View File

@@ -41,9 +41,7 @@ Flow2Auth::Flow2Auth(Account *account, QObject *parent)
QObject::connect(&_pollTimer, &QTimer::timeout, this, &Flow2Auth::slotPollTimerTimeout);
}
Flow2Auth::~Flow2Auth()
{
}
Flow2Auth::~Flow2Auth() = default;
void Flow2Auth::start()
{

View File

@@ -1,221 +0,0 @@
/*
* Copyright (C) by Michael Schuster <michael@nextcloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License
* for more details.
*/
#include "account.h"
#include "keychainchunk.h"
#include "theme.h"
#include "networkjobs.h"
#include "configfile.h"
#include "creds/abstractcredentials.h"
using namespace QKeychain;
namespace OCC {
Q_LOGGING_CATEGORY(lcKeychainChunk, "nextcloud.sync.credentials.keychainchunk", QtInfoMsg)
namespace KeychainChunk {
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
static void addSettingsToJob(Account *account, QKeychain::Job *job)
{
Q_UNUSED(account)
auto settings = ConfigFile::settingsWithGroup(Theme::instance()->appName());
settings->setParent(job); // make the job parent to make setting deleted properly
job->setSettings(settings.release());
}
#endif
/*
* Job
*/
Job::Job(QObject *parent)
: QObject(parent)
{
_serviceName = Theme::instance()->appName();
}
/*
* WriteJob
*/
WriteJob::WriteJob(Account *account, const QString &key, const QByteArray &data, QObject *parent)
: Job(parent)
{
_account = account;
_key = key;
// Windows workaround: Split the private key into chunks of 2048 bytes,
// to allow 4k (4096 bit) keys to be saved (obey Windows's limits)
_chunkBuffer = data;
_chunkCount = 0;
}
void WriteJob::start()
{
slotWriteJobDone(nullptr);
}
void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
{
QKeychain::WritePasswordJob *writeJob = static_cast<QKeychain::WritePasswordJob *>(incomingJob);
// errors?
if (writeJob) {
_error = writeJob->error();
_errorString = writeJob->errorString();
if (writeJob->error() != NoError) {
qCWarning(lcKeychainChunk) << "Error while writing" << writeJob->key() << "chunk" << writeJob->errorString();
_chunkBuffer.clear();
}
}
// write a chunk if there is any in the buffer
if (!_chunkBuffer.isEmpty()) {
#if defined(Q_OS_WIN)
// Windows workaround: Split the data into chunks of 2048 bytes,
// to allow 4k (4096 bit) keys to be saved (obey Windows's limits)
auto chunk = _chunkBuffer.left(KeychainChunk::ChunkSize);
_chunkBuffer = _chunkBuffer.right(_chunkBuffer.size() - chunk.size());
#else
// write full data in one chunk on non-Windows, as usual
auto chunk = _chunkBuffer;
_chunkBuffer.clear();
#endif
auto index = (_chunkCount++);
// keep the limit
if (_chunkCount > KeychainChunk::MaxChunks) {
qCWarning(lcKeychainChunk) << "Maximum chunk count exceeded while writing" << writeJob->key() << "chunk" << QString::number(index) << "cutting off after" << QString::number(KeychainChunk::MaxChunks) << "chunks";
writeJob->deleteLater();
_chunkBuffer.clear();
emit finished(this);
return;
}
const QString kck = AbstractCredentials::keychainKey(
_account->url().toString(),
_key + (index > 0 ? (QString(".") + QString::number(index)) : QString()),
_account->id());
QKeychain::WritePasswordJob *job = new QKeychain::WritePasswordJob(_serviceName);
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
job->setInsecureFallback(_insecureFallback);
connect(job, &QKeychain::Job::finished, this, &KeychainChunk::WriteJob::slotWriteJobDone);
// only add the key's (sub)"index" after the first element, to stay compatible with older versions and non-Windows
job->setKey(kck);
job->setBinaryData(chunk);
job->start();
chunk.clear();
} else {
emit finished(this);
}
writeJob->deleteLater();
}
/*
* ReadJob
*/
ReadJob::ReadJob(Account *account, const QString &key, const bool &keychainMigration, QObject *parent)
: Job(parent)
{
_account = account;
_key = key;
_keychainMigration = keychainMigration;
_chunkCount = 0;
_chunkBuffer.clear();
}
void ReadJob::start()
{
_chunkCount = 0;
_chunkBuffer.clear();
const QString kck = AbstractCredentials::keychainKey(
_account->url().toString(),
_key,
_keychainMigration ? QString() : _account->id());
QKeychain::ReadPasswordJob *job = new QKeychain::ReadPasswordJob(_serviceName);
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
job->setInsecureFallback(_insecureFallback);
job->setKey(kck);
connect(job, &QKeychain::Job::finished, this, &KeychainChunk::ReadJob::slotReadJobDone);
job->start();
}
void ReadJob::slotReadJobDone(QKeychain::Job *incomingJob)
{
// Errors or next chunk?
QKeychain::ReadPasswordJob *readJob = static_cast<QKeychain::ReadPasswordJob *>(incomingJob);
if (readJob) {
if (readJob->error() == NoError && readJob->binaryData().length() > 0) {
_chunkBuffer.append(readJob->binaryData());
_chunkCount++;
#if defined(Q_OS_WIN)
// try to fetch next chunk
if (_chunkCount < KeychainChunk::MaxChunks) {
const QString kck = AbstractCredentials::keychainKey(
_account->url().toString(),
_key + QString(".") + QString::number(_chunkCount),
_keychainMigration ? QString() : _account->id());
QKeychain::ReadPasswordJob *job = new QKeychain::ReadPasswordJob(_serviceName);
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
job->setInsecureFallback(_insecureFallback);
job->setKey(kck);
connect(job, &QKeychain::Job::finished, this, &KeychainChunk::ReadJob::slotReadJobDone);
job->start();
readJob->deleteLater();
return;
} else {
qCWarning(lcKeychainChunk) << "Maximum chunk count for" << readJob->key() << "reached, ignoring after" << KeychainChunk::MaxChunks;
}
#endif
} else {
if (readJob->error() != QKeychain::Error::EntryNotFound ||
((readJob->error() == QKeychain::Error::EntryNotFound) && _chunkCount == 0)) {
_error = readJob->error();
_errorString = readJob->errorString();
qCWarning(lcKeychainChunk) << "Unable to read" << readJob->key() << "chunk" << QString::number(_chunkCount) << readJob->errorString();
}
}
readJob->deleteLater();
}
emit finished(this);
}
} // namespace KeychainChunk
} // namespace OCC

View File

@@ -1,120 +0,0 @@
/*
* Copyright (C) by Michael Schuster <michael@nextcloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License
* for more details.
*/
#pragma once
#ifndef KEYCHAINCHUNK_H
#define KEYCHAINCHUNK_H
#include <QObject>
#include <keychain.h>
#include "accountfwd.h"
// We don't support insecure fallback
// #define KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK
namespace OCC {
namespace KeychainChunk {
/*
* Workaround for Windows:
*
* Split the keychain entry's data into chunks of 2048 bytes,
* to allow 4k (4096 bit) keys / large certs to be saved (see limits in webflowcredentials.h)
*/
static constexpr int ChunkSize = 2048;
static constexpr int MaxChunks = 10;
/*
* @brief: Abstract base class for KeychainChunk jobs.
*/
class Job : public QObject {
Q_OBJECT
public:
Job(QObject *parent = nullptr);
const QKeychain::Error error() const {
return _error;
}
const QString errorString() const {
return _errorString;
}
QByteArray binaryData() const {
return _chunkBuffer;
}
const bool insecureFallback() const {
return _insecureFallback;
}
// If we use it but don't support insecure fallback, give us nice compilation errors ;p
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
void setInsecureFallback(const bool &insecureFallback)
{
_insecureFallback = insecureFallback;
}
#endif
protected:
QString _serviceName;
Account *_account;
QString _key;
bool _insecureFallback = false;
bool _keychainMigration = false;
QKeychain::Error _error = QKeychain::NoError;
QString _errorString;
int _chunkCount = 0;
QByteArray _chunkBuffer;
}; // class Job
/*
* @brief: Simple wrapper class for QKeychain::WritePasswordJob, splits too large keychain entry's data into chunks on Windows
*/
class WriteJob : public KeychainChunk::Job {
Q_OBJECT
public:
WriteJob(Account *account, const QString &key, const QByteArray &data, QObject *parent = nullptr);
void start();
signals:
void finished(KeychainChunk::WriteJob *incomingJob);
private slots:
void slotWriteJobDone(QKeychain::Job *incomingJob);
}; // class WriteJob
/*
* @brief: Simple wrapper class for QKeychain::ReadPasswordJob, splits too large keychain entry's data into chunks on Windows
*/
class ReadJob : public KeychainChunk::Job {
Q_OBJECT
public:
ReadJob(Account *account, const QString &key, const bool &keychainMigration, QObject *parent = nullptr);
void start();
signals:
void finished(KeychainChunk::ReadJob *incomingJob);
private slots:
void slotReadJobDone(QKeychain::Job *incomingJob);
}; // class ReadJob
} // namespace KeychainChunk
} // namespace OCC
#endif // KEYCHAINCHUNK_H

View File

@@ -27,9 +27,7 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcOauth, "nextcloud.sync.credentials.oauth", QtInfoMsg)
OAuth::~OAuth()
{
}
OAuth::~OAuth() = default;
static void httpReplyAndClose(QTcpSocket *socket, const char *code, const char *html,
const char *moreHeaders = nullptr)

View File

@@ -1,13 +1,13 @@
#include "webflowcredentials.h"
#include "creds/httpcredentials.h"
#include "creds/keychainchunk.h"
#include <QAuthenticator>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QPointer>
#include <QTimer>
#include <keychain.h>
#include <QDialog>
#include <QVBoxLayout>
#include <QLabel>
@@ -18,13 +18,12 @@
#include "theme.h"
#include "wizard/webview.h"
#include "webflowcredentialsdialog.h"
#include "keychainchunk.h"
using namespace QKeychain;
namespace OCC {
Q_LOGGING_CATEGORY(lcWebFlowCredentials, "sync.credentials.webflow", QtInfoMsg)
Q_LOGGING_CATEGORY(lcWebFlowCredentials, "nextcloud.sync.credentials.webflow", QtInfoMsg)
namespace {
const char userC[] = "user";
@@ -87,10 +86,6 @@ static void addSettingsToJob(Account *account, QKeychain::Job *job)
#endif
WebFlowCredentials::WebFlowCredentials()
: _ready(false)
, _credentialsValid(false)
, _keychainMigration(false)
, _retryOnKeyChainError(false)
{
}
@@ -103,8 +98,6 @@ WebFlowCredentials::WebFlowCredentials(const QString &user, const QString &passw
, _clientSslCaCertificates(caCertificates)
, _ready(true)
, _credentialsValid(true)
, _keychainMigration(false)
, _retryOnKeyChainError(false)
{
}
@@ -152,7 +145,7 @@ void WebFlowCredentials::fetchFromKeychain() {
void WebFlowCredentials::askFromUser() {
// Determine if the old flow has to be used (GS for now)
// Do a DetermineAuthTypeJob to make sure that the server is still using Flow2
DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
auto job = new DetermineAuthTypeJob(_account->sharedFromThis(), this);
connect(job, &DetermineAuthTypeJob::authType, [this](DetermineAuthTypeJob::AuthType type) {
// LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic
bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow);
@@ -183,7 +176,11 @@ void WebFlowCredentials::askFromUser() {
void WebFlowCredentials::slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host) {
Q_UNUSED(host)
if (_user != user) {
// Compare the re-entered username case-insensitive and save the new value (avoid breaking the account)
// See issue: https://github.com/nextcloud/desktop/issues/1741
if (QString::compare(_user, user, Qt::CaseInsensitive) == 0) {
_user = user;
} else {
qCInfo(lcWebFlowCredentials()) << "Authed with the wrong user!";
QString msg = tr("Please login with the user: %1")
@@ -241,9 +238,10 @@ void WebFlowCredentials::persist() {
// write cert if there is one
if (!_clientSslCertificate.isNull()) {
auto *job = new KeychainChunk::WriteJob(_account,
_user + clientCertificatePEMC,
_clientSslCertificate.toPem());
auto job = new KeychainChunk::WriteJob(_account,
_user + clientCertificatePEMC,
_clientSslCertificate.toPem(),
this);
connect(job, &KeychainChunk::WriteJob::finished, this, &WebFlowCredentials::slotWriteClientCertPEMJobDone);
job->start();
} else {
@@ -254,14 +252,12 @@ void WebFlowCredentials::persist() {
void WebFlowCredentials::slotWriteClientCertPEMJobDone(KeychainChunk::WriteJob *writeJob)
{
if(writeJob)
writeJob->deleteLater();
// write ssl key if there is one
if (!_clientSslKey.isNull()) {
auto *job = new KeychainChunk::WriteJob(_account,
_user + clientKeyPEMC,
_clientSslKey.toPem());
auto job = new KeychainChunk::WriteJob(_account,
_user + clientKeyPEMC,
_clientSslKey.toPem(),
this);
connect(job, &KeychainChunk::WriteJob::finished, this, &WebFlowCredentials::slotWriteClientKeyPEMJobDone);
job->start();
} else {
@@ -289,9 +285,10 @@ void WebFlowCredentials::writeSingleClientCaCertPEM()
return;
}
auto *job = new KeychainChunk::WriteJob(_account,
_user + clientCaCertificatePEMC + QString::number(index),
cert.toPem());
auto job = new KeychainChunk::WriteJob(_account,
_user + clientCaCertificatePEMC + QString::number(index),
cert.toPem(),
this);
connect(job, &KeychainChunk::WriteJob::finished, this, &WebFlowCredentials::slotWriteClientCaCertsPEMJobDone);
job->start();
} else {
@@ -301,9 +298,6 @@ void WebFlowCredentials::writeSingleClientCaCertPEM()
void WebFlowCredentials::slotWriteClientKeyPEMJobDone(KeychainChunk::WriteJob *writeJob)
{
if(writeJob)
writeJob->deleteLater();
_clientSslCaCertificatesWriteQueue.clear();
// write ca certs if there are any
@@ -326,8 +320,6 @@ void WebFlowCredentials::slotWriteClientCaCertsPEMJobDone(KeychainChunk::WriteJo
qCWarning(lcWebFlowCredentials) << "Error while writing client CA cert" << writeJob->errorString();
}
writeJob->deleteLater();
if (!_clientSslCaCertificatesWriteQueue.isEmpty()) {
// next ca cert
writeSingleClientCaCertPEM();
@@ -336,7 +328,7 @@ void WebFlowCredentials::slotWriteClientCaCertsPEMJobDone(KeychainChunk::WriteJo
}
// done storing ca certs, time for the password
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
auto job = new WritePasswordJob(Theme::instance()->appName(), this);
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
@@ -356,8 +348,6 @@ void WebFlowCredentials::slotWriteJobDone(QKeychain::Job *job)
default:
qCWarning(lcWebFlowCredentials) << "Error while writing password" << job->errorString();
}
WritePasswordJob *wjob = qobject_cast<WritePasswordJob *>(job);
wjob->deleteLater();
}
void WebFlowCredentials::invalidateToken() {
@@ -386,13 +376,9 @@ void WebFlowCredentials::forgetSensitiveData() {
return;
}
DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
auto job = new DeletePasswordJob(Theme::instance()->appName(), this);
job->setInsecureFallback(false);
job->setKey(kck);
connect(job, &Job::finished, this, [](QKeychain::Job *job) {
DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job);
djob->deleteLater();
});
job->start();
invalidateToken();
@@ -443,30 +429,16 @@ void WebFlowCredentials::slotFinished(QNetworkReply *reply) {
void WebFlowCredentials::fetchFromKeychainHelper() {
// Read client cert from keychain
auto *job = new KeychainChunk::ReadJob(_account,
_user + clientCertificatePEMC,
_keychainMigration);
auto job = new KeychainChunk::ReadJob(_account,
_user + clientCertificatePEMC,
_keychainMigration,
this);
connect(job, &KeychainChunk::ReadJob::finished, this, &WebFlowCredentials::slotReadClientCertPEMJobDone);
job->start();
}
void WebFlowCredentials::slotReadClientCertPEMJobDone(KeychainChunk::ReadJob *readJob)
{
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
Q_ASSERT(!readJob->insecureFallback()); // If insecureFallback is set, the next test would be pointless
if (_retryOnKeyChainError && (readJob->error() == QKeychain::NoBackendAvailable
|| readJob->error() == QKeychain::OtherError)) {
// Could be that the backend was not yet available. Wait some extra seconds.
// (Issues #4274 and #6522)
// (For kwallet, the error is OtherError instead of NoBackendAvailable, maybe a bug in QtKeychain)
qCInfo(lcWebFlowCredentials) << "Backend unavailable (yet?) Retrying in a few seconds." << readJob->errorString();
QTimer::singleShot(10000, this, &WebFlowCredentials::fetchFromKeychainHelper);
_retryOnKeyChainError = false;
return;
}
_retryOnKeyChainError = false;
#endif
// Store PEM in memory
if (readJob->error() == NoError && readJob->binaryData().length() > 0) {
QList<QSslCertificate> sslCertificateList = QSslCertificate::fromData(readJob->binaryData(), QSsl::Pem);
@@ -475,12 +447,11 @@ void WebFlowCredentials::slotReadClientCertPEMJobDone(KeychainChunk::ReadJob *re
}
}
readJob->deleteLater();
// Load key too
auto *job = new KeychainChunk::ReadJob(_account,
_user + clientKeyPEMC,
_keychainMigration);
auto job = new KeychainChunk::ReadJob(_account,
_user + clientKeyPEMC,
_keychainMigration,
this);
connect(job, &KeychainChunk::ReadJob::finished, this, &WebFlowCredentials::slotReadClientKeyPEMJobDone);
job->start();
}
@@ -507,8 +478,6 @@ void WebFlowCredentials::slotReadClientKeyPEMJobDone(KeychainChunk::ReadJob *rea
qCWarning(lcWebFlowCredentials) << "Unable to read client key" << readJob->errorString();
}
readJob->deleteLater();
// Start fetching client CA certs
_clientSslCaCertificates.clear();
@@ -519,9 +488,10 @@ void WebFlowCredentials::readSingleClientCaCertPEM()
{
// try to fetch a client ca cert
if (_clientSslCaCertificates.count() < _clientSslCaCertificatesMaxCount) {
auto *job = new KeychainChunk::ReadJob(_account,
_user + clientCaCertificatePEMC + QString::number(_clientSslCaCertificates.count()),
_keychainMigration);
auto job = new KeychainChunk::ReadJob(_account,
_user + clientCaCertificatePEMC + QString::number(_clientSslCaCertificates.count()),
_keychainMigration,
this);
connect(job, &KeychainChunk::ReadJob::finished, this, &WebFlowCredentials::slotReadClientCaCertsPEMJobDone);
job->start();
} else {
@@ -540,8 +510,6 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
_clientSslCaCertificates.append(sslCertificateList.at(0));
}
readJob->deleteLater();
// try next cert
readSingleClientCaCertPEM();
return;
@@ -551,8 +519,6 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
qCWarning(lcWebFlowCredentials) << "Unable to read client CA cert slot" << QString::number(_clientSslCaCertificates.count()) << readJob->errorString();
}
}
readJob->deleteLater();
}
// Now fetch the actual server password
@@ -561,7 +527,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
_user,
_keychainMigration ? QString() : _account->id());
ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
auto job = new ReadPasswordJob(Theme::instance()->appName(), this);
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
@@ -572,7 +538,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob
}
void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
QKeychain::ReadPasswordJob *job = qobject_cast<ReadPasswordJob *>(incomingJob);
auto job = qobject_cast<ReadPasswordJob *>(incomingJob);
QKeychain::Error error = job->error();
// If we could not find the entry try the old entries
@@ -595,8 +561,6 @@ void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
}
emit fetched();
job->deleteLater();
// If keychain data was read from legacy location, wipe these entries and store new ones
if (_keychainMigration && _ready) {
_keychainMigration = false;
@@ -608,19 +572,7 @@ void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) {
auto startDeleteJob = [this, oldKeychainEntries](QString key) {
DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
#if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK)
addSettingsToJob(_account, job);
#endif
job->setInsecureFallback(false);
job->setKey(keychainKey(_account->url().toString(),
key,
oldKeychainEntries ? QString() : _account->id()));
connect(job, &Job::finished, this, [](QKeychain::Job *job) {
DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job);
djob->deleteLater();
});
auto job = new KeychainChunk::DeleteJob(_account, key, oldKeychainEntries, this);
job->start();
};
@@ -637,27 +589,17 @@ void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) {
*/
if(_account->isRemoteWipeRequested_HACK()) {
// <-- FIXME MS@2019-12-07
// Also delete key / cert sub-chunks (KeychainChunk takes care of the Windows workaround)
// The first chunk (0) has no suffix, to stay compatible with older versions and non-Windows
startDeleteJob(_user + clientKeyPEMC);
startDeleteJob(_user + clientCertificatePEMC);
// CA cert slots
for (auto i = 0; i < _clientSslCaCertificates.count(); i++) {
startDeleteJob(_user + clientCaCertificatePEMC + QString::number(i));
}
#if defined(Q_OS_WIN)
// Also delete key / cert sub-chunks (Windows workaround)
// The first chunk (0) has no suffix, to stay compatible with older versions and non-Windows
for (auto chunk = 1; chunk < KeychainChunk::MaxChunks; chunk++) {
const QString strChunkSuffix = QString(".") + QString::number(chunk);
startDeleteJob(_user + clientKeyPEMC + strChunkSuffix);
startDeleteJob(_user + clientCertificatePEMC + strChunkSuffix);
for (auto i = 0; i < _clientSslCaCertificates.count(); i++) {
startDeleteJob(_user + clientCaCertificatePEMC + QString::number(i));
}
}
#endif
// FIXME MS@2019-12-07 -->
}
// <-- FIXME MS@2019-12-07

View File

@@ -119,12 +119,11 @@ protected:
QSslCertificate _clientSslCertificate;
QList<QSslCertificate> _clientSslCaCertificates;
bool _ready;
bool _credentialsValid;
bool _keychainMigration;
bool _retryOnKeyChainError = true; // true if we haven't done yet any reading from keychain
bool _ready = false;
bool _credentialsValid = false;
bool _keychainMigration = false;
WebFlowCredentialsDialog *_askDialog;
WebFlowCredentialsDialog *_askDialog = nullptr;
};
} // namespace OCC

View File

@@ -82,7 +82,7 @@ Folder::Folder(const FolderDefinition &definition,
qCWarning(lcFolder, "Could not read system exclude file");
connect(_accountState.data(), &AccountState::isConnectedChanged, this, &Folder::canSyncChanged);
connect(_engine.data(), &SyncEngine::rootEtag, this, &Folder::etagRetreivedFromSyncEngine);
connect(_engine.data(), &SyncEngine::rootEtag, this, &Folder::etagRetrievedFromSyncEngine);
connect(_engine.data(), &SyncEngine::started, this, &Folder::slotSyncStarted, Qt::QueuedConnection);
connect(_engine.data(), &SyncEngine::finished, this, &Folder::slotSyncFinished, Qt::QueuedConnection);
@@ -293,12 +293,12 @@ void Folder::slotRunEtagJob()
_requestEtagJob = new RequestEtagJob(account, remotePath(), this);
_requestEtagJob->setTimeout(60 * 1000);
// check if the etag is different when retrieved
QObject::connect(_requestEtagJob.data(), &RequestEtagJob::etagRetreived, this, &Folder::etagRetreived);
QObject::connect(_requestEtagJob.data(), &RequestEtagJob::etagRetrieved, this, &Folder::etagRetrieved);
FolderMan::instance()->slotScheduleETagJob(alias(), _requestEtagJob);
// The _requestEtagJob is auto deleting itself on finish. Our guard pointer _requestEtagJob will then be null.
}
void Folder::etagRetreived(const QString &etag)
void Folder::etagRetrieved(const QString &etag)
{
// re-enable sync if it was disabled because network was down
FolderMan::instance()->setSyncEnabled(true);
@@ -312,7 +312,7 @@ void Folder::etagRetreived(const QString &etag)
_accountState->tagLastSuccessfullETagRequest();
}
void Folder::etagRetreivedFromSyncEngine(const QString &etag)
void Folder::etagRetrievedFromSyncEngine(const QString &etag)
{
qCInfo(lcFolder) << "Root etag from during sync:" << etag;
accountState()->tagLastSuccessfullETagRequest();

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