[Kde-pim] filtering

Wolfgang Rohdewald wolfgang at rohdewald.de
Wed Oct 19 22:02:04 BST 2011


Hi,

I would like to do something about kmail2 filtering - I want to fix some bugs.

so I compiled kmail2 and started it with kmail.shell

there were no filters defined, and I got a segfault when opening
the filter dialog.

#6  isHidden (this=0x0) at /usr/include/qt4/QtGui/qlistwidget.h:327
#7  MailCommon::KMFilterListBox::slotNew (this=0x203e2f0) at /home/wr/kdesrc/kde/kdepim/mailcommon/kmfilterdialog.cpp:931
#8  0x00007fd4c12443c9 in MailCommon::KMFilterListBox::loadFilterList (this=0x203e2f0, createDummyFilter=true) at /home/wr/kdesrc/kde/kdepim/mailcommon/kmfilterdialog.cpp:1199

the patch below would fix it. I do have commit rights but it is 
a long time since I coded in KDE/C++ so let me ask a few 
questions first:

- is this patch accepable - or should I use a local variable
for currentItem()?

- should I use the reviewboard for such trivial changes?

- I can only see a master branch in the git repository. Where
could I backport this fix to the KDE 4.7 branch?

- should I first apply the commit to the 4.7 branch and then
merge with master or should I first commit to master and
then cherry-pick for the 4.7 branch?

diff --git a/mailcommon/kmfilterdialog.cpp b/mailcommon/kmfilterdialog.cpp
index 6b54737..de54d8b 100644
--- a/mailcommon/kmfilterdialog.cpp
+++ b/mailcommon/kmfilterdialog.cpp
@@ -928,7 +928,7 @@ void KMFilterListBox::slotSelected( int aIdx )
 
 void KMFilterListBox::slotNew()
 {
-  if ( mListWidget->currentItem()->isHidden() )
+  if ( mListWidget->currentItem() && mListWidget->currentItem()->isHidden() )
     return;
 
   // just insert a new filter.

-- 
Wolfgang

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list