Commit Graph

5521 Commits

Author SHA1 Message Date
Olivier Goffart
d7e77b7473 FolderMan::checkPathValidityForNewFolder: make sure to work when folder points to deleted folders
Note that we also needed to adjust the server url to contains the user name
in the folder wizard. (As checkPathValidityForNewFolder expect the user name)

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

Issue #6644
2018-07-16 16:33:38 +02:00
Olivier Goffart
916343d7c2 Wizard OAuth2 Page: add a context menu to copy the link
Relates to https://github.com/owncloud/enterprise/issues/2600
2018-07-16 12:55:31 +02:00
Olivier Goffart
c620683251 Wizard: show a message when the URL is invalid
Rather than let Qt show "Host not found"

Issue #6646
2018-07-16 10:06:44 +02:00
Olivier Goffart
90ec9a9735 Reconcile: When detecting a local move, keep the local mtime
https://github.com/owncloud/client/issues/6629#issuecomment-402450691
2018-07-05 16:31:16 +02:00
Christian Kamm
25cca051a9 Log: Adjust update/reconcile log verbosity
Not having these enabled by default is causing significant extra back
and forth with reporters since they must manually use --logdebug for the
log to be useful.
2018-07-05 14:09:35 +02:00
Markus Goetz
c7aca2d4a9 Introduce an about dialog
Every proper application has that!

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

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

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

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2018-07-04 17:26:56 +02:00
Olivier Goffart
347d35ae5d OAuth: Remove the timeout
There is no real reason to have a timeout. The connection can stay open
as long as we are not authenticated. The User can still re-open a browser
from the UI at any time.

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

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

It would have been possible to change this just for Windows but as
written earlier this has caused lots of issues and thus I think it's
a good idea to just stay consistent accross platforms when touching it.
2018-06-20 11:23:16 +02:00
Olivier Goffart
850dc67a25 Wizard + OAuth: Make opening a new browser after clicking back works again
Issue #6574

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

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

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
2018-06-19 15:12:29 +02:00
Olivier Goffart
ae80317a74 Updater: Fix beta channel for translated clients.
The names in the combobox are being translated, so we need to rely
on the index rather than the text.
2018-06-19 12:56:31 +02:00
Christian Kamm
a0d6139505 fixup: remove outdated Qt5.5 workaround code 2018-06-19 12:47:23 +02:00
Christian Kamm
8b1d9799a3 fixup: use initializer for contextMenuVisibleManual 2018-06-19 12:47:23 +02:00
Christian Kamm
ca033b9685 fixup: make logging "info" 2018-06-19 12:47:23 +02:00
Christian Kamm
99116acdca Tray workarounds #6545
* Disentangle the previous 'qdbusWorkarounds' into three different
  things
* Make not trusting tray.isVisible() a new workaround
* Introduce env vars for all workaround flags
* Use the workaround flags for OSX
* Determine workaround flags for KDE when the plasma integration plugin
  is missing
2018-06-19 12:47:23 +02:00
Markus Goetz
92219c5bf7 SettingsDialogMac: Show the page for the newly created account 2018-06-19 09:47:07 +02:00
Olivier Goffart
de6b23c854 SettingsDialog: Show the page for the newly created account 2018-06-19 09:47:07 +02:00
Olivier Goffart
0062a28864 Theme: Put back the string as it was in 2.4, for branded clients.
Issue #6422
2018-06-14 12:59:02 +02:00
Olivier Goffart
4cc0539080 OAuth2: Try to refresh the token even if the credentials weren't ready.
This can happen when the client is started and the internet connection
was not enabled. Then we would fetch the credentials, but we would
no do the refresh token step (because network is down).
So next time we try to connect, we would also not refresh the token
because the credentials are not marked as 'ready'

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

To fix this, the finished signal also gets connected to the readyRead
slot.
2018-06-13 16:44:24 +02:00
Christian Kamm
9c66dbb2b7 Selective sync: Hide ui on disconnect #5809
The previous patch did forget about the big-folder-ui which should
also be hidden on disconnect.
2018-06-13 14:51:39 +02:00
Olivier Goffart
76bb76a59e FolderStatusModel: Fix crash when there is an error while expanding folders
In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

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

Regression introduced in commit d69936e0

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

Simplify the code by using QString instead.

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

TestDownload::testErrorMessage did not fail because the FakeErrorReply
did not emit readyRead and did not implement bytesAvailable.
2018-06-01 13:21:22 +02:00
Olivier Goffart
1753ce651b Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2018-05-30 11:57:57 +02:00
Christian Kamm
3a7a6b0b9e Virtual files: Wipe virtual after download completes, not before
Otherwise a interrupted or unsuccessful download would mean that the
download-intend was forgotten. The next sync would reestablish the
virtual file instead.
2018-05-30 11:50:14 +02:00
Olivier Goffart
d7792dc951 Rename SocketApi::FileData::accountRelativePath to serverRelativePath
As discussed in issue #6552
2018-05-30 10:51:44 +02:00
Olivier Goffart
1434fa5139 Share dialog: use the original name and not the virtual file name
When sharing a virtual file, we should actually use the original file name
not the virtual file name

Issue: #6461
2018-05-30 10:51:17 +02:00
Christian Kamm
252484e875 Virtual files: Only remove virtual file once on download
With thanks to @ogoffart for spotting the problem.
2018-05-30 10:39:49 +02:00
Olivier Goffart
7aded05f40 Fix compilation warning
propagateuploadng.cpp:500:10: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
2018-05-28 14:55:34 +02:00
Dominik Schmidt
13d0595296 Update libcrashreporter-qt to build it with msvc
(cherry picked from commit b9323bd191)
2018-05-25 15:36:54 +02:00
Christian Kamm
de77514671 AccountWizard: Reserve space for error label #6546 2018-05-25 08:44:03 +02:00
Markus Goetz
74e412c789 owncloudsynclog: 1 MB -> 10 MB #6420 2018-05-24 16:02:52 +02:00
Christian Kamm
5811c74f9c Settings migration: Preserve future settings where possible
See discussion in #6506
2018-05-24 12:18:44 +02:00