Bug 242712 - Match the names of the authors in the search filter
Summary: Match the names of the authors in the search filter
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 19:22 UTC by LuRan
Modified: 2010-09-22 01:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.6


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LuRan 2010-06-24 19:22:42 UTC
Version:           SVN (using Devel) 
OS:                Linux

The search bar in Akregator is a very handy tool, however, it only matches the abstract/article. I hope the search bar could be improved to support search for the name of the author,  sometimes it is more convenient to find a artcle this way.

Reproducible: Didn't try
Comment 1 Christophe Marin 2010-09-15 14:21:58 UTC
If I'm not mistaken, the following patch should do that: 

Index: src/searchbar.cpp
===================================================================
--- src/searchbar.cpp   (révision 1175239)
+++ src/searchbar.cpp   (copie de travail)
@@ -185,6 +185,8 @@
         textCriteria << subjCrit;
         Criterion crit1( Criterion::Description, Criterion::Contains, d->searchText);
         textCriteria << crit1;
+        Criterion authCrit( Criterion::Author, Criterion::Contains, d->searchText);
+        textCriteria << authCrit;
     }
 
     if (d->searchCombo->currentIndex())
Index: src/articlematcher.h
===================================================================
--- src/articlematcher.h        (révision 1175239)
+++ src/articlematcher.h        (copie de travail)
@@ -112,7 +112,7 @@
     public:
 
         enum Subject {
-            Title, Description, Link, Status, KeepFlag
+            Title, Description, Link, Status, KeepFlag, Author
         };
 
         static QString subjectToString(Subject subj);
Index: src/articlematcher.cpp
===================================================================
--- src/articlematcher.cpp      (révision 1175239)
+++ src/articlematcher.cpp      (copie de travail)
@@ -59,6 +59,8 @@
             return QString::fromLatin1("Status");
         case KeepFlag:
             return QString::fromLatin1("KeepFlag");
+        case Author:
+            return QString::fromLatin1("Author");
         default: // should never happen (TM)
             return QString::fromLatin1("Description");
     }
@@ -76,6 +78,8 @@
         return Status;
     else if (subjStr == QString::fromLatin1("KeepFlag"))
         return KeepFlag;
+    else if (subjStr == QString::fromLatin1("Author"))
+        return Author;
 
     // hopefully never reached
     return Description;
@@ -167,7 +171,10 @@
             concreteSubject = QVariant(article.status());
             break;
         case KeepFlag:
-            concreteSubject = QVariant(article.keep());   
+            concreteSubject = QVariant(article.keep());
+            break;
+        case Author:
+            concreteSubject = QVariant(article.authorName());
         default:
             break;
     }


@Frank, can I commit this ?
Comment 2 LuRan 2010-09-15 21:16:44 UTC
Great work, I tried this patch, and it works beautifully. Thanks a lot.
Comment 3 Christophe Marin 2010-09-22 01:12:30 UTC
SVN commit 1178003 by cgiboudeaux:

Let the search filter look for authors.
BUG: 242712
FIXED-IN: 4.6


 M  +7 -0      articlematcher.cpp  
 M  +1 -1      articlematcher.h  
 M  +2 -0      searchbar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1178003
Comment 4 Christophe Marin 2010-09-22 01:18:18 UTC
SVN commit 1178006 by cgiboudeaux:

Backport r1178003 from trunk to 4.5
Let the search filter look for authors.
CCBUG: 242712



 M  +7 -0      articlematcher.cpp  
 M  +1 -1      articlematcher.h  
 M  +2 -0      searchbar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1178006
Comment 5 Christophe Marin 2010-09-22 01:21:21 UTC
SVN commit 1178007 by cgiboudeaux:

Backport r1178003 from trunk to 4.4:
Let the search filter look for authors.
CCBUG:242712

MERGE: none



 M  +7 -0      articlematcher.cpp  
 M  +1 -1      articlematcher.h  
 M  +2 -0      searchbar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1178007