diff --git a/src/Cmd.cpp b/src/Cmd.cpp index 06cf3cfe9..7bfe930e8 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -167,3 +167,9 @@ void Cmd::loadCustomReports () } //////////////////////////////////////////////////////////////////////////////// +void Cmd::allCustomReports (std::vector & all) const +{ + all = customReports; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Cmd.h b/src/Cmd.h index 98780d90e..d98fb16e0 100644 --- a/src/Cmd.h +++ b/src/Cmd.h @@ -38,9 +38,10 @@ public: Cmd (const std::string&); // Default constructor ~Cmd (); // Destructor - bool valid (const std::string&); - bool validCustom (const std::string&); - void parse (const std::string&); + bool valid (const std::string&); + bool validCustom (const std::string&); + void parse (const std::string&); + void allCustomReports (std::vector &) const; public: std::string command; diff --git a/src/main.h b/src/main.h index 33346d45f..e75d53ce1 100644 --- a/src/main.h +++ b/src/main.h @@ -42,10 +42,6 @@ bool validPriority (const std::string&); bool validDate (std::string&); bool validDuration (std::string&); bool validDescription (const std::string&); -bool validCommand (std::string&); -void loadCustomReports (); -bool isCustomReport (const std::string&); -void allCustomReports (std::vector &); // task.cpp void gatherNextTasks (/*const TDB&,*/ T&, std::vector &, std::vector &); diff --git a/src/parse.cpp b/src/parse.cpp index 417c75fe4..171c6215b 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -554,40 +554,4 @@ void parse ( } //////////////////////////////////////////////////////////////////////////////// -void loadCustomReports () -{ - std::vector all; - context.config.all (all); - - foreach (i, all) - { - if (i->substr (0, 7) == "report.") - { - std::string report = i->substr (7, std::string::npos); - std::string::size_type columns = report.find (".columns"); - if (columns != std::string::npos) - { - report = report.substr (0, columns); - customReports.push_back (report); - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -bool isCustomReport (const std::string& report) -{ - foreach (i, customReports) - if (*i == report) - return true; - - return false; -} -//////////////////////////////////////////////////////////////////////////////// -void allCustomReports (std::vector & all) -{ - all = customReports; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/report.cpp b/src/report.cpp index 8f366cc2a..5cdbab15f 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -203,7 +203,7 @@ std::string shortUsage () // Add custom reports here... std::vector all; - allCustomReports (all); + context.cmd.allCustomReports (all); foreach (report, all) { std::string command = std::string ("task ") + *report + std::string (" [tags] [attrs] desc...");