|
From: Emilien K. <cur...@us...> - 2005-08-12 15:49:31
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23276/src Modified Files: Plugin.cpp Log Message: Fix some state flags settings. Add some debug output to say if features/plugins/modules are loaded. Index: Plugin.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Plugin.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Plugin.cpp 12 Aug 2005 09:25:19 -0000 1.8 --- Plugin.cpp 12 Aug 2005 15:49:23 -0000 1.9 *************** *** 52,56 **** { wxString str; ! str << m_strPath << wxT(" : ") << m_Elements.GetCount() << wxT(" objects registered.") << wxT("\n"); return str; } --- 52,59 ---- { wxString str; ! if(m_flagState==Error) ! str << m_strPath << wxT(" not loaded.\n"); ! else ! str << m_strPath << wxT(" : ") << m_Elements.GetCount() << wxT(" objects registered.") << wxT("\n"); return str; } *************** *** 70,74 **** long l=0; wxString strPath; ! while(strPath = Application::GetApp().GetConfig().GetPluginsPath(), !strPath.IsEmpty()) { strPath += wxT("/") + m_strPath; --- 73,77 ---- long l=0; wxString strPath; ! while(strPath = Application::GetApp().GetConfig().GetPluginsPath(l++), !strPath.IsEmpty()) { strPath += wxT("/") + m_strPath; *************** *** 84,94 **** --- 87,105 ---- Element::s_pElementManager = pOldBEM; if(flag) + { + m_flagState |= Loaded; wxLogDebug(wxT("Module %s loaded"), strLongName.GetData()); + } else + { + m_flagState = Error; wxLogDebug(wxT("Module %s loading error"), strLongName.GetData()); + } return flag; } } + m_flagState = Error; wxLogDebug(wxT("Module %s not found"), strLongName.GetData()); + return false; } *************** *** 111,114 **** --- 122,129 ---- bOK &= m_Elements[l].Initialize(); } + if(bOK) + m_flagState |= Initialized; + else + m_flagState = Error; return bOK; } *************** *** 117,120 **** --- 132,136 ---- bool ModuleRefData::Finalize() { + /** @todo Finalize all dependant elements.*/ return false; } *************** *** 213,223 **** { wxString str; ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! str << wxT("Used modules : ") << m_arrstrModules.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrModules.GetCount(); l++) ! str << wxT(" - ") << m_arrstrModules[l] << wxT("\n"); return str; } --- 229,244 ---- { wxString str; ! if((m_Status&ErrMask)!=0) ! str << m_strName << wxT(" not loaded.\n"); ! else ! { ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! str << wxT("Used modules : ") << m_arrstrModules.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrModules.GetCount(); l++) ! str << wxT(" - ") << m_arrstrModules[l] << wxT("\n"); ! } return str; } *************** *** 261,265 **** File.FillModuleArray(m_arrstrModules); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; return true; } --- 282,286 ---- File.FillModuleArray(m_arrstrModules); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status |= PreLoaded; return true; } *************** *** 286,290 **** bOk &= m_pLoader->LoadModule(strName + wxT("/") + m_arrstrModules[l])!=NULL; ! m_Status = Loaded | (bOk?0:Partial); return bOk; --- 307,311 ---- bOk &= m_pLoader->LoadModule(strName + wxT("/") + m_arrstrModules[l])!=NULL; ! m_Status |= Loaded | (bOk?0:Partial); return bOk; *************** *** 330,341 **** { wxString str; ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used features : ") << m_arrstrFeatures.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrFeatures.GetCount(); l++) ! str << wxT(" - ") << m_arrstrFeatures[l] << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! return str; } ) --- 351,367 ---- { wxString str; ! if((m_Status&ErrFlag)!=0) ! str << m_strName << wxT(" not loaded.\n"); ! else ! { ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used features : ") << m_arrstrFeatures.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrFeatures.GetCount(); l++) ! str << wxT(" - ") << m_arrstrFeatures[l] << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! } ! return str; } ) *************** *** 377,381 **** File.FillDependantFeatureArray(m_arrstrFeatures); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; return true; } --- 403,407 ---- File.FillDependantFeatureArray(m_arrstrFeatures); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status |= PreLoaded; return true; } *************** *** 402,406 **** bOk &= m_pLoader->LoadPlugin(m_arrstrPlugins[l])!=NULL; ! m_Status = Loaded | (bOk?0:Partial); return bOk; --- 428,432 ---- bOk &= m_pLoader->LoadPlugin(m_arrstrPlugins[l])!=NULL; ! m_Status |= Loaded | (bOk?0:Partial); return bOk; *************** *** 545,549 **** str << wxT("Plugin loader : ") << wxT("\n"); ! str << wxT("Features : ") << m_FeatureMap.size() << wxT("\n"); FeatureMap::iterator it1; for( it1 = m_FeatureMap.begin(); it1 != m_FeatureMap.end(); ++it1 ) --- 571,575 ---- str << wxT("Plugin loader : ") << wxT("\n"); ! str << wxT("*** Features : ") << m_FeatureMap.size() << wxT(" ***\n"); FeatureMap::iterator it1; for( it1 = m_FeatureMap.begin(); it1 != m_FeatureMap.end(); ++it1 ) *************** *** 553,557 **** } ! str << wxT("Plugins : ") << m_PluginMap.size() << wxT("\n"); PluginMap::iterator it2; for( it2 = m_PluginMap.begin(); it2 != m_PluginMap.end(); ++it2 ) --- 579,583 ---- } ! str << wxT("*** Plugins : ") << m_PluginMap.size() << wxT(" ***\n"); PluginMap::iterator it2; for( it2 = m_PluginMap.begin(); it2 != m_PluginMap.end(); ++it2 ) *************** *** 561,565 **** } ! str << wxT("Modules : ") << m_ModuleMap.size() << wxT("\n"); ModuleMap::iterator it3; for( it3 = m_ModuleMap.begin(); it3 != m_ModuleMap.end(); ++it3 ) --- 587,591 ---- } ! str << wxT("*** Modules : ") << m_ModuleMap.size() << wxT(" ***\n"); ModuleMap::iterator it3; for( it3 = m_ModuleMap.begin(); it3 != m_ModuleMap.end(); ++it3 ) |