Commit graph

49 commits

Author SHA1 Message Date
Thomas Lauf
7b4a234f03 Unify coding style
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-12-23 22:38:31 +01:00
Thomas Lauf
2535c2c399 Cleanup includes
- Remove unused includes
- Use '<..>' style consistently
- Strip any paths from include
- Replace deprecated C++ headers
- Sort includes according to LLVM rules
  https://llvm.org/docs/CodingStandards.html#include-style

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-06-17 14:19:02 +02:00
Thomas Lauf
14bed139f6 Update copyrights
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-04-04 22:44:44 +02:00
Stanisław Wysocki
04822aa195 Use XDG Base Directories compliant dirs on Unix for new installations
Signed-off-by: Stanisław Wysocki <garethel@protonmail.com>
2022-09-27 23:33:43 +02:00
Tomas Babej
e5870380a4
doc: Update copyright to 2021 2021-01-02 02:52:39 -05:00
Thomas Lauf
ad58309159 Update Copyright
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-04-19 12:41:23 +02:00
Shaun Ruffell
1abf6e9320 Database: firstLine -> getLatestEntry
firstLine is ambiguous (the first line that was added in time? The first line
that will be returned when iterating the database?)

See https://github.com/GothenburgBitFactory/timewarrior/pull/269#discussion_r367922757
2020-01-26 19:49:23 +01:00
Shaun Ruffell
894f8ba5d8 Database: Add method empty 2020-01-17 17:48:57 +01:00
Shaun Ruffell
b06b8cf8ae Database: add tags method for getting set of tag names
The database class now separatly tracks tag information. So for the one
place where all the inclusions were iterated over in order to build up a
tag set, we now instead ask the database for this set directly.

Related to issue #245
2020-01-17 17:48:57 +01:00
Shaun Ruffell
5dcf226d20 Database: Switch the natural order from newest inclusion to oldest
The inclusion database for the user always starts with the most recent
entry. It is now the same way in the code as well.
2020-01-17 17:48:57 +01:00
Shaun Ruffell
623db0c8e4 Database: Remove Database::allLines()
The Database class itself can now be used in range-based for loops for iterating
over all the lines.
2020-01-17 17:48:57 +01:00
Shaun Ruffell
557fd4cb34 Database: Add forward/reverse iterator
This allows the database to be treated as a single collection of strings, but
can be used to avoid loading the entire database when only interested in recent
entries.

Related to issue #245.
2020-01-17 17:48:57 +01:00
Thomas Lauf
d64017a7a6 Update copyright dates
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-10-18 10:59:16 +02:00
Thomas Lauf
f72c4fda52 Extract class Journal from class Database
- const-ify Transaction and UndoAction
- Clang-tidying
2019-06-19 18:05:44 +02:00
Thomas Lauf
4f5eb6eb0c Make warning about new tags adhere to :quiet hint 2018-09-07 10:13:22 +02:00
Thomas Lauf
a7da0438ca Connect database and tag-info database 2018-09-07 10:13:22 +02:00
Thomas Lauf
76ee22e7e5 #9 TI-1: Add TransactionFactory
- CmdUndo pops last transaction from array (and applies undo actions - tbd)
- TransactionFactory reads contents of undo.data into transaction array
- Transaction array is written back to undo.data
2018-07-19 19:56:10 +02:00
Thomas Lauf
881d9590da #9 TI-1: Add wrapper methods for config and interval undo-actions
- make recordUndoAction private
2018-07-18 21:49:18 +02:00
Thomas Lauf
b8b0bbfeaf #9 TI-1: Rename undoTxn*-functions 2018-07-18 21:38:06 +02:00
Thomas Lauf
f031bd9d22 #9 TI-1: Use Transaction and UndoAction in Database
- Add toString-Methods to Transaction and UndoAction
2018-07-18 21:09:07 +02:00
Simon Ruderich
2271bd9eea Use https:// link for opensource.org 2018-03-16 23:11:08 +01:00
Paul Beckingham
50dd735101 Database: Relocated ::validateInterval to helper.cpp, it is a macro function 2016-07-01 08:29:12 -04:00
Paul Beckingham
7d5befb607 Database: Added support mehtods for undo 2016-05-14 13:59:09 -04:00
Paul Beckingham
f87fb2e2ec Database: Removed exclusions 2016-04-27 18:05:59 -04:00
Paul Beckingham
4176bf23d4 Range: Renamed Daterange to Range 2016-04-23 08:52:16 -04:00
Paul Beckingham
0debcf935b Database: Added ::validateAddition 2016-04-20 08:22:25 -04:00
Paul Beckingham
ebb3d63da5 Database: Datafiles now initialized on demand 2016-04-17 10:59:00 -04:00
Paul Beckingham
7db6f68b92 Database: Removed obsolete ::getCurrentDataFile 2016-04-17 08:07:25 -04:00
Paul Beckingham
843865b5ee Database: Added ::getDatafile 2016-04-17 07:44:07 -04:00
Paul Beckingham
de875eac0d Database: Added ::segmentRange 2016-04-16 15:55:33 -04:00
Paul Beckingham
1d90b51266 Database: Renamed ::createNewDatafile to ::createDatafileIfNecessary 2016-04-16 15:19:28 -04:00
Paul Beckingham
cee6ff0c2e Database: Refactored data I/O 2016-04-11 08:22:27 -04:00
Paul Beckingham
b29f458a7b Database: Exclusions are back to being strings again 2016-04-10 16:33:42 -04:00
Paul Beckingham
1aa72f99b6 Database: Removed unused top-level _dirty flag 2016-04-10 16:31:42 -04:00
Paul Beckingham
beb620116b Database: Removed unused member 2016-04-10 16:05:59 -04:00
Paul Beckingham
e1d738b066 Database: Added ::clearExclusions, modified ::addExclusion 2016-04-10 14:03:04 -04:00
Paul Beckingham
08f1a0000a Database: Added ::files 2016-03-22 01:32:23 -04:00
Paul Beckingham
90525013a3 Database: Implemented ::getAllIntervals 2016-03-22 00:21:54 -04:00
Paul Beckingham
a199c2e161 Data{base,file}: Made ::getLatestInterval non-const 2016-03-20 17:20:05 -04:00
Paul Beckingham
8c74b0e1e9 Database: Now tracks the need to write data with ::_dirty 2016-03-20 12:39:57 -04:00
Paul Beckingham
61b04ff0e8 Database: Added ::getLatestInterval 2016-03-20 11:33:16 -04:00
Paul Beckingham
634e6bad75 Database: Added methods for injecting data 2016-03-20 11:07:40 -04:00
Paul Beckingham
175f0d63f4 Database: Removed unused ::location 2016-03-20 11:01:18 -04:00
Paul Beckingham
2d701b768b Database: Added location accessor 2016-03-19 09:00:07 -04:00
Paul Beckingham
b2f470d113 Database: Switched from file names to Datafile objects 2016-03-19 08:55:28 -04:00
Paul Beckingham
a3c468e8a6 Database: Identified current data file name 2016-03-05 00:15:44 -05:00
Paul Beckingham
39a3a4aed6 Code cleanup: Header formatting 2016-03-05 00:02:12 -05:00
Paul Beckingham
f2d9c61878 Database: Added ::initialize 2016-03-01 20:13:25 -05:00
Paul Beckingham
e7dd36a2c6 Database: Added stub 2016-03-01 00:26:21 -05:00