diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-28 08:15:31 -0700 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-04-06 21:21:54 +0200 |
commit | 76bdc9681799a7ed17be1cddbe7b91adef242373 (patch) | |
tree | 53a7cd1d14a5233938704015404d9ea1f5e4490d /src/client.cpp | |
parent | 59919635523d41f3a15120c83db4b7d080c155de (diff) | |
download | mana-76bdc9681799a7ed17be1cddbe7b91adef242373.tar.gz mana-76bdc9681799a7ed17be1cddbe7b91adef242373.tar.bz2 mana-76bdc9681799a7ed17be1cddbe7b91adef242373.tar.xz mana-76bdc9681799a7ed17be1cddbe7b91adef242373.zip |
Removed seemingly pointless config file checksremoved-config-file-checks
* When config file can't be read, it will be reported by
Configuration::init.
* When config file can't be written, xmlNewTextWriterFilename will
probably return nullptr.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/client.cpp b/src/client.cpp index 2a854bc0..afd53fa3 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1175,30 +1175,7 @@ void Client::initConfiguration() config.setValue("ChatLogLength", 128); config.setValue("disableTransparency", false); - // Checking if the configuration file exists... otherwise create it with - // default options. - FILE *configFile = nullptr; - std::string configPath; - - configPath = mConfigDir + "/config.xml"; - - configFile = fopen(configPath.c_str(), "r"); - - // If we can't read it, it doesn't exist ! - if (!configFile) - { - // We reopen the file in write mode and we create it - configFile = fopen(configPath.c_str(), "wt"); - } - if (!configFile) - { - logger->log("Can't create %s. Using defaults.", configPath.c_str()); - } - else - { - fclose(configFile); - config.init(configPath); - } + config.init(mConfigDir + "config.xml"); } /** |