mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Preserved open intervals on delete
This commit is contained in:
parent
c848aa268a
commit
30e7a8ca3f
1 changed files with 4 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <FS.h>
|
#include <FS.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <iostream> // TODO Remove
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
@ -141,6 +142,9 @@ void Database::deleteInterval (const Interval& interval)
|
||||||
// Intersect the original interval range, and the segment.
|
// Intersect the original interval range, and the segment.
|
||||||
Interval segmentedInterval (interval);
|
Interval segmentedInterval (interval);
|
||||||
segmentedInterval.range (intervalRange.intersect (segment));
|
segmentedInterval.range (intervalRange.intersect (segment));
|
||||||
|
if (! interval.isEnded ())
|
||||||
|
segmentedInterval.end ({0});
|
||||||
|
|
||||||
_files[df].deleteInterval (segmentedInterval);
|
_files[df].deleteInterval (segmentedInterval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue