Commit Graph

90 Commits

Author SHA1 Message Date
Lars Toenning
bcc4bdd31e Add SPDX identifiers for REUSE compliance
Co-authored-by: Mat Sutcliffe <oktal3700@gmail.com>
2023-10-03 09:29:49 +02:00
Lars Toenning
7ef0e6e1eb Fix cppcheck warnings 2023-04-18 16:07:19 +02:00
Lars Toenning
970b7c3650 clang-format src 2023-04-18 16:07:19 +02:00
Lars Toenning
c0efc9ea81 Clean up includes 2022-05-25 19:47:34 +01:00
Mat Sutcliffe
eb6b0ff289 Fix clang-tidy and clazy warnings 2021-08-29 17:02:27 +01:00
Mat Sutcliffe
33209fa1eb Use std::as_const (C++17 feature) 2021-07-13 17:56:31 +01:00
Mat Sutcliffe
63e8de8f00 Issue #77 getLogCategories returns a simple QStringList instead of our own class 2020-12-19 18:50:34 +00:00
Mat Sutcliffe
2dc86652c2 Issue #77 Include style 2020-08-28 00:45:26 +01:00
Mat Sutcliffe
670b1a1986 Fix cppcheck and compiler warnings 2020-06-29 18:34:16 +01:00
Mat Sutcliffe
e5528288b5 Lifetime management of value cache singletons
Hook in to the `destroyed` signal of the `qApp` to destroy the caches.
This ensures any associated workers are quit before application
terminates and kills all the threads.
2020-06-12 18:42:41 +01:00
Mat Sutcliffe
e8380173c9 Store CDataCacheSerializer as a pointer for correct lifetime management 2020-06-12 18:42:41 +01:00
Klaus Basan
6284ed0c5a Minor style adjustments 2020-01-18 02:48:28 +01:00
Mat Sutcliffe
4a0d8e9864 Fixed most Qt 5.14 deprecation warnings 2020-01-07 19:57:25 +00:00
Mat Sutcliffe
69afe771d2 Ref T321 Improve CAtomicFile error message and advise the user to try restarting or manually deleting. 2019-02-23 19:01:10 +00:00
Mat Sutcliffe
e9a4c49d68 Ref T547 Update license masthead in all source code files. 2019-02-22 20:36:43 +00:00
Mat Sutcliffe
225ff81252 Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API. 2019-02-22 20:34:55 +00:00
Mat Sutcliffe
6c05c5249d When calling arg() on a QString constructed from a literal, use QStringLiteral. 2019-02-22 20:23:47 +00:00
Mat Sutcliffe
c71d358648 Fixed clazy warnings: unnecessary containers and containers being detached. 2019-02-22 20:23:37 +00:00
Mat Sutcliffe
462172a87f Fixed clazy warnings: unnecessary containers and containers being detached in range-for loops. 2019-02-22 20:23:37 +00:00
Klaus Basan
4f3cb6447f Ref T292, Ref T285 minor adjustments in worker/cache 2018-07-26 21:40:52 +02:00
Klaus Basan
fa6f83d87b Ref T218, sequence replaceOrAdd overloads 2018-01-14 18:45:50 +01:00
Klaus Basan
26b5a6ce28 Found during T215, rectify CIdentifier issues
* null/anonymous identifier
* CIdentifier can be linked with QObject and
* CIdentifier reflects name changes of QObject (UI components change name after ctor call)
2018-01-13 05:04:27 +01:00
Klaus Basan
8324c2d305 Ref T160, continous worker now CIdentifiable and name is mandatory 2017-09-25 05:23:57 +02:00
Mathew Sutcliffe
de11f7fe35 Correctly remove session cache value of expired session.
Summary:
`CDataCacheRevision` stores current working timestamps in `m_timestamps` and stores complete timestamps (including unadmitted deferred values) in `m_originalTimestamps`. A value is "in" the cache if and only if its timestamp is in `m_timestamps`. In `writeNewRevision` the `.rev` file is written based on `m_originalTimestamps` so that unadmitted deferred values don't get lost.

Session cache works by removing timestamps that were not created in the current session. But it needs to remove from both `m_timestamps` and `m_originalTimestamps` so that old session cache values can't get recreated by `writeNewRevision`.

Test Plan: Currently being evaluated by @kbasan to check that it does not introduce unintended consequences.

Reviewers: #swift_pilot_client, kbasan

Reviewed By: #swift_pilot_client, kbasan

Subscribers: jenkins, kbasan

Tags: #swift_pilot_client

Differential Revision: https://dev.swift-project.org/D53
2017-09-24 19:53:41 +01:00
Mathew Sutcliffe
b7f69c6887 refs #937 Resolved clazy warnings: unnecessary memory allocation. 2017-04-19 19:31:39 +01:00
Mathew Sutcliffe
fce1513dae refs #937 Resolved clazy warnings: unnecessary detaching of containers. 2017-04-19 19:31:38 +01:00
Klaus Basan
ecb7877908 refs #906, obtain .rev file name from static function instead of member 2017-04-18 00:00:34 +01:00
Mathew Sutcliffe
0d0e2cf9e0 refs #884 Refactoring: moved method. 2017-04-18 00:00:20 +01:00
Mathew Sutcliffe
70224bea72 refs #904 Settings JSON files split into arbitrary levels of subfolders, one file per key. 2017-04-17 23:59:00 +01:00
Klaus Basan
9b4b2f70cc refs #890, use CFileUtils to append paths 2017-04-17 23:56:58 +01:00
Klaus Basan
888375d294 refs #887, directories available via CDirectoryUtils/relative paths
* relative cache/settings paths are available relativeFilePath
* directories build in CDirectoryUtils
* directory comparison in CDirectoryUtils
* using CFileUtils to concatenate dir paths
* using URL encoded string for normalized directory (as it can be decoded)
2017-03-01 20:51:34 +01:00
Mathew Sutcliffe
97e3cf8475 refs #890 Use BlackMisc::singleShot for async calls in CDataCache,
to tolerate calls made before the CDataCacheSerializer has started.
(Like all CContinuousWorkers, it moves thread upon being started.)
2017-02-26 03:36:12 +00:00
Mathew Sutcliffe
3439edf946 Fixed warning and error found by Clang svn-trunk. 2017-02-25 02:11:16 +00:00
Mathew Sutcliffe
c268581954 refs #885 Regenerate revision file from available JSON files. 2017-02-25 02:11:13 +00:00
Mathew Sutcliffe
51c3ae8c25 refs #815 Catch and handle CJsonException when calling convertFromJson. 2017-01-10 23:46:36 +00:00
Klaus Basan
3f2fc33b27 Minor change, added ' in error messages 2017-01-10 23:46:08 +00:00
Roland Winklmeier
e82d06849c Upgrade and cleanup cppcheck suppressions to version 1.76.1
Also renamed the suppressions file to the standard name.

refs #831
2017-01-10 23:44:25 +00:00
Mathew Sutcliffe
5d7289adb3 refs #784 The data cache worker thread could interfere with performance measurements,
so only run it in applications that start the main event loop.
2016-12-13 19:00:19 +01:00
Mathew Sutcliffe
1e3afea9c2 refs #783 Used BlackMisc::singleShot in CDataPageQueue::queueValuesFromCache, to tolerate the page owner moving thread. 2016-12-06 09:34:08 +01:00
Mathew Sutcliffe
0b07088639 refs #782 Extended error information when data cache fails to write. 2016-12-06 09:34:05 +01:00
Mathew Sutcliffe
d0d1a9c8b8 refs #756 Fixed session cache concept:
Each new session generates an ID identifying that session, and
the .rev file annotates the ID associated with each cache value.
This is needed to avoid reading a value from a previous session
when loading for a continuing (non-new) session. The coarse-
grained approach of distinguishing new sessions from non-new
sessions was insufficient.
2016-12-06 09:33:52 +01:00
Mathew Sutcliffe
937cdbcc55 refs #756 Minor simplification and removal of unnecessary code. 2016-12-06 09:33:51 +01:00
Mathew Sutcliffe
64315e1022 refs #756 Allow to mark data cache traits with a session flag, so they are overwritten when starting a new session.
(Starting a new session means, that a swift application is started when no other swift application is running.)
2016-10-17 14:34:24 +01:00
Mathew Sutcliffe
3c82bb3a9c Data cache shall emit an error message if it fails to save the revision file. 2016-08-26 21:04:40 +01:00
Mathew Sutcliffe
e7c9d3b62f CDataCacheRevision: always need to lock the mutex when accessing m_updateInProgress. 2016-08-02 17:14:14 +01:00
Mathew Sutcliffe
88920501bf refs #715 Assert no longer appropriate: pruning revision file means calling writeNewRevision when m_pendingWrite is false. 2016-08-02 05:09:39 +01:00
Mathew Sutcliffe
61f3655b2c refs #695 Allow to set a mock root directory for caches, for unit tests. 2016-07-29 17:09:08 +01:00
Mathew Sutcliffe
9339991644 refs #715 When loading data cache, prune revision file to remove keys that weren't found. 2016-07-29 17:09:07 +01:00
Mathew Sutcliffe
242e041ceb refs #679 CValueCache local signal relay moved to the point of emission, to tolerate different orders of initialization of application. 2016-06-30 02:06:16 +01:00
Klaus Basan
dc02ff2d0c Addded log categories / human readable pattern 2016-06-29 01:04:44 +02:00