From: Mike J. <mrj...@mi...> - 2008-03-29 01:28:19
|
Because it's instantiated statically before main is called. :-) > + QSettings s("TOra", "TOra"); // FIXME: WTF it does not use QCoreApp settings?! > s.beginGroup("preferences"); > m_provider = s.value(CONF_PROVIDER, DEFAULT_PROVIDER).toString(); > m_savePassword = s.value(CONF_SAVE_PWD, DEFAULT_SAVE_PWD).toBool(); > @@ -413,8 +415,7 @@ > m_connectSize = s.value(CONF_CONNECT_SIZE, DEFAULT_CONNECT_SIZE).toInt(); > > // #define CONF_CONNECT_CURRENT "ConnectCurrent" > - m_defaultTool = s.value(CONF_DEFAULT_TOOL, "").toString(); > - > + m_defaultTool = s.value(CONF_DEFAULT_TOOL).toString(); > // #define CONF_TOOL_ENABLE "Enabled" > m_chartSamples = s.value(CONF_CHART_SAMPLES, DEFAULT_CHART_SAMPLES).toInt(); > m_displaySamples = s.value(CONF_DISPLAY_SAMPLES, DEFAULT_DISPLAY_SAMPLES).toInt(); > @@ -564,6 +565,7 @@ > m_syntaxDebugBg = s.value("SyntaxDebugBg", "darkgreen").toString(); > > s.endGroup(); > + qDebug() << "err: " << s.status(); > } > > toConfiguration::~toConfiguration() > > Modified: trunk/tora/src/toglobalsetting.cpp > =================================================================== > --- trunk/tora/src/toglobalsetting.cpp 2008-03-28 15:04:24 UTC (rev 2646) > +++ trunk/tora/src/toglobalsetting.cpp 2008-03-28 16:02:07 UTC (rev 2647) > @@ -429,9 +429,9 @@ > /* QString str = (*it)->text(2).toLatin1(); > str += CONF_TOOL_ENABLE; > toConfigurationSingle::Instance().globalSetConfig(str, (*it)->isSelected() ? "Yes" : ""); > - > +*/ > if (DefaultTool->currentText() == (*it)->text(0)) > - toConfigurationSingle::Instance().setDefaultTool((*it)->text(2));*/ > + toConfigurationSingle::Instance().setDefaultTool((*it)->text(2)); > > } > toConfigurationSingle::Instance().setTools(tMap); > > Modified: trunk/tora/src/tomain.cpp > =================================================================== > --- trunk/tora/src/tomain.cpp 2008-03-28 15:04:24 UTC (rev 2646) > +++ trunk/tora/src/tomain.cpp 2008-03-28 16:02:07 UTC (rev 2647) > @@ -135,14 +135,16 @@ > std::map<QString, toTool *> &tools = toTool::tools(); > > QString defName(toConfigurationSingle::Instance().defaultTool()); > - > DefaultTool = NULL; > for (std::map<QString, toTool *>::iterator k = tools.begin(); > k != tools.end(); > k++) { > > - if(defName == (*k).first) > + if (defName == (*k).first) > + { > DefaultTool = (*k).second; > + break; > + } > > // if there is no default tool, set the first one > if(defName.isEmpty() && !DefaultTool) > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tora-cvs mailing list > Tor...@li... > https://lists.sourceforge.net/lists/listinfo/tora-cvs |