fix for 9b65b39126 (funny bug)

This commit is contained in:
unK
2008-09-27 23:17:57 +02:00
parent 0318da84ca
commit d0e521de98
2 changed files with 27 additions and 26 deletions

View File

@@ -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)
@@ -243,32 +269,6 @@ namespace
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)
{
Color result = clDefault;

View File

@@ -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