------------------------------------------------------------ revno: 3072 committer: cologic <[email protected]> branch nick: dcplusplus timestamp: Fri 2012-10-05 23:20:43 -0400 message: hide buggy -Wformat warnings in mingw64; allow PluginManager to load settings regardless of DCPlusPlus.xml existence/validity; reset missing Lua plugin settings regardless of whether it's upon installation modified: SConstruct dcpp/PluginManager.cpp dcpp/PluginManager.h plugins/Script/Plugin.cpp
-- lp:dcplusplus https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk Your team Dcplusplus-team is subscribed to branch lp:dcplusplus. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'SConstruct' --- SConstruct 2012-10-01 18:25:44 +0000 +++ SConstruct 2012-10-06 03:20:43 +0000 @@ -16,8 +16,11 @@ # TODO enable LTO when it doesn't ICE... (-flto) +# TODO remove -Wno-format when http://cygwin.com/ml/cygwin/2012-01/msg00061.html +# ("mingw64-i686-gcc-4.5.3-4: -Wformat warnings broken in C++") fixed + gcc_flags = { - 'common': ['-g', '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-value', '-Wno-missing-field-initializers', '-Wno-address', '-Wno-unknown-pragmas', '-fexceptions', '-mthreads'], + 'common': ['-g', '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-value', '-Wno-missing-field-initializers', '-Wno-address', '-Wno-unknown-pragmas', '-Wno-format', '-fexceptions', '-mthreads'], 'debug': [], 'release' : ['-O3', '-fno-ipa-cp-clone', '-mwindows'] } === modified file 'dcpp/PluginManager.cpp' --- dcpp/PluginManager.cpp 2012-09-08 13:54:40 +0000 +++ dcpp/PluginManager.cpp 2012-10-06 03:20:43 +0000 @@ -69,6 +69,7 @@ memset(&dcCore, 0, sizeof(DCCore)); #endif SettingsManager::getInstance()->addListener(this); + loadSettings(); // workaround for SettingsManager loading memory of this when loading fails } PluginManager::~PluginManager() { @@ -455,7 +456,7 @@ } // Load / Save settings -void PluginManager::on(SettingsManagerListener::Load, SimpleXML& /*xml*/) noexcept { +void PluginManager::loadSettings() noexcept { Lock l(cs); try { @@ -479,7 +480,11 @@ } catch(const Exception& e) { dcdebug("PluginManager::loadSettings: %s\n", e.getError().c_str()); } - } +} + +void PluginManager::on(SettingsManagerListener::Load, SimpleXML& /*xml*/) noexcept { + loadSettings(); +} void PluginManager::on(SettingsManagerListener::Save, SimpleXML& /*xml*/) noexcept { Lock l(cs); === modified file 'dcpp/PluginManager.h' --- dcpp/PluginManager.h 2012-09-08 13:54:40 +0000 +++ dcpp/PluginManager.h 2012-10-06 03:20:43 +0000 @@ -160,6 +160,9 @@ void removePluginSetting(const string& pluginName, const string& setting); private: + // So the constructor can easily call it. + void loadSettings() noexcept; + // Check if plugin can be loaded bool checkPlugin(const MetaData& info, function<void (const string&)> err); === modified file 'plugins/Script/Plugin.cpp' --- plugins/Script/Plugin.cpp 2012-08-02 17:49:34 +0000 +++ plugins/Script/Plugin.cpp 2012-10-06 03:20:43 +0000 @@ -91,12 +91,17 @@ Util::initialize(core->host_name(), utils, config, logger); - if(install) { - // Default settings + // Default settings + if(Util::getConfig("ScriptPath").empty()) Util::setConfig("ScriptPath", Util::getPath(PATH_RESOURCES) + "scripts" PATH_SEPARATOR_STR); + + if(Util::getConfig("LuaDebug").empty()) Util::setConfig("LuaDebug", false); + + if(Util::getConfig("FormatChat").empty()) Util::setConfig("FormatChat", true); + if(install) { Util::logMessage("Script plugin installed, please restart " + Util::appName + " to begin using the plugin."); return; }
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : [email protected] Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp

