- if ( !strGlobal.IsEmpty() && !wxIsPathSeparator(strGlobal[0u]) )
- m_strGlobalFile = GetGlobalDir();
- m_strGlobalFile << strGlobal;
+ // Make up names for files if empty
+ if (m_strLocalFile.IsEmpty() && (style & wxCONFIG_USE_LOCAL_FILE) && wxTheApp)
+ {
+ m_strLocalFile = wxTheApp->GetAppName();
+ }
+
+ if (m_strGlobalFile.IsEmpty() && (style & wxCONFIG_USE_GLOBAL_FILE))
+ {
+ // TODO: What should the default global filename be?
+ m_strGlobalFile = "global";
+ }
+
+ // Check if styles are not supplied, but filenames are, in which case
+ // add the correct styles.
+ if (!m_strLocalFile.IsEmpty() && ((style & wxCONFIG_USE_LOCAL_FILE) != wxCONFIG_USE_LOCAL_FILE))
+ SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE);
+
+ if (!m_strGlobalFile.IsEmpty() && ((style & wxCONFIG_USE_GLOBAL_FILE) != wxCONFIG_USE_GLOBAL_FILE))
+ SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE);
+
+ // if the path is not absolute, prepend the standard directory to it
+ if ( !strLocal.IsEmpty() && !wxIsAbsolutePath(strLocal) )
+ {
+ m_strLocalFile = GetLocalDir();
+ m_strLocalFile << strLocal;
+ }
+
+ if ( !strGlobal.IsEmpty() && !wxIsAbsolutePath(strGlobal) )
+ {
+ m_strGlobalFile = GetGlobalDir();
+ m_strGlobalFile << strGlobal;
+ }