mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Removed exclusions
This commit is contained in:
parent
db3c3fb14c
commit
f87fb2e2ec
2 changed files with 3 additions and 23 deletions
|
@ -58,7 +58,6 @@ std::vector <std::string> Database::files () const
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Walk backwards through the files until an interval is found.
|
||||
// Note: Not an exclusion.
|
||||
std::string Database::lastLine ()
|
||||
{
|
||||
if (! _files.size ())
|
||||
|
@ -93,18 +92,6 @@ std::vector <std::string> Database::allLines ()
|
|||
return all;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Database::clearExclusions ()
|
||||
{
|
||||
_exclusions.clear ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Database::addExclusion (const std::string& exclusion)
|
||||
{
|
||||
_exclusions.push_back (exclusion);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Database::addInterval (const Interval& interval)
|
||||
{
|
||||
|
@ -165,9 +152,6 @@ std::string Database::dump () const
|
|||
{
|
||||
std::stringstream out;
|
||||
out << "Database\n";
|
||||
for (auto& exclusion : _exclusions)
|
||||
out << " Exclusion: " << exclusion << '\n';
|
||||
|
||||
for (auto& df : _files)
|
||||
out << df.dump ();
|
||||
|
||||
|
@ -192,10 +176,9 @@ unsigned int Database::getDatafile (int year, int month)
|
|||
if (_files[i].name () == basename)
|
||||
return i;
|
||||
|
||||
// Create the Datafile. New files need the set of current exclusions.
|
||||
// Create the Datafile.
|
||||
Datafile df;
|
||||
df.initialize (name);
|
||||
df.setExclusions (_exclusions);
|
||||
|
||||
// Insert Datafile into _files. The position is not important.
|
||||
_files.push_back (df);
|
||||
|
|
|
@ -44,8 +44,6 @@ public:
|
|||
std::string lastLine ();
|
||||
std::vector <std::string> allLines ();
|
||||
|
||||
void clearExclusions ();
|
||||
void addExclusion (const std::string&);
|
||||
void addInterval (const Interval&);
|
||||
void deleteInterval (const Interval&);
|
||||
void modifyInterval (const Interval&, const Interval&);
|
||||
|
@ -59,9 +57,8 @@ private:
|
|||
void validateAddition (const Interval&) const;
|
||||
|
||||
private:
|
||||
std::string _location {"~/.timewarrior/data"};
|
||||
std::vector <Datafile> _files {};
|
||||
std::vector <std::string> _exclusions {};
|
||||
std::string _location {"~/.timewarrior/data"};
|
||||
std::vector <Datafile> _files {};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue