From c6f5933bf9540ea838bef205f9e0946a8221b317 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 19 Nov 2016 15:52:47 +0100 Subject: [PATCH] settings: remove default_space_mode --- src/settings.cpp | 8 ++------ src/utility/option_parser.cpp | 2 +- src/utility/option_parser.h | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index 019a8537..f1024e1b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -177,12 +177,13 @@ NC::Buffer buffer(const std::string &v) return result; } +/* void deprecated(const char *option, double version_removal) { std::cerr << "WARNING: " << option << " is deprecated and will be removed in " << version_removal << "\n"; } - +*/ } @@ -190,11 +191,6 @@ bool Configuration::read(const std::vector &config_paths, bool igno { option_parser p; - // deprecation warnings - p.add("default_space_mode", nullptr, "", [](std::string) { - deprecated("default_space_mode", 0.8); - }); - // keep the same order of variables as in configuration file p.add("ncmpcpp_directory", &ncmpcpp_directory, "~/.ncmpcpp/", adjust_directory); p.add("lyrics_directory", &lyrics_directory, "~/.lyrics/", adjust_directory); diff --git a/src/utility/option_parser.cpp b/src/utility/option_parser.cpp index 75b33680..c7c0635e 100644 --- a/src/utility/option_parser.cpp +++ b/src/utility/option_parser.cpp @@ -35,7 +35,7 @@ #include "utility/option_parser.h" -bool yes_no(std::string v) +bool yes_no(const std::string &v) { if (v == "yes") return true; diff --git a/src/utility/option_parser.h b/src/utility/option_parser.h index 25134c47..be08a09e 100644 --- a/src/utility/option_parser.h +++ b/src/utility/option_parser.h @@ -46,10 +46,10 @@ } template -DestT verbose_lexical_cast(std::string v) +DestT verbose_lexical_cast(const std::string &v) { try { - return boost::lexical_cast(std::move(v)); + return boost::lexical_cast(v); } catch (boost::bad_lexical_cast &) { invalid_value(v); } @@ -73,7 +73,7 @@ std::vector list_of(const std::string &v) return list_of(v, verbose_lexical_cast); } -bool yes_no(std::string v); +bool yes_no(const std::string &v); ////////////////////////////////////////////////////////////////////////////////