mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Timeline: Now has a public ::range
This commit is contained in:
parent
63a6255412
commit
6e93538b48
3 changed files with 6 additions and 13 deletions
|
@ -49,12 +49,6 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Timeline::range (const Range& range)
|
||||
{
|
||||
_range = range;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Timeline::include (const Interval& interval)
|
||||
{
|
||||
|
@ -72,7 +66,7 @@ std::vector <Interval> Timeline::tracked (Rules& rules) const
|
|||
{
|
||||
// Create a range representing the whole timeline.
|
||||
// If no range is defined, then assume the full range of all the inclusions.
|
||||
Range overallRange {_range};
|
||||
Range overallRange {range};
|
||||
if (! overallRange.started () &&
|
||||
! overallRange.ended ())
|
||||
overallRange = overallRangeFromIntervals (_inclusions);
|
||||
|
@ -123,7 +117,7 @@ std::string Timeline::dump () const
|
|||
{
|
||||
std::stringstream out;
|
||||
|
||||
out << "Timeline _range " << _range.dump () << "\n";
|
||||
out << "Timeline range " << range.dump () << "\n";
|
||||
for (auto& i : _inclusions)
|
||||
out << " " << i.json ();
|
||||
for (auto& e : _exclusions)
|
||||
|
|
|
@ -37,17 +37,16 @@ class Timeline
|
|||
{
|
||||
public:
|
||||
Timeline () = default;
|
||||
void range (const Range&);
|
||||
void include (const Interval&);
|
||||
void exclude (const Exclusion&);
|
||||
|
||||
std::vector <Interval> tracked (Rules&) const;
|
||||
std::vector <Interval> untracked (Rules&) const;
|
||||
|
||||
std::string dump () const;
|
||||
|
||||
public:
|
||||
Range range {};
|
||||
|
||||
private:
|
||||
Range _range {};
|
||||
std::vector <Interval> _inclusions {};
|
||||
std::vector <Exclusion> _exclusions {};
|
||||
};
|
||||
|
|
|
@ -296,7 +296,7 @@ Timeline createTimelineFromData (
|
|||
const Interval& filter)
|
||||
{
|
||||
Timeline t;
|
||||
t.range (filter.range);
|
||||
t.range = filter.range;
|
||||
|
||||
// Add filtered intervals.
|
||||
for (auto& line : database.allLines ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue