|
From: Emilien K. <cur...@us...> - 2005-02-23 14:21:31
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5705/src/unix Modified Files: Config.cpp Log Message: Transfert de la fonction Config::CreateSubConfig vers les spécialisations unix et msw. Index: Config.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/unix/Config.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Config.cpp 23 Feb 2005 13:39:59 -0000 1.4 --- Config.cpp 23 Feb 2005 14:21:22 -0000 1.5 *************** *** 26,29 **** --- 26,33 ---- + #include <wx/config.h> + #include <wx/fileconf.h> + + using namespace wxDevCenter; *************** *** 136,137 **** --- 140,173 ---- // Ne fait rien sous unix } + + // Crée une sous-configuration et la place dans le dictionnaire. + bool ConfigUnix::CreateSubConfig(wxString strSubConfName) + { + wxFileConfig* pFC; + wxString strAppName, strDir; + strAppName << WXDC_SETUP_APPIDENT << wxT("/") << strSubConfName; + + // Création du répertoire de config global + strDir = GetGlobalConfPath() + wxT("/") + strSubConfName; + strDir.Replace(wxT("\\"), wxT("/")); + strDir = strDir.BeforeLast(wxT('/')); + if(!wxDirExists(strDir)) + wxMkDir(strDir, 0777); + // Création du répertoire de config utilisateur + strDir = GetUserConfPath() + wxT("/") + strSubConfName; + strDir.Replace(wxT("\\"), wxT("/")); + strDir = strDir.BeforeLast(wxT('/')); + if(!wxDirExists(strDir)) + wxMkDir(strDir, 0777); + + pFC = new wxFileConfig(strAppName, WXDC_SETUP_VENDOR, + GetUserConfPath() + wxT("/") + strSubConfName + wxT(".conf"), + GetGlobalConfPath() + wxT("/") + strSubConfName + wxT(".conf")); + + wxConfigBase* pConf = m_SubConfigMap[strSubConfName]; + if(pConf!=NULL) + delete pConf; + m_SubConfigMap[strSubConfName] = pFC; + + return true; + } |