From d0e521de98ce7ff8181aad971c7ab25305aab819 Mon Sep 17 00:00:00 2001 From: unK Date: Sat, 27 Sep 2008 23:17:57 +0200 Subject: [PATCH] fix for 9b65b39126a7d99ada44283a2ab6616bfdab8b5f (funny bug) --- src/settings.cpp | 52 ++++++++++++++++++++++++------------------------ src/settings.h | 1 + 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index d16242eb..ec4b4ef8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -218,6 +218,32 @@ string GetLineValue(const string &line, char a, char b) return ""; } +string IntoStr(Color color) +{ + string result; + + if (color == clDefault) + result = "default"; + else if (color == clBlack) + result = "black"; + else if (color == clRed) + result = "red"; + else if (color == clGreen) + result = "green"; + else if (color == clYellow) + result = "yellow"; + else if (color == clBlue) + result = "blue"; + else if (color == clMagenta) + result = "magenta"; + else if (color == clCyan) + result = "cyan"; + else if (color == clWhite) + result = "white"; + + return result; +} + namespace { void GetKeys(string line, int *key) @@ -242,32 +268,6 @@ namespace key[0] = !one.empty() && one[0] == '\'' ? one[1] : (atoi(one.c_str()) == 0 ? null_key : atoi(one.c_str())); key[1] = !two.empty() && two[0] == '\'' ? two[1] : (atoi(two.c_str()) == 0 ? null_key : atoi(two.c_str())); } - - string IntoStr(Color color) - { - string result; - - if (color == clDefault) - result = "default"; - else if (color == clBlack) - result = "black"; - else if (color == clRed) - result = "red"; - else if (color == clGreen) - result = "green"; - else if (color == clYellow) - result = "yellow"; - else if (color == clBlue) - result = "blue"; - else if (color == clMagenta) - result = "magenta"; - else if (color == clCyan) - result = "cyan"; - else if (color == clWhite) - result = "white"; - - return result; - } Color IntoColor(const string &color) { diff --git a/src/settings.h b/src/settings.h index f6e022fb..7eabe3f3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -151,6 +151,7 @@ void DefaultConfiguration(ncmpcpp_config &); void ReadKeys(ncmpcpp_keys &); void ReadConfiguration(ncmpcpp_config &); +string IntoStr(Color); string GetLineValue(const string &, char = '"', char = '"'); #endif