1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-10-22 22:42:44 +02:00
Commit Graph

4562 Commits

Author SHA1 Message Date
Christian Kamm
3e1690ff7a Improvements to file recall 2016-09-14 15:42:19 +02:00
Olivier Goffart
6f1b03c560 SyncEngine: Fix renaming of folder when file are changed (#5195)
Two bugs:
 - The change filed are not considered as move, they are re-downloaded
   but the old file was not removed from the database. The change in
   owncloudpropagator.cpp takes care of removing the old entries.

 - Next sync would then remove the file in the server in the old folder
   This was not a problem until we start reusing the sync engine, and
   that the _renamedFolders map is not cleared. We were before deleting
   a non-existing file. But now we delete the actual file.

Also improve the tests to be able to do move on the server.
This include support for file id.

Issue #5192
(cherry picked from commit 85b8ab178e)
2016-09-22 09:05:09 +02:00
Olivier Goffart
a810d69daa ConnectionValidator: properly handle error in status.php (#5188)
We wwer enot connecting to the right signal from the check server
job, and therefore we were not catching the condition in which the
json was invalid. We would then never terminate the ConnectionValidator job.

Note that instanceNotFound is also emited if there is a network error.

The log looked like this:

10:25:51.247 OCC::CheckServerJob::finished: status.php from server is not valid JSON!
10:25:51.248 OCC::CheckServerJob::finished: status.php returns:  QMap()   QNetworkReply::NetworkError(NoError)  Reply:  QNetworkReplyHttpImpl(0x2b6a790)
10:25:51.248 OCC::CheckServerJob::finished: No proper answer on  QUrl("http://localhost/~owncloud/status.php")
10:26:23.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
10:26:55.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
[...]
(cherry picked from commit ff701bd473)
2016-09-21 14:30:36 +02:00
Olivier Goffart
b228488eb7 Revert "FolderWatcher: Act on relative paths #5116 (#5153)"
This is not sufficient as it is not working for the Socket API.
Next commit will fix it in another layer.

Also, not ignoring paths that are not inside the folder is wrong
as it might still happen if the name has a different casing

This reverts commit d5a481f132.

(cherry picked from commit 904cd46f75)
2016-09-15 16:26:25 +02:00
Markus Goetz
907918dca3 FolderWatcher: Act on relative paths #5116 (#5153)
(cherry picked from commit d5a481f132)
2016-09-12 14:09:13 +02:00
Christian Kamm
5ffaf3a90f Set discovery thread priority to low #5017
(cherry picked from commit bd7ec19644)
2016-09-12 14:09:13 +02:00
Olivier Goffart
1040e7b57b ExcludeFiles: Fix when the folder casing is not the same in the settings and in the FS
If the folder has different case in the settings and in the FS, we should
not ignore all the files. This is important for the files system watcher.

(cherry picked from commit 98268d102f)
2016-09-12 14:09:12 +02:00
Olivier Goffart
65c49e1de6 CleanupPollsJob: Fix possible leak
Missing deleteLater when the CleanupPollsJob aborts.
This is only a problem if the SyncEngine is kept alive a long time. Which is
usually not the case in the configuration where poll jobs are used.

(cherry picked from commit 3465024898)
2016-09-12 14:09:12 +02:00
Christian Kamm
4abaee7736 Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7

Also expand the test case to cover this.

(cherry picked from commit af9c4d0e2f)
2016-09-12 14:09:12 +02:00
Markus Goetz
3cdcd8dea0 Selective Sync: Fix request loop and show error in view (#5154)
I got into a situation where the model would endlessly request the directory
contents from the server because we did not notice yet that the server
is actually in maintenance mode while we were expanding the tree view when
changing the tab to the account or when just expanding it by clicking.
(cherry picked from commit 524220d090)
2016-09-12 14:09:12 +02:00
Christian Kamm
cb19ebc9e3 ShareLink: Ensure the password line edit is enabled #5117
(cherry picked from commit b541fea793)
2016-09-12 14:09:12 +02:00
Daniel Molkentin
37adaa7872 Update owner to be ownCloud GmbH
Fixes #5079

(cherry picked from commit a83c5598e8)
2016-09-12 14:09:12 +02:00
Markus Goetz
fc868d89f3 Merge pull request #5108 from owncloud/limit_library_path
Limit Qt and OpenSSL Library pathes to the install directory
2016-08-05 16:39:04 +02:00
Daniel Molkentin
5a57e4a7a6 Ensure OpenSSL config file is only read from app dir 2016-08-05 16:38:08 +02:00
Olivier Goffart
4a7f3cb486 SyncEngine: Fix detection of backup (#5104)
Once upon a time, the SyncEngine was instantiated once per sync. But now that
the SyncEngine is kept between sync, we need to reset all these variable between
syncs.
2016-08-04 16:06:10 +02:00
Jocelyn Turcotte
b307f2b65c Revert "Fix a deadlock when shutting down during discovery" (#5100)
Reverts commit 622017adcf

Could be the cause of #5092 and the cost is higher than the benefit if this is the case.
A network request taking more than 30 seconds isn't something unlikely in this world
and shouldn't be a good reason to abort. We should try to untangle the threads
dependencies to properly fix this if possible instead.
2016-08-03 16:35:24 +02:00
Klaas Freitag
ebcec44202 ShibbolethView: Open a debug windows that shows cipher info. (#5080)
It opens a window and connects to a cipher test
page, showing the output from there, that helps for debugging.

The window is enabled by setting the environment variable
OWNCLOUD_SHIBBOLETH_DEBUG
2016-07-25 17:47:23 +02:00
Olivier Goffart
f3f387c36b Merge pull request #5016 from owncloud/overrideurl
AccountManager: Don't force the server URL while loading the config.
2016-07-12 14:33:28 +02:00
Olivier Goffart
b53ce78eb6 Merge pull request #5025 from ArthurChiao/bugfix_#5015
fix #5015 overlay icon not show: compare folder paths with no case-se…
2016-07-12 14:32:54 +02:00
ckamm
bc4753e938 Sharing: Fix bug with file names containing percent encodes #5042 (#5043) 2016-07-12 14:25:33 +02:00
arthurchiao
3335c733d7 be case insensitive for MacOSX, too 2016-07-08 15:53:11 +08:00
arthurchiao
4da55b69df ignore case-sensitivity only on windows 2016-07-08 15:12:37 +08:00
Daniel Molkentin
8a1a2eb5b3 Only accept notification API Capability if endpoint is OCS-enabled
Fixes #5033
2016-07-04 18:33:02 +02:00
arthurchiao
7a2a439426 fix #5015 overlay icon not show: compare folder paths with no case-sensitivity 2016-07-01 13:03:42 +08:00
Olivier Goffart
dff57362f9 AccountManager: Don't force the server URL while loading the config.
While loading the account, only override the server url if Theme::forceConfigAuthType
is set. This restore the behavior from the client 2.1 for theme that did not
use Theme::forceConfigAuthType.

Issue: owncloud/enterprise#1418
2016-06-28 14:32:03 +02:00
Jocelyn Turcotte
446e7cbd93 Fix a QAction leak (#5008)
Attach the accout menu QAction to the menu rather than the
ownCloudGui since it should be destroyed when the context
menu is cleared.
2016-06-27 16:22:51 +02:00
ckamm
b4d26ba952 Fix windows HiDPI #4994 (#4998)
This was removed in 0194ebb222
because it breaks on Linux. However, it looks like it is correct
for Windows. In the meantime the surrounding ifdef has changed
from !Q_OS_MAC to Q_OS_WIN, so reverting it makes sense.
2016-06-27 16:17:58 +02:00
Jocelyn Turcotte
622017adcf Fix a deadlock when shutting down during discovery (#4993)
Since the SyncEngine now quits and waits for the discovery thread,
the main thread can enter a deadlock where the discovery thread waits
for its directory result.

Add a 2 seconds timer to the discovery thread wait condition
to limit the deadlock time.
2016-06-27 16:12:39 +02:00
ckamm
86fd982b00 SocketAPI: Use different pipe name #4977 (#4997)
Named pipe names that contain backslashes sometimes lead to problems.
2016-06-27 15:13:08 +02:00
ckamm
bdb304f8ec Share: Permissions for federated shares on servers >=9.1 #4996 (#5001)
This disables the workaround 487e1fdca5ee04fc98c1ed77898df70d740967c8
for servers that are new enough to support fine grained permissions
on federated shares.

The consequence is that the 'reshare' permission is now granted by
default and that users can edit permissions on the usual fine-grained
level again.

The way the client deals with servers <9.1 is unchanged.
2016-06-27 11:09:51 +02:00
Christian Kamm
440a804836 Tray: Add minimal mode as workaround and testing tool #4985 #4990 2016-06-23 10:22:43 +02:00
Christian Kamm
7601783553 Fix Qt4 build 2016-06-22 15:47:33 +02:00
Christian Kamm
c0b0bd5b63 owncloudcmd: Fix --exclude regression
It's ok if the system exclude file is missing when --exclude is
specified explicitly.
2016-06-22 15:30:20 +02:00
Jocelyn Turcotte
5d71ad83ec Fix the Qt4 build
QSharedPointer::reset doesn't exist in Qt4.
2016-06-21 12:04:26 +02:00
Markus Goetz
ab24980001 Merge pull request #4979 from jturcotte/2.2
Memory improvements during propagation
2016-06-21 10:00:41 +02:00
ckamm
07dea72c37 Setup csync logging earlier (#4991)
We were missing some csync related log output during startup.

Discovered in #4967
2016-06-21 09:58:53 +02:00
ckamm
43a2aec92b Performance: Don't redundantly add the same exclude files #4967 (#4988)
Excludes: Don't redundantly add the same exclude files #4967, Never accept duplicate exclude patterns #4967
2016-06-20 15:14:13 +02:00
Jocelyn Turcotte
edfd75949d Reduce the memory usage of the StopWatch during propagation
Use a QMap to avoid using a full hashtable for only a few entries, and
clear the QMap once we're done with the measuring. This saves a few
hundred bytes per job during propagation that would otherwise only be
freed at the end of the sync.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
7fb134b4e0 Delete the ComputeChecksum object when the job is finished
Each object takes almost 1k and we don't need it once the propagation is
done.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
87e3553c85 Prevent the sync protocol widget from over-using memory
During propagation, we create a line for each file, taking memory, but
we delete all lines passed 2000 right at the beginning of the next sync.
Since the user has little chances of being able to read past those 2000
lines in the log, we might as well keep it capped at 2000 also during
propagation to prevent it from eating memory.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
6f3aaecb78 Fix a crash on if shutting down during propagation
The SyncRunFileLog owned by the Folder must be destroyed after the
SyncEngine since the SyncEngine will abort during destruction, resulting
in all jobs being aborted.

It's possible that this crash only happens with a debug build.
2016-06-17 19:20:52 +02:00
Jocelyn Turcotte
3342ebfcc5 SocketAPI: Push new status of dirty files regardless when not synced (#4970)
The FolderWatcher inserts files to be marked as SYNC and we
currently assume that all file statuses will be updated by the
following sync. It's however possible that the FolderWatcher
notify us of a change that csync won't consider necessary to
propagate, in which case a new status wouldn't be pushed and
the file manager would continue showing this file as syncing.

Re-push the file status when emptying the dirty files list
before propagating to avoid this issue, most likely the OK
status.
2016-06-16 15:27:10 +02:00
Olivier Goffart
b4900d60b7 Checksum speedup. (#4968)
No need to allocate (and initialize to 0) a 10 MiB buffer for each files, even
when most files are much smaller than that.
So make sure the buffer that we allocate is not bigger than the file size.
And Also 10 MiB is a bit big for a buffer. 500 KiB should be more than enough.
(Too big allocations can cause problem because of memory fragmentation and such)
2016-06-16 08:28:30 +02:00
Olivier Goffart
92309013da SyncEngine: make abort and closing more robust
We first need to set the abort flag to csync and then aborting the discovery
job, otherwise, the discovery thread could start a new job in the mean time.

We also need to make sure that the thread has existed before we destroy the
exclude list.
2016-06-16 08:26:33 +02:00
Jocelyn Turcotte
05d199881e Merge pull request #4971 from owncloud/fixAccountHandleSslErrorsCrash
Attempt to fix the Account::slotHandleSslErrors crash
2016-06-15 18:53:47 +02:00
Jocelyn Turcotte
147cf798a6 Attempt to fix the Account::slotHandleSslErrors crash
Events from the crash reporter suggest that the QNAM and its
child replies might get deleted before returning from this method
and the only possible cause we can see is that the inner event
loop has something to do with it.

Try keeping a ref on the QNAM while in this method to make sure
that it won't get deleted by the inner event loop.
2016-06-15 18:12:02 +02:00
Jocelyn Turcotte
d40c56eda5 Account: Use smart pointers to hold its credentials and QNAM objects
Also make sure that both use QObject::deleteLater as their delete
function.
2016-06-15 18:12:01 +02:00
Olivier Goffart
6dade0b114 PropagateUpload: fix crash in PUTFileJob::slotTimeout
Same fix as in commit 60c101d9

From the crash reporter:

Crash
EXCEPTION_ACCESS_VIOLATION_READ at 0x4
qnetworkreply.cpp in QNetworkReply::request at line 476
propagateupload.cpp in OCC::PUTFileJob::slotTimeout at line 100
moc_abstractnetworkjob.cpp in OCC::AbstractNetworkJob::qt_static_metacall at line 98
qobject.cpp in QMetaObject::activate at line 3716
moc_qtimer.cpp in QTimer::timeout at line 192
qtimer.cpp in QTimer::timerEvent at line 247
qobject.cpp in QObject::event at line 1267
qapplication.cpp in QApplicationPrivate::notify_helper at line 3722
qapplication.cpp in QApplication::notify at line 3505
qcoreapplication.cpp in QCoreApplication::notifyInternal at line 932
2016-06-15 14:32:25 +02:00
Jürgen Weigert
ebc44fa494 Update accountsettings.cpp 2016-06-07 14:21:50 +02:00
ckamm
355a8a0a27 Workaround for Ubuntu 16.04 tray issue #4944 (#4947) 2016-06-07 11:48:25 +02:00