void ConfigManager::readConfiguration() { string homeDir = getenv ("HOME"); this->configurationFile = homeDir + "/.config/garminplugin/garminplugin.xml"; try { this->configuration = new TiXmlDocument(this->configurationFile ); if (this->configuration->LoadFile()) { return; } } catch(ticpp::Exception& ex) { if (Log::enabledInfo()) Log::info("Failed reading configuration from "+this->configurationFile); } this->configurationFile = homeDir + "/.garminplugin.xml"; try { this->configuration = new TiXmlDocument(this->configurationFile ); if (this->configuration->LoadFile()) { return; } } catch(ticpp::Exception& ex) { if (Log::enabledInfo()) Log::info("Failed reading configuration from "+this->configurationFile); } configuration = createNewConfiguration(); }
void ConfigManager::readConfiguration() { string homeDir = getenv ("HOME"); this->configurationFile = homeDir + "/.config/garminplugin/garminplugin.xml"; if (this->configuration != NULL) { delete (this->configuration); this->configuration = NULL; } this->configuration = new TiXmlDocument(this->configurationFile ); if (this->configuration->LoadFile()) { return; } this->configurationFile = homeDir + "/.garminplugin.xml"; this->configuration = new TiXmlDocument(this->configurationFile ); if (this->configuration->LoadFile()) { return; } configuration = createNewConfiguration(); }