Commit Graph

36 Commits

Author SHA1 Message Date
Martchus 0ef3b80447 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:29:49 +02:00
Martchus 1acfb8c896 Consider directories still out-of-sync if there are pull errors
Syncthing can report an "idle" status despite pull errors. This still means
the directory is out-of-sync. With this change the out-of-sync status is
only cleared when reading a "FolderSummary" event without pull errors (or
temporarily if the directory is e.g. scanning).
2021-07-01 17:40:23 +02:00
Martchus fdc73bed60 Query only one event at the beginning (to find the ID of the latest event)
Syncthing's official web UI also does the first query for events like this.
This should make loading times a bit faster and removes the possibility of
picking-up obsolete events (which was always problematic).
2021-07-01 17:37:47 +02:00
Martchus 986959c8b2 Avoid reading reply data if the reply isn't open
This might be the case when the request has been aborted. Reading from the
reply in this case would result in an unwanted log message from Qt.
2021-06-04 16:26:09 +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 fbb7685f4b Fix warnings about detatching Qt container via for loop 2021-05-18 00:08:21 +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 46099abc0c Assign empty completion when receiving 404 response 2021-04-07 19:55:47 +02:00
Martchus 9ae7f4a265 Avoid requesting completion for paused devs/dirs after remote index changed 2021-04-07 19:53:16 +02:00
Martchus a5f629d710 Avoid crash when start time can not be parsed 2021-04-07 19:42:07 +02:00
Martchus f75966aadc Fix warnings 2021-03-20 22:39:40 +01:00
Martchus 851edeaafc Never consider the own device as paused 2021-02-12 19:44:27 +01:00
Martchus 1cfd067abd Do not accept "lastSeen" timestamps older or equal to the UNIX epoch
The UNIX epoch seems to be the "null-value" provided by Syncthing's API
when there's no "lastSeen" timestamp, e.g. when it is the own device.
2021-02-12 17:55:38 +01:00
Martchus bdf00a9889 Never consider the own device as paused 2021-02-12 12:51:18 +01:00
Martchus 395a3503d7 Apply clang-format 2020-03-05 19:17:55 +01:00
Martchus b8f19b5cc1 Improve code to avoid multiple completion requests 2020-03-02 18:20:48 +01:00
Martchus 28dc0bb825 Fix duplicated 'eventType == ' 2020-03-02 15:51:14 +01:00
Martchus 5227a7961e Use queued connection for "other replies"
so the handler is not called while looping through the
list of these replies to abort them. The handler must
not be called in that situation because it mutates the
list.
2020-03-01 23:40:27 +01:00
Martchus fb86ee7bf9 Avoid unnecessary completion queries
* Ensure the completion for the same dev/dir is not requested
  twice
* Prevent completion query if (no longer) polling for events
2020-03-01 23:06:02 +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 6026339c83 Show recent changes 2020-01-18 16:43:13 +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 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 d88df866d2 Adapt to c++utilities v5 2019-05-04 21:05:21 +02:00
Martchus e56c950100 Show overall statistics in plasmoid 2019-02-17 23:46:03 +01:00
Martchus 267cbd7dad Document SyncthingConnection::readDevRejected() 2018-12-26 01:14:19 +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 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 0ef2bf919a Remove duplicated status recalculation 2018-11-02 22:15:16 +01:00
Martchus 9817be858d Update stateChanged in readDirSummary() 2018-11-02 22:10:18 +01:00
Martchus 038cb130b7 Don't emit notifications for folder errors 2018-11-02 21:49:24 +01:00
Martchus 25ae9266a8 Discard obsolete folder errors
* Discard folder errors older than the last "sync" state
* Unfortunately we don't know the the time of the last
  sync from the beginning. To prevent showing obsolete
  errors in this state, discard all errors if the status
  changes to something other than "out-of-syn".
2018-11-02 21:47:27 +01:00
Martchus 32b2907e67 Split syncthingconnection.cpp
* Move methods for specific requests to its own file
2018-10-28 15:37:25 +01:00