1
0
Fork 0
Commit Graph

14 Commits

Author SHA1 Message Date
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
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
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
Olivier Goffart a831164d65 Revert "Revert "Discovery: consider also the "shared by me" as shared""
This reverts commit efa7821dd2.

This reverts the revert, but also add a check that the server version
is bigger than 10.0

Issue #4788
2017-07-25 12:11:33 +02:00
Christian Kamm c8d0f788e0 Apply clang-format 2017-05-17 12:26:27 +02:00
Jocelyn Turcotte 4ad190a558 Use Qt logging categories for logging
This gives more insight about the logs and allow setting fine-tuned
logging rules. The categories are set to only output Info by default
so this allows us to provide more concise logging while keeping the
ability to extract more information for a specific category when
developping or debugging customer issues.

Issue #5647
2017-05-11 17:22:59 +02:00
Christian Kamm db24f60ae3 License: Adjust license of GPLv2 source files to GPLv2+
See #5180
2016-10-25 11:06:54 +02:00
Jocelyn Turcotte b7ff4a76e8 Add TestSyncEngine and TestSyncFileStatusTracker auto tests
To be able to test the SyncEngine efficiently, a set of server
mocking classes have been implemented on top of QNetworkAccessManager.

The local disk side hasn't been mocked since this would require adding
a large abstraction layer in csync. The SyncEngine is instead pointed
to a different temporary dir in each test and we test by interacting
with files in this directory instead.

The FakeFolder object wraps the SyncEngine with those abstractions
and allow controlling the local files, and the fake remote state
through the FileModifier interface, using a FileInfo tree structure
for the remote-side implementation as well as feeding and comparing
the states on both side in tests.

Tests run fast and require no setup to be run, but each server feature
that we want to test on the client side needs to be implemented in
this fake objects library. For example, the OC-FileId header isn't
set as of this commit, and we can't test the file move logic properly
without implementing it first.

The TestSyncFileStatusTracker tests already contain a few QEXPECT_FAIL
for what I esteem being issues that need to be fixed in order to catch
up on our test coverage without making this patch too huge.
2016-08-17 15:39:30 +02:00
Klaas Freitag 15988c6fda SocketAPI: Use NOP only, not NONE in the share api protocol.
Otherwise, plugins might brake, as the linux one did.
2016-04-12 18:28:27 +02:00
Jocelyn Turcotte 82190eaa81 Refactor the overlay icon logic to show errors as a warning for parent folders #3634
This also remove all smartness from the SocketApi about the status
of a file and solely use info from the current and last sync.
This simplifies the logic a lot and prevents any discrepancy between
the status shown in the activity log and the one displayed on the
overlay icon of a file.

The main benefit of the additional simplicity is that we are able
to push all new status of a file reliably (including warnings for
parent folders) to properly update the icon on overlay implementations
that don't allow us invalidating the status cache, like on OS X.

Both errors and warning from the last sync are now kept in a set,
which is used to also affect parent folders of an error.

To make sure that errors don't become warning icons on a second
sync, SyncFileItem::_hasBlacklistEntry is also interpreted as an error.
This also renames StatusIgnore to StatusWarning to match this semantic.

SyncEngine::aboutToPropagate is used in favor of SyncEngine::syncItemDiscovered
since the latter is emitted before file permission warnings are set on the
SyncFileItem. SyncEngine::finished is not used since we have all the
needed information in SyncEngine::itemCompleted.
2016-03-28 14:29:48 +02:00
Jocelyn Turcotte 69aa39f1f6 Don's use SyncFileStatus for Folder::createGuiLog
SyncFileStatus' purpose is to track overlay icon status.
Instead of putting comments and default: clauses in switch
on both sides about unused enums, use different enums.

This also remove STATUS_NEW which is the equivalent of
STATUS_SYNC in all shell extension implementations, and
remove STATUS_UPDATED and STATUS_STAT_ERROR which have
the same semantic as STATUS_UPTODATE and STATUS__ERROR.
2016-03-28 14:29:47 +02:00
Jocelyn Turcotte 62df938465 Rename SyncFileStatus::STATUS_SYNC to STATUS_UPTODATE
Also use STATUS_UPDATED instead to match SyncFileItem::Success in the SocketAPI.
2016-01-05 15:41:15 +01:00
Daniel Molkentin ae85aa33fd Adjust namespaces 2014-11-09 22:34:07 +01:00
Daniel Molkentin df3c3bca02 Split into three separate projects: library, gui and cmd 2014-07-11 11:07:31 +02:00