[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [PATCH] Fix for wishlist bug #78073
From:       Severin Greimel <greimel-kde () fs-pw ! uni-muenchen ! de>
Date:       2004-03-31 10:29:26
Message-ID: 200403311229.26981.greimel-kde () fs-pw ! uni-muenchen ! de
[Download RAW message or body]

Hi,

another wishlist item that seems to meet my intuition :)

Bug 78073: KMail message editor address book filter seems case-sensitive...

(http://bugs.kde.org/show_bug.cgi?id=78073)

The two patches both make the filter match case-insensitively. I couldn't find 
any side-effects for the first version. But if it does, then the second 
version should behave nicer.

Regards,

  Severin

["addressesdialog.cpp.diff" (text/x-diff)]

Index: addressesdialog.cpp
===================================================================
RCS file: /home/kde/kdepim/libkdepim/addressesdialog.cpp,v
retrieving revision 1.24
diff -u -r1.24 addressesdialog.cpp
--- addressesdialog.cpp	27 Mar 2004 17:51:36 -0000	1.24
+++ addressesdialog.cpp	31 Mar 2004 09:35:16 -0000
@@ -147,7 +147,7 @@
 
 bool AddresseeViewItem::matches(const QString& txt) const
 {
-    return d->address.realName().contains(txt) || \
d->address.preferredEmail().contains(txt); +    return \
d->address.realName().contains(txt, false) || \
d->address.preferredEmail().contains(txt, false);  }
 
 void AddresseeViewItem::setSelected(bool selected)


["addressesdialog.cpp-v2.diff" (text/x-diff)]

Index: addressesdialog.cpp
===================================================================
RCS file: /home/kde/kdepim/libkdepim/addressesdialog.cpp,v
retrieving revision 1.24
diff -u -r1.24 addressesdialog.cpp
--- addressesdialog.cpp	27 Mar 2004 17:51:36 -0000	1.24
+++ addressesdialog.cpp	31 Mar 2004 10:26:25 -0000
@@ -145,9 +145,9 @@
   return text(1);
 }
 
-bool AddresseeViewItem::matches(const QString& txt) const
+bool AddresseeViewItem::matches(const QString& txt, bool cs) const
 {
-    return d->address.realName().contains(txt) || \
d->address.preferredEmail().contains(txt); +    return \
d->address.realName().contains(txt, cs) || d->address.preferredEmail().contains(txt, \
cs);  }
 
 void AddresseeViewItem::setSelected(bool selected)
@@ -806,7 +806,7 @@
       continue;
     }
     if ( item->category() == AddresseeViewItem::Entry ) {
-      bool matches = item->matches( txt ) ;
+      bool matches = item->matches( txt, false ) ;
       item->setVisible( matches );
       if ( matches && static_cast<QListViewItem*>(item)->parent() ) {
           static_cast<QListViewItem*>(item)->parent()->setOpen( true );//open the \
                parents with found entries
Index: addressesdialog.h
===================================================================
RCS file: /home/kde/kdepim/libkdepim/addressesdialog.h,v
retrieving revision 1.10
diff -u -r1.10 addressesdialog.h
--- addressesdialog.h	5 Feb 2004 21:37:03 -0000	1.10
+++ addressesdialog.h	31 Mar 2004 10:26:25 -0000
@@ -60,7 +60,7 @@
     QString name()  const;
     QString email() const;
 
-    bool matches( const QString& ) const;
+    bool matches( const QString&, bool cs = true ) const;
 
     virtual int compare( QListViewItem * i, int col, bool ascending ) const;
     virtual void setSelected( bool );



_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic