Update of /cvsroot/mahogany/M/src/classes
In directory usw-pr-cvs1:/tmp/cvs-serv15854/src/classes
Modified Files:
MFolder.cpp Moptions.cpp
Log Message:
added MF_VIRTUAL and use the type now to choose the folder class instead of profile
entry
Index: MFolder.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MFolder.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -b -u -2 -r1.83 -r1.84
--- MFolder.cpp 17 Jul 2002 00:06:28 -0000 1.83
+++ MFolder.cpp 21 Jul 2002 19:28:08 -0000 1.84
@@ -77,4 +77,16 @@
// ----------------------------------------------------------------------------
+// functions
+// ----------------------------------------------------------------------------
+
+// return the folder class name from its type: currently we don't store the
+// class sepaartely simply because we have only one non default class and only
+// for the folders of one type
+static String GetClassForType(MFolderType type)
+{
+ return type == MF_VIRTUAL ? "virtual" : "cclient";
+}
+
+// ----------------------------------------------------------------------------
// MFolder implementations
// ----------------------------------------------------------------------------
@@ -85,13 +97,12 @@
{
public:
- MTempFolder(const String& kind,
- const String& fullname,
+ MTempFolder(const String& fullname,
MFolderType type,
Profile *profile)
- : m_kind(kind),
- m_fullname(fullname),
- m_type(type),
- m_flags(0)
+ : m_fullname(fullname)
{
+ m_type = type;
+ m_flags = 0;
+
m_profile = profile ? profile : mApplication->GetProfile();
m_profile->IncRef();
@@ -136,5 +147,5 @@
virtual wxString GetFullName() const { return m_fullname; }
virtual MFolderType GetType() const { return m_type; }
- virtual String GetClass() const { return m_kind; }
+ virtual String GetClass() const { return GetClassForType(m_type); }
virtual bool NeedsNetwork(void) const { return false; }
@@ -172,6 +183,5 @@
private:
- String m_kind,
- m_fullname,
+ String m_fullname,
m_path,
m_server,
@@ -531,10 +541,9 @@
/* static */
MFolder *
-MFolder::CreateTemp(const String& kind,
- const String& fullname,
+MFolder::CreateTemp(const String& fullname,
MFolderType type,
Profile *profile)
{
- return new MTempFolder(kind, fullname, type, profile);
+ return new MTempFolder(fullname, type, profile);
}
@@ -543,5 +552,5 @@
MFolder::CreateTempFile(const String& fullname, const String& path, int flags)
{
- MFolder *folder = CreateTemp("", fullname, MF_FILE);
+ MFolder *folder = CreateTemp(fullname, MF_FILE);
if ( folder )
{
@@ -738,15 +747,5 @@
String MFolderFromProfile::GetClass() const
{
- String kind = READ_CONFIG_TEXT(m_profile, MP_FOLDER_CLASS);
-
- // this is a hack needed for backwards compatibility and which also allows
- // to have the empty default value for the folder class which saves quite
- // some bytes in the profile
- if ( kind.empty() )
- {
- kind = "cclient";
- }
-
- return kind;
+ return GetClassForType(GetType());
}
Index: Moptions.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/Moptions.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -b -u -2 -r1.43 -r1.44
--- Moptions.cpp 5 Jul 2002 17:58:35 -0000 1.43
+++ Moptions.cpp 21 Jul 2002 19:28:08 -0000 1.44
@@ -276,5 +276,4 @@
const MOption MP_COMPOSE_XFACE_FILE;
const MOption MP_FOLDER_TYPE;
-const MOption MP_FOLDER_CLASS;
const MOption MP_FOLDER_TRY_CREATE;
const MOption MP_FOLDER_ICON;
@@ -661,5 +660,4 @@
DEFINE_OPTION(MP_COMPOSE_XFACE_FILE),
DEFINE_OPTION(MP_FOLDER_TYPE),
- DEFINE_OPTION(MP_FOLDER_CLASS),
DEFINE_OPTION(MP_FOLDER_TRY_CREATE),
DEFINE_OPTION(MP_FOLDER_ICON),
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates