Database: Removed unused member

This commit is contained in:
Paul Beckingham 2016-04-10 16:05:59 -04:00
parent baa7671926
commit beb620116b
2 changed files with 4 additions and 7 deletions

View file

@ -37,7 +37,7 @@
void Database::initialize (const std::string& location) void Database::initialize (const std::string& location)
{ {
_location = location; _location = location;
_current = currentDataFile (); auto current = currentDataFile ();
// Because the data files have names YYYY-MM.data, sorting them by name also // Because the data files have names YYYY-MM.data, sorting them by name also
// sorts by the intervals within. // sorts by the intervals within.
@ -47,8 +47,8 @@ void Database::initialize (const std::string& location)
// Ensure the list always contains the name of the current file, even if it // Ensure the list always contains the name of the current file, even if it
// does not exist. // does not exist.
if (std::find (files.begin (), files.end (), _current) == files.end ()) if (std::find (files.begin (), files.end (), current) == files.end ())
files.push_back (_current); files.push_back (current);
for (auto& file : files) for (auto& file : files)
{ {
@ -146,9 +146,7 @@ std::string Database::dump () const
std::stringstream out; std::stringstream out;
out << "Database\n"; out << "Database\n";
for (auto& file : _files) for (auto& file : _files)
out << " Datafile: " << file.name () out << " Datafile: " << file.name () << "\n";
<< (file.name () == _current ? " (current)" : "")
<< "\n";
out << " Dirty: " << (_dirty ? "true" : "false") << "\n"; out << " Dirty: " << (_dirty ? "true" : "false") << "\n";

View file

@ -56,7 +56,6 @@ private:
private: private:
std::string _location {"~/.timewarrior/data"}; std::string _location {"~/.timewarrior/data"};
std::string _current {};
std::vector <Datafile> _files {}; std::vector <Datafile> _files {};
bool _dirty {false}; bool _dirty {false};
std::vector <Exclusion> _exclusions {}; std::vector <Exclusion> _exclusions {};