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

List:       kde-commits
Subject:    KDE/kdepim/kleopatra/models
From:       Marc Mutz <mutz () kde ! org>
Date:       2010-11-11 15:06:19
Message-ID: 20101111150619.59B2DAC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195589 by mutz:

KeyListSortFilterProxyModel: move some codelines around for easier #ifdef'ing

 M  +6 -4      keylistsortfilterproxymodel.cpp  


--- trunk/KDE/kdepim/kleopatra/models/keylistsortfilterproxymodel.cpp #1195588:1195589
@@ -165,15 +165,17 @@
     //
     // 1. Check that name or email matches filterRegExp
     //
+    const int role = filterRole();
+
     const QModelIndex nameIndex = sourceModel()->index( source_row, PrettyName, source_parent );
+    const QString name = nameIndex.data( role ).toString();
+
     const QModelIndex emailIndex = sourceModel()->index( source_row, PrettyEMail, source_parent );
-
-    const int role = filterRole();
-    const QString name = nameIndex.data( role ).toString();
     const QString email = emailIndex.data( role ).toString();
 
     const QRegExp rx = filterRegExp();
-    if ( !name.contains( rx ) && !email.contains( rx ) )
+    if ( !name.contains( rx ) )
+        if ( !email.contains( rx ) )
         return false;
 
     //
[prev in list] [next in list] [prev in thread] [next in thread] 

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