Code Cleanup

- Integrated Context.config.
- Eliminated Config& as a function argument.
- Added extern references to Context where needed.
This commit is contained in:
Paul Beckingham
2009-06-03 02:03:49 -04:00
parent 98978c7c00
commit 66bd5fc3c0
29 changed files with 1115 additions and 451 deletions

View File

@@ -32,50 +32,49 @@
#include "Context.h"
#include "T.h"
#include "TDB.h"
#include "Config.h"
#include "Table.h"
#include "Date.h"
#include "color.h"
#include "../auto.h"
// parse.cpp
void parse (std::vector <std::string>&, std::string&, T&, Config&);
void parse (std::vector <std::string>&, std::string&, T&);
bool validPriority (const std::string&);
bool validDate (std::string&, Config&);
bool validDate (std::string&);
bool validDuration (std::string&);
void loadCustomReports (Config&);
void loadCustomReports ();
bool isCustomReport (const std::string&);
void allCustomReports (std::vector <std::string>&);
// task.cpp
void gatherNextTasks (const TDB&, T&, Config&, std::vector <T>&, std::vector <int>&);
void nag (TDB&, T&, Config&);
void gatherNextTasks (const TDB&, T&, std::vector <T>&, std::vector <int>&);
void nag (TDB&, T&);
int getDueState (const std::string&);
void handleRecurrence (TDB&, std::vector <T>&);
bool generateDueDates (T&, std::vector <Date>&);
Date getNextRecurrence (Date&, std::string&);
void updateRecurrenceMask (TDB&, std::vector <T>&, T&);
void onChangeCallback ();
std::string runTaskCommand (int, char**, TDB&, Config&, bool gc = true, bool shadow = true);
std::string runTaskCommand (std::vector <std::string>&, TDB&, Config&, bool gc = false, bool shadow = false);
std::string runTaskCommand (int, char**, TDB&, bool gc = true, bool shadow = true);
std::string runTaskCommand (std::vector <std::string>&, TDB&, bool gc = false, bool shadow = false);
// command.cpp
std::string handleAdd (TDB&, T&, Config&);
std::string handleAppend (TDB&, T&, Config&);
std::string handleExport (TDB&, T&, Config&);
std::string handleDone (TDB&, T&, Config&);
std::string handleModify (TDB&, T&, Config&);
std::string handleProjects (TDB&, T&, Config&);
std::string handleTags (TDB&, T&, Config&);
std::string handleUndelete (TDB&, T&, Config&);
std::string handleVersion (Config&);
std::string handleDelete (TDB&, T&, Config&);
std::string handleStart (TDB&, T&, Config&);
std::string handleStop (TDB&, T&, Config&);
std::string handleUndo (TDB&, T&, Config&);
std::string handleColor (Config&);
std::string handleAnnotate (TDB&, T&, Config&);
std::string handleDuplicate (TDB&, T&, Config&);
std::string handleAdd (TDB&, T&);
std::string handleAppend (TDB&, T&);
std::string handleExport (TDB&, T&);
std::string handleDone (TDB&, T&);
std::string handleModify (TDB&, T&);
std::string handleProjects (TDB&, T&);
std::string handleTags (TDB&, T&);
std::string handleUndelete (TDB&, T&);
std::string handleVersion ();
std::string handleDelete (TDB&, T&);
std::string handleStart (TDB&, T&);
std::string handleStop (TDB&, T&);
std::string handleUndo (TDB&, T&);
std::string handleColor ();
std::string handleAnnotate (TDB&, T&);
std::string handleDuplicate (TDB&, T&);
T findT (int, const std::vector <T>&);
int deltaAppend (T&, T&);
int deltaDescription (T&, T&);
@@ -84,33 +83,33 @@ int deltaAttributes (T&, T&);
int deltaSubstitutions (T&, T&);
// edit.cpp
std::string handleEdit (TDB&, T&, Config&);
std::string handleEdit (TDB&, T&);
// report.cpp
void filterSequence (std::vector<T>&, T&);
void filter (std::vector<T>&, T&);
std::string handleInfo (TDB&, T&, Config&);
std::string handleCompleted (TDB&, T&, Config&);
std::string handleReportSummary (TDB&, T&, Config&);
std::string handleReportNext (TDB&, T&, Config&);
std::string handleReportHistory (TDB&, T&, Config&);
std::string handleReportGHistory (TDB&, T&, Config&);
std::string handleReportCalendar (TDB&, T&, Config&);
std::string handleReportActive (TDB&, T&, Config&);
std::string handleReportOverdue (TDB&, T&, Config&);
std::string handleReportStats (TDB&, T&, Config&);
std::string handleReportTimesheet (TDB&, T&, Config&);
std::string handleInfo (TDB&, T&);
std::string handleCompleted (TDB&, T&);
std::string handleReportSummary (TDB&, T&);
std::string handleReportNext (TDB&, T&);
std::string handleReportHistory (TDB&, T&);
std::string handleReportGHistory (TDB&, T&);
std::string handleReportCalendar (TDB&, T&);
std::string handleReportActive (TDB&, T&);
std::string handleReportOverdue (TDB&, T&);
std::string handleReportStats (TDB&, T&);
std::string handleReportTimesheet (TDB&, T&);
std::string handleCustomReport (TDB&, T&, Config&, const std::string&);
std::string handleCustomReport (TDB&, T&, const std::string&);
void validReportColumns (const std::vector <std::string>&);
void validSortColumns (const std::vector <std::string>&, const std::vector <std::string>&);
// rules.cpp
void initializeColorRules (Config&);
void autoColorize (T&, Text::color&, Text::color&, Config&);
void initializeColorRules ();
void autoColorize (T&, Text::color&, Text::color&);
// import.cpp
std::string handleImport (TDB&, T&, Config&);
std::string handleImport (TDB&, T&);
// list template
///////////////////////////////////////////////////////////////////////////////