Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv22456/src/gui

Modified Files:
        wxFolderTree.cpp wxFolderView.cpp wxMDialogs.cpp wxMFrame.cpp 
        wxOptionsDlg.cpp 
Log Message:
1. implemented --config=filename command line option support for Windows
2. changes the profile section name handling to account for this: now we
   may use either Unix or Windows-style section names under Windows


Index: wxFolderTree.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderTree.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -b -u -2 -r1.189 -r1.190
--- wxFolderTree.cpp    18 Mar 2002 14:20:06 -0000      1.189
+++ wxFolderTree.cpp    14 Apr 2002 12:16:54 -0000      1.190
@@ -2668,12 +2668,8 @@
       }
 
-      int pos = profileName.Find(M_PROFILE_CONFIG_SECTION);
+      wxString folderName = profileChanged->GetFolderName();
 
-      // don't know how to get folder name...
-      CHECK( pos == 0, true, "weird profile path" )
-
-      // skip the M_PROFILE_CONFIG_SECTION prefix
-      wxString folderName = profileName.c_str() +
-                            strlen(M_PROFILE_CONFIG_SECTION);
+      // we should have a valid folder name
+      CHECK( !folderName.empty(), true, "weird profile path" );
 
       wxTreeItemId item = GetTreeItemFromName(folderName);

Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.576
retrieving revision 1.577
diff -b -u -2 -r1.576 -r1.577
--- wxFolderView.cpp    1 Apr 2002 21:04:37 -0000       1.576
+++ wxFolderView.cpp    14 Apr 2002 12:16:55 -0000      1.577
@@ -992,17 +992,5 @@
 static String GetShortFolderNameFromProfile(const Profile *profile)
 {
-   String name = profile->GetName();
-   if ( !name.StartsWith(String(M_PROFILE_CONFIG_SECTION) + '/', &name) )
-   {
-      if ( name != M_PROFILE_CONFIG_SECTION )
-      {
-         FAIL_MSG( "unexpected profile - what folder does it correspond to?" );
-      }
-      else
-      {
-         // editing global settings
-         name.clear();
-      }
-   }
+   String name = profile->GetFolderName();
 
    if ( name.empty() )

Index: wxMDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v
retrieving revision 1.362
retrieving revision 1.363
diff -b -u -2 -r1.362 -r1.363
--- wxMDialogs.cpp      19 Mar 2002 01:38:41 -0000      1.362
+++ wxMDialogs.cpp      14 Apr 2002 12:16:55 -0000      1.363
@@ -832,6 +832,9 @@
             // should still honour the old settings
 
+            String pathOld = Profile::GetProfilePath().c_str();
+
             // skip the leading slash
-            String pathOld = M_PROFILE_CONFIG_SECTION + 1;
+            pathOld.erase(0, 1);
+
             pathOld.Replace("/", "_");
             pathOld << "_" << path;

Index: wxMFrame.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMFrame.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -b -u -2 -r1.152 -r1.153
--- wxMFrame.cpp        13 Mar 2002 22:30:03 -0000      1.152
+++ wxMFrame.cpp        14 Apr 2002 12:16:55 -0000      1.153
@@ -410,5 +410,5 @@
    {
       String path;
-      path << M_FRAMES_CONFIG_SECTION << '/' << name;
+      path << Profile::GetFramesPath() << '/' << name;
       pConf->SetPath(path);
       *x = GetOptionValue(pConf, MP_XPOS);
@@ -460,5 +460,5 @@
    {
       String path;
-      path << M_FRAMES_CONFIG_SECTION << '/' << name;
+      path << Profile::GetFramesPath() << '/' << name;
 
       pConf->SetPath(path);
@@ -945,5 +945,5 @@
                //        use this identity the section will be recreated...
                String identSection;
-               identSection << M_IDENTITY_CONFIG_SECTION << '/' << ident;
+               identSection << Profile::GetIdentityPath() << '/' << ident;
                profile->DeleteGroup(identSection);
 

Index: wxOptionsDlg.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxOptionsDlg.cpp,v
retrieving revision 1.326
retrieving revision 1.327
diff -b -u -2 -r1.326 -r1.327
--- wxOptionsDlg.cpp    13 Apr 2002 23:34:34 -0000      1.326
+++ wxOptionsDlg.cpp    14 Apr 2002 12:16:55 -0000      1.327
@@ -1976,15 +1976,5 @@
 String wxOptionsPage::GetFolderName() const
 {
-   String name;
-   if ( !m_Profile->GetName().StartsWith
-                              (
-                                 String(M_PROFILE_CONFIG_SECTION) + '/',
-                                 &name
-                              ) )
-   {
-      FAIL_MSG( "unexpected profile name!" );
-   }
-
-   return name;
+   return m_Profile->GetFolderName();
 }
 


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to