Code Cleanup

- Removed obsolete code from main.cpp.
This commit is contained in:
Paul Beckingham 2009-06-11 21:34:40 -04:00
parent 37e08df8ba
commit 5836430cc1
3 changed files with 29 additions and 102 deletions

View file

@ -24,44 +24,14 @@
// USA
//
////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <time.h>
#include "Context.h"
#include "Date.h"
#include "Duration.h"
#include "Table.h"
#include "T.h"
#include "text.h"
#include "util.h"
#include "main.h"
#ifdef HAVE_LIBNCURSES
#include <ncurses.h>
#endif
// Global context for use by all.
Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
// Set up randomness.
#ifdef HAVE_SRANDOM
srandom (time (NULL));
#else
srand (time (NULL));
#endif
int status = 0;
try
@ -71,33 +41,6 @@ int main (int argc, char** argv)
status = context.interactive ();
else
status = context.run ();
// start OBSOLETE
/*
TDB tdb;
std::string dataLocation = expandPath (context.config.get ("data.location"));
tdb.dataDirectory (dataLocation);
// Allow user override of file locking. Solaris/NFS machines may want this.
if (! context.config.get ("locking", true))
tdb.noLock ();
// Check for silly shadow file settings.
std::string shadowFile = expandPath (context.config.get ("shadow.file"));
if (shadowFile != "")
{
if (shadowFile == dataLocation + "/pending.data")
throw std::string ("Configuration variable 'shadow.file' is set to "
"overwrite your pending tasks. Please change it.");
if (shadowFile == dataLocation + "/completed.data")
throw std::string ("Configuration variable 'shadow.file' is set to "
"overwrite your completed tasks. Please change it.");
}
std::cout << runTaskCommand (context.args, tdb);
*/
// end OBSOLETE
}
catch (std::string& error)
@ -116,45 +59,3 @@ int main (int argc, char** argv)
}
////////////////////////////////////////////////////////////////////////////////
// TODO Obsolete
void updateShadowFile ()
{
}
////////////////////////////////////////////////////////////////////////////////
// TODO Obsolete
std::string runTaskCommand (
int argc,
char** argv,
// TDB& tdb,
bool gc /* = true */,
bool shadow /* = true */)
{
/*
std::vector <std::string> args;
for (int i = 1; i < argc; ++i)
if (strncmp (argv[i], "rc:", 3) &&
strncmp (argv[i], "rc.", 3))
{
std::cout << "arg=" << argv[i] << std::endl;
args.push_back (argv[i]);
}
return runTaskCommand (args, tdb, gc, shadow);
*/
return "";
}
////////////////////////////////////////////////////////////////////////////////
// TODO Obsolete
std::string runTaskCommand (
std::vector <std::string>& args,
// TDB& tdb,
bool gc /* = false */,
bool shadow /* = false */)
{
std::string out;
return out;
}
////////////////////////////////////////////////////////////////////////////////