put configuration related functions into appropriate structs
This commit is contained in:
@@ -223,12 +223,12 @@ namespace
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
CreateConfigDir();
|
CreateConfigDir();
|
||||||
DefaultConfiguration(Config);
|
|
||||||
DefaultKeys(Key);
|
Config.SetDefaults();
|
||||||
ReadConfiguration(Config);
|
Key.SetDefaults();
|
||||||
ReadKeys(Key);
|
Config.Read();
|
||||||
|
Key.Read();
|
||||||
|
|
||||||
if (getenv("MPD_HOST"))
|
if (getenv("MPD_HOST"))
|
||||||
Mpd.SetHostname(getenv("MPD_HOST"));
|
Mpd.SetHostname(getenv("MPD_HOST"));
|
||||||
|
|||||||
894
src/settings.cpp
894
src/settings.cpp
File diff suppressed because it is too large
Load Diff
@@ -52,8 +52,11 @@ struct Column
|
|||||||
bool display_empty_tag;
|
bool display_empty_tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ncmpcpp_keys
|
struct NcmpcppKeys
|
||||||
{
|
{
|
||||||
|
void SetDefaults();
|
||||||
|
void Read();
|
||||||
|
|
||||||
int Up[2];
|
int Up[2];
|
||||||
int Down[2];
|
int Down[2];
|
||||||
int PageUp[2];
|
int PageUp[2];
|
||||||
@@ -129,8 +132,11 @@ struct ncmpcpp_keys
|
|||||||
int Quit[2];
|
int Quit[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ncmpcpp_config
|
struct NcmpcppConfig
|
||||||
{
|
{
|
||||||
|
void SetDefaults();
|
||||||
|
void Read();
|
||||||
|
|
||||||
std::string mpd_host;
|
std::string mpd_host;
|
||||||
std::string mpd_music_dir;
|
std::string mpd_music_dir;
|
||||||
std::string visualizer_fifo_path;
|
std::string visualizer_fifo_path;
|
||||||
@@ -242,15 +248,13 @@ struct ncmpcpp_config
|
|||||||
std::list<BasicScreen *> screens_seq;
|
std::list<BasicScreen *> screens_seq;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ncmpcpp_config Config;
|
extern NcmpcppKeys Key;
|
||||||
extern ncmpcpp_keys Key;
|
extern NcmpcppConfig Config;
|
||||||
|
|
||||||
void CreateConfigDir();
|
void CreateConfigDir();
|
||||||
void SetWindowsDimensions(size_t &header_height, size_t &footer_start_y, size_t &footer_height);
|
void SetWindowsDimensions(size_t &header_height, size_t &footer_start_y, size_t &footer_height);
|
||||||
void DefaultKeys(ncmpcpp_keys &);
|
void ReadKeys(NcmpcppKeys &);
|
||||||
void DefaultConfiguration(ncmpcpp_config &);
|
void ReadConfiguration(NcmpcppConfig &);
|
||||||
void ReadKeys(ncmpcpp_keys &);
|
|
||||||
void ReadConfiguration(ncmpcpp_config &);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user