settings: fix columns generation without configuration file (ticket #3490)

This commit is contained in:
Andrzej Rybczak
2012-07-16 00:20:25 +02:00
parent 4475902eb9
commit 6126def6c5
3 changed files with 8 additions and 1 deletions

View File

@@ -249,6 +249,8 @@ int main(int argc, char **argv)
Config.Read(); Config.Read();
Key.Read(); Key.Read();
Config.GenerateColumns();
if (getenv("MPD_HOST")) if (getenv("MPD_HOST"))
Mpd.SetHostname(getenv("MPD_HOST")); Mpd.SetHostname(getenv("MPD_HOST"));
if (getenv("MPD_PORT")) if (getenv("MPD_PORT"))

View File

@@ -1365,7 +1365,11 @@ void NcmpcppConfig::Read()
} }
} }
f.close(); f.close();
}
void NcmpcppConfig::GenerateColumns()
{
columns.clear();
std::string width; std::string width;
while (!(width = GetLineValue(song_list_columns_format, '(', ')', 1)).empty()) while (!(width = GetLineValue(song_list_columns_format, '(', ')', 1)).empty())
{ {

View File

@@ -152,6 +152,7 @@ struct NcmpcppConfig
void SetDefaults(); void SetDefaults();
void Read(); void Read();
void GenerateColumns();
std::string ncmpcpp_directory; std::string ncmpcpp_directory;
std::string lyrics_directory; std::string lyrics_directory;