Commit Graph
100 Commits
Author SHA1 Message Date
Olivier Goffart bb2f221edf Fix broken slot connection
The slot was renamed.
2013-12-09 19:19:49 +01:00
Olivier Goffart 89d1e2d924 When reconfiguring, we need to clear the _currentSyncFolder
Else, if we reconfigure when the folder is syncing, it may be impossible to
sync again.
This happens for example when changing the password when the folder is
syncing
2013-12-09 17:16:04 +01:00
Olivier Goffart e5edb8e2c7 Fix opening the explorer with a selected file on windows.
Should Fix #1249
2013-12-09 16:13:48 +01:00
Olivier Goffart fa9d9c9909 Maybe we need to destroy the decompress context before the request.
Possibly fix the issue #1229
2013-12-05 16:51:39 +01:00
Olivier Goffart 1f5c4bde14 Fix windows rename of temporary files 2013-12-03 16:10:44 +01:00
Olivier Goffart 09d850bfaa When the temporary file is the same size as the file we would download, just keep it
Don't download the file if the temporary file is complete.

else, we get error from server: Requested Range not satisfiable
2013-12-03 14:44:04 +01:00
Olivier Goffart de5161137f remove unneeded file 2013-12-03 13:11:41 +01:00
Olivier Goffart 58eb000163 Make the "details" manu entry work
Fix #1214
2013-11-29 11:18:59 +01:00
Olivier Goffart f5f56e45c0 Fix pausing one of the folder pauses all foder after it while restarting. 2013-11-29 10:57:34 +01:00
Olivier Goffart ef8fe11f5a Do not write the directory etag in the database in case of soft error
Else we won't retry next time as we think nothing has changed.
2013-11-28 10:01:30 +01:00
Olivier Goffart 30db533cea Stop iterating files when aborting. 2013-11-28 10:01:30 +01:00
Olivier Goffart 99eeaa0db5 no need to set twice the error string
done() is already taking care of that
2013-11-28 10:01:30 +01:00
Olivier Goffart 5c8b6ed902 Fix Remove -gzip from etag
Remove it from both "foo"-gzip  and "foo-gzip"

See issue #1195
2013-11-26 12:10:52 +01:00
Olivier Goffart fa0f773fcb Separate the case of file changing durng upload in the chunk or non chunk case.
If the file is changed between chunk, it is easy and we can just retry as the
file has not been changed on the server.
But if the file is changed after it has been updated on the server, we must still
update the database with the etag. (and possibly delete the partial file)

Relates to issue #1002
2013-11-25 19:16:54 +01:00
Olivier Goffart ca3d8ab193 Add one case of missing -gzip removal 2013-11-25 17:48:57 +01:00
Olivier Goffart 6b7da798b8 Remove -gzip from Etag
Fix #1195
2013-11-25 16:30:13 +01:00
Olivier Goffart 6f17131e3c Fix mutex usage in the journal
All public function must lock the mutex. And therefore none of the journal
function may call public function because the mutex is already locked.

So have a public commit that lock the mutex,  and a private  commitInternal
that assume the mutex is locked
2013-11-25 15:11:37 +01:00
Olivier Goffart ca3885de2a Fix some SQL error and warning
Such as:
 Error opening the db:  "Driver not loaded Driver not loaded"
or
 QSqlDatabasePrivate::removeDatabase: connection '...' is still in use, all queries will cease to wor

We need to clear the QSqlDatabase _db handle before calling removeDatabase.
And we also need to give a different name to different folder database, just to be sure
2013-11-25 15:07:58 +01:00
Olivier Goffart c15a1eedd1 Only update the db for ETAG if the etag has changed for directories 2013-11-15 13:53:18 +01:00
Olivier Goffart b610dd2754 Revert "Partial revert of "CMake: Remove cmake module""
That patch reverted the oposite of what it should have reverted :-)

This reverts commit b22ef9f8fa.
2013-11-15 10:20:12 +01:00
Olivier Goffart b3972a5ba8 Do not fetch the file id in the propagator with a HEAD
Normally, the fileid comes with the PUT or the GET.
If it did not comes with the PUT, it means the server do not support
fileid,  we should not query it with a useless HEAD.

Also, in case the fileid changes (which it should not)  update anyway
to the new fileid in the db
2013-11-15 10:18:19 +01:00
Olivier Goffart e8e27b61f6 Revert the changes that fetch the file id in the propagator.
We don't want to fetch the file id in the propagator.

Revert "Put item member variable to base class."
This reverts commit f7aa2aa348.

Revert "Add isValidFileId and getFileIdPropget methods."
This reverts commit ccd254abba.
2013-11-14 14:59:03 +01:00
Olivier Goffart 52e01b39d6 Adapt to csync 'md5'->'etag' change 2013-11-13 14:28:41 +01:00
Olivier Goffart f0a1ac4346 Fix syncing folder with nothing in it
Do the start after connecting, as the finish may be imediate if there
is nothing to do.
2013-10-31 12:11:56 +01:00
Olivier Goffart bdc39f9cc2 Allow folder that are prefix of another 2013-10-31 11:41:56 +01:00
Olivier Goffart d3ae2f42a7 Reset the proxy module property at every sync
This is required for the fix for #713
Since the module properties are shared in global variables shared by
every folders, removing another folder may clean the proxy settings.
So we need to restore them at every sync
2013-10-31 11:39:43 +01:00
Olivier Goffart df39ab0b2f Don't leak the system tray 2013-10-31 10:52:19 +01:00
Olivier Goffart 28833ee5ac Fix crash when removing folder while syncing.
We need to set _thread to 0 after destoying it
2013-10-31 10:51:45 +01:00
Olivier Goffart 5c67f39476 Ignore error 404 on DELETE
This may happen if we have stale entries in the database
2013-10-30 17:33:06 +01:00
Olivier Goffart fb47657b1f Make F6 in the account config sync the selected folder, for debugging purposes
Issue #409
2013-10-30 16:58:08 +01:00
Olivier Goffart 76d46af4b7 Revert "Implement a sync now button"
Actually, after discussion with the team, we decided this button is a bad idea

This reverts commit b56fcd8ebd.
2013-10-30 16:48:28 +01:00
Olivier Goffart b56fcd8ebd Implement a sync now button
The button is in the account config, next to the "pause/resume" button

Fixes #409
2013-10-30 16:27:00 +01:00
Olivier Goffart e38d6d974b Replace _Button* with _button
Identifiers starting with underscore and uppercase are reserved in C++.
2013-10-30 15:52:30 +01:00
Olivier Goffart 9500c5ffab Do not change the instruction anymore when we finish an item
The status is in the status.  Keep the original instruction so the
UI knows what to display for eath item
2013-10-30 10:46:05 +01:00
Olivier Goffart b079cedbf5 Use the status instead of the instruction for finished items 2013-10-30 10:44:41 +01:00
Olivier Goffart 6e088e28f5 Adjust the mtime in case of fake conflicts
"Fake conflicts" happen when the etag changes on the server, and the
mtime changes on the client,  but the actual file is still exactly
the same.  We correctly detect them as false conflict and we do not
generate the conflict file for them.
But we should also update the local mtime to the server mtime so future
sync don't get confused.
2013-10-29 12:23:51 +01:00
Olivier Goffart 01e2743bae Always download the conflicted files.
Conflicts have a direction==NONE. And they need to be downloaded, not uploaded
2013-10-29 12:13:30 +01:00
Olivier Goffart 75ffa787a6 emit the EndDownload progress at the right place.
It was put in rename instead of download
2013-10-29 12:13:30 +01:00
Olivier Goffart 4ad9f34807 Save the UPDATED files in the database
Those are files that were detected as "resolved conflict".
They should have been a conflict because they both were new, or both
had their local mtime or remote etag modified, but the size and mtime
is the same on the server.  This typically happen when the database is removed.
Nothing will be done for those file, but we still need to update the database.
2013-10-29 12:13:30 +01:00
Olivier Goffart adc47948a5 Add a comment explaining OwncloudPropagator::start 2013-10-28 17:00:27 +01:00
Olivier Goffart 6e886e28e9 Merge branch 'propagator-job'
Conflicts:
	src/mirall/owncloudpropagator.cpp
2013-10-28 16:26:25 +01:00
Olivier Goffart 84a40dcb59 Refactor the new propagator in jobs
This makes the code (IMHO) more easy to understand, and will allow
even more easy parallelism
2013-10-28 15:58:35 +01:00
Olivier Goffart 8e90782107 Make owncloudcmd display the debug output 2013-10-28 15:45:37 +01:00
Olivier Goffart 0efbfb10aa Fix MOVE of directory.
Remove the right entry from the database (i.e: the original file name)
Fetch the etags of the sub entries
2013-10-17 13:06:39 +02:00
Olivier Goffart cb8006b89f Fix comments of the propagation step.
Also, don't mark item as removed if the instruction is not REMOVE
2013-10-17 12:09:44 +02:00
Olivier Goffart 746b86a1dd Save the progress db once a chunk has been upload
Allow to resume when we cancel the sync
2013-10-16 16:47:24 +02:00
Olivier Goffart 313832de8d Put the progress database within the journal 2013-10-16 12:01:14 +02:00
Olivier Goffart 2c63f7a24d Merge branch '1.4'
Conflicts:
	VERSION.cmake
	src/mirall/application.cpp
	src/mirall/application.h
	src/mirall/csyncthread.cpp
	src/mirall/folder.cpp
	src/mirall/folder.h
	src/mirall/folderman.cpp
2013-10-15 17:00:53 +02:00
Olivier Goffart 10fba886dc Do not elide the progress text
It's size is computed so the text fit, there is no need to alide it.

Fixes #1094
2013-10-15 14:58:34 +02:00
Olivier Goffart 1fccb23442 Don't show desktop notification when the user don't want to
Fix #1093
2013-10-14 11:33:47 +02:00
Olivier Goffart 05fbfb520f Protect the sync database by a mutex since it is used by the thread 2013-10-04 21:05:46 +02:00
Olivier Goffart 7c6fcf688c Fix the fact that some success was reported as error 2013-10-04 15:55:59 +02:00
Olivier Goffart 127055dd70 Refactor a bit the error reporting from the propagator
Add different classes of error failures.
Fatal error means the sync should be stopped.
SoftErrors are not to be displayed to the user.

We still need to make a classification of the errors.
2013-10-04 15:55:59 +02:00
Olivier Goffart 8ed2588cdf Fix build with Qt5 2013-10-03 23:14:10 +02:00
Olivier Goffart d8d2d36638 Fix SQL Query 2013-10-03 23:00:47 +02:00
Olivier Goffart afc13e70b9 fix Qt5 test compilation 2013-10-03 22:51:40 +02:00
Olivier Goffart baa9ba089c Save the database after each operation. 2013-10-03 22:41:12 +02:00
Olivier Goffart 3495b822a5 TMP 2013-10-03 20:01:07 +02:00
Olivier Goffart 21cd57228e Fix build with Qt5
Missing SQL module
2013-10-03 16:29:47 +02:00
Olivier Goffart 7ea3fc1533 Fix compilation of the test 2013-10-03 14:45:00 +02:00
Olivier Goffart 396ec4f888 Fix race condition in the logger.
Logs can come from multiple thread, we need to keep the _logstream
protected by a mutex
2013-10-03 14:37:13 +02:00
Olivier Goffart 79ea7c3eed Abort the sync asynchroniously
Don't block the GUI when clicking on pause

Mirall issue #968
2013-10-03 14:36:32 +02:00
Olivier Goffart b18810f381 Implement abort with the new propagator
abort was implemented in csync after the new propagator was written,
so it was not working with the new propagator
2013-10-03 14:35:56 +02:00
Olivier Goffart 47f299f0ee Send the last known etag to the server in a If-Match header
That way we avoid race conditions in case the file changed between the
update and the reconcile
2013-10-02 15:57:49 +02:00
Olivier Goffart d135aab86c clear the etag in every cases, not only when we upload files 2013-10-02 15:57:49 +02:00
Olivier Goffart e2a2b882bb Remove the unused errorDetails
It was not displayed to the user. Only use errorString instead.

Also report neon error to the user
2013-10-02 15:57:49 +02:00
Olivier Goffart 927f7549d4 Revert "Compile (find httpbf)"
This reverts commit 2d2e843804.

Turns out i had an old build of csync
2013-09-11 09:00:27 +02:00
Olivier Goffart 177114f8d9 Initialize the size of the SyncItem 2013-09-11 08:49:09 +02:00
Olivier Goffart 6bfdfd1af0 Fix progress with new propagator 2013-09-11 08:42:29 +02:00
Olivier Goffart 2d2e843804 Compile (find httpbf) 2013-09-11 08:11:03 +02:00
Olivier Goffart 013b87f9c5 ignore the progress database 2013-09-09 15:18:28 +02:00
Olivier Goffart 6da2f6bbaa Qt5: QSettings is no longer case insensitive 2013-09-09 14:00:13 +02:00
Olivier Goffart 198cb43ad6 Qt5: Q_WS_* macro were deprecated, replace by QT_OS_*
in particular, QT_WS_X11 is no longer defined
2013-09-09 13:31:39 +02:00
Olivier Goffart 02b3033ca3 Use the same convention as on the server to format strings
* use power of 10 SI units
 * use "B" instead of "bytes"
 * use at least 2 significant digit, but no more than one digit after
   the period
2013-08-29 12:06:41 +02:00
Olivier Goffart a27c8ad90c Fix crash in case of error
the QObject::parent() is 0
2013-08-28 21:26:42 +02:00
Olivier Goffart bf6d0a521c Compile with Qt5 2013-08-28 20:58:22 +02:00
Olivier Goffart 336bbb2403 Compile with Qt4 2013-08-28 20:14:40 +02:00
Olivier Goffart c15de69156 Reconfigure the proxy when needed 2013-08-27 10:02:59 +02:00
Olivier Goffart c3326efe94 Do not sort the entries in the syc protocol dialog alphabetically
The entries should be sorted chronogically.  But now the QTreeWidget can
only sort them alphabetically by the time,  which is not what we want.
Disalbe the sorting, and always insert the elements in the reverse
order.

Fix #890
2013-08-26 17:27:44 +02:00
Olivier Goffart e78eab46ff Fix saving the geometry of the log browser 2013-08-23 12:41:29 +02:00
Olivier Goffart 19a08f8d5e Make remember the size of the settings dialog
Before, we saved the geometry in the closeEvent which is only called if
the user press the [x] in the title bar.  But it is not called when the
user accept the dialog (by pressing the close button or the enter key)
So save the geometry in the destructor of the dialog instead.

One also must call delete from the Application destructor because it was
leaking
2013-08-23 12:25:16 +02:00
Olivier Goffart c6319117fd Better default size for the setting dialog 2013-08-23 11:59:49 +02:00
Olivier Goffart 4c10ed4ada Remove some entries from the default exclude list.
If the user really want to have those entries excluded it can add them
manually.
But one cannot change the default so if user want the .bak files synced,
he would not be able to do it
2013-08-23 11:17:02 +02:00
Olivier Goffart d3a333e03c Fix the 'copy button' in the protocol log
Fix #863

Also added more padding for the filename because it might be big, and in
case it's not enough, always add at least a space.
2013-08-22 16:20:04 +02:00
Olivier Goffart 04d3e282fb Stop the poll timer when the folder is disabled
No need to request etag every 30 second for disabled folder.

When the folder is re-enabled, the Timer is actived again after the sync
2013-08-22 12:35:28 +02:00
Olivier Goffart 4be5f970d5 Default to no limit upload
We don't want to make the transfer slow by default
2013-08-22 12:26:34 +02:00
Olivier Goffart 3c2bb1e2bc Compile after the merge 2013-08-21 15:29:04 +02:00
Olivier Goffart 24af9f38f4 Merge branch 'csync_lgpl' into propagator-ng
Conflicts:
	src/mirall/csyncthread.cpp
	src/mirall/csyncthread.h
	src/mirall/folder.cpp
	src/mirall/progressdispatcher.h
	src/mirall/syncfileitem.h
2013-08-21 13:19:02 +02:00
Olivier Goffart b4c116e2a2 Add the new directories comming from the sync in the watcher 2013-08-21 00:45:36 +02:00
Olivier Goffart 29d2094626 Hide password in the account settings
Fix #811
2013-08-19 13:42:01 +02:00
Olivier Goffart 1a7c89326b Fix crash when finishing the wizard
As shown on this backtrace:

=13334== Invalid read of size 8
QCoreApplication::postEvent(QObject*,QEvent*, int)
Mirall::ownCloudInfo::slotReplyFinished()
[...]

==13334==  Address 0x1afb91d8 is 8 bytes inside a block of size 16 free'd
operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
QNetworkAccessManager::~QNetworkAccessManager()
Mirall::MirallAccessManager::~MirallAccessManager()
[...]
Mirall::ownCloudInfo::setNetworkAccessManager(QNetworkAccessManager*)
Mirall::ownCloudInfo::setCustomConfigHandle(QString const&)
Mirall::OwncloudSetupWizard::slotAssistantFinished(int)
[...]
Mirall::OwncloudWizard::basicSetupFinished(int)
Mirall::OwncloudWizard::slotCurrentPageChanged(int)
[...]
QWizard::currentIdChanged(int) (in
Mirall::OwncloudWizard::successfulStep()
Mirall::OwncloudSetupWizard::finalizeSetup(bool)
Mirall::OwncloudSetupWizard::slotAuthCheckReply(QString const&,
[...]
Mirall::ownCloudInfo::ownCloudDirExists(QString const&, QNetworkReply*)
Mirall::ownCloudInfo::slotReplyFinished()

The QNetworkManager was destroyed in a slot connected to a signal emited
by slotReplyFinished,  but we did not finish with the QNetworkReply yet.

Fix the crash by using QueuedConnection so the QNetworkAccessManager is
not destroyed before slotReplyFinished has completed.
2013-08-19 12:43:52 +02:00
Olivier Goffart 22de23c651 Fix the 'no limit' upload setting
Fix issue #879
2013-08-17 16:11:45 +02:00
Olivier Goffart 23926d2461 small leak 2013-08-16 20:18:35 +02:00
Olivier Goffart c03f31b6ba put the 'Account' item first 2013-08-16 15:09:54 +02:00
Olivier Goffart a1060a8538 fixup the layout of the account settings 2013-08-16 15:03:38 +02:00
Olivier Goffart c4084de716 Remove the 'Remove Account' button
It is not doing anything right now, and we have no plans to implement it
in a short future

Fix Issue #866
2013-08-15 16:42:08 +02:00
Olivier Goffart 3c667918e7 Fix Reconfiguration keeps sync folder definition
Issue #875
2013-08-15 16:35:03 +02:00
Olivier Goffart e55745cbcf Remove connection from unexisting signal to unexisting slot 2013-08-15 16:16:22 +02:00
Olivier Goffart dce8cb83d9 Do not forget the config on the second page of the wizzard
Fixes mirral issue #874 where certificate was not stored on the first
page
2013-08-15 15:45:16 +02:00
Olivier Goffart 8dc956c55b Put all the debug in the log window
Don't emit debug before we installed the hook and created he log window
Also no debug if we use --help
2013-08-15 15:45:16 +02:00