diff --git a/src/Config.cpp b/src/Config.cpp index 662230ff6..ad4a0291b 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -696,69 +696,3 @@ void Config::all (std::vector& items) const } //////////////////////////////////////////////////////////////////////////////// -std::string Config::checkForDeprecatedColor () -{ - std::vector deprecated; - std::map ::const_iterator it; - for (it = this->begin (); it != this->end (); ++it) - { - if (it->first.find ("color.") != std::string::npos) - { - std::string value = get (it->first); - if (value.find ("_") != std::string::npos) - deprecated.push_back (it->first); - } - } - - std::stringstream out; - if (deprecated.size ()) - { - out << STRING_CONFIG_DEPRECATED_US - << "\n"; - - std::vector ::iterator it2; - for (it2 = deprecated.begin (); it2 != deprecated.end (); ++it2) - out << " " << *it2 << "=" << get (*it2) << "\n"; - - out << "\n"; - } - - return out.str (); -} - -//////////////////////////////////////////////////////////////////////////////// -std::string Config::checkForDeprecatedColumns () -{ - std::vector deprecated; - std::map ::const_iterator it; - for (it = this->begin (); it != this->end (); ++it) - { - if (it->first.find ("report") == 0) - { - std::string value = get (it->first); - if (value.find ("entry_time") != std::string::npos || - value.find ("start_time") != std::string::npos || - value.find ("end_time") != std::string::npos) - deprecated.push_back (it->first); - } - } - - std::stringstream out; - out << "\n"; - - if (deprecated.size ()) - { - out << STRING_CONFIG_DEPRECATED_COL - << "\n"; - - std::vector ::iterator it2; - for (it2 = deprecated.begin (); it2 != deprecated.end (); ++it2) - out << " " << *it2 << "=" << get (*it2) << "\n"; - - out << "\n"; - } - - return out.str (); -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Config.h b/src/Config.h index 14c125a97..9944bfa68 100644 --- a/src/Config.h +++ b/src/Config.h @@ -60,9 +60,6 @@ public: void set (const std::string&, const std::string&); void all (std::vector &) const; - std::string checkForDeprecatedColor (); - std::string checkForDeprecatedColumns (); - public: File _original_file; diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 40bd90db8..fedcb0160 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -304,8 +305,9 @@ int CmdShow::execute (std::string& output) out << " " << format (STRING_CMD_SHOW_DIFFER_COLOR, warning.colorize ("color")); } - out << context.config.checkForDeprecatedColor (); - out << context.config.checkForDeprecatedColumns (); + out << legacyCheckForDeprecatedColor (); + out << legacyCheckForDeprecatedColumns (); + // TODO Check for referenced but missing theme files. // TODO Check for referenced but missing string files. // TODO Check for referenced but missing tips files. diff --git a/src/legacy.cpp b/src/legacy.cpp index 018aa889e..85edbb2d3 100644 --- a/src/legacy.cpp +++ b/src/legacy.cpp @@ -27,6 +27,7 @@ #define L10N // Localization complete. +#include #include #include #include @@ -102,3 +103,69 @@ void legacySortColumnMap (std::string& name) } //////////////////////////////////////////////////////////////////////////////// +std::string legacyCheckForDeprecatedColor () +{ + std::vector deprecated; + std::map ::const_iterator it; + for (it = context.config.begin (); it != context.config.end (); ++it) + { + if (it->first.find ("color.") != std::string::npos) + { + std::string value = context.config.get (it->first); + if (value.find ("_") != std::string::npos) + deprecated.push_back (it->first); + } + } + + std::stringstream out; + if (deprecated.size ()) + { + out << STRING_CONFIG_DEPRECATED_US + << "\n"; + + std::vector ::iterator it2; + for (it2 = deprecated.begin (); it2 != deprecated.end (); ++it2) + out << " " << *it2 << "=" << context.config.get (*it2) << "\n"; + + out << "\n"; + } + + return out.str (); +} + +//////////////////////////////////////////////////////////////////////////////// +std::string legacyCheckForDeprecatedColumns () +{ + std::vector deprecated; + std::map ::const_iterator it; + for (it = context.config.begin (); it != context.config.end (); ++it) + { + if (it->first.find ("report") == 0) + { + std::string value = context.config.get (it->first); + if (value.find ("entry_time") != std::string::npos || + value.find ("start_time") != std::string::npos || + value.find ("end_time") != std::string::npos) + deprecated.push_back (it->first); + } + } + + std::stringstream out; + out << "\n"; + + if (deprecated.size ()) + { + out << STRING_CONFIG_DEPRECATED_COL + << "\n"; + + std::vector ::iterator it2; + for (it2 = deprecated.begin (); it2 != deprecated.end (); ++it2) + out << " " << *it2 << "=" << context.config.get (*it2) << "\n"; + + out << "\n"; + } + + return out.str (); +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/main.h b/src/main.h index a359a0ca6..d76a9ce8a 100644 --- a/src/main.h +++ b/src/main.h @@ -82,6 +82,8 @@ void sort_tasks (std::vector &, std::vector &, const std::string&); void legacyAttributeCheck (const std::string&); void legacyColumnMap (std::string&); void legacySortColumnMap (std::string&); +std::string legacyCheckForDeprecatedColor (); +std::string legacyCheckForDeprecatedColumns (); // list template ///////////////////////////////////////////////////////////////////////////////