Commit Graph

21 Commits

Author SHA1 Message Date
John Veness c2a0eee029 Change Directory to Folder in user-facing strings 2023-09-17 19:33:31 +01:00
Martchus f5795d45c2 Show this/own device always as first device
See https://github.com/Martchus/syncthingtray/issues/203
2023-09-16 23:07:00 +02:00
Martchus 5fa69e4f5a Rename `SyncthingDevStatus::OwnDevice` in accordance with UI change 2023-09-16 22:28:35 +02:00
Martchus 669923dbb6 Ensure redirects to HTTPS are enabled/allowed regardless of the Qt version
Technically, this is not completely true because it is not supported on Qt
versions older than 5.9.
2023-09-04 20:33:32 +02:00
Martchus bd924330ad Remove identical branches
GCC warns about this so let's just remove this leftover.
2023-09-04 20:20:51 +02:00
Martchus 25c8d3f69a Use consistent/new coding style in `readDirEvent` as well 2023-09-01 23:34:26 +02:00
Martchus 92b305aa89 Store the disconnect reason in the device info 2023-09-01 23:33:50 +02:00
Martchus 3696869a99 Remove useless and possibly problematic code when handling device events 2023-09-01 23:25:06 +02:00
Martchus ae319f604b Fix reading device events
* Fix logic error that prevented the `devStatusChanged()` event
  from being emitted when a device has connected
* Fix reading device ID from event data
2023-09-01 23:21:01 +02:00
Martchus 7e651be694 Fix compilation against Qt < 5.15 for Leap 15.3 builds 2023-07-11 11:55:39 +02:00
Martchus faeefba03f Do not apply transfer timeout to long-polling requests
This leads to "disconnects" from Syncthing otherwise.
2023-07-04 19:26:48 +02:00
Martchus ac07982596 Allow setting transfer timeout for network requests of SyncthingConnection 2023-07-04 18:39:14 +02:00
Martchus 42a0d9c9f7 Show the connection type of a device 2023-05-11 23:44:10 +02:00
Martchus ae6b8712cb Re-connect if Syncthing appears to be restarted
* This is now required after 843f164d which uses event IDs
  instead of time stamps and event IDs reset when Syncthing has
  been restarted.
* It is likely a good idea to cleanly re-connect anyways.
* This change re-introduces the previously uneffective and hence
  removed code (see 8c74b240). It fixes the code to effectively
  make sure a re-connect is continued once it has been started.
  So this change should fix the re-connect not working in
  certain cases.
2023-04-15 22:51:55 +02:00
Martchus c6a5b40a1d Re-connect when event ID is decreasing 2023-04-15 22:25:12 +02:00
Martchus 8c74b24045 Remove uneffective code when handling reply
Calling `handleAdditionalRequestCanceled();` when `handleAborting`
is true is useless because then also `m_abortingAllRequests` is true
and therefore `handleAdditionalRequestCanceled();` always returns
early doing nothing.
2023-04-15 22:02:43 +02:00
Martchus fc8ab2e845 Improve coding style
Improve coding style, mainly in SynctingConnection, for better
consistency with more recently added code.
2023-04-15 20:28:51 +02:00
Martchus d3901cee37 Don't reset last event IDs when connecting again
When connecting again, no data is cleared. Since we now keep
track of event IDs and not just timestamps it makes sense to not
forget what the last event IDs were. To still run into the
"limit" case the flags for having events at all can be used
(which is also reset on just `connect()`).
2023-04-15 20:08:21 +02:00
Martchus 843f164df1 Avoid potentially losing events
I have observed that Syncthing Tray can get stuck thinking a remote device
still needs data. Likely the update got lost. The code contains certain
conditions in which folder completion events and requesting completion are
supressed. Those conditions are based on timestamps. That is not ideal as
the accuracy is only one second (so different timestamps might be
considered equal as they are rounded to be the same). Additionally, it
makes no sense to assume a timestamp upon receiving a response as the
information might be older than the time it was received.

This change avoids those conditions. It rather uses the event ID to
decide what event/reply is newer.

This change also uses quint64 instead of int for event IDs to avoid running
into an overflow (or rather conversion error) when deserializing the ID
which might be bigger than int. (Not sure how big the ID can become; this
is to be on the safe side.)
2023-04-15 16:18:23 +02:00
Martchus db657bb1aa Use QByteArrayLiteral for such literals 2023-03-28 17:20:59 +02:00
Martchus 96e92f13a3 Avoid relying on symlink for include directories
Symlinks aren't working very well with Git under Windows so better avoid
them.
2023-02-27 18:27:33 +01:00