1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-09-28 06:42:46 +02:00
Commit Graph

7999 Commits

Author SHA1 Message Date
Olivier Goffart
2f8c77c54f
Fixup commit 835c9163374f42003aa2f7795ade3f4ff62c8877
The previous code considered the also HTTP 207 code without the
application/xml header to have this message.
httpCode 0 does not make much sense anyway.

This change the behavior to consider any 2xx without the xml header
to show this error message
2020-12-15 10:58:08 +01:00
Olivier Goffart
c009dae1ce
New discovery algorithm: fixups
Adapt reviews from ckamm in https://github.com/owncloud/client/pull/6738#pullrequestreview-164623532

- SyncJournalFileRecord: initialize everything inline
- Add more comments
- And some ENFORCE
2020-12-15 10:58:08 +01:00
Olivier Goffart
059f722b3b
Move Result to its own header 2020-12-15 10:58:08 +01:00
Olivier Goffart
afed46afcc
New discovery algorithm: Parallel PROPFIND 2020-12-15 10:58:08 +01:00
Olivier Goffart
c8eff3da2d
New Discovery algorithm: Remove the sync cleanup phase
Since we do not recurse within some directories, many files are not seen.

The stale entry will cleanup by themself as the sync engine try to remove
the files that are already removed.
Should we need to actually do this cleanup, it should be dotected in the
discovery.
2020-12-15 10:58:08 +01:00
Olivier Goffart
35c0cf4e59
New discovery algorithm: Set the originalFile for ignored files
This is used to show the name in the UI
2020-12-15 10:58:08 +01:00
Olivier Goffart
52dcfcb166
New Propagation algorithm: Fetch, and emit, the root etag
Remove the feature to concatenate etags as servers that don't
have a root etag are no longer suported
2020-12-15 10:58:07 +01:00
Olivier Goffart
d25d87e92c
New Discovery Algorithm: Ge tthe size of new folders
Also add a test that this works properly
2020-12-15 10:58:07 +01:00
Olivier Goffart
ef542ac83d
New Discovery algorithm: Split the process function even further
Move the finialization in its own function.
This allow to save a bit of code duplication.

Also change the order of the parameter in the constructor for consistency
2020-12-15 10:58:07 +01:00
Olivier Goffart
fc69dda246
New Discovery Algo: Refactor by splitting the processFile in two 2020-12-15 10:58:07 +01:00
Olivier Goffart
b7d827d6d0
New Discovery Algorithm: Handle rename of virtual files 2020-12-15 10:58:07 +01:00
Christian Kamm
e58a25d7c5
Virtual files: Renames propagate #6718 2020-12-15 10:58:07 +01:00
Olivier Goffart
3289675b8d
Folder Wizard: Disable the 'choose what to sync' treeview if virtual files are selected
Don't allow to configure virtual files with a selective sync blacklist
2020-12-15 10:58:07 +01:00
Olivier Goffart
d8fa8e270f
AccountSetting: Fix Small Memoy leak 2020-12-15 10:58:06 +01:00
Olivier Goffart
0ba9dc7dd1
AccountSettings: Force sync should wipe the blacklist
Issue #6757
2020-12-15 10:58:06 +01:00
Olivier Goffart
68ace415d4
Virtual files: don't check for new big folders
https://github.com/owncloud/client/issues/6724#issuecomment-417368475
2020-12-15 10:58:06 +01:00
Olivier Goffart
75a57778d9
Virtual files: Don't show selective sync
Issue #6724
2020-12-15 10:58:06 +01:00
Olivier Goffart
46aa8fd1f8
Socket API: add an option to replace existing files with virtual files
Issue #6726
2020-12-15 10:58:06 +01:00
Olivier Goffart
afc953b649
Update the minimum supported version
We want to warn if the server version is not supported and did not get
appropriate QA for this client version.

https://github.com/owncloud/enterprise/issues/2687
2020-12-15 10:58:05 +01:00
Markus Goetz
811ac50c05
CMakeLists.txt: Log the Qt version in compile 2020-12-15 10:58:05 +01:00
Christian Kamm
6b571b609c
Conflicts: Rename BasePath to InitialBasePath #6709 2020-12-15 10:58:05 +01:00
Olivier Goffart
d81ccbb0c1
Checksum: Add support for SHA256 and SHA3
In case, some day, the server also supports it
2020-12-15 10:58:05 +01:00
Olivier Goffart
bf6e4174c8
Move the checksum related routine from FileSystem to checksum, where they belong 2020-12-15 10:58:05 +01:00
Olivier Goffart
198b65e9fc
Fix a compilation error on windows 2020-12-15 10:58:05 +01:00
Olivier Goffart
21fe54fb13
New Discovery Algo: readability improvements
As proposed by ckamm on #6738
2020-12-15 10:58:04 +01:00
Olivier Goffart
3a06a7978f
New discovery algo: data finger print 2020-12-15 10:58:04 +01:00
Olivier Goffart
5683f1c33d
New Disco Algo: Handle spurious virtual files
Port commit 0b9049e6ff
for issue #6718
2020-12-15 10:58:04 +01:00
Olivier Goffart
c3f745fa76
Conflict handling: add the OC-ConflictBasePath header
Issue #6702
2020-12-15 10:58:04 +01:00
Olivier Goffart
358aadfb98
Account Settings: Add a text for folder using vierual files
Issue #6723
2020-12-15 10:58:04 +01:00
Olivier Goffart
73d933115a
Virtual Files: Set the mtime of the virtual file to that of the server
Note: When the server mtime is modified, the mtime of the file is not updated

Issue #6727
2020-12-15 10:58:04 +01:00
Olivier Goffart
a17a2a9c06
Virtual Files Mime Type: use "vnd." prefix instead of "x-"
As reported in https://github.com/owncloud/client/issues/6717#issuecomment-413703567
2020-12-15 10:58:03 +01:00
Christian Kamm
c10f103fb8
Virtual files: Renaming to virtual doesn't delete data #6718
Unfortunately to do this, the local update phase must write to the
database, creating a new side-effect and order dependency (local update
must run before remote update).
2020-12-15 10:58:03 +01:00
Christian Kamm
be0fa72fcb
RemotePermissions: Fix empty vs null
Fixes two bugs that appeared since the introduction of the struct:
- when reading permissions from the journal, null ("") was read as
  empty-not-null
- when reading permissinos from the server, empty ("") was read as null

Addresses #4608
2020-12-15 10:58:03 +01:00
Olivier Goffart
4837bc8d60
FolderStatusModel: Do not abort applying selective sync if one folder has an error
Issue #6675
2020-12-15 10:58:03 +01:00
Olivier Goffart
732069aaa7
SyncEngine: Fix the "direction" of the "all file delted" message when the server is reset
Using the direction of the "first" item is not enough as it might be a directory
which is a UPDATE_META_DATA,  or there can have been a few changes locally as well.

As reported on https://github.com/owncloud/client/issues/6317#issuecomment-412163113
2020-12-15 10:58:02 +01:00
Christian Kamm
f6ca649308
Do not require server replies to contain an mtime
The check was added for #6317 in commit
13eb64584f.

We did see missing mtimes in replies in tests with live servers though.
Possibly those were old incomplete responses cached in the stat cache?
2020-12-15 10:58:02 +01:00
Olivier Goffart
9401273daf
New discovery algorithm: Call FolderDiscovered 2020-12-15 10:58:02 +01:00
Olivier Goffart
a36ed56f01
New Discovery algorithm: Refactor a bit the way the signal are emited 2020-12-15 10:58:02 +01:00
Olivier Goffart
8f3ce6e520
Fix TestDownload: _ignore_hidden_files was not properly initialized 2020-12-15 10:58:02 +01:00
Olivier Goffart
b6487181c6
New Discovery Phase: fix a few FIXME
Some FIXME were already fixed.
2020-12-15 10:58:02 +01:00
Olivier Goffart
9863500ec1
New discovery algorithm: handle symlinks 2020-12-15 10:58:01 +01:00
Olivier Goffart
a9ec521bf1
New discovery algo: Handle Database error 2020-12-15 10:58:01 +01:00
Olivier Goffart
1bcbcd407c
New discovery phase: read the direct download URL and Cookie 2020-12-15 10:58:01 +01:00
Olivier Goffart
ca32eb1cf7
More cleanup of csync remains 2020-12-15 10:58:01 +01:00
Olivier Goffart
ac24cdbde6
New Discovery Algo: Permsission check 2020-12-15 10:58:01 +01:00
Olivier Goffart
0a6d2d0f46
Remove csync_update and csync_reconcile
I guess some other csync utilities can also be remove dnow but
that will be for later
2020-12-15 10:58:00 +01:00
Olivier Goffart
57068b0fd9
New Discovery Algorithm: handle server errors 2020-12-15 10:58:00 +01:00
Olivier Goffart
4031fb6d5b
Backport 64014dd374 2020-12-15 10:58:00 +01:00
Olivier Goffart
75a1f2d089
Convert p7.pl to a C++ test
This is just a translation of test/scripts/txpl/t7.pl to C++ using the test
framework.
2020-12-15 10:58:00 +01:00
Olivier Goffart
f4a5167812
New Discovery Algo: Support the DatabaseAndFilesystem mode for local discovery 2020-12-15 10:57:59 +01:00
Olivier Goffart
370923791d
New Disco algortihm: Fix TestChunkingNG::connectionDroppedBeforeEtagRecieved
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:59 +01:00
Olivier Goffart
710934bdbd
New disco algo: Fix TestSyncFileStatusTracker 2020-12-15 10:57:59 +01:00
Olivier Goffart
f926248937
New discovery algorithm: More work on virtual files 2020-12-15 10:57:59 +01:00
Olivier Goffart
35e40b58ca
New Disco algorithm: Type change (file to dir) 2020-12-15 10:57:59 +01:00
Olivier Goffart
1e8c37d3d6
New discovery algorithm: Virtual files
The commented tests lines were implementation details
2020-12-15 10:57:59 +01:00
Olivier Goffart
22d989e272
New discovery algorithm: Fix directory deletion
TestAllFilesDeleted passes
2020-12-15 10:57:59 +01:00
Olivier Goffart
d54e00488a
New Discovery algorithm
Some error handling. In particular for the case where there is a conflict
between files and directories.

SyncEngineTest and SyncMoveTest passes
2020-12-15 10:57:58 +01:00
Olivier Goffart
a384a2d1cb
New Discovery algorithm: Handle of move within a moved directory 2020-12-15 10:57:58 +01:00
Olivier Goffart
bdd1e72dda
New discovery algoritmh: more on Renames 2020-12-15 10:57:58 +01:00
Olivier Goffart
f43d07dc05
New Discovery algorithm: Check that the original file is still on the server while renaming 2020-12-15 10:57:58 +01:00
Olivier Goffart
7e36cc3fcb
New disco algorithm: Fix some moving
Fix TestSyncMove::testSelectiveSyncMovedFolder
2020-12-15 10:57:58 +01:00
Olivier Goffart
5a57a36729
New discovery algorithm: Local rename 2020-12-15 10:57:58 +01:00
Olivier Goffart
f9a9be59e6
New discovery algo: Remote move
TestSyncMove::testRemoteChangeInMovedFolder
2020-12-15 10:57:57 +01:00
Olivier Goffart
92ddc60900
Handle Encoding Problems
TestSyncEngine now passes
2020-12-15 10:57:57 +01:00
Olivier Goffart
501da58b10
Ignore Hidden Files 2020-12-15 10:57:57 +01:00
Olivier Goffart
8bf69cf0cd
Port the invalid napme regexp
TestSyncEngine::testInvalidFilenameRegex
2020-12-15 10:57:57 +01:00
Olivier Goffart
9efd21d70b
More progress
TestSyncEngine::testFakeConflict / TestSyncEngine::testSyncFileItemProperties
2020-12-15 10:57:57 +01:00
Olivier Goffart
e934f6b27b
New discovery algo
Make TestSyncEngine::testSelectiveSyncBug pass
2020-12-15 10:57:57 +01:00
Olivier Goffart
4066c1a004
New discovery: TestSyncEngine::testEmlLocalChecksum 2020-12-15 10:57:57 +01:00
Olivier Goffart
9bf417d930
New discovery algorithm
Some progress:
TestSyncEngine::testDirUpload
2020-12-15 10:57:56 +01:00
Olivier Goffart
ec681ab2a5
New discovery algorithm: Initial work.
SyncEngineTest testFileDownload is passing
2020-12-15 10:57:56 +01:00
Kevin Ottens
ba0d465e47
Revert "Merge pull request #1454 from nextcloud/syncjournal-del-prio"
This reverts commit d9fd9cfef2, reversing
changes made to 2dcf594fc6.
2020-12-15 10:57:56 +01:00
Dominik Schmidt
07f331717f
Rename ocsync library to ${APPLICATION_EXECUTABLE}_csync 2020-12-15 10:57:56 +01:00
Dominik Schmidt
aad928a6be
Install libocsync to lib/ without subfolder.
Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of
irritations in the past and subtle annoying to fix bugs. To avoid name
clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now
part of the filename instead of the subfolder.

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

It would have been possible to change this just for Windows but as
written earlier this has caused lots of issues and thus I think it's
a good idea to just stay consistent accross platforms when touching it.
2020-12-15 10:57:56 +01:00
Olivier Goffart
0155a4fa73
Wizard + OAuth: Make opening a new browser after clicking back works again
Issue #6574

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

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

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
2020-12-15 10:57:55 +01:00
Olivier Goffart
0d21936e95
FolderStatusModel: Fix crash when there is an error while expanding folders
In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

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

Regression introduced in commit d69936e0

Issue #6562
2020-12-15 10:57:55 +01:00
Olivier Goffart
cf3846c565
csync: refactor csync_s::error_string to avoid valgrind error
The problem here is that we were sometimes allocating the error_string with
qstrdup, which need to be released with delete[] and not free().

Simplify the code by using QString instead.

```
==7230== Mismatched free() / delete / delete []
==7230==    at 0x4C2E10B: free (vg_replace_malloc.c:530)
==7230==    by 0x57C2321: csync_s::reinitialize() (csync.cpp:247)
==7230==    by 0x548130F: OCC::SyncEngine::finalize(bool) (syncengine.cpp:1212)
==7230==    by 0x5481223: OCC::SyncEngine::handleSyncError(csync_s*, char const*) (syncengine.cpp:746)
==7230==    by 0x5483E78: OCC::SyncEngine::slotDiscoveryJobFinished(int) (syncengine.cpp:965)
==7230==    by 0x5495E34: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (OCC::SyncEngine::*)(int)>::call(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:134)
==7230==    by 0x5495D92: void QtPrivate::FunctionPointer<void (OCC::SyncEngine::*)(int)>::call<QtPrivate::List<int>, void>(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:167)
==7230==    by 0x5495CB5: QtPrivate::QSlotObject<void (OCC::SyncEngine::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:396)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==  Address 0x225b2640 is 0 bytes inside a block of size 50 alloc'd
==7230==    at 0x4C2DC6F: operator new[](unsigned long) (vg_replace_malloc.c:423)
==7230==    by 0xA7E8FC8: qstrdup(char const*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x53F5750: OCC::DiscoveryJob::remote_vio_opendir_hook(char const*, void*) (discoveryphase.cpp:666)
==7230==    by 0x57E1278: csync_vio_opendir(csync_s*, char const*) (csync_vio.cpp:39)
==7230==    by 0x57D718F: csync_ftw(csync_s*, char const*, int (*)(csync_s*, std::unique_ptr<csync_file_stat_s, std::default_delete<csync_file_stat_s> >), unsigned int) (csync_update.cpp:674)
==7230==    by 0x57C1B05: csync_update(csync_s*) (csync.cpp:109)
==7230==    by 0x53F5BCC: OCC::DiscoveryJob::start() (discoveryphase.cpp:718)
==7230==    by 0x54B8F74: OCC::DiscoveryJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_discoveryphase.cpp:494)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==
```
2020-12-15 10:57:55 +01:00
Olivier Goffart
857afd32df
PropagateDownload: Don't discard the body of error message
We want to keep the body so we can get the message from it
(Issue #6459)

TestDownload::testErrorMessage did not fail because the FakeErrorReply
did not emit readyRead and did not implement bytesAvailable.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:55 +01:00
Olivier Goffart
4ee244190b
Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2020-12-15 10:57:54 +01:00
Christian Kamm
6dba2e8b06
Virtual files: Wipe virtual after download completes, not before
Otherwise a interrupted or unsuccessful download would mean that the
download-intend was forgotten. The next sync would reestablish the
virtual file instead.
2020-12-15 10:57:54 +01:00
Olivier Goffart
530614bf78
Rename SocketApi::FileData::accountRelativePath to serverRelativePath
As discussed in issue #6552
2020-12-15 10:57:54 +01:00
Olivier Goffart
ced5dfb8ee
Share dialog: use the original name and not the virtual file name
When sharing a virtual file, we should actually use the original file name
not the virtual file name

Issue: #6461
2020-12-15 10:57:54 +01:00
Christian Kamm
a6c19572a2
Virtual files: Only remove virtual file once on download
With thanks to @ogoffart for spotting the problem.
2020-12-15 10:57:54 +01:00
Christian Kamm
97f7b5abeb
Settings migration: Preserve future settings where possible
See discussion in #6506
2020-12-15 10:57:54 +01:00
Christian Kamm
87ba4e6b9c
Config: Add version flags to accounts and folders
Also, if there is too-new configuration, backup the file, show a
warning message asking the user whether it's ok to discard the
configuration from the future.

See #6504
2020-12-15 10:57:53 +01:00
Christian Kamm
aa6f5f59c4
Rename Placeholders to Virtual Files in code #6531 2020-12-15 10:57:53 +01:00
Olivier Goffart
a877a9d472
SyncRunFileLog: Add the requestid
https://github.com/owncloud/client/pull/6427#issuecomment-383879509
2020-12-15 10:57:53 +01:00
Olivier Goffart
09cacc4cd4
Blacklist: remember the X-Request-ID
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
2020-12-15 10:57:53 +01:00
Christian Kamm
7da4bb4c20
Wizard: Add a "(recommended)" to the main option #6470 2020-12-15 10:57:53 +01:00
Christian Kamm
ddeeecd061
Rename "placeholder" feature 2020-12-15 10:57:53 +01:00
Christian Kamm
4e3f2f755a
Placeholder: Stop adding ignore pattern
Because we can't make older clients preserve the version directive that
was attached to it.

See #6504 and #6498
2020-12-15 10:57:52 +01:00
Christian Kamm
8b6ac63ddb
Placeholder: Don't contain "stub" 2020-12-15 10:57:52 +01:00
Christian Kamm
27b65cbc69
Placeholders: Save to key that's invisible to <2.5 clients #6504 2020-12-15 10:57:52 +01:00
Olivier Goffart
3272f3b72b
FolderWizard: fix crash when experimental feature are disabled
The _placeholderCheckBox only exists if the experimental features are enabled

Found via the crash reporter
https://sentry.io/owncloud/desktop-win-and-mac/issues/556407777/
2020-12-15 10:57:52 +01:00
Markus Goetz
215afba89e
Share Dialog: Disable workaround for macOS too #6185 2020-12-15 10:57:52 +01:00
Markus Goetz
8dcfd50a7d
Placeholders: Support for macOS #6290 2020-12-15 10:57:51 +01:00
Christian Kamm
765c12dae1
LocalDiscoveryTracker: Separate from Folder and move to libsync
To allow relevant code to be closer together and for testing in
unittests without having to get a gui Folder.

See #6120
2020-12-15 10:57:51 +01:00
Olivier Goffart
7969067f80
Logger: Guard zlib usage by ZLIB_FOUND
Similar to the use for the checksum.
I know that zlib is required in principle, but i don't have it
in one of my test building environment, and it is easier to just
disable it.
2020-12-15 10:57:51 +01:00
Kevin Ottens
b1dc14977f
Get TestDownload to pass
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:51 +01:00
Olivier Goffart
4eb8997519
Download: Remove useless code and add a test
From issue #7015, the code is wrong because the path is the file system path and
not the path on the DB.
But since this is a conflict, this means the reconcile will still want to download
the file from the server next sync, so we need not to worry about this case
2020-12-15 10:57:50 +01:00
Olivier Goffart
718843ffce
Download: Use the <s:message> from the reply in the error message if any
Issue: #6459
2020-12-15 10:57:50 +01:00
Christian Kamm
27c8bce0b9
Wizards: Show placeholder option only if showExperimentalOptions is set
This config file option will also control other features in the future.
2020-12-15 10:57:50 +01:00
Christian Kamm
aee8b9f3c5
Wizards: Add placeholder option and warning to account wizard
Also add the warning dialog to the option in the folder wizard.
2020-12-15 10:57:50 +01:00
Christian Kamm
7dc65b060d
NSIS: Register placeholder extension
Also change the placeholder suffix config option to not include the dot,
the dotless form is needed in the nsis script.
2020-12-15 10:57:50 +01:00
Christian Kamm
6a37a7a42c
Placeholders: Fix migration issues
Some edgecases weren't covered and didn't have tests yet.
2020-12-15 10:57:49 +01:00
Christian Kamm
40f2303166
SyncOptions: Add default placeholder suffix
Otherwise each test has to set this up anew.
2020-12-15 10:57:49 +01:00
Christian Kamm
12d6f680f2
Placeholders: Ignore placeholder files in older clients
To do this, we add the placeholder extension to the user exclude file
automatically. However, newer clients shouldn't use that exclude
pattern: so we also add version directives that allow making exclude
patterns dependent on the client version.
2020-12-15 10:57:49 +01:00
Christian Kamm
d6078f958b
Placeholders: Download from shell integration 2020-12-15 10:57:49 +01:00
Olivier Goffart
91f53521ae
Placeholder: The extension is now a branding option 2020-12-15 10:57:49 +01:00
Olivier Goffart
a2bdd5b9a5
Placeholders: Fixup clicking on placeholder after previous change
Now that the name in the db is the name of the placeholder file,
we need to adjust the call to downloadPlaceholder
2020-12-15 10:57:49 +01:00
Christian Kamm
b1de184bc8
Placeholders: Safe migration to older client versions
Now the db entries for placeholders will have the full placeholder
paths. That way older clients will, on remote discovery, delete the
placeholders and download the real files.
2020-12-15 10:57:48 +01:00
Christian Kamm
0cd83a2c09
Placeholders: Deal with conflicts when a placeholder exists
So "foo.owncloud" exists but the user adds a new "foo".
2020-12-15 10:57:48 +01:00
Olivier Goffart
d233e5f8d7
Placeholders: install mimetype on linux 2020-12-15 10:57:48 +01:00
Olivier Goffart
7eeb99ba24
Placeholders: Add an checkbox in the FolderWizard to enable the placeholder feature 2020-12-15 10:57:48 +01:00
Olivier Goffart
1049fb74d9
Placeholders: Move the placeholder option from the account to the folder 2020-12-15 10:57:48 +01:00
Olivier Goffart
6ce7c7a56b
PlaceHolders: Trigger a download of the placeholder and open it 2020-12-15 10:57:48 +01:00
Christian Kamm
f5cf03b6a6
On-demand downloading: Placeholder-file based prototype
- Controled by an option.
- New remote files start out as ItemTypePlaceholder, are created with a
  .owncloud extension.
- When their db entry is set to ItemTypePlaceholderDownload the next
  sync run will download them.
- Files that aren't in the placeholder state sync as usual.
- See test cases in testsyncplaceholders.

Missing:
- User ui for triggering placeholder file download
- Maybe: Going back from file to placeholder?
2020-12-15 10:57:43 +01:00
Kevin Ottens
8c4bd2bb52 Ensure a sync happens after a conflict resolution
You'd expect that after a conflict resolution the file watcher would
pick up the change and trigger a sync. For some reason it doesn't seem
to happen on at least some Ubuntu systems. In such cases the user would
then still have a stale conflict entry in the activity list and wouldn't
be able to do anything with it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 09:40:57 +00:00
Kevin Ottens
d640076454 UserModel: check indices are inside the user list
The model was just checking for the user list being empty or not which
is overly optimistic. Indeed there might be cases where the id is
actually outside the boundaries so properly check for this.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 08:43:32 +00:00
Kevin Ottens
5ed397a430
Have the new account wizard open again
UserModel can't be connected to AccountSettings if the settings dialog
doesn't exist. This is the case now since we delay the creation of that
dialog and free it after use.

Instead it should be properly channeled through the Systray object all
the way up to OwncloudGui which knows how to handle this properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-14 15:58:52 +01:00
Camila
b4dc682690
Handle the warning message when unchecking folders for syncing.
Split widgets and slot to handle the refreshing of the view:
- refreshSelectiveSyncStatus is connected to signal dirtyChanged
and will handle big folder warning.
- slotSelectiveSyncChanged  which is connected to dataChanged signal
and will handle the selective sync warning. It fixes #1029 because
it looks for the checkbox state before showing the warning.

Signed-off-by: Camila <hello@camila.codes>
2020-12-14 12:36:51 +01:00
Camila
cfbd22b5e7
Use the icon color property to color the icons in the tray window header.
The icon color is set with APPLICATION_WIZARD_HEADER_TITLE_COLOR in the
theme.

Signed-off-by: Camila <hello@camila.codes>
2020-12-10 17:43:45 +01:00
allexzander
9266ecc2e8 Fixed slow sharee search in the share dialog
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-08 13:48:43 +00:00
allexzander
6e8658dc2c Added sharing via email.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-08 11:08:45 +02:00
Camila
5517ff2c02
Add debug log to check which folders are being skipped during syncing.
Signed-off-by: Camila <hello@camila.codes>
2020-12-03 12:24:25 +01:00
allexzander
f04281cb69 Implemented notification action buttons and context menu for confirm/dismiss and other actions.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-02 08:08:37 +00:00
Brian Kendall
f9991e180c Fix macOS bug where tray window causes spaces to switch
Signed-off-by: Brian Kendall <brian@briankendall.net>
2020-12-02 06:54:16 +00:00
Camila
bdd3465e7b
Check if there are patterns associated with a sync exclude file.
The previous check didn't take into the account that .sync-exclude.lst
might be empty which would crash at Q_ASSERT(_allExcludes.contains(basePath))
in the prepare function. It also takes into account that
_allExcludes[basePath] was creating new items in the list.

Signed-off-by: Camila <hello@camila.codes>
2020-11-26 12:12:04 +01:00
Camila
998e93ac13
Add last / to exclude list file path.
This Q_ASSERT(this->endsWith('/')) in BasePathByteArray was the reason
for bug report #1458.

Signed-off-by: Camila <hello@camila.codes>
2020-11-26 12:11:57 +01:00
Dominik Schmidt
a50c665051
Simplify Sparkle handling in CMake 2020-11-25 09:43:59 +01:00
Chih-Hsuan Yen
6962cbf582
Fix build without Sparkle.framework
(PR #6567)
2020-11-25 09:40:20 +01:00
Christian Kamm
60d3696ccd
Settings: Add warning when switching update channel 2020-11-25 09:39:16 +01:00
Kevin Ottens
4906353f2e Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-24 18:22:33 +00:00
Hannah von Reth
038644f378 Don't scare users with critical parser log messages 2020-11-24 18:22:33 +00:00
Hannah von Reth
d30cd0f0fd Include architecture in updater query
Fixes: #8074
2020-11-24 18:22:33 +00:00
Hannah von Reth
c76095859a Cleanup stirngs 2020-11-24 18:22:33 +00:00
Olivier Goffart
a7f010c370 Updater: Fix crash when there is an XML error
The problem was accessing the lines with an off by one error, while printing
the log.

Other problem included the fact that QDebug added spaces, quotes, and other
things which made the error lot look right in the console.

Issue #7545
2020-11-24 18:22:33 +00:00
Olivier Goffart
1bf895cadc Updater: Fix Version numer not shown in the user visible string
There was one argument too many in the string.
Bug was introduced in commit 21ac396b

Issue: #7288
2020-11-24 18:22:33 +00:00
Christian Kamm
c58f00abc7 Updater: Improved logging output #7388 2020-11-24 18:22:33 +00:00
Hannah von Reth
1df3f5b6df NSISUpdater: Improve logging for version comparison 2020-11-24 18:22:33 +00:00
Hannah von Reth
1aca005267 Updater: Log parsing issues in autoupdatLog parsing issues in autoupdatee 2020-11-24 18:22:33 +00:00
Markus Goetz
9a375211d7 Autoupdater: Log the URL #3475 2020-11-24 18:22:33 +00:00
Christian Kamm
d2991210c5 Updater: Preserve target version string
For #7217
2020-11-24 18:22:33 +00:00
Christian Kamm
aa7409f401 Updater: Make "Update manually" not also "skip this version"
See #7217
2020-11-24 18:22:33 +00:00
Christian Kamm
0b3512f49c WinUpdater: More useful options on update failure #7217
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-24 18:22:33 +00:00
Olivier Goffart
9596eb7f20 Updater: show the human readable version in the settings
The xml looks like this:

   <version>2.5.0.328</version>
   <versionstring>ownCloud Client 2.5.0 alpha1 (build 238)</versionstring>

And we should show the version string

Issue #6602
2020-11-24 18:22:33 +00:00
Olivier Goffart
f2c3ef741b Updater: remove unused function 2020-11-24 18:22:33 +00:00
Dominik Schmidt
ae38b88d1c Remove unused installers before copying new ones into the appdata dir 2020-11-24 18:22:33 +00:00
Olivier Goffart
e93972824d MSI: Fix crash in the auto updater
'auto' here is a QStringBuilder referencing a temporary

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

Found in the crash reporter:
https://sentry.io/owncloud/desktop-win-and-mac/issues/623245771/
2020-11-24 18:22:33 +00:00
Markus Goetz
5e518419de MSI: Always with logfile #6609 2020-11-24 18:22:33 +00:00
Dominik Schmidt
d069fda9ab Extract filename of updateFile without leading slash 2020-11-24 18:22:33 +00:00
Dominik Schmidt
dfac8c0e59 Escape msi and owncloud.exe path (who knows...) 2020-11-24 18:22:33 +00:00
Dominik Schmidt
ed0dc68db2 Run msi properly and restart client after update 2020-11-24 18:22:33 +00:00
Dominik Schmidt
08b5981fb6 Implement basic .msi support in updater 2020-11-24 18:22:33 +00:00
Markus Goetz
412e43b696 Updater: Comments 2020-11-24 18:22:33 +00:00
Christian Kamm
4b39731c27 Updater: Make sparkle updater respect release channel 2020-11-24 18:22:33 +00:00
Markus Goetz
311e3a3bd8 Auto Updater: Show UI element also on macOS
(cherry picked from commit dfdc2e1e87f99d387a042f4983c999fbb7fcf3d9)
2020-11-24 18:22:33 +00:00
Christian Kamm
a8ad946758 Settings: Add update channel combobox #6259 2020-11-24 18:22:33 +00:00
Markus Goetz
65035d1990 Sparkle: Delegate calls work now with 1.18.1 (maybe even before)
We can extend on this to give UI feedback.
2020-11-24 18:22:33 +00:00
Christian Kamm
08014b6dc3 FolderWatcher: Disable test on OSX #7305 2020-11-24 16:56:49 +00:00
Olivier Goffart
5a432a193f FolderWatcher: Usage of QTime for elapsed time is deprecated 2020-11-24 16:56:49 +00:00
Christian Kamm
28e4fc54a1 FolderWatcher: Wait for ready before testing #7305 2020-11-24 16:56:49 +00:00
Christian Kamm
e97fc430bf FolderWatcher: Become unreliable if test notification fails #7241
Necessary for some filesystems on windows that don't have full file
watching capabilities.
2020-11-24 16:56:49 +00:00
Christian Kamm
74382ddcc0 FolderWatcher linux: Make automatically recursive #7068
Previously it depended on addFolder() / removeFolder() calls to adjust
watchers when new folders were added or removed. There also needed to be
complex move handling.

Now, any folder creation/move-in notifications automatically trigger
watcher additions and folder deletion/move-out triggers removal.
2020-11-24 16:56:49 +00:00
Christian Kamm
21b931dc6b FolderWatcher: Always notify about conflict files #7073
This makes sure that the conflict list can be updated if a user resolves
a conflict by deleting the local conflict file. Previously one had to
wait for the next sync run.
2020-11-24 16:56:49 +00:00
Christian Kamm
351bada552 Folderwatcher: On linux, fix paths after dir renames #6808
If a folder was renamed A -> B, the folder watcher for the inode
would be unaware and still report changes for A/foo. Now directory
renames in the watched folders are tracked and paths are updated
accordingly.
2020-11-24 16:56:49 +00:00
allexzander
29ca1404cc Fix Windows compilation broken after QML debugging fix.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-24 16:50:16 +02:00
allexzander
92733e9069 Fix QML debugging by removing incorrect dependency
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-24 15:19:17 +02:00
Kevin Ottens
922b322337 Enable the QML debugger on debug builds
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-23 17:39:50 +00:00
allexzander
665a8c4217 Use dynamic path for account online/offline state icon. Refresh GUI on connection state change.
Signed-off-by: Alex Zolotov <alex.zolotov.nextcloud.com>
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-23 17:49:25 +02:00
Kevin Ottens
4f7876f520 Migrate journal dbs files back to the sync folder
In case of past collisions during the 3.0 times... well one will resync
from scratch unfortunately. But if that happened there are likely other
problems which occurred.

Also this might fix some of the bugs with people loosing settings from
the database. Indeed the -wal and -shm concatenations were wrong. Using
append was in fact changing the folderDefinition member which (I guess)
would potentially lead to funny ".db-wal-shm-wal-shm" names.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens
0b731eb516 Revert "moved default db sync file to Qt standard path AppDataLocation"
This reverts commit fc6b895f52.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens
1b553b93b9 Partial Revert "Adapted for cmd version and added migration step for config file"
This partially reverts commit 67ed54671b.

The migration code was left untouched.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens
cebd39aa85 Revert "Adjust to makeDbName returning an absolute path"
This reverts commit 2492e241ac.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens
6c463442ef Bring back the pause/resume action in the systray menu
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:29:51 +00:00
Kevin Ottens
1288ee0437 Move pause/unpause helpers to Systray
We had signals just to call those backs in ownCloudGui, they were
otherwise unused. So let's move them inside of Systray since it's
specific to it anyway.

Also fix the dangerous call to sender(). We can call this function
without going through a signal/slot connection and also it's never
connected to an AccountState.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:29:51 +00:00
Kevin Ottens
95487d8bfc Make sure the settings dialog exist before hiding it
Because of PR #2580 the settings dialog doesn't always exist. We need to
check for it first before placing calls to it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 16:57:56 +00:00
Kevin Ottens
86d240f7b4
Fetch apps when we get connected only
This was right now on the check connectivity beat which is too much when
you got many users. Be more conservative there and only update the list
of apps when the account gets connected.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-05 13:37:25 +01:00
Kevin Ottens
3427dadaeb
Get rid of FindQt5Keychain.cmake
QtKeychain provides Qt5KeychainConfig.cmake and friends nowadays, so no
need to have a less reliable and outdated find module on our end.

Also this shows that we were including keychain.h in the wrong way and
were not using the link target, so both got fixed as well.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-02 13:19:48 +01:00
Sergey Zolotarev
18c1bc0bd6 Misc fixes for Windows 7
Signed-off-by: Sergey Zolotarev <sryze@protonmail.com>
2020-10-28 06:24:53 +00:00
Kevin Ottens
3e6b257ccd Remove last left over of the "remote" wording
I switched from "remote" to "server" but apparently left one behind by
mistake...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-26 14:45:46 +00:00
Valdnet
204cced445 l10n: Change the ellipsis 2020-10-26 13:22:55 +00:00
Valdnet
f116c39b0a l10n: Add a space in generalsettings.ui 2020-10-26 13:22:55 +00:00
Kevin Ottens
8fad88055e Also output the event flags in the debug logs
When we skip a watcher event on mac, we log the file path but not the
event flags which came with it. Let's add it, it should help figure out
what's going on with #2578.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-26 12:37:00 +00:00
rakekniven
62fa8028a6 Triple dot to ellipsis
Reported at Transifex.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-10-26 12:22:23 +00:00
Kevin Ottens
24964e2b9b Ensure we quickly show/hide the systray window on startup
This is quick enough that no flickering should appear in practice.

We end up doing this because for some reason on Windows (I dug up deep
into the Windows QPA without nailing it down) not showing that systray
window at least once prevents the app object to return from exec() when
the session ends.

It's as if that window would be in some limbo state (neither opened nor
closed) which would prevent quitting. Clearly what we're doing here is a
workaround...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 17:31:05 +00:00
Kevin Ottens
b835092ae9
Use the ConflictDialog directly from the activity list
No need to go to the file manager first to then have the user go through
the context menu, just popup the dialog directly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:47 +02:00
Kevin Ottens
4116c90c9c
Move the activity action behavior on the C++ side
We better do this before this business logic grows in the QML side and
gets out of control. We'll need finer grained information due to the
conflict handling anyway.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
910f0c9339
Repair SettingsDialog::showIssuesList
This was completely disabled code and the connect was gone... So let's
introduce the connect back and have it trigger the main window while
selecting the right user. This way the new activity list is displayed
and since the conflicts are shown at the top this is hopefully obvious
again.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
c42f4abd25
Add a function to know the user id matching a given account
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
e3b97b0a04
In the case of conflicts, have the socket api propose the config dialog
This should be safe in the case of conflicts in folders on which the
user can write. For other cases we still use the older actions.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
49c478cd2a
Add a conflict dialog to help the user solve them
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
67e81fcd0f
Add KeepBothVersions as a possible solution to ConflictSolver
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
4fdb203cdb
Move some of the SocketApi conflict handling in a ConflictSolver class
The socket api move and delete commands are not strictly about conflicts
since they also deal with files which couldn't be uploaded for some
other reason. Still the new ConflictSolver could be used in those cases.

This opens the door at reusing that logic in other places.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens
26d62a9712
Repair the canAddToDir logic
This could only work at the root of the sync folder where the record for
the parent folder would be invalid. Otherwise the negation would be
wrong... assuming you can add a file only if the permission is not
there.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:44 +02:00
Christian Kamm
00e901f5a7
SocketAPI: Introduce conflict resolution actions #6252
For conflicts generally as well as new files in read-only directories
the context menu will now present delete and move options.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:10 +02:00
Christian Kamm
f62be57ef2
FileSystem: make removeRecursively() reusable
We want to use it for deleting directory conflicts.
2020-10-22 16:39:17 +02:00
Christian Kamm
e70371f408
FileSystem: Fix bad indentation 2020-10-22 16:39:17 +02:00
Michael Schuster
7699004a11 Fix crash in SettingsDialog with delayed initialization
setWindowFlags triggered changeEvent, thus causing a crash in customizeStyle.

This fix should be kept even if we decide against delayed init in the future.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-22 11:29:38 +00:00
Michael Schuster
0fb10163a3 Delay initialization of SettingsDialog
ownCloudGui::slotShowSettings already got what it takes to create it only when we try to show it for the first time.

This however has some implications:

Pros:
- Only created when needed, while testing saved ca. 20 MB of RAM and got freed again after closing the dialog.
- Since we defaulted to the new Tray UI from 3.0, this is an added bonus for users don't opening the settings.

Cons:
- Resources like the avatar image have to be refetched everytime the dialog is recreated.
  This may be desired as well, because it ensures displaying no outdated info (e.g. on connection issues).

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-22 11:29:38 +00:00
Kevin Ottens
a2e3f9d63a
Expose Theme on the QML side
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:46:38 +02:00
Kevin Ottens
7536e4c00b
Expose the branding related members of Theme as properties
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:46:04 +02:00
Kevin Ottens
de63e5e221
Don't hardcode the color of text in the header
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:40:42 +02:00
Kevin Ottens
0e9efe728a
Get rid of ncBlueHover
Use a similar trick of a semi-transparent rectangle on top when the
mouse area is hovered. This way it will always work whatever is the
background color.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 11:24:06 +02:00
Kevin Ottens
10cb4170c7
Don't use depth infinity anymore to get the folders e2ee status
This way we avoid the expensive SQL query on the server at the price of
more round-trips since we're doing the recursive traversal by hand now.

Also it turns out this depth was used for all the other propfind calls
during sync when we want fresher information regarding a folder. This
was very inefficient in all cases and won't happen anymore.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:59 +02:00
Kevin Ottens
b5fdbefb0e
Make sure jobs don't outlive ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens
399b97442e
Factor out the logic to start a new e2ee status job
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens
cbc40b5a15
Mention the folder we listed in the debug logs
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens
8e3ca71763
Change the way we store the job result
If there's more than one job we need to unite the maps not simply overwrite
them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens
9aeb7046d2
Start managing a list of GetFolderEncryptStatusJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens
cfb66ddadd
Add a way to know which folder was listed for encrypted status
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Camila San
03b1c0b84a
Fix crash when clicking on folder with status 403 in the main dialog.
LsColJob was still being used after delete was called.

Signed-off-by: Camila San <hello@camila.codes>
2020-10-20 16:19:27 +02:00
Kevin Ottens
b7ea6530c5 Stop the animation if we got an error message
Otherwise it would spin forever while we know we're not doing any work
anymore since we got a message from the server.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Kevin Ottens
ecc170decc Inform _emptyShareLinkWidget of linkShareRequiresPassword signals
All the other ShareLinkWidgets process that signal (which allows to
display error messages for instance) but not that one for some reason.
That being said it might need to deal with an enforced password
situation.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Kevin Ottens
e502e71926 Emit last to avoid use after delete crash
It turns out the shareDeleted() signal is connected to a function
cleaning up the ShareLinkWidget holding the last shared pointer to the
Share object. Since we use member variables for calling updateFolder()
this would lead to using deleted objects.

Just swap the call and the signal to have everything back in order.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Michael Schuster
61dc4b9137
Update comments
Everyone uses their private mail, so ensure people can get in touch.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-15 02:18:52 +02:00
Kevin Ottens
ca57221b74
Ensure we use the app name in the GUI
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:43 +02:00
Kevin Ottens
7efaa2ed68
Fix the secure lock label aspect
Make sure we got a fixed size for that label. Also ensure that the
pixmap we display there is properly scaled to fit while maintaining the
aspect ratio.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:32 +02:00
Kevin Ottens
ec945b8ac7
Hide the slideshow when going to the login page
This is indeed very distracting otherwise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:32 +02:00
Kevin Ottens
9ec4b5ef8e
Add a label explaining the server address field
This is as discussed in #1160

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:31 +02:00
Kevin Ottens
5e472e629f
Improve wording on the wizard buttons
This is as discussed on #1158

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:31 +02:00
renyhp
e5b307c81f Update bookmarks location
Signed-off-by: renyhp <renyhp@disroot.org>
2020-10-12 15:02:00 +00:00
Nicolas Fella
206c98688e Avoid string translation puzzle
Combining translated strings like this makes them hard to translate since the order of words is different between languages.
Use proper placeholder strings instead.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 13:34:50 +00:00
Nicolas Fella
6f17bbe6d5 Don't use nullptr for QFlags
This fixes some deprecation warnings

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 11:52:53 +00:00
Nicolas Fella
f5860928d9 Make QML code more declarative by using properties
By using properties and property bindings the QML code gets more declarative rather than imperative, which is considered better.

This patch:
- Introduces a currentUserId property in UserModel that replaces the equivalent Q_INVOKABLE call
- Introduces an avatar property in User that contains the avatar's image provider url without any fallback
- Introduces new image provider urls for fallback images
- Moves the fallback image selection to QML since we want different fallbacks according to where it is used
- Wires up the necessary signals to propagate a changing avatar

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 11:00:20 +00:00
Kevin Ottens
a53a87a3eb
Export the WordList functions
Now that they are used from gui/ they need to be properly exported so
that linking doesn't fail when visibility is activated (only on our
Windows build it seems).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 15:58:29 +02:00
Kevin Ottens
ab67741d87 Use setHeader instead of setRawHeader for the user agent
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens
3d8af05037 Use friendly user agent during webflow2 auth
This way the server displays a less scary string while granting access
from the browser. Also this same string will be used in the "Devices and
sessions" section of the server settings.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens
836de0358d Add a function for a more friendly user agent string
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens
50dd715f4d Don't force user agent if one is already set on the request
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens
3fca307fbb Also add build infos in the archive
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
8ce137cc53 Also add the command line arguments in the archive
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
8fb673457b Add a button to create a debug archive
This will harvest everything we might need for debugging purposes:
 * config file
 * sync journal dbs
 * log files

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
15d294e7fb Add dependency on QtGuiPrivate
I'm not a huge fan of using private APIs but QZip is really the API with
the least hassles for our debug archive need. No external dependency and
we know it is generally available and stable despite the lack of
stability promise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
607347289e Expose more of the logger state
It is better to rely on the Logger state to know exactly where we're
logging. Indeed due to the the various ways to impact its state the
config alone might not now where we're logging.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
167800320f Make sure --logfile has precedence on config
Since we changed the default in the config file and since log dir had
precedence on log file, the --logfile command line option wasn't doing
anything anymore.

We make sure it has an effect again overriding --logdir or the logDir
config entry.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
b0a38816fc Change the defaults for logging
Turn on the logging by default for everyone. Let's use a log dir within
the config directory of the application and have debug logs expiring
after a day.

This obviously means we'll generate quite some logs but with the
automated compression it shouldn't be too horrible. Obviously that
scales with the amount of files and syncs occurring. In our tests with a
large setup we're around 100 MB for a day worth of logs, this shouldn't
be too much of an issue on today's average desktop/laptop.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens
e78312f094 If askForOptionalPassword is enabled preset a random password
This is the same approach used on the server side. Turns out I quite
like it, this avoids popping up a dialog to the user and since she won't
know the password she'll have to set a new one anyway or disable it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens
099d25a56c Since we must ask for a password this can't be a default public link
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens
e356acbcee Add sharePublicLinkAskOptionalPassword to Capabilities
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens
f39542688a
Handle redirects when downloading updates
This is necessary for downloads coming from Github for instance. They
are systematically redirected and we'd just fail the download.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-05 15:48:39 +02:00
Michael Schuster
bb30633d31 Fix source file access modes
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-02 16:56:29 +00:00
Michael Schuster
5979ae30e1 macOS: Fix memory leak in FolderWatcherPrivate::startWatching
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-02 16:56:29 +00:00
Aldaris1985
ef6773bd60 Update propagateupload.cpp
Typo corrected.
2020-10-01 21:26:17 +00:00
Camila
954544830d Add a clickable icon for Talk notifications.
Signed-off-by: Camila <hello@camila.codes>
2020-09-30 08:46:01 +00:00
Harald Eilertsen
7721da25e5 Replace find_if with none_of where appropriate.
We're not interested in any found element in these cases, just to check
that none of the elements matches.

Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:32:39 +02:00
Harald Eilertsen
061ef027ff Don't hold ref to value returned from function.
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:32:24 +02:00
Harald Eilertsen
074a94ceb9 gui/accountmanager: Make isAccountIdAvailable a bit clearer.
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:24 +02:00
Harald Eilertsen
62bf4c5fda gui/folderman: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:24 +02:00
Harald Eilertsen
677997b2b3 gui/folder: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen
5bd2529ca6 gui/application: replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen
e343b4b947 gui/accountstate: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen
225fdabf6a gui/accountstate: Replace foreach (#2219)
Most instances have been converted to range based for, but std::find_if
has been used where it made sense.

Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen
1898782781 gui/accountmanager: Replace foreach/Q_FOREACH (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen
5f4cec870b cmd: Replace foreach with range base for (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Camila
dc12cdf196
Correct the object name returned by the api.
The id was always 0 so no new systray messages were displayed.

Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Camila
d2eb24a9a8
Connect signal guiLog to slot to display systray message.
Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Valdnet
d50ad548d2
l10n: Remove space from string text 2020-09-29 14:39:34 +02:00
Dominique Fuchs
b96b7e20c7 emitting signals from Qts Accessibility interaction invocations instead of duplicating actions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
1053c58b0f KISS. Removed description for now, instead clarified some Accessible.name
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
8abe4219a5 Added missing qsTr() calls - again
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
a69898371f Added missing qsTr() calls
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
a4151d71bc Fix typo
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
3287ec2387 Typo fixes, minor additions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
c6047e4d63 Re-add wrongly delete action
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs
43bf703806 Initial accessibility declarations for tray window qml src
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dan Griffin
5763e1e9d8
Free IconJob after use
Signed-off-by: Dan Griffin <github.mk@xiragon.com>
2020-09-28 12:30:53 +02:00
Kevin Ottens
78b03739a7
Force tooltip wrap mode because it's not enabled in Qt 5.12...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-24 14:47:56 +02:00
Jeremy Plsek
5fa2a13f8d Use native text rendering for qml windows
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-23 08:00:46 +00:00
Michael Schuster
ce71ffe9f9 Allow server URL to be pre-defined without enforcing it to be used unmodified
APPLICATION_SERVER_URL can be either empty or be specified. This commit adds the new CMake option APPLICATION_SERVER_URL_ENFORCE to decide whether to enforce the
URL's unmodified use (like before, default: ON) or to allow modification by the user (new).

By default APPLICATION_SERVER_URL_ENFORCE is set to ON, to no break with the previous implementation's expectations.

If APPLICATION_SERVER_URL is empty, APPLICATION_SERVER_URL_ENFORCE will be ignored by the Account Wizard.

The previous behaviour confused me a bit with branded builds. When the URL was (usually) specified but not forced, it was simply discarded, forcing the user to
manually supply it.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-09-23 07:21:35 +00:00
Jeremy Plsek
3a53afd704 Remove "This includes" due to tooltip order
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-21 09:46:25 +00:00
Kevin Ottens
3171cb2720 If there's no description just say nothing
Otherwise we get lots of "No description available" lines in the
activity list which is basically noise. Also trains the user to ignore
the secondary line.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-18 17:46:38 +00:00
Dominique Fuchs
f8f3190cb4 Fix missing subdirectory discovery on move operations in macOS.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Add qAsConst to avoid detaching

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Changed callchain to find and return possibly coalesced paths

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Removed another qAsConst remnant, more func const-correctness.

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-17 15:44:32 +02:00
Dominique Fuchs
d09b0284dd
Do not break out of outer loop when upgrading folders, continue instead
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Remove awkward debug line a.k.a. whoops

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-16 10:57:43 +02:00
Jeremy Plsek
797df2b5d5 Include list info in tooltip
Also extend the tooltip timeout

Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-15 10:04:06 +00:00
Kevin Ottens
6ee37b5975 Make sure menu are closed when button is clicked again
This way we also made sure all the Menu are currently on the same close
policy.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens
f7efe6a902 Delay binding on the menu width
Indee the MenuItem might not be linked to its Menu at creation time
which will make the binding fail and give a warning. Delay for the menu
availability.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens
eb0cedebfa Remove pre-QQC2.3 workaround
Now that we depend on Qt 5.12 anyway, the count property is available
just fine on the Menu item.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:09 +00:00
Kevin Ottens
7ccb016397 Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen()
Under Wayland QCursor::pos() is unlikely to give us anything meaningful,
so fallback to the primary screen information.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 07:17:03 +00:00
Kevin Ottens
01986df8ca Don't use a confusing "royal you" in the sync messages
Users get rightfully confused with the "You changed ..." messages in the
activity list for syncs. Indeed, some of those changes might be coming
from the server in which case we don't really know who did the change.

So now we use the old "Synced ..." messages for changes pulled from the
server and we have a more precise "You changed ..." (renamed, deleted,
created) when the changes were initiated locally (since there we know
the user reading the message did it).

Also changed how the messages are constructed so that they can be
properly translated.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-10 15:40:05 +02:00
Camila
95f634ce28 Click on activity list in systray open file in the file manager.
Clean up code, add more const and auto.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Camila
c1086c9886 Fix tooltip for activity info.
Also improves readability of the items in the list.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Kevin Ottens
fdb35e5f9f Leave the implicit uint to int cast
I wrongly (and stupidly) assumed the int in QBitArray was treated as a
hash as well but it is an index so it must be positive. Also to make
things even worse I misread on which expression clang-tidy was
complaining regarding the implementation specific narrowing
conversion... This is happening after the modulo operator and not
before. We're in a safe range of values at that point, so it's fine to
let the narrowing happen.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-08 16:44:31 +02:00
Jan Schmidt
3077a1378b syncjournaldb: index e2eMangledName column in metadata
Add an index on the e2eMangledName column in the metadata table
to speed up file sync by orders of magnitude on directories with
a large number of files.

Signed-off-by: Jan Schmidt <jan@centricular.com>
2020-09-03 22:56:14 +10:00
Kevin Ottens
aa63889e5b Enable bugprone-terminating-continue clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
80cc196f6f Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
5cec1373ad Enable bugprone-macro-parentheses clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
608bf025e6 Enable bugprone-forward-declaration-namespace clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
c8ea848596 Enable the bugprone-branch-clone clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
eb76682b1e Use httpd/unix-directory mimetype for E2EE folders
We don't do much with that mimetype on our end, but other clients
somehow don't expect inode/directory to let's lie. ;-)

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-31 10:08:48 +00:00
Kevin Ottens
1a0945a973 Enable all the misc clang-tidy check except one
This flagged mostly unused parameters. Didn't enable the
misc-non-private-member-variables-in-classes check as we got a lot of
those. Hopefully we'll get to fix them at some point but that feels too
early and too much work for now.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-31 09:14:09 +02:00
Michael Schuster
5945f18d5a
Remove remaining QLinkedList includes in addition to #2300
Now the only remaining reference is in:

src/3rdparty/libcrashreporter-qt/3rdparty/drkonqi-parser/backtraceparser.cpp:269:        || line.functionName().startsWith(QLatin1String("QLinkedList")

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 03:12:09 +02:00
Michael Schuster
bd519ffe7a
Adapt code style in addition to #2300
- Use "!empty()" instead of "size() > 0" in std::list
- Add comments for namespace brackets

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 01:31:06 +02:00
V.C
b20ea25201 Code review changes implemented
Code review changes implemented for bandwidthmanager.cpp
1. Use auto instead of size_t
2. Check for empty instead of size comparisions

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
V.C
af1bb7e98c Support client builds on VS2019
Scenario: Build fails on Qt 5.15.0 + VS2019 16.7.2
Root cause: QLinkedList seems to be depreciated. Advise to use std::list instead.
Fix: Used std::list insead of QLinkedList.

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
Michael Schuster
11632da7ea
Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE
Avoid interference with foreign pipes as this is always a bad idea ;p

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-20 18:50:05 +02:00
Kevin Ottens
ed5e9de9f6
Present sharing of E2EE files from the main dialog too
The visibility of the share button for the activity list is tied to the
path role in the ActivityListModel, so make sure we don't return a path
for E2EE files and folders.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:53:14 +02:00
Kevin Ottens
07388e0f22
Disable context menu actions for E2EE files and folders
Those files and folders are not shareable and the "Edit" or "Open in
browser" actions will lead to showing an error in the web GUI. No need
to lead users there so just disable them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:13:56 +02:00
Kevin Ottens
3540f1e460 Show the "Display mnemonic" button only when we know e2e is supported
Turns out that showing the button straight from the page ctor is a bit
too early. At that point the account might not be connected yet and thus
we wouldn't have proper information. Currently we were displaying that
button all the time, now we wait for the account to be connected to
decide to show it or not.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 17:41:38 +02:00
Camila
71fbc65eb0 Minor fix in text of warning and debug message.
Signed-off-by: Camila <hello@camila.codes>
2020-08-18 14:00:21 +02:00
Kevin Ottens
f6e36523d2 Make sure we don't assert when calling fileStatus
It happens that sometimes we leak a directory path ending with a slash,
but that violates fileStatus' precondition so let's catch it early and
skip such path.

Of course the right fix would be a larger swipe in the sync engine and
around it to not use naked strings anymore but rely on the typesystem.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 13:52:28 +02:00
István Váradi
89d4b6e12a Include cstdint only when compiling C++ code
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-08-14 06:15:42 +02:00
Olivier Goffart
a7847a4e82
Upload: Store the size in the UploadInfo, and compare it when resolving potential conflict
This is about the conflicts that happens when the file has been uploaded
correctly to the server, but the etag was not recieved because the connection
was closed before we got the reply.

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

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

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2020-08-13 16:46:08 +02:00
Christian Kamm
c74c0d8e6e
Upload: Add more chunk resuming unit tests #6405 2020-08-13 16:45:55 +02:00
Kevin Ottens
866ffc2a6b Enable the modernize-loop-convert check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens
a5b4922a0e Remove unused method
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens
0e2af4b502 Enable the modernize-deprecated-headers check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:53:52 +02:00
Kevin Ottens
2f8c29082a Enable the modernize-use-equals-default check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:19:42 +02:00
Kevin Ottens
cdf6e7d72b Enable the modernize-user-nullptr check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 19:45:25 +02:00
Kevin Ottens
6ae1d0ddf6
Get rid of useless using constructs
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens
97af14a4f0
Make QTokenizer use simpler by having optional second parameter
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens
d58ec4bf70
Enable the modernize-use-using check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens
3e79e1861b
We don't really need two \ here
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 09:48:33 +02:00
Kevin Ottens
c50a968a1e
Add more raw string literals missed previously
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 09:48:29 +02:00
Kevin Ottens
37e20698ca
Keep the E2EE info message around to allow displaying mnemonic
We lost the ability to display the E2EE mnemonic during the GUI
redesign and the info message wasn't displayed again on restart. So now
we display it every time, it still can be dismissed and the button text
is different in such a case to make the intent clearer.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-11 14:55:51 +02:00
Kevin Ottens
ef3c516598
Add support for BASE64 encoded '|' when decrypting
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens
595eb78c8a
Move the private key salt handling in its own function
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens
d5339265fb
Ignore the salt part of the key during decryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens
54a19945fd
Restore the symmetry between *StringSymmetric functions
If we receive data without base64 encoding for encryption, it makes
sense to get it without base64 encoding out of decryption.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens
26b88131cc
Add unit tests for the encryption helpers
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Camila
8f300ffe66 Remove extra check for talk app on server in AccountState.
- Remove repeated hard coded "spreed" string.

Signed-off-by: Camila <hello@camila.codes>
2020-08-04 16:28:19 +00:00
Camila
6d6cc3852b Fix #2243: use server url instead of hard coded string.
Signed-off-by: Camila <hello@camila.codes>
2020-08-04 16:28:19 +00:00
Kevin Ottens
0516db5e10 Make sure we always have a CLSID when Explorer integration is used
We update properly the CLSID of folders to integrate them with the
Explorer pane when they are added or removed from the GUI. That said,
there might be cases of users adding folders to sync straight from the
GUI. In such a case the CLSID might be missing on config load so now we
assign one on the fly when that happens.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-04 07:33:53 +02:00
Michael Schuster
e02be629bb Windows: Enable CFG and SafeSEH linker security flags
See:
https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-03 10:11:33 +02:00
Michael Schuster
bc5888e8e4 Always show Settings in the context menu (amends #2164)
The context menu should allow access to the Settings even when no accounts are configured.

Users may specify proxy / startup / update and other settings at any time.

This slipped through in #2164.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-03 10:10:05 +02:00
Kevin Ottens
66ede652f8 Use PNGs for branded clients
For branded clients try to load a png of the right size, for unbranded
clients use the SVGs. If something fails at load time skip it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens
72eba2b93d Move the svg rendering part in a lambda
This simplifies the loop body a bit, opening the door to what's next.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens
73c3aa7898 Extract the svg renderer from the loop
No need to recreate it each time for nothing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens
16a37c6aa0 Branded clients have more size variety for their icons
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens
983c02b6db Switch to for range loop
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens
14ecf535f9 Let Theme tell us if we're branded or not
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Camila
e89177b25b Add OpacityMask to fix mouse hover on round corner.
- Fix for #2173.
- Removed the workaround for the left round corner which was also
fixed with the OpacityMask.

Signed-off-by: Camila <hello@camila.codes>
2020-07-28 11:19:22 +02:00
Stephan Beyer
cd008ffe59 Let context menu open wizard if there are no accounts
The context menu offers to open the main dialog and the settings
even if no accounts are configured.  In this case, the main dialog
is useless and the settings are probably confusing.  Hence, this
commit replaces these actions in the context menu by an action
to open the wizard (which also opens on left click, so this is
the most natural thing to do).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-23 21:08:53 +02:00
Dominique Fuchs
a07db657d5 sigh, too
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 12:44:45 +02:00
Dominique Fuchs
cd3a72822e Get a const auto for the FolderMap to iterate over
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs
dbdf40ea45 Replaced Qt foreach by C++11 ranged for loop
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs
82c70f0c95 Properly set syncPause state on Systray creation when account init is done
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs
5ac3099b37 Fixed copy/paste bug, resulting in a wrong signal ::pauseSync used instead of ::resumeSync
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs
6ab55eddae Add -no-strip cmd line arg to macdeployqt if when building with Debug profile
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-20 15:04:33 +02:00
Kevin Ottens
f46276d70d Update our E2E API requirement
Now that we adjusted our protocol to follow the slightly updated server
API, let's make sure we don't try to talk to a server with an older API.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 18:39:29 +02:00
Kevin Ottens
c369d33015
Disable parallelism if we think the parent is e2e
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 13:05:54 +02:00
Kevin Ottens
cfd3771818
Allow to override the parallelism
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 13:05:11 +02:00
Kevin Ottens
5cfbf34501
Move PropagateRemoteMkdir ctor to the cpp file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 13:03:55 +02:00
Kevin Ottens
6b8d2270c6 Make sure the tray icon point is in screen coordinates
Previously we were using QCursor::pos() in the Linux case, which is a
fair heuristic except it will always be relative to the primary screen
and not the current screen. This explains why we had to adjust with the
virtual geometry.

In the Windows and Mac case we got the position out of QSystemTrayIcon
and that one was already relative to the current screen.

So now we use QCursor::pos(currentScreen()) which ensures we give the
coordinates relatively to the current screen also in the Linux case.

Since all platforms are now having that point in the same coordinate
system we don't need to mess around with the virtual geometry to
compensate.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 12:22:54 +02:00
Dominique Fuchs
6bc70ddd5b
Fix typo, use compound assignment op
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:19 +02:00
Dominique Fuchs
bc20edc582
Only attempt to move if file exist
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:18 +02:00
Dominique Fuchs
4656748130
Move existing syncjournal db files from client ver <2.7
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:11 +02:00
Dominique Fuchs
19d46f0541 Merge branch 'fix-delete-base-folders-instr' of https://github.com/Nextcloud/desktop into fix-delete-base-folders-instr 2020-07-09 21:47:34 +02:00
Dominique Fuchs
f8920f969f Remove debug variable
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-09 21:47:19 +02:00
Dominique Fuchs
8deb38ac24
Merge branch 'master' into fix-delete-base-folders-instr 2020-07-09 21:38:11 +02:00
Dominique Fuchs
d47e570ff3 Prevent empty FileMap in local csync to be processed if folder not empty
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-09 21:23:24 +02:00
Kevin Ottens
3ccac1b1be Properly register folder as encrypted during sync
Turns out that when we added a new e2e folder during sync, we were
passing the wrong path to the e2e object. We have several path
convention in the sync code, just happened to be the wrong one.

I still long for the day when we'll use the type system to deal with
paths. All those strings are error-prone.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 17:16:21 +02:00
Kevin Ottens
26686ecd45 Recover from missing metadata on uploads
Other clients seem to allow creating empty encrypted folders with no
metadata associated to them, so let's get ready to handle it. In case of
a 404 to get the metadata, we create an empty metadata payload and pass
it further down.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
4ef42e53d3 Change the separator in the private key
It used to be a base64 encoded '|', now it is still a '|' but not
encoded, let's adjust accordingly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
3c20b2414e Prevent parallelism when deleting encrypted files
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
1be869fdc7 Unlock the folder only after we actually deleted the file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
8e0ab5ce47 Allow to specify the e2e-token on DeleteJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
0575d0e793 Stop unlocking from within PropagateRemoteDeleteEncrypted
We need to finish deleting the file before we can actually unlock. Also
the token will be necessary for the delete to succeed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
7e251edd6e Compare the unencrypted filename with the originalName
Otherwise obviously we'd never find the files in the metadata.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
2831b22be4 Use the encrypted path for collection listing
If we use the local path we'll get a 404.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
511a6e66dc Pass e2e-token to PropagateUpload subjobs
The headers() method is used to pass extra headers to the PUT jobs for
instance, definitely needed for uploads now.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
9a4c63404d Pass the e2e-token for encrypted MKCOL
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
01f5501ad8 Allow to pass extraHeaders to a path based MkColJob
We could specify the extra headers with a URL but not a simple path.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Kevin Ottens
e14ae806b6 E2EE RFC has been updated to use e2e-token instead of token
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-09 16:22:54 +02:00
Camila
f018f7df3b Fix text in the permissions menu for share link.
Changed word capitalization and replace && for andi to match the server.

Signed-off-by: Camila <hello@camila.codes>
2020-07-09 03:21:04 +00:00
Camila
30a533d49c Share link display the correct permissions for files and folders.
- Fix #2175:
	- Shows the correct default permissions
	- Shows the permissions the user set

Signed-off-by: Camila <hello@camila.codes>
2020-07-09 03:21:04 +00:00
Camila
d7a1367292
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>
2020-07-08 18:15:36 +02:00
Stephan Beyer
308bed0da7 Use braced initializer list for returns in Systray::taskbarGeometry()
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
a87b6157ee Make csync_file_stat_s::isE2eEncrypted a bitfield
This is in line with other bools of that struct and gets rid
of clang-tidy's modernize-use-default-member-init warning.
(The trivial alternative to get rid of that warning would be
to use default member init for that bool variable, but I think
it is better to have it as a bitfield.)

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
1e6747cd1d Remove redundant initialization of ElidedLabel::_elideMode
The value gets already initialized by default member initialization,
so there is no need to set it again in the constructor.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
293be2c2e6 Remove redundant initialization of HttpCredentials::_keychainMigration
The value gets already initialized by default member initialization,
so there is no need to set it again.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
a9de465927 Remove redundant initialization of SyncFileStatus::_shared attribute
The value gets already initialized by default member initialization,
so there is no need to set it again in the copy constructor.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
ed570d6274 Use default member init for PKeyCtx::_ctx and PKey::_pkey
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer
00f93fdb77 Use more auto in folderstatusdelegate.cpp
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Kevin Ottens
2492e241ac Adjust to makeDbName returning an absolute path
PR #1451 changed the behavior of makeDbName which now returns an
absolute path. This obviously then failed in nextcloudcmd which
prepended to it the path to the local folder to sync. We just stop doing
this to have the journal db end up at the right place in that case as
well.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-08 13:09:13 +02:00
Kevin Ottens
c2632eb604 Handle properly null avatar
If we try to produce the avatar before we managed to connect we'd end up
trying to paint in a null image. Just return early, which will allow the
caller to do something else instead.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-07 18:07:33 +02:00
Kevin Ottens
217869e95c Decode the href from the XML payload
The XML we get as reply has href entities properly percent encoded.
Since we didn't go through QUrl next we didn't get a properly decoded
version. Make sure we decode it before storage.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-07 15:51:24 +00:00
Kevin Ottens
f90d6951c2 No need to compute base at each loop run
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-07 15:51:24 +00:00
Stephan Beyer
e32bd75519 Set maximum height of account and app menu
The menus may become too large if they have too many items
(the account menu has this in case of many accounts, the apps
menu in case of many apps).  This commit limits the maximum
height such that the menus do not hide the header.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-07 17:35:09 +02:00
Kevin Ottens
b98cf0a029 Reach out to the contentItem inside of the ListView to find the width
Turns out that the ListView embedded in the Menu (reachable via
contentItem) would create a binding loop if we're using its
childrenRect. But really we're interested in the total width for the
instantiated delegate *inside* the ListView. That's why we go one level
deeper and get the childrenRect of the inner contentItem instead.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 20:39:42 +00:00
Michael Schuster
f4d83d02f6
Cleanup auto pointers and qobject casts, refactor KeychainChunk
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster
ff631e919f
ProxyAuthHandler: Add template member function execAwait to avoid code duplication
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster
8503226c44
Keychain: Use auto deletion in WebFlowCredentials and ConfigFile
- Also make use of the new KeychainChunk::DeleteJob

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster
42eb3388f8
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>
2020-07-06 21:51:40 +02:00
Michael Schuster
ea95c4bf49
Refactor ProxyAuthHandler to use QEventLoop
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:39 +02:00
Michael Schuster
81c644e702
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>
2020-07-06 21:51:39 +02:00
Michael Schuster
18cbbc5052
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>
2020-07-06 21:51:39 +02:00
Michael Schuster
2a3ef044be
Move KeychainChunk class from gui to libsync
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:39 +02:00
Michael Schuster
203a2ce003
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>
2020-07-06 21:51:36 +02:00
Kevin Ottens
d3d713ff9c Fix the hover for the other menu items
Ultimately we would avoid the code duplication by creating our own
proper QQC2 style instead of directly tuning everything. That's a battle
for another time (more elements would need to be adjusted for that, I
don't want to dilute this branch too much).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 20:14:57 +02:00
Dominique Fuchs
180f191014 Fix hover cutoff in apps menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-06 20:14:57 +02:00
asemmar
628a426d22 forgot some indent
Signed-off-by: asemmar <anis.semmar@itron.com>
2020-07-06 09:46:14 +02:00
asemmar
d5587e386c fixed bad spelling of word 'retreive' except in sqlite dependancy
Signed-off-by: asemmar <anis.semmar@itron.com>
2020-07-06 09:46:14 +02:00
Kevin Ottens
d217fc272e Make sure moves involving e2e are delete + upload
If the file has a mangled name or will end up in a parent directory
known to be encrypted, we stick to the CSYNC_INTRUCTION_NEW instead of
going for CSYNC_INSTRUCTION_RENAME. This way we'll have a delete and an
upload instead of a move command.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Kevin Ottens
0b1cf69134 Update the metadata table with encryption info before discovery
When the ClientSideEncryption object is fed, also serialize the
encryption info of the folders inside the metadata table.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Kevin Ottens
7bb48a76c4 Add isE2eEncrypted column in the metadata table
This will allow to exploit the information of a directory being
encrypted or not during the discovery phase.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Kevin Ottens
287a130044 Also deliver the encrypted status via the ClientEncryption signal
This will turn useful for other consumers of that data. The alternative
would be to expose a method breaking all form of encapsulation.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Kevin Ottens
3520360159 Move the e2e information fetch even earlier
We used to do it when the propagation starts, let's do it even before
the discovery starts. This way we'll have a chance to exploit the
information during the discovery phase.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Kevin Ottens
f98c7990ba Split the discovery phase out of startSync()
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 05:27:14 +00:00
Camila
bd9aae8ca2 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:06:12 +02:00
Camila
fdc160460b Fix #2085 new tray menu.
Update systray behavior and context menu:
- left click brings up the new QtQuick based dialogs on all latforms
- right click brings up the new QtQuick based dialog on Mac OS only
- right click brings up a context menu on all other platforms than Mac OS
- "Quit Nextcloud" => "Exit Nextcloud"
- Add "Open main dialog" option.

Signed-off-by: Camila <hello@camila.codes>
2020-07-02 19:21:10 +02:00
Kevin Ottens
5a07a36d06 Avoid job parallelism when uploading to an encrypted folder
With the current design of the file upload this necessarily pushed to a
lock starvation on the folder. Indeed you could end up with N jobs
asking for the lock at the same time. So just avoid parallelizing for
now even though it will be slow.

We could try to optimize but that'd require some serious changes to the
sync logic on the jobs... let's stabilize first and optimize later.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:11:57 +00:00
Kevin Ottens
27b982ceaf Override parallelism() for uploads
This way we'll be able to control parallelism for upload jobs.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:11:57 +00:00
Kevin Ottens
5e20e2b46f Move PropagateUpload ctor impl to the cpp file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:11:57 +00:00
Kevin Ottens
542d303313 Reduce interaction with e2ee folders when in the wizard
During the wizard we currently don't have much information about the
encrypted folders. In particular we can only display their mangled names
which is far from ideal for the user to make an informed choice.

That's why in the wizard we now forbid creation of subfolders in e2ee
folders and we also don't display subfolders of e2ee folders.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
cb9ba9702b Properly display encryption status for non root folder connection
Since the e2e oracle works only in term of absolute remote paths and
that our model x._path was relative, we need to properly convert.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
d2e8cd4469 Deal properly with encrypted item updates accross connections
In such cases we get a download for which _file is already the demangled
name and _encryptedFileName has the mangled information. This is
different to what we encountered so far where initially _file was
mangled and _encryptedFileName was empty. Let's deal with that case
properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
9a2d04720a Also use mangled paths when looking for entries below a path
Otherwise on second sync we wouldn't find anything under a mangled path
and just end up thinking said files were removed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
0f21b625ab Also check on mangled names when cleaning up the journal
Otherwise, after a first sync all the mangled entries would be removed
from the journal. On second sync it would be fine because we'd then have
seen the unmangled names because of the local files. Unfortunately
that'd mean reuploading them for nothing or trying to mkdir again on the
server for nothing... with a chance of using differently mangled names
(although I didn't spot it, I can't exclude it never happened).

This also led to weirdly getting stuck during sync when there was more
than one sync point.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
3204c15911 Better separate between absolute and relative paths on uploads
Yes... I still wish this would be all driven by the type system, would be
much less error-prone.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
8d5c79c219 Better separate between absolute and relative paths on downloads
I wish this would be all driven by the type system instead of
error-prone string concatenation everywhere. That will be for a (much)
later refactoring hopefully.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
8a181adb3a Always use an absolute remote path for GetFolderEncryptStatusJob
It turns out this job expected an absolute remote path even in the case
of a subfolder sync point.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens
fdceb1f2d2 Allow to control logFlush from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:56 +02:00
Kevin Ottens
f557dd7792 Allow to control logDir from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:53 +02:00
Kevin Ottens
be2d9d4838 Allow to control logExpire from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:50 +02:00
Kevin Ottens
808fb17809 Allow to control log debug from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 15:56:23 +02:00
Kevin Ottens
7996eaae82 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 15:39:52 +02:00
Kevin Ottens
53c31f5fed 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 15:39:52 +02:00
Kevin Ottens
90f757b96b Repair the log message pattern
At last it will become useful again...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 15:39:52 +02:00
Hannah von Reth
5a05c2d6cd [Logger] Ensure log file is flushed before crash 2020-07-01 15:13:20 +02:00
Hannah von Reth
cd96b4a265 [Logger] Ensure errors are also printed to an attached console 2020-07-01 15:13:20 +02:00
Olivier Goffart
44fc881ced 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 15:13:20 +02:00
Hannah von Reth
669e42edd1 [Logger] Correctly handle message priority
This fixes the flodded sys log.

Fixes: #7453
2020-07-01 15:13:20 +02:00
Hannah von Reth
a57bf0c899 Print critical and fatal messages to stderr
That way we might get a reason why the client crashes (dev setup)
2020-07-01 15:13:20 +02:00
Christian Kamm
039d885b76 LogDir: Compress last logfile on restart
For #7353
2020-07-01 15:13:20 +02:00
Kevin Ottens
09c9a1c5bc Properly guard io.h since it is Windows only
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 15:13:20 +02:00
Dominik Schmidt
b171bd991d Make -logfile - work on Windows 2020-07-01 14:54:52 +02:00
Dominik Schmidt
fd493a0598 Make qFatal() trigger the crash reporter on Windows 2020-07-01 14:54:32 +02:00
Valdnet
01e6f73da5 Change the space character to a dot
Change the space character to a dot in the text string
2020-07-01 14:11:14 +02:00
Valdnet
d526f9e073 Delete a space character
Delete a space character before the line breaks
2020-07-01 14:10:49 +02:00
Kevin Ottens
d7a9a4cd09 Fix parenting issues of PropagateUploadEncrypted
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
3182c613ac Take care of mangled paths on download as well
This means adjusting PropagateDownloadEncrypted so that it knows where
the file will end (otherwise it would create temporary files in non
existant paths for instance).
In turn we have to adjust PropagateDownloadFile accordingly so that it
resolves the local folder the file will end up in.
And last we adjust PropagateLocalMkdir to resolve paths as well and
demangle as needed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
6dc12166ad Update the item even if we don't call decryptFile()
This way it makes it usable in a directory context.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
2abc3ce2f5 Stop leaking PropagateDownloadEncrypted objects
We give them a parent to make sure they will be destroyed when the jobs
which created them are destroyed themselves.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
01d44dd3a1 Display folder names demangled in the settings
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
710c470c13 Assume that folder paths can be mangled
PropagateUploadEncrypted made the assumption of the folder names never
being mangled. This is not true since the previous commits so make sure
we properly deal with that using the journal db.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
3e13919c35 Use QHash instead of QMap
This is not only a question of performances in our case (complexity
being better on look ups). It also provides a few more services.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
3db267a03b Ensure GetFolderEncryptStatusJob gets all the folders
We ensure the PROPFIND Depth is infinity by explicitly specifying the
header (turns out our implementation just doesn't assume infinity
otherwise). This way we have a clear picture about *all* the folders of
the user, otherwise ClientSideEncryption couldn't be a trustable oracle
on the encryption state for any folder not on the root and all the
encryption code assumes it has a full picture of encryption.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
f93fdafa80 Finally encrypt subdirectories during sync
We catch when a directory is inside a known encrypted folder and in such
a case we now do the following:
 1) we encrypt the folder meta data (its name) properly and create it
    under that mangled name on the server side
 2) we mark the new folder itself as encrypted

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
319e441653 Make PropagateUploadEncrypted reusable in a directory context
It was assuming we'd encrypt only files but directory names also need to
be encrypted. We just skip the writing to temp file part in that case.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
fc9a8c4496 Mark user strings for translation
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
74978a23fb Move the encrypt folder logic in a reusable job class
This way this whole logic isn't stuck into the settings dialog anymore.
Also cleaned up the unused "decrypt folder" logic.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
b3fb730d5a Use the propagator to trigger the e2e info fetch
This is a much better place than the GUI, this way we ensure the
propagator is always operating of up to date information. Previously if
the propagator kicked in without user interaction from startup (not
showing the settings dialog) it would have no E2E information available
whatsoever... unsurprisingly it would thus take wrong information at
every turn.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
5f611d6e39 Get ClientSideEncryption to notify when folder info fetch is done
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
76fbbfefa5 Fix typo
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
5afcf71e68 Fix typo
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
839c056b8d Don't show the encrypt action in subfolders of encrypted folders
Since we want to move to a place where the encryption of subfolders is
always enforced it makes no sense to leave it in control of the user.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
3bbc54ee6c Fix typo
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens
03ecaab259 Capture the pointer to info by value
Using a reference capture is a disaster waiting to happen here, if for
some reason we'd move from exec() to popup() for the menu below we'd be
getting garbage in the lambda call.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Stephan Beyer
20b58219e4 Hide Systray's auxiliary positioning methods from public and Qml
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-26 12:03:26 +00:00
Stephan Beyer
080505ef46 Simplify tray window positioning
The Qml position setting code is moved to C++, which allowed to get rid
of the currentScreenIndex() method (which seemed to be just a detour to
pass the screen from C++ to Qml).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-26 12:03:26 +00:00
Michael Schuster
d71249bb6e Fix crash in UserModel::currentUser() and add more sanity checks
Commit 07bede8 (PR #1892) introduced a new helper method currentUser()
that didn't check for _users.count() thus causing to throw an
"index out of range" exception when no accounts are configured.

This commit uses the opportunity to add more sanity checks to UserModel.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-25 20:52:30 +02:00
Stephan Beyer
f90e0e519f Make Systray's _trayEngine a QPointer
This is just safer.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-24 17:25:20 +02:00
Stephan Beyer
08cb289b8c Fix SEGV (by circular ownership) at exit
Commit a12205f322 (PR #1891) introduced
a circular ownership: qmlRegisterSingletonType<Systray>(...) makes the
QQmlEngine own the resulting singleton Systray instance, however, the
QQmlEngine _trayEngine itself is owned by the Systray instance. This
circular ownership results in a crash when the destructor of Systray
calls the destructor of _trayEngine which attempts to call the destructor
of Systray.

This commit solves this problem by making ownCloudGui, which is the
parent of Systray, the parent of the _trayEngine.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-24 13:50:17 +02:00
Stephan Beyer
6adb798728 Let Systray constructor call its base class constructor
Although I see no behavioral difference, this is probably
a good idea.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-24 13:42:26 +02:00
Michael Schuster
902963fa10 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>
2020-06-22 11:59:13 +02:00
Stephan Beyer
3f4ed0883a Make sure the menu separator uses Style.menuBorder color
In case the default color value will ever change, this
commit makes sure that the colors of the menu border and
the menu separator coincide.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-22 06:54:57 +00:00
Michael Schuster
92c8d6836b
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>
2020-06-18 21:05:11 +02:00
Michael Schuster
0253e98041
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>
2020-06-18 20:13:57 +02:00
Roeland Jago Douma
50dcab5f88
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>
2020-06-18 18:38:06 +02:00
Kevin Ottens
2ce1669ceb Bring forward the main systray dialog on second execution
Previously we were showing up the settings dialog but it doesn't quite
make sense anymore now that we got two dialogs.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-17 16:01:49 +00:00
Kevin Ottens
a6873f556b Also show the window on right click
Note this won't work on all platforms. KDE Plasma and GNOME Shell (with
systray extension) assume that right click is necessarily for a context
menu exposed via D-Bus, there's not nice way to make the right click
popup the main dialog on those platforms.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-17 16:01:49 +00:00
Kevin Ottens
73a689bc39 Don't call method on potentially null object
We were calling accountState() on a "folder" member which could be
nullptr. In fact this would happen any time one right click on a file
outside of a sync dir under Windows, this thus led to a crash.

Since the capabilities variable was unused anyway, we just removed it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 19:15:53 +02:00
Kevin Ottens
4f7a6cfb1d Make activity items with a link clickable
We then get more items clickable, in particular the bottom one proposing
to open the activity application. Now we can click it and it opens the
activity application straight away.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens
f147e5a66f Don't use a bright blue color for menus
As advised, use a light gray instead, this electric blue was a bit too
much.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens
bc863584db Don't duplicate file name in the info line
For the "Activity" type activities, displayPath contains the file name
which is also in the subject. This was redundant, so now we don't
display an info line at all for that type of activities.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens
f8e2e3403a Close all menus on window show
We previously missed the app menu which wasn't closed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Nicolas Fella
07bede8a56 Use properties to get user details
Convert imperative QML code to declarative code using property bindings

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-16 15:01:37 +02:00
Nicolas Fella
a12205f322 Port from context properties to singletons
Context properties are deprecated and will be removed in Qt 6.
QML singletons are the better option here, especially given that
UserModel and UserAppsModel already are singletons.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-16 14:34:59 +02:00
Nicolas Fella
be2e5266aa Create HeaderButton QML component
Deduplicate the Button code by moving it into a separate file.

Also use the same background code for the apps button since as far as I can tell it didn't behave any different

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-15 20:52:41 +02:00
Kevin Ottens
d3d99b2d9d Add some debug output for the window placement
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Michael Schuster
44a9200c5d Fix crash caused by setting Tray window screen pointer on the QML side
Seems like Qt sometimes doesn't like the QML window's screen property to be set
to a C++ (QVariant) pointer value, so we use the index: Qt.application.screens[]

See Qt docs: https://doc.qt.io/qt-5/qml-qtquick-window-window.html#screen-prop

This fix returns the matching window's index from the QGuiApplication::screens()
list to the QML side, instead of the window pointer.

Steps to reproduce the crash with the previous code:
- Open the Tray menu and close it a few times,
  or scroll randomly up and down in its activity list.

Tested with Qt 5.12.5

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-15 12:32:25 +00:00
Michael Schuster
5055f526c2 Remove Submodule qtmacgoodies again
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-15 12:32:25 +00:00
Kevin Ottens
f15a9cfc82 Try make taskbar position heuristic more readable
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
5848a1575b Make the reference point independent of the window
This leads to simplifying the computation code quite a bit as well.
Indeed we're separating concern between what is window size dependent or
not and that shows.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
40824dc427 Get rid of screenIndex
This was leading to the same logic being duplicated several times. It's
fine to return the QScreen* on the QML side directly but wrapped into a
QVariant.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
6c6dfb15a7 Move all the position computation on the C++ side
The API is just more convenient there, the rect and point types on the
QML side are just pale shadow of their C++ counterparts.

Also improved a bit the constness of the Systray class.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
83b36b4ab0 Rename tbOrientation into taskbarOrientation
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
aa90237e94 Introduce a screenRect as coordinate space
The top left corner of that screenRect is (0,0) or based on
(virtualX,virtualY) depending on the platform. This leads to easier
reduction in code duplication.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens
65e8f33ccf Use TaskBarPosition enum on the QML side
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Dominique Fuchs
a6f918f3c2 More simplifications, also transfer of more tray positioning logic to C++ backend.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-06-15 12:32:25 +00:00
Dominique Fuchs
f44df7f61a Major multi monitor improvements and rewrite of tray window positioning
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-06-15 12:32:25 +00:00
Michael Schuster
456c1eadbe
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>
2020-06-11 00:27:30 +02:00
Rick van der Zwet
24177ec7e4 Change default autostart to hide gui
Signed-off-by: Rick van der Zwet <info@rickvanderzwet.nl>
2020-06-09 18:34:30 +02:00
Stephan Beyer
0f620acc1f Replace prefixing of paths with file:// by QUrl::fromLocalFile()
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:46 +02:00
Stephan Beyer
749070a29c Hide openLocalFolderButton if no local folder is configured
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:46 +02:00
Stephan Beyer
131c1f1bac Fix crash on opening unconfigured local folder
When you try to open the local sync folder (by clicking on the
folder symbol) for an account that has no folder configured,
the client crashes.

This commit changes User::openLocalFolder() to do nothing in
case no local folder is configured.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:38 +02:00
Stephan Beyer
2946c335ba Change width of app menu
The app menu had a width based on the header button size which was
way too narrow to display its content.

This commit changes the width based on the contents (menu items) of
the menu, however, limiting the maximum width to half the window width.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 14:53:51 +02:00
Stephan Beyer
ea16804751 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>
2020-06-08 20:07:50 +02:00
Nicolas Fella
bce93b052b Use APPLICATION_ICON_NAME for autostart icon
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-08 20:06:00 +02:00
Roeland Jago Douma
fba69de096 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-08 19:40:16 +02:00
Michael Schuster
e6389959ce 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>
2020-06-07 14:39:42 +02:00
Dominique Fuchs
a45c2e04e5 Copy nextcloudcmd post-build instead of macdeployqt when building macOS bundle
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-06-07 14:39:42 +02:00
Michael Schuster
acb56be528 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>
2020-06-07 14:39:42 +02:00
Michael Schuster
221e5c5fc4
Improve command line version info and help display to streamline gui and cmd
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 14:20:33 +02:00
Michael Schuster
0fe7a65738
Fix Qt 5.15.0 build error (missing include)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 02:43:45 +02:00
Kevin Ottens
0503be65ae Cleanup the missing braced init list returns
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:14:18 +02:00
Kevin Ottens
e3e262e42e Use default member init when applicable
This also fixes a couple of warnings at places (out of order init for
instance) and a potential bug in the webflow credentials / qtkeychain
integration.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:10:39 +02:00
Kevin Ottens
965909f7fa Add missing auto opportunities
Somehow forgot to run it on the updater code

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:02:43 +02:00
Camila San
3bae570f29 Do not declare local variables without an initial value.
Signed-off-by: Camila San <hello@camila.codes>
2020-06-03 07:50:40 +00:00
Kevin Ottens
02a28325a8 Show broken encryption icon only in non-empty folders
This should address Tobias' concerns regarding the icon being
misleading. Now we basically do the following inside an encrypted folder
parent:
 * encrypted folders get the encrypted icon;
 * non-encrypted empty folders get the regular folder icon;
 * non-encrypted non-empty folders get the broken encryption icon.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-02 15:50:18 +00:00
Ivan Čukić
c800d9149e Show a broken lock icon for unencrypted subdirectory
The E2E application allows creating unencrypted subdirectories
in an encrypted parent. This is a big privacy problem.

This patch shows a red broken lock icon for these subdirectories
in the NC client UI.

Signed-off-by: Ivan Čukić <ivan.cukic@kde.org>
2020-06-02 15:50:18 +00:00
Ivan Čukić
4fb370275d Introduced RAII classes for other OpenSSL resources 2020-06-02 14:09:06 +00:00
Ivan Čukić
c31b1a750d Fixing memory leaks in the encryption module
Due to usage of early-returns, combined with malloc/free,
several buffers that get allocated are leaked when an error
occurs.

Several functions had potential leaks:

 - `encryptStringSymmetric` leaked `ctext`
 - `EncryptionHelper::fileDecryption` leaked `out`
 - `EncryptionHelper::fileEncryption` leaked `out`

Most of the functions had leaks of the cypher context.

This patch uses `QByteArray` as the handler for the dynamically
allocated buffers for openssl to operate on. This also removes
the need for conversions from malloc'd buffers to `QByteArray`
variables previously present in the code.

It also introduces a `CypherCtx` thin wrapper class to provide
a leak-free handling of `EVP_CIPHER_CTX`.
2020-06-02 14:09:06 +00:00
Michael Schuster
6ec69a700d
ShareDialog: Pointer cosmetics
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 20:57:52 +02:00
Michael Schuster
ae0ea12501
Merge branch 'master' into traywindow-listview-actions 2020-05-29 19:08:21 +02:00
Michael Schuster
ba4d109315
ShareDialog: Add further checks for the _manager member ptr
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 18:29:47 +02:00
Michael Schuster
efdef8535f
ShareDialog: Fix crash, properly init member pointers
_manager ptr only got initialized in the constructor when sharingPossible was set to true

Changes:
- Move member ptr inits from constructor to the header file's class definition
- Init _manager: set to nullptr too
- Add check for _manager to avoid crash in showSharingUi()

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 18:12:36 +02:00
Kevin Ottens
08cc4e1967 Remove the last redundant void arg I left behind
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-28 18:57:20 +02:00
Kevin Ottens
6e62c8b430 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:36:07 +02:00
Michael Schuster
ccc409dbd0
Merge pull request #2024 from nextcloud/use_raw_string_literals
Use raw string literals when appropriate
2020-05-27 05:54:54 +02:00
Michael Schuster
044a4bf6b5
Merge pull request #2021 from nextcloud/use_default_for_trivial_ctor_and_dtor
Use = default for trivial ctors and dtors
2020-05-27 05:17:24 +02:00
Michael Schuster
b2b0e8f4e4
Merge pull request #2020 from nextcloud/use_make_unique
Use make_unique when appropriate
2020-05-27 05:10:41 +02:00
Michael Schuster
4b2684cf4a
Merge pull request #2019 from nextcloud/remove_redundant_void_argument
Remove redundant void argument list
2020-05-27 05:07:52 +02:00
Kevin Ottens
f5350db078 Use raw string literals when appropriate
This is especially nice for Windows paths.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-26 20:13:51 +02:00
Kevin Ottens
a73a1f3927 Use = default for trivial ctors and dtors
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-25 21:33:24 +02:00
Kevin Ottens
9e20a0fecf Use make_unique when appropriate
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-25 21:08:43 +02:00
Kevin Ottens
65e6c445e5 Remove redundant void argument list
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-25 20:32:55 +02:00
Kevin Ottens
86b1821251 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-25 20:12:09 +02:00
Kevin Ottens
b579b49a5c Get rid of redundant parentheses
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-25 20:03:01 +02:00
Stephan Beyer
375fcb8e14 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:32:18 +02:00
Stephan Beyer
f46ce2ce98 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:32:15 +02:00
Stephan Beyer
deff3230f5 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:32:10 +02:00
Kevin Ottens
89316ced9e
Merge pull request #1987 from sbeyer/fix-leaks
Fix a few leaks
2020-05-21 17:12:04 +02:00
Stephan Beyer
faeb233a74 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-21 01:45:13 +02:00
Stephan Beyer
04a24c14a8 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-21 01:41:33 +02:00
Stephan Beyer
3015ea5715 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-21 01:32:16 +02:00
Stephan Beyer
8bc1525df5 Fix leak in Systray
The member _trayEngine, allocated in the constructor, was leaking.

This commit sets the Systray instance as the Qt object tree parent of
the _trayEngine to fix the leak.

While at it, a few unused header includes have been removed.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-05-21 01:22:15 +02:00
Stephan Beyer
eaf4aa0e5b 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>
2020-05-21 01:22:15 +02:00
Stephan Beyer
71a474129b 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>
2020-05-21 01:22:15 +02:00
Stephan Beyer
15bdfa9fbf 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-21 00:56:26 +02:00
Stephan Beyer
ff192e48d0 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-21 00:56:06 +02:00
Kevin Ottens
5543e4d834 Don't use int literals for bools
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 13:52:58 +02:00
Dominique Fuchs
e9a82dff77 Merge remote-tracking branch 'origin/master' into traywindow-listview-actions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-05-20 10:48:46 +02:00
Michael Schuster
7804b8e006
Fix spacing
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-20 03:57:33 +02:00
Kevin Ottens
712869db9a Use auto to avoiding repeating type names
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 03:54:41 +02:00
Michael Schuster
7fd431b50f
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 02:30:45 +02:00
Kevin Ottens
dea6ebaa35 Use nullptr when appropriate
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 02:21:26 +02:00
Michael Schuster
0c040c9686
Merge pull request #1986 from nextcloud/properly_handle_denormalized_href_path
Properly handle denormalized href
2020-05-20 01:31:34 +02:00
Dominique Fuchs
9bfcdbae3a More code cleanupand style-preference adjustments.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-05-20 00:09:41 +02:00
Dominique Fuchs
aa13aa533a Removed publiclink param and corresponding if branch.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-05-19 23:29:59 +02:00
Dominique Fuchs
fa9dddf567 Code cleanup and this-> removals.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-05-19 23:25:21 +02:00
Kevin Ottens
4d1ff01654 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-18 19:33:34 +02:00
Kevin Ottens
3867e73fd5 Stop supporting Qt older than 5.12
This both removes older Qt from the CI and also adjust all the
find_package calls in CMakeLists.txt

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-14 21:15:45 +02:00
Kevin Ottens
9000a880cb 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:33:13 +02:00
Kevin Ottens
3b6ab2fa5a Indicate this is a dialog and not a regular window
This is necessary with some window managers which would otherwise
consider they can reposition and resize the tray window as they wish
(yes, even though the user can't do it directly).

This is for instance the case if you use the tiling mode scripts of
KWin. It automatically ignores dialogs but might force windows to be
fullscreen (which would badly break the layout in our case).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-07 09:39:08 +02:00
Kevin Ottens
de7021e85e Force the default QQC2 style
This works around a bug in KDE's qqc2-desktop-style which breaks buttons
with icons not based on a name. By forcing a style name the KDE Plasma
platformtheme plugin won't try to force qqc2-desktops-style anymore.

Can be removed once the bug in qqc2-desktop-style is gone.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-07 02:07:02 +02:00
Sandro Knauß
6cdae6c19e Fix typos.
Debian has a list of known typos in their checking tools.

Signed-off-by: Sandro Knauß <hefee@debian.org>
2020-05-04 18:11:36 +00:00
Dominique Fuchs
671961e641 Added share icon from nc server repo, changed corresp. btn icon
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-04-27 08:06:58 +02:00
Dominique Fuchs
1c21bfdd7c
Merge pull request #1922 from taaem/fix-recent-files
Fix cloudprovider crashing - don't clear the _recentMenu pointer
2020-04-25 13:37:29 +02:00
Dominique Fuchs
ddee26084d
Merge pull request #1937 from ivaradi/xenial-compat
Qt 5.5 compatibility #ifdef
2020-04-25 12:23:25 +02:00
Dominique Fuchs
6df75328fd
Merge pull request #1893 from nicolasfella/override
override specifier missing
2020-04-25 12:18:56 +02:00
Dominique Fuchs
210253ce35
Merge pull request #1889 from nicolasfella/applicationengine
Use QQmlApplicationEngine instead of QQmlEngine
2020-04-25 12:15:33 +02:00
Dominique Fuchs
4bd5e9d79b Implemented share functionality in tray window and changed actions / button logic.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-04-25 10:17:53 +02:00
István Váradi
3d44a71755 Qt 5.5 compatibility #ifdef
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-04-23 20:22:30 +02:00
Michael Schuster
6e220b10e4
Merge pull request #1883 from nicolasfella/contexticon
[dolphin] Add icon to context menu
2020-04-16 02:52:34 +02:00
Michael Schuster
45342d7952
Merge pull request #1882 from nicolasfella/detach
Fix container detaching
2020-04-15 21:28:51 +02:00
Michael Schuster
d0b698ed37
Merge pull request #1881 from nicolasfella/envempty
Use qEnvironmentVariableIsEmpty
2020-04-15 17:52:09 +02:00
Michael Schuster
ef42635c23
Merge pull request #1880 from nicolasfella/timeout
Remove timeout parameter from showMessage
2020-04-15 17:28:02 +02:00
Nicolas Fella
29fa924853 Use LINUX_APPLICATION_ID
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-04-14 21:38:33 +02:00
Tim Klocke
18615d0297 CloudProviders: Don't clear the _recentMenu pointer
The _recentMenu pointer ref should not be freed, when building the
menu.
This fixes #1920 and #1818
2020-04-10 23:08:07 +02:00
Nicolas Fella
b4d1a63c14 Use override
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-03-22 21:58:15 +01:00
Nicolas Fella
d54add6233 Use QQmlApplicationEngine
This simplifies the code a bit.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-03-22 16:14:56 +01:00
Nicolas Fella
e1f4d17446 [dolphin] Add icon to context menu
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-03-21 02:04:42 +01:00
Nicolas Fella
1afda2b875 Fix container detaching
Found by clazy

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-03-21 01:24:37 +01:00
Nicolas Fella
c1189421c0 Use qEnvironmentVariableIsEmpty
clazy suggests that it is more efficient since it doesn't allocate.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-03-21 01:06:15 +01:00
Nicolas Fella
b84a1eeb8d 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>
2020-03-21 00:40:40 +01:00
Nicolas Fella
2f54e911b7 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>
2020-03-21 00:25:33 +01:00
Michael Schuster
102369bfbe
WebView: Add missing Q_OBJECT macros
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-11 01:18:11 +01:00
Michael Schuster
78776f81e4
Merge pull request #1847 from nextcloud/enh/updater
Updater: Enhance UI, make build optional
2020-03-10 15:53:47 +01:00
Michael Schuster
e833e86da6 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>
2020-03-09 02:34:55 +01:00
Michael Schuster
c812d896aa Fix OCUpdater: Also change status on network error or invalid XML
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-09 02:34:55 +01:00
Michael Schuster
c043a4e55c 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>
2020-03-09 02:34:55 +01:00
Michael Schuster
555b41f300
Fix Legal notice dialog: Correct title and header font
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-09 00:41:59 +01:00
Michael Schuster
d8c407ac97
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-07 06:45:41 +01:00
Michael Schuster
2adde0fcca
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-07 06:38:09 +01:00
Michael Schuster
a471868d88
Version parameter: Show Qt platform plugin, OS and CPU arch
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-07 06:31:14 +01:00
Michael Schuster
6685722cb3
Add missing --version parameter to help screen
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-07 06:20:00 +01:00
Michael Schuster
0e60bf7c82
Merge pull request #1838 from nextcloud/enh/share_circles
Allow sharing to circles: https://github.com/nextcloud/circles
2020-03-06 02:17:36 +01:00
Roeland Jago Douma
3776a04206
Allow sharing to circles
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-03-05 10:44:06 +01:00
Michael Schuster
ff642085b4
Fix Explorer pinning: Add fallbacks for Shell commands (fixes #1599)
See: #1599

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 18:45:58 +01:00
Michael Schuster
ab1099f13e
WebFlowCredentials: Make username comparison case-insensitive (fix #1741)
Fixes issue #1741

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 06:01:27 +01:00
Michael Schuster
aab735a595
Fix MSVC warnings: Missing return value, cast type
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-03 02:08:37 +01:00
Michael Schuster
f90f31756a
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 01:47:00 +01:00
XNG
e2066b317b
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 01:27:04 +01:00
Michael Schuster
eb7ed33d98
Merge pull request #1744 from nextcloud/qt-traygeometry-workaround
Fix wrong window position on some linux DEs - worked around invalid g…
2020-03-01 07:07:47 +01:00
Michael Schuster
712fef0cac
Merge branch 'master' into qml-singleton-style and fix merge conflict
Migrate changes in client.qrc to resources.qrc

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 06:47:46 +01:00
Michael Schuster
318c749558
Merge pull request #1736 from nextcloud/resource-cleanup
Resource cleanup and application-wide svg usage
2020-03-01 06:11:17 +01:00
Michael Schuster
5b2877a63e
Merge branch 'master' into resource-cleanup
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 05:34:12 +01:00
Michael Schuster
29e02d0579
owncloudsetuppage.cpp: adapt to string change from master: url -> URL
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 05:32:59 +01:00
Michael Schuster
a92a764c2a
owncloudsetuppage.cpp: also rename client/theme/lock-http(s) PNGs to SVG
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 05:12:59 +01:00
Michael Schuster
40767f7ae0
Fix Explorer integration: Hide option on non-Windows
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 04:03:29 +01:00
Michael Schuster
f1dd312b2e
Fix Explorer integration re-save (fixes issue #1807)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-03-01 03:39:24 +01:00
Michael Schuster
bf838bd336
Merge pull request #1809 from sroracle/cmake-qml-quick
Fix cmake inclusion of Qml and Quick
2020-02-29 21:18:11 +01:00
rakekniven
b936cc1f6e
l10n: Change spelling of "webdav"
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 11:14:34 +01:00
rakekniven
62bc9d025e
l10n: Removed colon from translation
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 11:13:34 +01:00
rakekniven
961c05363a
l10n: Removed blank before colon
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 11:10:05 +01:00
rakekniven
3f7cd5c0f3
l10n: Change case of one word
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-24 11:08:56 +01:00
Max Rees
3d3021e3b0
Fix cmake inclusion of Qml and Quick
Signed-off-by: Max Rees <maxcrees@me.com>
2020-02-23 23:44:54 -06:00
Michael Schuster
9c8a0204e5
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 21:28:42 +01:00
Michael Schuster
5554488dd8
Merge pull request #1768 from nextcloud/umlaut-sync-fix
Fix wrong encoding when specifying extra header with if-match path
2020-02-17 01:49:48 +01:00
Michael Schuster
640655ea10
Code cleanup
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-02-14 03:00:20 +01:00
Michael Schuster
abfebcf291
Add UserInfo class and fetch quota via API instead of PropfindJob
The PropfindJob quota includes the size of shares and thus leads to confusion
in regard of the real space available, as shown in the UI.
This commit aims to streamline the behaviour with the Android and iOS apps,
which also utilize the API.

Details:
- Refactor the QuotaInfo class into UserInfo
- Use JsonApiJob (ocs/v1.php/cloud/user) instead of PropfindJob
- Let ConnectionValidator use the new UserInfo class to fetch
  the user and the avatar image (to avoid code duplication)
- Allow updating the avatar image upon AccountSettings visibility,
  using UserInfo's quota fetching

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-02-14 02:10:01 +01:00
Dominique Fuchs
6d23ce82d7
Merge pull request #1770 from nextcloud/rakekniven-patch-1
l10n: Changed grammar and triple dots to ellipsis
2020-02-06 08:17:38 +01:00
Dominique Fuchs
4b8b84f2dd
Merge pull request #1759 from nextcloud/fix/do_not_save_all_the_time
Do not save notes on text change
2020-02-06 07:49:28 +01:00
Dominique Fuchs
e7b5cc8974
Merge pull request #1763 from nextcloud/tintou/cloudprovider-valid-dbus-path
Make sure that the libcloudprovider integration is using a valid D-Bus path
2020-02-06 07:17:35 +01:00
rakekniven
da66b3956e
l10n: Changed grammar
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-05 06:55:51 +01:00
rakekniven
1988511c55
l10n: Triple dot to ellipsis
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-05 06:54:32 +01:00
rakekniven
abcadec94a
l10n: Triple dot to ellipsis
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-05 06:53:17 +01:00
rakekniven
8f82fc2e51
Triple dot to ellipsis
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-05 06:52:17 +01:00
rakekniven
f9d27e4e3b
l10n: Triple dot to ellipsis
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-02-05 06:50:27 +01:00
rakekniven
32c2c062c0 l10n: Changed spelling of "user name" to "username"
Using "username" like on > 200 strings over the whole Nextcloud project.

Signed-off-by: rakekniven mark.ziegler@rakekniven.de
2020-02-03 10:42:37 +01:00
Dominique Fuchs
c69aba9b44 Fix wrong encoding when specifying extra header with if-match path
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-02-02 13:35:16 +01:00
Corentin Noël
a7d6555de2 Make sure that the libcloudprovider integration is using a valid D-Bus path
Set a simple unique identifier per folder to ensure that it is always unique.

Fixes https://github.com/nextcloud/desktop/issues/1704

Signed-off-by: Corentin Noël <corentin@elementary.io>
2020-01-30 21:05:13 +01:00
rakekniven
dfdb872e7b Changed product name to Nextcloud
Reported at Transifex.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-01-30 19:16:01 +01:00
Roeland Jago Douma
bd9b0cf23f Am empty note is not a valid note
Do not show the note edit field for empty new shares.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-01-28 12:46:15 +01:00
Roeland Jago Douma
d449912a0a
Do not save notes on text change
Only save notes on submit. Else you will get spammed with a ton of
requests (and possibly mails)

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-01-28 12:09:17 +01:00
Dominique Fuchs
0697c81ae6 Rewrite of screen selection logic, plus synamic screen selection Window.qml
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-21 13:54:04 +01:00
Dominique Fuchs
77be6729a2 Fix also screen selection for different Qt versions and for buggy linux DEs
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-21 12:16:24 +01:00
Julius Härtl
baf082df7c
Use system proxy by default if no config file is present
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-01-21 11:59:07 +01:00
Dominique Fuchs
f3062f6c96 Fix wrong window position on some linux DEs - worked around invalid geometry() returned by QT
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-21 09:55:26 +01:00
Dominique Fuchs
bb757c6a27 Merge branch 'master' into resource-cleanup
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-19 20:44:59 +01:00
Dominique Fuchs
6593317afa Merge branch 'master' into qml-singleton-style
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-19 20:43:36 +01:00
Dominique Fuchs
9deb51c846 Module styling also for UserLine.qml
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-19 20:40:49 +01:00
Dominique Fuchs
3a39e636ae Introduced Style module
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-19 20:13:12 +01:00
Michael Schuster
03cddabfd0
Tray menu: Only show time ago (view too noisy)
Don't show date and time for now, rather as a tool tip later.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-19 19:12:34 +01:00
Michael Schuster
8c2d77c68f
Merge pull request #1699 from Milokita/test-file-fix
apply http2 qt resend patch from owncloud
2020-01-19 18:11:36 +01:00
Dominique Fuchs
d3cd422b46
Fix crash on start without any accounts
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit 9935606c87ec4818f04c7d7c63d2f4b61187eead)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-19 14:14:23 +01:00
István Váradi
835cd2ac80 Qt 5.5 compatibility ifdef
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-01-19 13:16:17 +01:00
Dominique Fuchs
01e9343d8b Cleanup/Removal/Adaption/Update to resource files and crresponding code, esp. regarding svg usage
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-18 17:47:17 +01:00
Michael Schuster
c0863ede02
Share context menu: Use directEditing capability in SocketApi
- Allow direct editing "Edit" when an editor is available for the mime type
- Show "Open in browser" if editing is unavailable (as previously)
  (now on top of the menu list)
- Rename the menu title to the app name, "Nextcloud" instead of "Share via ..."

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-18 15:12:16 +01:00
Michael Schuster
45b39cdbc1
Add support for the directEditing capability
- Fetch in ConnectionValidator::slotCapabilitiesRecieved
- Add editors to a list made of the new DirectEditor class

TODO:
- Add support for re-fetch and continously check for changes (ETag)

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-18 15:07:51 +01:00
Michael Schuster
9447a10716
JsonApiJob: Add method usePOST to allow anonymous POST requests
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-18 15:03:21 +01:00
Michael Schuster
2039872ee5
Merge pull request #1565 from nextcloud/qml-tray-menu
New tray window
2020-01-18 13:18:45 +01:00
Michael Schuster
016a90d7b0
More code maintenance
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-18 12:56:26 +01:00
Dominique Fuchs
9b5bb1365c Code maintenance - correct some syntax, fix some warnings.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-18 10:30:34 +01:00
Michael Schuster
de74057cc8
Add grey hint Activity entry if limit is reached
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-17 20:26:48 +01:00
Michael Schuster
e2188b109a
Limit fetching Activities to 100 or max. 30 days old
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-17 20:25:41 +01:00
Michael Schuster
3ae55c2555
AccountState: Add helper to find navigation App
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-17 20:21:42 +01:00
Michael Schuster
b47adb7aeb
Notifications bug fix: Don't init ETag response header with *
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-17 20:20:37 +01:00
Michael Schuster
889cb636d3
Add Activity date and time
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-17 20:16:20 +01:00
Dominique Fuchs
c9719f44dc Fix hover property wrongly placed in button, not MouseArea
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 16:30:27 +01:00
Dominique Fuchs
599dae0486 Inclusion of possible 'notification' type descriptions in activity
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 14:50:05 +01:00
Dominique Fuchs
1c5cdc4d36 Adapted currentId logic for activity fetching to new API (should fix endless fetch bug)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 14:29:54 +01:00
Dominique Fuchs
0156edf320 Removed visibility workaround
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 11:21:43 +01:00
Dominique Fuchs
f425dfdfea Set sourceSize to prevent blurry rerendering of svg source in activityIcon
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 10:38:21 +01:00
Dominique Fuchs
7ea2f3fa59 Refresh visibility of ListView based on presence of items on showWindow
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 09:09:42 +01:00
Dominique Fuchs
1c22070a74 Refresh immediately on showWindow, regardless of the timer
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-17 09:04:24 +01:00
Michael Schuster
9abc1eb921
Add initial support for Apps menu icon display (show remote SVGs)
Caching and showing them from local data-URLs leaded to blurry rendering in Qt.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-16 18:43:48 +01:00
Dominique Fuchs
94325359d7 Fixed bug regarding additional but empty delegate at end of activitylist
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 18:01:18 +01:00
Dominique Fuchs
585094a719 Minor property hierarchy fix
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 17:40:47 +01:00
Dominique Fuchs
4b79c597dc Disabled animations until population glitches are fixed
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 17:11:08 +01:00
Dominique Fuchs
1bc8ec59aa Streamlining local sync notification/activity icons with server ones. Added fileAction logic for local sync activities
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 17:09:34 +01:00
Dominique Fuchs
b9a350e201 Minor layout adjustments
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 15:19:17 +01:00
Dominique Fuchs
cd80c749d6 Retreive and svg data from icon property url for activity entries
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 14:01:54 +01:00
Dominique Fuchs
06fdde8f1e Upgrade of NC server API usage + corresponding activity queries and properties including icon ref
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 12:43:04 +01:00
Dominique Fuchs
9f259bda27 Add check if applist rowCount() already empty to prevent assert exception
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 11:30:51 +01:00
Dominique Fuchs
246f7e9395 1px border #0082c9 around tray window
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-16 08:01:09 +01:00
Michael Schuster
7fe138330e
Double the width of the Apps menu (x starts at the Talk button)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-16 00:57:49 +01:00
Michael Schuster
3488fd7c7f
Fix font sizes for "Log out" and "Remove account" and the Apps menu
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-16 00:45:31 +01:00
Brandon
d10bc1bb14 Correct wrong variable
Signed-off-by: Brandon <brandon.yeow@websparks.sg>
2020-01-15 23:07:14 +01:00
Brandon
18a88fcecf Correct wrong variable
Signed-off-by: Brandon <me@branbit.com>
Signed-off-by: Brandon <brandon.yeow@websparks.sg>
2020-01-15 23:07:14 +01:00
ritsute
c92f520423 Handle broken shared file error gracefully
Signed-off-by: Brandon <me@branbit.com>
Signed-off-by: Brandon <brandon.yeow@websparks.sg>
2020-01-15 23:07:14 +01:00
Dominique Fuchs
00d73a9389 Add visual separation between accountStateIndicator and avatar
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-15 20:11:50 +01:00
Dominique Fuchs
ddf67ff948 Preserve a 2px distance from tray border (streamlining with acount menu)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-15 19:28:40 +01:00
Dominique Fuchs
9b32ebdae4 Allow text to expand further if one or both buttons aren't visible
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-15 19:15:25 +01:00
Dominique Fuchs
0ec2291bd7 Layout adjustments & also show remote path in activitylist
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-15 18:44:33 +01:00
Michael Schuster
026bf02c85
App menu: Filter out Talk because we have a dedicated button for it
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-15 18:14:20 +01:00
Michael Schuster
42ebc7e995
Remove debug output
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-15 18:09:33 +01:00
Michael Schuster
b4b6366ba8
Add App list menu to Tray UI
- Modify Window.qml and Systray to show the App menu upon clicking the App button
  on the top-right. Fall back to opening the general URL in case no apps are found.

- Introduce a new UserAppsModel in UserModel.cpp to access the fetched server Apps
  from AccountState (propagated down from the User class).

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-15 16:42:06 +01:00
Michael Schuster
7b740f5e9a
Remove setTalkCapability() from AccountState and filter for Talk upon App list building
Since the per Account App list is now being built in AccountState's slotNavigationAppsFetched
it's easy to filter for the availability of the Talk app on the server by its ID property
upon App list building, thus eliminating the need for an extra fetch job.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-15 16:30:05 +01:00
Michael Schuster
cb328d6cea
Fetch server Apps in AccountState (moved from ownCloudGui)
- Add a new class AccountApp to keep them in an AccountAppList
  and also save properties like ID and Icon URL.

- Clear the app list upon re-fetch to avoid endlessly growing lists
  like in the previous implementation in ownCloudGui.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-15 16:23:46 +01:00
Dominique Fuchs
b57b8cfb66 Resized add account icon, adapted layout for new size
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-15 08:01:54 +01:00
Dominique Fuchs
29138cc533 Font and icon size improvements, svg transfer to new folder
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-14 19:48:21 +01:00
Dominique Fuchs
c09dd9287c Fix missing trayScreen init in non-OSX clause
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-14 08:55:39 +01:00
Dominique Fuchs
65b47d4613 Make qml UI strings translatable
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-14 07:59:28 +01:00
Dominique Fuchs
f748a4bb50 Made tray window positioning HighDPI aware
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 22:11:57 +01:00
Dominique Fuchs
e4b19d0cb5 Activity refresh in background
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 14:35:58 +01:00
Dominique Fuchs
eeefbe57af Added progressInfo / cleanup to acitivtymodel
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 13:10:32 +01:00
Dominique Fuchs
84066634e7 Integrated local error messages in activitymodel
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 12:54:38 +01:00
Dominique Fuchs
9e82ba60b4 Integrated local sync activities in activitymodel
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 12:20:41 +01:00
Dominique Fuchs
96a74d9ef0 Minor improvements
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 11:46:49 +01:00
Dominique Fuchs
1ebcd3a0fb Icon selection, svg path transfers, scrollbar
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 09:59:34 +01:00
Michael Schuster
8f9101773c Fix Explorer integration on Windows and the crash on other systems
- Ensure that the folder integration stays persistent in Explorer,
  the uninstaller removes the folder upon updating the client.
  Recreate all entries upon start. This has the benefit of removing
  old remains of non-working, outdated entries.

- Don't crash on the other systems when the user clicks the option
  button "Show sync folders in Explorer's Navigation Pane".
  Even though the option currently doesn't work on the other platforms,
  crashing is never good...

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-01-13 09:25:01 +01:00
Dominique Fuchs
17fcfd4e41 Show ListView delegate only when model is populated (prevent dummy delegate)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 09:12:44 +01:00
Dominique Fuchs
9e6df7a4dc Add populate transition
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 08:43:51 +01:00
Dominique Fuchs
9319210c4c Fix local folder not opening on windows, add extra slash
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-13 08:33:10 +01:00
Dominique Fuchs
58f1c3234d Temperarily disabling animations due to lags - FIXME
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 21:37:08 +01:00
Dominique Fuchs
715924cac6 Show activitylist on initial tray opening when logged in
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 21:19:18 +01:00
Dominique Fuchs
163ca3b58a Removed old account toolbox
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 19:53:02 +01:00
Dominique Fuchs
1c2916052d Bunch of fixes and optimizations for activityList
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 17:52:51 +01:00
Dominique Fuchs
b76da25ef1 Model/View improvements, also fixes crash on account removal
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 16:16:24 +01:00
Dominique Fuchs
7f35178c70 More fixes to login/logout logic
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 11:06:48 +01:00
Dominique Fuchs
212e1f80f5 emit signal for current user GUI refresh on login/logout
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 10:46:14 +01:00
Dominique Fuchs
a2c9e369c3 call resetRejectedCertificates on fresh login
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 10:42:40 +01:00
Dominique Fuchs
78f12de997 Merge branch 'master' into qml-tray-menu 2020-01-12 09:12:16 +01:00
Dominique Fuchs
8ec7cfa700 Connection status indicators as avatar overlay
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 09:10:06 +01:00
Dominique Fuchs
bc8f64bb98 Generalized connection check, now working for every user in account menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-12 08:50:13 +01:00
Dominique Fuchs
578a3b4ef4 Streamlined 'Add account' button with account entries
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 20:28:00 +01:00
Dominique Fuchs
cc671dfad3 Fix local folder URL
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 19:56:56 +01:00
Dominique Fuchs
86b915d42e Systray now a singleton with instance(), show tray on finished wizard
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 17:34:56 +01:00
Dominique Fuchs
738127525f Fix comment
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 17:14:44 +01:00
Dominique Fuchs
6485ef480b Added confirmation dialog for account removal
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 17:06:42 +01:00
Dominique Fuchs
9af7d4ad06 Fix crash on startup when no users configured
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 16:41:20 +01:00
Dominique Fuchs
32741162d9 Detect newly added user and rebuild account menu automatically
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 15:47:36 +01:00
Dominique Fuchs
3da982f073 Implemented account removal
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 15:32:59 +01:00
Dominique Fuchs
a021f62e96 Tray creation timing, account menu reinstantiating on visible change
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 15:05:37 +01:00
Dominique Fuchs
80e21560eb More UserLine, avatar fixes
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-11 14:57:22 +01:00
Dominique Fuchs
9c0221a0fa UserLine drafting, bugfixes, restuctures
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-10 16:28:53 +01:00
Roeland Jago Douma
05083e32c9 Ask for password on password protected link shares
Fixes #1485

This was missed when creating the new share dialog.
Now it pops up with a nice share password dialog to enter for your link
share.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-01-09 18:20:32 +01:00
JanDragon
4a64e8da83 Updated year in legalnotice.cpp 2020-01-06 09:08:22 +01:00
Dominique Fuchs
6ac1a4a353 Preps for UserLine submenu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-05 21:31:09 +01:00
Dominique Fuchs
330ff96ee2 Code cleanup regarding context menu. Pause/resume logic implemented. Halfway through remodeling account menu.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-05 21:06:42 +01:00
Dominique Fuchs
a90995cf15 Focus and popup improvements for macOS
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-05 16:25:32 +01:00
Dominique Fuchs
aa9921c6f5 Quit/settings button in tray menu, disable context menu, font size fixes
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-04 17:22:56 +01:00
Dominique Fuchs
d653618b0a Fix blurry caret svg due to https://bugreports.qt.io/browse/QTBUG-44863
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-04 12:18:06 +01:00
Dominique Fuchs
dc9744448c Fix wrong macro clause
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-04 12:15:01 +01:00
Dominique Fuchs
ed9c06583a Fix macOS popup y position, neglecting unneccesary calculations
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-04 12:08:30 +01:00
Dominique Fuchs
ff92adf3e0 Tray account menu wording/positioning
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-04 10:09:01 +01:00
Dominique Fuchs
e0641df727 First real activity connection
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 16:15:15 +01:00
Dominique Fuchs
f01c47e0ec Fix server adress retreival in tray window buttons
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 14:00:07 +01:00
Dominique Fuchs
faf46fcf60 More typo fix
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 13:42:07 +01:00
Dominique Fuchs
687a99279d Has function for ActivityModel, typos
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 13:39:10 +01:00
Dominique Fuchs
02cb43180c Fix git not recognizing case sensitive changes
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 13:12:04 +01:00
Dominique Fuchs
b32310b8a6 Gigantic ton of changes and deletions: ActivityListModel, tray GUI, Account logic.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-03 13:09:29 +01:00
Dominique Fuchs
556a1a5ef2 Added ActivityModel in new tray backend, implemented as delegate in UI
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-02 10:39:53 +01:00
Dominique Fuchs
36467c1e3a Added folder search for User instance, added open folder button connection
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-02 09:55:37 +01:00
Dominique Fuchs
d4b334636e Fall back to primary screen on QT version < 5.10 instead of icon position detection
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-02 08:56:07 +01:00
Dominique Fuchs
7653c5fa60 Fix merge conflict
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-01-02 08:43:34 +01:00
Dominique Fuchs
44bfc79caa Implemented platform agnostic tray window positioning logic
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-30 14:14:28 +01:00
Dominique Fuchs
6f8ffc0357 Backend code separation & structure cleanup
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-30 11:52:07 +01:00
Dominique Fuchs
bb45a5f67e Added popup show/hide logic
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-30 11:39:21 +01:00
XNG
314c00a8b7 apply http2 qt resend patch from owncloud
Signed-off-by: XNG <Milokita@users.noreply.github.com>
2019-12-25 13:59:15 +08:00
Michael Schuster
2b2810511d
KeychainChunk: Fix error handling in ReadJob::slotReadJobDone
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 12:17:43 +01:00
Michael Schuster
e07859fb3c Fix date in ActivityWidget and remove unnecessary string conversion
The local date and time value was converted into a string, just to be converted
into another string, to be converted to a value once again, returning zero as
the result. This caused the widget to always display "now".

Looks like this was a simply copy and paste mistake from this line in
ActivityListModel::slotActivitiesReceived:

a._dateTime = QDateTime::fromString(json.value("date").toString(), Qt::ISODate);

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 08:53:14 +01:00
Michael Schuster
9b034a2eb0 Heavy refactoring: Windows workaround for >= 4k (4096 bit) client-cert SSL keys and large certs
With QtKeychain on Windows, storing larger keys or certs in one keychain entry causes the
following error due to limits in the Windows APIs:
    Error: "Credential size exceeds maximum size of 2560"

This fix implements the new wrapper class KeychainChunk with wrapper jobs ReadJob and WriteJob
to encapsulate the QKeychain handling of ReadPasswordJob and WritePasswordJob with binaryData
but split every supplied keychain entry's data into 2048 byte chunks, on Windows only.

The wrapper is used for all keychain operations in WebFlowCredentials, except for the server password.

All finished keychain jobs now get deleted properly, to avoid memory leaks.

For reference also see previous fixes:
- https://github.com/nextcloud/desktop/pull/1389
- https://github.com/nextcloud/desktop/pull/1394

This should finally fix the re-opened issue:
- https://github.com/nextcloud/desktop/issues/863

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:47:35 +01:00
Michael Schuster
bd9652b24c Flow2AuthWidget: Minor fixes and improvements
- Improve status messages

- Add a counter to make sure that "Link copied to clipboard." is visible for
  three seconds and to not enable the buttons too early

- Add more space between buttons and status

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
8b5f09305c Flow2: Refactor UI into Flow2AuthWidget only and improve Flow2Auth
- Flow2AuthCredsPage:
  - Remove .ui file and embed Flow2AuthWidget into layout

- Flow2AuthWidget:
  - Make use generic for Flow2AuthCredsPage and WebFlowCredentialsDialog
  - Fix _errorLabel to render HTML tags instead of dumping them as plain text

- Flow2Auth:
  - Explicitly start auth with startAuth(account) instead of using constructor
  - Take control of copying the auth link to clipboard
  - Request a new auth link on copying, to avoid expiry invalidation
  - Use signals statusChanged() and result() to be more verbose (status, errors)
  - Change timer invocation and add safety bool's to avoid weird behaviour when
    the user triggers multiple link-copy calls (fetchNewToken)

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
6d033f2964 Add new HeaderBanner class for WebFlowCredentialsDialog
New widget on top of the layout, based on Qt's own modern wizard header banner.

This should improve the user's perception of the dialog.

Encapsulate the existing layout into a container layout to allow the banner taking
the full width of the dialog.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
0bcac1882a Make WebFlowCredentialsDialog cancellation- and deletion-safe
- Add new signal to let WebFlowCredentials know and emit asked() to also
  tell AccountState that the user won't authenticate, and triggering
  log-out state in the settings window.

- Use deleteLater() to safely delete WebFlowCredentialsDialog, so
  that Qt can free it at the right time and without crashes.
  Do the same with it's _webView and _flow2AuthWidget on closeEvent().

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
b6b04aeff8 WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) on error
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
a69aed80e6 Flow2: Make ProgressIndicator's background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
e81f972270 Flow2: Add poll status text, ProgressIndicator and countdown timer
Also enable / disable buttons during polling.

This aims to make the authentication status more transparent and should avoid the
impression that the client is perhaps doing nothing.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
542590db7c Small fixes and code cleanup
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
e04aae94bc Flow2: Poll for re-auth result upon WebFlowCredentialsDialog window activation
Since the default remote poll interval has been re-raised recently to 30 seconds,
the delay between clicking "Grant access" in the browser and fetch and showing success
in the dialog may seem erroneous to the users and tempt them to click "Re-open browser"
again, causing the whole login process to restart.

This commit implements an event handler to pass the dialog's window activation
event down to the Login Flow v2 widget, in order to allow it to poll earlier.

See previous commits for dependent implementation details.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
aa18667905 WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) upon showing SettingsDialog
Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden behind
the SettingsDialog, and the users have to minimize a lot of other windows to find them again.

See previous commit for dependent implementation details.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
addb27a085 Add helper slots and signals to catch SettingsDialog's window activation events
Signal the SettingsDialog's window activation event down to ownCloudGui and Application,
so that other classes can hook in to get notified when the SettingsDialog is being shown
again.

This approach has been chosen because we otherwise would have to deal with new instance
pointers of the current SettingsWindow - but Application is already there ;-)

Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden
behind the SettingsDialog, and the users have to minimize a lot of other windows to find
them again. This commit implements the preparation for the upcoming fix commit.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
be10d5200f Flow2: Use ownCloudGui::raiseDialog to bring account setup wizard to top (raise) on auth result
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
e8348612b4 Flow2: Poll for auth result upon account setup wizard window activation
Since the default remote poll interval has been re-raised recently to 30 seconds,
the delay between clicking "Grant access" in the browser and fetch and showing success
in the wizard may seem erroneous to the users and tempt them to click "Re-open browser"
again, causing the whole login process to restart.

This commit implements an event handler to pass the wizard's window activation
event down to the Login Flow v2 page, in order to allow it to poll earlier.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
3a160a4dce Flow2: Bring account setup wizard to top (raise) on auth result
Show and raise the wizard on success / error in the Login Flow v2 auth.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:46:57 +01:00
Michael Schuster
ccd20f0172 Fix issue #1237: White text on almost-white background
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:44:18 +01:00
Michael Schuster
c03bc8540c Fix folder opening in ActivityListModel
After fixing the crash in the previous commit, double-clicking on Activity list rows still didn't work.

This fix partly reverts commit 8546d53b05 in ActivityItemDelegate::PathRole
of ActivityListModel::data, but adds a new check for relPath's existence in line 74.

I'm assuming the previous change there has been done to shorten the code and avoid opening the user's home
folder upon clicking entries which file value is "App Password". The new path-check takes care of that too now.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:42:01 +01:00
Michael Schuster
003acb7254 Fix crash in ActivityListModel (fixes #1693)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:42:01 +01:00
Michael Schuster
b961b683d6 Show date and time in activity log (fixes issue #1683)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 07:40:42 +01:00
Michael Schuster
a7dade979c Fix build (missing refactoring)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
3a2caf61e5 Mac and high-dpi displays: Add workaround in ActivityItemDelegate to show full uncropped activity's actionText and timeText
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
b5ed16088a Make all ProgressIndicator's background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
e4a20b9e72 Make OwncloudWizard and its pages background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
37e5fe786f Remove unnecessary string translation and copy in ActivityItemDelegate
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
643995528b Remove unnecessary breaks in ActivityListModel
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
ecd17f2ea2 Make ActivityItemDelegate background- and selection-aware (Dark-/Light-Mode switching)
Also implement cached member icons in ActivityListModel and return their enums to
ActivityItemDelegate instead of always recreating them for each call to paint().

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
bf0bf2c1b6 Refactor ActivitySettings: Rename member variable ui to _ui
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
acedf362b6 Make AccountSettings and ActivitySettings background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
3b580eeca7 Change error link colour in AccountSettings::showConnectionLabel
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
6adfff1f13 Add new Theme helper method to custom-colourize links
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
7d542d7989 Change Dark Mode link colour
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-19 22:07:30 +01:00
Michael Schuster
cc21d175f1 Fix Activity List: Add check to avoid first empty entry
Add checks to ActivityListModel::combineActivityLists in order to avoid adding
empty Activity entries to the _finalList.

The previous implementation always added an empty entry to the top of the list because
_notificationIgnoredFiles was appended without checking (_listOfIgnoredFiles.size() > 0).

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-18 03:29:54 +01:00
Michael Schuster
b754eacd74 macOS: Rename 'Explorer' appropriately on non-Windows
- Rename it to 'Finder' on macOS.
- This way we also avoid having the whole string re-translated on Transifex.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
7ce8a6a201 Make the ShareDialog background-aware (Dark-/Light-Mode switching)
Use customizeStyle() to change link colours, icons and pixmaps in the ShareDialog and notify
it's widgets via slots.

TODO - known issue (macOS):
- The background and font colours in the ShareUserLine widget still stay the same.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
789a2a7ae3 Make SettingsDialog background-aware (Dark-/Light-Mode switching)
Use customizeStyle() to change link colours in the SettingsDialog and notify it's widgets via slots.

Also modify the background colour of the errors messages in AccountSettings::showConnectionLabel
to always use an appropiate colour for it's custom-defined background.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
be4fc6b887 Implement and move some colour-aware helper methods into the Theme class
This introduces a new method to change the colours in the links in QLabel's.
Utilizes a custom crafted RegEx function to replace already-coloured links.

Moved code is based on stuff from the SettingsDialog class.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
2dae31486a Pick from upstream: Fix too low contrast when tab is selected
The low contrast is also a problem with the Dark Mode on macOS.

For reference please see:
- Commit: 413ef5e96d
- Issue: https://github.com/owncloud/client/issues/7512

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
71f66c6229 Fix SSL-button's info background color for Dark Mode
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Michael Schuster
b4f926ded7 Remove submodule qtmacgoodies and the MacSettingsDialog class
Reverts back to the SettingsDialog class because of bugs and glitches with
more recent Qt versions (Qt 5.12) and with the macOS Dark Mode.

See upstream: https://github.com/owncloud/client/pull/7492

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:37:21 +01:00
Dominique Fuchs
438a445353 Merge remote-tracking branch 'origin/master' into qml-tray-menu 2019-12-09 06:52:52 +01:00
Dominique Fuchs
6a04fe8ab6 Remove init.qml from CMakeLists and resource file
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-09 06:43:20 +01:00
Dominique Fuchs
c45d2212a5 Removal of init.qml plus minor fixes
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-08 20:18:03 +01:00
Dominique Fuchs
66bfccc738 Replaced .engine() by pointer access b/c of backward compatibility
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-08 13:18:46 +01:00
Dominique Fuchs
ae7eddf7c9 Fixed inconsistent module import versions (based on Qt 5.9)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-08 11:32:22 +01:00
Michael Schuster
5869b93acb Fix deleteKeychainEntries: Stay consistent with job->setInsecureFallback(false)
We never fall back to the insecure variant in the whole codebase, so don't do it here.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
b15eb27aa9 Fix Windows key-chunk deletion (too paranoid)
Clear the key chunk buffer, but don't set _clientSslKeyChunkCount to zero because we need it later for deleteKeychainEntries

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
336b64a569 Fix member variable name from last refactoring (Windows code)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
6a49e787bb Fix Remote Wipe keychain storage
In certain cases don't write the app password in Account::writeAppPasswordOnce:
- id() is empty: This always happend once the Account Wizard showed the folder selection
- appPassword is empty: Caused by Logout -> Relaunch, preventing remote wipe on relaunch

Implement some logging to ease debugging in the future.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
0c5f4a1525 Remote Wipe: Implement hack to allow deleting all keychain entries (SSL certs & keys)
Client SSL certificates and keys cannot be deleted at this time because there is
no UI for selecting them on re-login.

We introduce this dirty hack here, to allow deleting them upon Remote Wipe.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
6ef9f3cc26 Refactoring: Windows workaround for >= 4k (4096 bit) client-cert SSL keys
WebFlowCredentials:
- Remove _clientSslCaKeyWriteQueue and simply use _clientSslKeyChunkBufferPEM
- Store key's sub-chunks in slots with "." (dot) suffix
- Implement deletion of the key chunks in WebFlowCredentials::deleteKeychainEntries
- Remove spaces in log messages
- Improve code readability

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
72be80cbd9 Windows: Workaround for storing >= 4k (4096 bit) client-cert SSL keys
With QtKeychain on Windows, storing larger keys in one keychain entry causes the
following error due to limits in the Windows APIs:
  Error: "Credential size exceeds maximum size of 2560"

To avoid overhead on the other platforms and balance code duplication, this
approach puts some read- and write-parts into Windows-only defines.

For reference also see previous fixes:
- https://github.com/nextcloud/desktop/pull/1389
- https://github.com/nextcloud/desktop/pull/1394

This (again) fixes the re-opened issue:
- https://github.com/nextcloud/desktop/issues/863

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 02:47:22 +01:00
Michael Schuster
877fd7abb9 Fall back to old login flow on GS as this is not yet ready (#2: re-auth)
This commit ensures that the check also occurs on re-authorization in case
the user gets logged out.

See: https://github.com/nextcloud/desktop/pull/1644

Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-06 21:03:01 +01:00
Roeland Jago Douma
363e62f8fa Fall back to old login flow on GS as this is not yet ready
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-06 21:03:01 +01:00
David Kahles
9a3aa55b29 Compare QDateTime objects more efficient
There is no need to call toMSecsSinceEpoch() as QDateTime implements an
comparison operator itself. This is more efficient, because the
QDateTime comparison operator doesn't call localtime() in all cases. Thus, we
don't read /etc/localtime for every comparison. This improves
performance in some cases.

Signed-off-by: David Kahles <david.kahles96@gmail.com>
2019-12-06 16:17:53 +01:00
Dominique Fuchs
ab9897b397 Added frontend invokation to open local folder
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-06 14:50:34 +01:00
Dominique Fuchs
c18611d4af Finished account switch back- and frontend in tray menuwindow
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-05 11:38:29 +01:00
Dominique Fuchs
5eff8608fe Account swtich logic and UI updates
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-05 08:21:19 +01:00
Dominique Fuchs
3a4ca5e190 Working on account switching
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-04 16:19:42 +01:00
Dominique Fuchs
d1d1f9bb58 Connected AccountWizard with new account action in tray menu, minor fixes
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-04 14:19:23 +01:00
Dominique Fuchs
90ace3fedc Minor preps for c++ ActivityListModel impl. in QML
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-04 13:10:28 +01:00
Dominique Fuchs
4e0997dbdf Minor fixes and enhancements
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-04 08:06:56 +01:00
Dominique Fuchs
57084fbd3e WIP: working UserModel.cpp and account menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-03 22:15:25 +01:00
Dominique Fuchs
4478399282 More stuff regarding tray/UserModel.cpp
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-03 18:50:34 +01:00
Dominique Fuchs
53abf5a316 WIP: Building User/MenuModel backend for tray menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-12-03 17:25:11 +01:00
Joas Schilling
9ce2491d67 Use … instead of 3 dots
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-03 09:06:06 +01:00