On Tuesday, 24. April 2007, David Southwell wrote:
> On Tuesday 24 April 2007 08:44:14 Michael Nottebrock wrote:
> > On Tuesday, 24. April 2007, David Southwell wrote:
> > > On Monday 23 April 2007 12:17:14 Michael Nottebrock wrote:
> > > > On Monday, 23. April 2007, David Southwell wrote:
> > > > > Hi
> > > > >
> > > > > A couple of us have posted reports to the kde-pim list about
> > > > > peculiar kmail crashes and not received any replies.
> > > > >
> > > > > The crashes are frequent and peculiar resulting in a total freeze
> > > > > of the X-window and necessitating ctl-alt-backspace to force logout
> > > > >  In my case the crashes seem to be occuring more frequently in
> > > > > particular folders e.g. on that carries traffic from
> > > > > [EMAIL PROTECTED]  I am wondering if there is a bug in
> > > > > filter system that results in lack of syncronicity mails listed as
> > > > > present in a folder and those actually accesible from the folder.
> > > >
> > > > Could it be http://bugs.kde.org/show_bug.cgi?id=126715? The current
> > > > kdepim3 ports doesn't include the patches referenced in this bug
> > > > report.
> > > >
> > > > Cheers,
> > >
> > > Thanks for getting back to me. From reading that bug report it looks as
> > > though this is the same bug.
> > >
> > > Is there any likliehood of kdepim3 be upgraded to include the fix or
> > > should I try and apply the patch. If the latter I need some detailed
> > > instructions as I am not familiar with the process.
> >
> > I will try and prepare a patchset for you to check out, but it might take
> > another day or two before I get around to do it.
> >
> > Cheers,
>
> Thank you so much ..
>
> Whenever it works for you will be appreciated by me.

Save the file attached to this email into /usr/ports/deskutils/kdepim3/files, 
then recompile and reinstall the kdepim3 port.

Dmitry, I'm cc'ing you since you originally reported the bug 
(http://bugs.kde.org/show_bug.cgi?id=143718) - let me know if the patch works 
for you.


Cheers,
-- 
   ,_,   | Michael Nottebrock               | [EMAIL PROTECTED]
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
--- kmail/kmailicalifaceimpl.cpp	2007/03/09 17:06:16	640993
+++ kmail/kmailicalifaceimpl.cpp	2007/03/21 06:57:39	644873
@@ -555,6 +555,7 @@
 #endif
     }
   }
+  f->close();
   return aMap;
 }
 
--- kmail/kmcomposewin.cpp	2007/03/19 16:40:22	644271
+++ kmail/kmcomposewin.cpp	2007/03/21 06:57:39	644873
@@ -3928,12 +3928,11 @@
   if ( imapTheFolder && imapTheFolder->noContent() )
     imapTheFolder = 0;
 
-  if ( theFolder == 0 ) {
+  if ( theFolder == 0 )
     theFolder = ( mSaveIn==KMComposeWin::Drafts ?
                   kmkernel->draftsFolder() : kmkernel->templatesFolder() );
-  } else {
-    theFolder->open();
-  }
+
+  theFolder->open();
   kdDebug(5006) << k_funcinfo << "theFolder=" << theFolder->name() << endl;
   if ( imapTheFolder )
     kdDebug(5006) << k_funcinfo << "imapTheFolder=" << imapTheFolder->name() << endl;
@@ -3951,6 +3950,7 @@
     (static_cast<KMFolderImap*>( imapTheFolder->storage() ))->getFolder();
   }
 
+  theFolder->close();
   return sentOk;
 }
 
--- kmail/kmfolderimap.cpp	2007/03/16 21:54:53	643329
+++ kmail/kmfolderimap.cpp	2007/03/21 06:57:39	644873
@@ -109,13 +109,13 @@
 void KMFolderImap::close(bool aForced)
 {
   if (mOpenCount <= 0 ) return;
-  if (mOpenCount > 0) mOpenCount--;
-  if (mOpenCount > 0 && !aForced) return;
+  if (mOpenCount - 1 > 0 && !aForced) return;
   if (isSelected() && !aForced) {
       kdWarning(5006) << "Trying to close the selected folder " << label() <<
-          " - ignoring!" << endl;
+        " - ignoring! " << kdBacktrace() << endl;
       return;
   }
+  if (mOpenCount > 0) mOpenCount--;
   // FIXME is this still needed?
   if (mAccount)
     mAccount->ignoreJobsForFolder( folder() );
@@ -695,7 +695,6 @@
         KMFolderImap* f = static_cast<KMFolderImap*> ( fld->storage() );
         f->initializeFrom( this, mAccount->addPathToNamespace( name ),
             "inode/directory" );
-        f->close();
         if ( !mAccount->listOnlyOpenFolders() )
         {
           f->slotListResult( subfolderNames, subfolderPaths,
@@ -811,7 +810,6 @@
       KMFolder *fld = folder()->child()->createFolder(subfolderNames[i]);
       if ( fld ) {
         f = static_cast<KMFolderImap*> ( fld->storage() );
-        f->close();
         settingsChanged = true;
       } else {
         kdWarning(5006) << "can't create folder " << subfolderNames[i] << endl;
@@ -876,7 +874,6 @@
     if ( f )
     {
       f->folder()->setLabel( i18n("inbox") );
-      f->close();
     }
     kmkernel->imapFolderMgr()->contentsChanged();
   }
@@ -996,7 +993,6 @@
 {
   if (!mAccount) {
     emit folderComplete(this, false);
-    close();
     return;
   }
   KURL url = mAccount->getUrl();
@@ -1012,7 +1008,6 @@
     kdDebug(5006) << "KMFolderImap::checkValidity - got no connection" << endl;
     emit folderComplete(this, FALSE);
     mContentState = imapNoInformation;
-    close();
     return;
   } else if ( connectionState == ImapAccountBase::Connecting ) {
     // We'll wait for the connectionResult signal from the account. If it
@@ -1025,7 +1020,6 @@
   // Only check once at a time.
   if (mCheckingValidity) {
     kdDebug(5006) << "KMFolderImap::checkValidity - already checking" << endl;
-    close();
     return;
   }
   // otherwise we already are inside a mailcheck
@@ -1045,6 +1039,7 @@
   if ( account()->mailCheckProgressItem() ) {
     account()->mailCheckProgressItem()->setStatus( folder()->prettyURL() );
   }
+  open();
   ImapAccountBase::jobData jd( url.url() );
   KIO::SimpleJob *job = KIO::get(url, FALSE, FALSE);
   KIO::Scheduler::assignJobToSlave(mAccount->slave(), job);
@@ -1144,6 +1139,7 @@
       mMailCheckProgressItem->setCompletedItems( 0 );
     }
     reallyGetFolder(startUid);
+    close();
   }
 }
 
@@ -1178,6 +1174,7 @@
     mCheckFlags = TRUE;
   }
   checkValidity();
+  close();
 }
 
 
@@ -1189,7 +1186,6 @@
   {
     mContentState = imapNoInformation;
     emit folderComplete(this, FALSE);
-    close();
     return;
   }
   quiet(true);
@@ -1199,6 +1195,7 @@
       mMailCheckProgressItem->setStatus( i18n("Retrieving message status") );
     url.setPath(imapPath() + ";SECTION=UID FLAGS");
     KIO::SimpleJob *job = KIO::listDir(url, FALSE);
+    open();
     KIO::Scheduler::assignJobToSlave(mAccount->slave(), job);
     ImapAccountBase::jobData jd( url.url(), folder() );
     jd.cancellable = true;
@@ -1218,6 +1215,7 @@
     KIO::Scheduler::assignJobToSlave(mAccount->slave(), newJob);
     ImapAccountBase::jobData jd( url.url(), folder() );
     jd.cancellable = true;
+    open();
     mAccount->insertJob(newJob, jd);
     connect(newJob, SIGNAL(result(KIO::Job *)),
             this, SLOT(slotGetLastMessagesResult(KIO::Job *)));
@@ -1310,6 +1308,9 @@
   else sets = makeSets( (*it).items );
   mAccount->removeJob(it); // don't use *it below
 
+  if ( sets.isEmpty() )
+    close();
+
   // Now kick off the getting of envelopes for the new mails in the folder
   for (QStringList::Iterator i = sets.begin(); i != sets.end(); ++i)
   {
@@ -1812,6 +1813,7 @@
 
 void KMFolderImap::setStatus(QValueList<int>& ids, KMMsgStatus status, bool toggle)
 {
+  open();
   FolderStorage::setStatus(ids, status, toggle);
   if (mReadOnly) return;
 
@@ -1855,6 +1857,7 @@
     quiet( false );
     reallyGetFolder( QString::null );
   }
+  close();
 }
 
 //-----------------------------------------------------------------------------
--- kmail/kmheaders.cpp	2007/01/05 18:17:45	620346
+++ kmail/kmheaders.cpp	2007/03/21 06:57:39	644873
@@ -15,6 +15,7 @@
 #include "kmmsgdict.h"
 #include "kmdebug.h"
 #include "kmfoldertree.h"
+#include "kmfolderimap.h"
 #include "folderjob.h"
 using KMail::FolderJob;
 #include "actionscheduler.h"
@@ -215,6 +216,11 @@
   {
     writeFolderConfig();
     writeSortOrder();
+    if (mFolder->folderType() == KMFolderTypeImap)
+    {
+      KMFolderImap *imap = static_cast<KMFolderImap*>(mFolder->storage());
+      imap->setSelected( false );
+    }
     mFolder->close();
   }
   writeConfig();
--- kmail/kmmainwidget.cpp	2007/03/20 20:20:57	644741
+++ kmail/kmmainwidget.cpp	2007/03/21 06:57:39	644873
@@ -164,6 +164,7 @@
   mJob = 0;
   mConfig = config;
   mGUIClient = aGUIClient;
+  mOpenedImapFolder = false;
 
   mCustomReplyActionMenu = 0;
   mCustomReplyAllActionMenu = 0;
@@ -1875,8 +1876,11 @@
   folderSelected( mFolder );
   updateFolderMenu();
   // opened() before the getAndCheckFolder() in folderSelected
-  if ( mFolder && mFolder->folderType() == KMFolderTypeImap )
+  if ( mFolder && mFolder->folderType() == KMFolderTypeImap && mOpenedImapFolder )
+  {
     mFolder->close();
+    mOpenedImapFolder = false;
+  }
 }
 
 //-----------------------------------------------------------------------------
@@ -1930,6 +1934,12 @@
            this, SLOT( updateMarkAsReadAction() ) );
     disconnect( mFolder, SIGNAL( msgRemoved( KMFolder * ) ),
            this, SLOT( updateMarkAsReadAction() ) );
+    if ( mOpenedImapFolder && newFolder && mFolder->folderType() == KMFolderTypeImap ) {
+      mFolder->close();
+      KMFolderImap *imap = static_cast<KMFolderImap*>(mFolder->storage());
+      imap->setSelected( false );
+      mOpenedImapFolder = false;
+  }
   }
 
   mFolder = aFolder;
@@ -1944,6 +1954,7 @@
     if ( newFolder && !mFolder->noContent() )
     {
       imap->open(); // will be closed in the folderSelected slot
+      mOpenedImapFolder = true;
       // first get new headers before we select the folder
       imap->setSelected( true );
       connect( imap, SIGNAL( folderComplete( KMFolderImap*, bool ) ),
--- kmail/kmmainwidget.h	2006/12/16 03:44:17	614049
+++ kmail/kmmainwidget.h	2007/03/21 06:57:39	644873
@@ -531,6 +531,7 @@
   KXMLGUIClient *mGUIClient;
 
   static QValueList<KMMainWidget*>* s_mainWidgetList;
+  bool mOpenedImapFolder;
 };
 
 #endif

Attachment: pgp1eaYOTSuXH.pgp
Description: PGP signature

_______________________________________________
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd

Reply via email to