Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv22456/include
Modified Files:
MFolder.h Mdefaults.h Profile.h
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: MFolder.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MFolder.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -b -u -2 -r1.46 -r1.47
--- MFolder.h 27 Mar 2002 19:37:16 -0000 1.46
+++ MFolder.h 14 Apr 2002 12:16:54 -0000 1.47
@@ -243,7 +243,6 @@
MFolder_obj(const Profile *profile)
{
- String name;
- if ( profile->GetName().
- StartsWith(String(M_PROFILE_CONFIG_SECTION) + '/', &name) )
+ String name = profile->GetFolderName();
+ if ( !name.empty() )
{
Init(name);
Index: Mdefaults.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Mdefaults.h,v
retrieving revision 1.252
retrieving revision 1.253
diff -b -u -2 -r1.252 -r1.253
--- Mdefaults.h 18 Jan 2002 20:08:37 -0000 1.252
+++ Mdefaults.h 14 Apr 2002 12:16:54 -0000 1.253
@@ -26,25 +26,9 @@
*/
#ifndef M_PROFILE_CONFIG_SECTION
-# ifdef OS_WIN
-# define M_PROFILE_CONFIG_SECTION "/Profiles"
-# define M_IDENTITY_CONFIG_SECTION "/Ids"
-# define M_FILTERS_CONFIG_SECTION "/Filters"
-# define M_FRAMES_CONFIG_SECTION "/Frames"
-# define M_TEMPLATES_CONFIG_SECTION "/Templates"
-# else // Unix
-# define M_PROFILE_CONFIG_SECTION "/M/Profiles"
-# define M_IDENTITY_CONFIG_SECTION "/M/Ids"
-# define M_FILTERS_CONFIG_SECTION "/M/Filters"
-# define M_FRAMES_CONFIG_SECTION "/M/Frames"
-# define M_TEMPLATES_CONFIG_SECTION "/M/Templates"
-# endif // Unix/Win
-
- // these are used for remote IMAP sync: we have to use the same format for
- // the remote settings and we choose to use Unix one
-# define M_PROFILE_CONFIG_SECTION_UNIX "/M/Profiles"
-# define M_IDENTITY_CONFIG_SECTION_UNIX "/M/Ids"
-# define M_FILTERS_CONFIG_SECTION_UNIX "/M/Filters"
-# define M_FRAMES_CONFIG_SECTION_UNIX "/M/Frames"
-# define M_TEMPLATES_CONFIG_SECTION_UNIX "/M/Templates"
+ #define M_PROFILE_CONFIG_SECTION "/M/Profiles"
+ #define M_IDENTITY_CONFIG_SECTION "/M/Ids"
+ #define M_FILTERS_CONFIG_SECTION "/M/Filters"
+ #define M_FRAMES_CONFIG_SECTION "/M/Frames"
+ #define M_TEMPLATES_CONFIG_SECTION "/M/Templates"
#endif
Index: Profile.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Profile.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -b -u -2 -r1.70 -r1.71
--- Profile.h 4 Dec 2001 21:49:08 -0000 1.70
+++ Profile.h 14 Apr 2002 12:16:54 -0000 1.71
@@ -1,9 +1,14 @@
-/*-*- c++ -*-********************************************************
- * Profile - managing configuration options on a per class basis *
- * *
- * (C) 1998,1999 by Karsten Ball�der ([EMAIL PROTECTED]) *
- * *
- * $Id$
- *******************************************************************/
+///////////////////////////////////////////////////////////////////////////////
+// Project: M - cross platform e-mail GUI client
+// File name: Profile.h: Mahogany Profile class
+// Purpose: Profiles are used for storing all program options and much more
+// Author: Karsten Ball�der
+// Modified by:
+// Created: 1997
+// CVS-ID: $Id$
+// Copyright: (c) 1997-2002 Mahogany team
+// Licence: M licence
+///////////////////////////////////////////////////////////////////////////////
+
#ifndef PROFILE_H
#define PROFILE_H
@@ -18,4 +23,5 @@
#include "MObject.h"
+#include "Mdefaults.h" // for M_PROFILE_CONFIG_SECTION &c
class kbStringList;
@@ -184,7 +190,40 @@
virtual String GetFolderName() const = 0;
+ /**
+ @name Return config paths used
+
+ Returns the paths we use in wxConfig object for various entities stored in
+ the profiles.
+ */
+ //@{
+
+ /// return the path used for the normal config info (folders options &c)
+ static String GetProfilePath()
+ { return GetSectionPath(M_PROFILE_CONFIG_SECTION); }
+
+ /// return the path under which the identities are stored
+ static String GetIdentityPath()
+ { return GetSectionPath(M_IDENTITY_CONFIG_SECTION); }
+
+ /// return the path under which the filters are stored
+ static String GetFiltersPath()
+ { return GetSectionPath(M_FILTERS_CONFIG_SECTION); }
+
+ /// return the path under which the frame options are stored
+ static String GetFramesPath()
+ { return GetSectionPath(M_FRAMES_CONFIG_SECTION); }
+
+ /// return the path under which the templates are stored
+ static String GetTemplatesPath()
+ { return GetSectionPath(M_TEMPLATES_CONFIG_SECTION); }
+
+ //@}
+
protected:
- /// why does egcs want this?
- Profile() {}
+ // egcs wants this
+ Profile() { }
+
+ /// helper of all GetXXXPath() functions
+ static String GetSectionPath(const String& section);
/// global wxConfig object, shared by all profiles
@@ -198,5 +237,5 @@
Profile(const Profile &);
/// forbid assignments
- Profile & operator=(const Profile & );
+ Profile& operator=(const Profile & );
};
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates