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

master
Andrzej Rybczak 14 years ago
parent 4475902eb9
commit 6126def6c5
  1. 2
      src/ncmpcpp.cpp
  2. 4
      src/settings.cpp
  3. 1
      src/settings.h

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

@ -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())
{ {

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

Loading…
Cancel
Save