From 7ec523d5eafacf07952a8e1ef72f7b2096f31e33 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 16 Jun 2008 23:37:32 -0400 Subject: [PATCH] - Removed unused std::vector forms of get/set - Added more defaults to Config::createDefault --- src/Config.cpp | 29 ++++++----------------------- src/Config.h | 2 -- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index c9e6bfed7..78a377957 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -116,6 +116,9 @@ void Config::createDefault (const std::string& file) fprintf (out, "confirmation=yes\n"); fprintf (out, "#nag=Note: try to stick to high priority tasks. See \"task next\".\n"); fprintf (out, "next=2\n"); + fprintf (out, "dateformat=m/d/Y\n"); + fprintf (out, "showage=yes\n"); + fprintf (out, "monthsperline=1\n"); fprintf (out, "curses=on\n"); fprintf (out, "color=on\n"); @@ -137,6 +140,9 @@ void Config::createDefault (const std::string& file) set ("command.logging", "off"); set ("confirmation", "yes"); set ("next", 1); + set ("dateformat", "m/d/Y"); + set ("showage", "yes"); + set ("monthsperline", 3); set ("curses", "on"); set ("color", "on"); set ("color.overdue", "red"); @@ -246,29 +252,6 @@ void Config::set (const std::string& key, const std::string& value) (*this)[key] = value; } -//////////////////////////////////////////////////////////////////////////////// -// The vector form of Config::get assumes the single value is comma-separated, -// and splits accordingly. -void Config::get ( - const std::string& key, - std::vector & values) -{ - values.clear (); - split (values, (*this)[key], ','); -} - -//////////////////////////////////////////////////////////////////////////////// -// The vector form of Config::set joins the values together with commas, and -// stores the single value. -void Config::set ( - const std::string& key, - const std::vector & values) -{ - std::string conjoined; - join (conjoined, ",", values); - (*this)[key] = conjoined; -} - //////////////////////////////////////////////////////////////////////////////// // Provide a vector of all configuration keys. void Config::all (std::vector& items) diff --git a/src/Config.h b/src/Config.h index c09a9e485..d8f8dd940 100644 --- a/src/Config.h +++ b/src/Config.h @@ -47,11 +47,9 @@ public: bool get (const std::string&, bool); int get (const std::string&, const int); double get (const std::string&, const double); - void get (const std::string&, std::vector &); void set (const std::string&, const int); void set (const std::string&, const double); void set (const std::string&, const std::string&); - void set (const std::string&, const std::vector &); void all (std::vector &); };