Commit Graph

130 Commits

Author SHA1 Message Date
Martchus 453c1d451f Hardcore print-debugging 2021-06-21 17:05:52 +02:00
Martchus 93f59ebf8a Apply clang-format 2021-05-27 18:16:56 +02:00
Martchus 7ad82c9dfe Emit time stamp parsing errors like other parsing errors 2021-05-21 22:34:42 +02:00
Martchus 62e7797558 Allow enabling logging of libsyncthingconnector at runtime
* Remove compile-time switches to enable logging
* Enable logging if certain environment variables are set
* Allow logging all API responses
2021-05-18 18:21:48 +02:00
Martchus 239f750028 Improve timestamp parsing/handling
* Use local time consistently for timestamps which might get displayed
  within the UI, e.g. the dir status was in one case set to the local time
  and in other cases GMT was used which could lead to discarding status
  updates
* Print warning when timestamp parsing fails (instead of ignoring it
  silently)
* Set directory status from folder status response even when parsing the
  timestamp fails
* Catch possible exception when printing log timestamps in syncthingctl
2021-05-18 00:08:21 +02:00
Martchus 31ad8b979c Do not request completion for paused directories
See https://github.com/Martchus/PKGBUILDs/issues/132
2021-04-07 15:12:28 +02:00
Martchus 851edeaafc Never consider the own device as paused 2021-02-12 19:44:27 +01:00
Martchus ed495ec667 Add UI to configure what information should be considered to compute overall status
* See https://github.com/Martchus/syncthingtray/issues/74
* See https://github.com/Martchus/syncthingtray/issues/76
2021-01-01 20:55:18 +01:00
Martchus da911c6350 Refactor overall status compution
* Allow configuring the information to consider for computing the overall
  status via SyncthingStatusComputionFlags
    * Add flag to allow considering the status of remote devices for
      https://github.com/Martchus/syncthingtray/issues/74
    * Show only plain "idle" status when no flags are present for
      https://github.com/Martchus/syncthingtray/issues/76
* Set the default flags to keep the default behavior as-is
2020-12-31 02:48:18 +01:00
Martchus 392eb70b12 Remove uses of SyncthingStatus::OutOfSync which is never actually set 2020-12-31 02:33:20 +01:00
Martchus f7c3ceaece Improve documentation of connector library 2020-12-31 02:30:05 +01:00
Martchus 41e0934cd8 Don't call recalculateStatus() in emitNotifications()
because notifications have nothing to do with the status and it should not
make a difference since the status would not change. The UI is supposed to
rely only on newNotification().
2020-12-31 02:28:11 +01:00
Martchus 64686caee6 Avoid detaching Qt container in SyncthingConnection::abortAllRequests()
* See https://doc.qt.io/qt-5/qtglobal.html#qAsConst
* Using std::as_const() instead of qAsConst() to keep support for Qt 5.6
2020-12-31 02:11:35 +01:00
Martchus 6010bf72c9 Stop auto-reconnect timer when disconnecting 2020-03-05 19:16:26 +01:00
Martchus 11834f89d4 Stop polling timers when reconnecting/disconnecting 2020-03-01 23:20:30 +01:00
Martchus bafdb22c47 Compute the sync state for remote devices
See https://github.com/Martchus/syncthingtray/issues/62
2020-03-01 22:04:30 +01:00
Martchus f9100bb0b4 Don't record file changes on dir level by default 2020-01-18 16:57:03 +01:00
Martchus 31e7e4e79e Support "Waiting to scan"
This state has been introduced
with https://github.com/syncthing/syncthing/pull/4888
2019-09-27 16:41:24 +02:00
Martchus 6243a4c2fd Prepare for "Prepare to Sync"
See https://github.com/syncthing/syncthing/pull/6028
2019-09-27 16:32:54 +02:00
Martchus bcb81e15b5 Apply clang-format 2019-07-26 22:02:11 +02:00
Martchus 7e46096feb Log directory/device list renewal when event logging enabled
This is useful for debugging to track (unnecessary) renewal of those
lists.
2019-07-25 18:27:38 +02:00
Martchus dc7d9b815f Adapt to changes in c++utilities 2019-06-14 19:15:26 +02:00
Martchus 64473df5ba Adapt to changes in c++utilities 2019-06-10 22:48:26 +02:00
Martchus e56c950100 Show overall statistics in plasmoid 2019-02-17 23:46:03 +01:00
Martchus dc5f2d99e2 Fix SyncthingConnection::connectLater() 2019-02-06 17:35:21 +01:00
Martchus 1156721822 Ensure not to continue reconnecting while still aborting 2018-12-26 01:14:01 +01:00
Martchus 67723bfa27 Set status to disconnected on error due to insufficient config 2018-12-25 02:31:18 +01:00
Martchus c83df582b6 Fix subtile bugs on reconnect
* Ensure previous long polling requests for events are aborted
  before connecting again
* Ensure results from previous requests are always discarded
  after aborting to reconnect
2018-12-25 02:30:13 +01:00
Martchus ad42c24c96 Prevent reading QNetworkReply in error case when not bytes available 2018-12-24 17:35:10 +01:00
Martchus 4a42a3f0c0 Fix and refactor directory error handling
* Rely not only on the FolderErrors event
* Request pull errors when opening the dialog
* Use "pullErrors" from FolderSummary
* Move code for directory error dialog into
  its own class

This should fix that sometimes obsolete errors
were still displayed or actually present errors
missing.
2018-11-03 21:30:17 +01:00
Martchus dcbc19cf8c Adapt mocking to latest changes
* Cover all required requests so the connection can be
  established without errors
* Add more events to test error handling
* Fix definition of LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
  after syncthingconnection.cpp split
2018-11-03 20:44:11 +01:00
Martchus 2ee1bc0c63 Discard previous item errors also on connect()
Because errors might be gone now and should be repopulated
if not.
2018-10-28 16:03:18 +01:00
Martchus 25ace0eb17 Fix condition to set status to disconnected 2018-10-28 15:39:15 +01:00
Martchus 32b2907e67 Split syncthingconnection.cpp
* Move methods for specific requests to its own file
2018-10-28 15:37:25 +01:00
Martchus 4c4a1ebd47 Don't unset m_has... on disconnect 2018-10-25 18:25:59 +02:00
Martchus bb6825aa4c Use timeout of 0 on first event call 2018-10-25 18:24:31 +02:00
Martchus b9a65ef113 Remove redundant poll interval defaults 2018-10-25 18:23:37 +02:00
Martchus a024e36ffd Rework reply/connection handling in SyncthingConnection
* Improve consistency
* Ensure all relevant requests are have finished before
  setting status to connected
2018-10-25 00:59:13 +02:00
Martchus 703225b410 Fix/improve CLI tests
* Adapt to interleaved output previously enabled in SyncthingTestInstance
* Make it work when verbose output for debugging is enabled
* Show which status line didn't match in case of an failure
* Disable flaky rescan tests in release mode
2018-10-20 23:48:24 +02:00
Martchus 2e67e6b2de Use signals for logAvailable() and qrCodeAvailable() 2018-10-20 22:08:25 +02:00
Martchus 8a77cdf516 Pass callbacks for requestLog() and requestQrCode() by ref 2018-10-18 23:34:59 +02:00
Martchus e410991012 Allow logging all API calls 2018-10-14 22:48:52 +02:00
Martchus 0ee25c1ae2 Fix warnings about QJsonValue ref 2018-10-12 00:21:05 +02:00
Martchus 00e0b58c86 Allow logging POSTs 2018-10-12 00:20:15 +02:00
Martchus 00e83e721d Consider failure to request disk events fatal
Prevents endless polling for disk events in the error
case.
2018-10-10 22:05:48 +02:00
Martchus 87a10c5b33 Allow hiding Plasma applet in certain states
See https://github.com/Martchus/syncthingtray/issues/23
2018-10-10 17:48:48 +02:00
Martchus 73c44591d5 Consume disk events in SyncthingConnection
First step to:
* Show history of most recent file changes
* Notify about file changes
  (see https://github.com/Martchus/syncthingtray/issues/7)
2018-08-04 22:06:31 +02:00
Martchus 45ef2518e8 Apply clang-format 2018-08-04 15:47:43 +02:00
Martchus 39dd98354a Request Syncthing version 2018-07-30 23:00:40 +02:00
Martchus 3549a4cdef Compute overall statistics 2018-07-30 23:00:22 +02:00