Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6784/src/gui

Modified Files:
        wxMFolderDialogs.cpp wxSubfoldersDialog.cpp 
Log Message:
1. removed MailFolder::GetImapSpec(), it doesn't make sense for an ABC
2. (AS)MailFolder::ListFolders() now always returns relative paths instead
   of IMAP specs


Index: wxMFolderDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMFolderDialogs.cpp,v
retrieving revision 1.190
retrieving revision 1.191
diff -b -u -2 -r1.190 -r1.191
--- wxMFolderDialogs.cpp        10 Feb 2004 22:44:06 -0000      1.190
+++ wxMFolderDialogs.cpp        30 Jun 2005 23:39:47 -0000      1.191
@@ -2560,33 +2560,4 @@
          // always assume the the folder does have children - and if later we
          // find out that it doesn't we just reset MF_FLAGS_GROUP then
-#if 0
-         // we need login/password for this
-         if ( !(!password || !loginName) ||
-              (flags & MF_FLAGS_ANON) ||
-              MDialog_GetPassword(fullname, &password, &loginName) )
-         {
-            // and also the IMAP server (already written above)
-            String server = folder->GetServer();
-
-            // got them all, build the spec and check the flag
-            String spec = MailFolder::GetImapSpec
-                          (
-                           MF_IMAP,
-                           flags,
-                           m_mailboxname->GetValue(),
-                           server,
-                           loginName
-                          );
-
-            wxLogStatus(_("Connecting to the IMAP server %s..."),
-                        server.c_str());
-
-            if ( MailFolderCC::HasInferiors(spec, loginName, password) )
-            {
-               flags |= MF_FLAGS_GROUP;
-            }
-         }
-#endif // 0
-
          WriteEntryIfChanged(Path, m_mailboxname->GetValue());
          break;

Index: wxSubfoldersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxSubfoldersDialog.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -b -u -2 -r1.81 -r1.82
--- wxSubfoldersDialog.cpp      21 Apr 2004 21:41:27 -0000      1.81
+++ wxSubfoldersDialog.cpp      30 Jun 2005 23:39:48 -0000      1.82
@@ -87,5 +87,5 @@
 static void RemoveTrailingDelimiters(wxString *s, wxChar chDel = '/')
 {
-   // now remove trailing backslashes if any
+   // now remove trailing slashes if any
    size_t len = s->length();
    while ( len > 0 && (*s)[len - 1] == chDel )
@@ -166,5 +166,5 @@
    wxChar m_chDelimiter;
 
-   // the full spec of the folder whose children we're currently listing
+   // the path of the folder whose children we're currently listing
    wxString m_reference;
 
@@ -257,5 +257,5 @@
 
    // callbacks
-   void OnChar(wxKeyEvent& event);
+   void OnKeyDown(wxKeyEvent& event);
 
 private:
@@ -308,5 +308,5 @@
    int m_flagsParent;
 
-   // the full spec of the folder whose children we're currently listing
+   // the path of the folder whose children we're currently listing
    wxString m_reference;
 };
@@ -321,5 +321,5 @@
 
 BEGIN_EVENT_TABLE(wxFolderNameTextCtrl, wxTextCtrl)
-   EVT_CHAR(wxFolderNameTextCtrl::OnChar)
+   EVT_KEY_DOWN(wxFolderNameTextCtrl::OnKeyDown)
 END_EVENT_TABLE()
 
@@ -360,6 +360,4 @@
    m_mailFolder->IncRef();
 
-   m_reference = m_mailFolder->GetImapSpec();
-
    m_progressInfo = (MProgressInfo *)NULL;
    m_chDelimiter = m_mailFolder->GetFolderDelimiter();
@@ -382,5 +380,5 @@
          RemoveTrailingDelimiters(&m_folderPath);
 
-         // andnow only leave the last component
+         // and now only leave the last component
          m_folderPath = m_folderPath.AfterLast('/');
       }
@@ -455,6 +453,5 @@
       if ( !m_reference.empty() )
       {
-         wxChar chLast = m_reference.Last();
-         if ( chLast != '}' && chLast != m_chDelimiter )
+         if ( m_reference.Last() != m_chDelimiter )
          {
             ASSERT_MSG( m_chDelimiter, _T("should have folder name separator") 
);
@@ -469,15 +466,5 @@
 
       // now OnNewFolder() and OnNoMoreFolders() will be called
-      //
-      // NB: the cast below is needed as ListEventReceiver compares the user
-      //     data in the results it gets with "this" and its this pointer is
-      //     different from our "this" as we use multiple inheritance
-      m_mailFolder->ListFolders
-                    (
-                       _T("%"),         // everything at this tree level
-                       FALSE,       // subscribed only?
-                       reference,   // path relative to the folder
-                       (ListEventReceiver *)this  // data for the callback
-                    );
+      List(m_mailFolder, _T("%"), reference);
 
       // process the events from ListFolders
@@ -519,5 +506,5 @@
    }
 
-   // we're passed a folder specification - extract the folder name from it
+   // we're passed a folder path -- extract the folder name from it
    wxString name;
    if ( spec.StartsWith(m_reference, &name) )
@@ -525,7 +512,7 @@
       if ( m_chDelimiter )
       {
-         if ( !!name && name[0u] == m_chDelimiter )
+         if ( *name.c_str() == m_chDelimiter )
          {
-            name = name.c_str() + 1;
+            name.erase(0, 1);
          }
       }
@@ -674,11 +661,15 @@
 // ----------------------------------------------------------------------------
 
-void wxFolderNameTextCtrl::OnChar(wxKeyEvent& event)
+void wxFolderNameTextCtrl::OnKeyDown(wxKeyEvent& event)
 {
    ASSERT( event.GetEventObject() == this ); // how can we get anything else?
 
-   // we're only interested in TABs and only it's not a second TAB in a row
-   if ( event.GetKeyCode() == WXK_TAB )
+   // we're only interested in TABs and only if it's not a second TAB in a row
+   if ( event.GetKeyCode() != WXK_TAB )
    {
+      event.Skip();
+      return;
+   }
+
       if ( IsModified() &&
            !event.ControlDown() && !event.ShiftDown() && !event.AltDown() )
@@ -698,9 +689,8 @@
       //else: nothing because we're not interested in Ctrl-TAB, Shift-TAB &c -
       //      and also in the TABs if the last one was already a TAB
-   }
 
-   // let the text control process it normally: if it's a TAB this will make
-   // the focus go to the next window
-   event.Skip();
+   // handle TAB as usually: navigate to the next control (or previous one
+   // with Shift)
+   Navigate(!event.ShiftDown());
 }
 
@@ -987,6 +977,7 @@
 bool wxSubscriptionDialog::OnComplete(wxTextCtrl *textctrl)
 {
-   if ( !!m_completion )
-   {
+   if ( !m_completion.empty() )
+      return false;
+
       m_settingFromProgram = true;
 
@@ -997,9 +988,4 @@
 
       return true;
-   }
-   else
-   {
-      return false;
-   }
 }
 
@@ -1021,5 +1007,5 @@
       bool isGroup = m_treectrl->ItemHasChildren(id);
 
-      // construct the full folder name by going upwars the tree and
+      // construct the full folder name by going upwards the tree and
       // concatenating everything
       wxArrayString components;
@@ -1141,5 +1127,4 @@
    m_flagsParent = m_folder->GetFlags();
 
-   m_reference = mailFolder->GetImapSpec();
    m_nFoldersRetrieved = 0u;
    m_finished = false;
@@ -1211,7 +1196,7 @@
    {
       // remove the leading delimiter to get a relative name
-      if ( name[0u] == chDelimiter && chDelimiter != '\0')
+      if ( chDelimiter != '\0' && *name.c_str() == chDelimiter )
       {
-         name = name.c_str() + 1;
+         name.erase(0, 1);
       }
    }



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to