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

List:       kde-commits
Subject:    [kdepimlibs/akregator_port] krss: use the sort role for dates, disable the author column for now
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2012-03-31 15:16:22
Message-ID: 20120331151622.5CF68A6100 () git ! kde ! org
[Download RAW message or body]

Git commit 5969267ed2da0b0a4de717e4bcecbec76d4308a7 by Frank Osterfeld.
Committed on 17/10/2009 at 23:35.
Pushed by osterfeld into branch 'akregator_port'.

use the sort role for dates, disable the author column for now 

svn path=/branches/work/akonadi-ports/kdepim/; revision=1036829

M  +9    -2    krss/feeditemmodel.cpp

http://commits.kde.org/kdepimlibs/5969267ed2da0b0a4de717e4bcecbec76d4308a7

diff --git a/krss/feeditemmodel.cpp b/krss/feeditemmodel.cpp
index fd41dbc..d6d0a52 100644
--- a/krss/feeditemmodel.cpp
+++ b/krss/feeditemmodel.cpp
@@ -58,12 +58,14 @@ QVariant FeedItemModel::getData( const Akonadi::Item &akonadiItem, int column, i
     if ( role == IsDeletedRole )
         return false;
 
+
     if ( role == Qt::DisplayRole || role == SortRole ) {
         switch ( column ) {
             case ItemTitleColumn:
                 return item.titleAsPlainText();
             case AuthorsColumn:
             {
+#if 0 //TODO: we probably want to cache this
                 QString authors;
                 Q_FOREACH( const KRss::Person &person, item.authors() ) {
                     if ( !authors.isEmpty() )
@@ -71,10 +73,15 @@ QVariant FeedItemModel::getData( const Akonadi::Item &akonadiItem, int column, i
                     authors += person.name();
                 }
                 return authors;
+#endif
+                return QVariant();
             }
             case DateColumn:
-                return KGlobal::locale()->formatDateTime( item.dateUpdated(),
-                                                          KLocale::FancyShortDate );
+                if ( role == SortRole )
+                    return item.dateUpdated().toTime_t();
+                else
+                    return KGlobal::locale()->formatDateTime( item.dateUpdated(),
+                                                              KLocale::FancyShortDate );
             case FeedTitleForItemColumn:
 #ifdef TEMPORARILY_REMOVED
                return d->m_feed->title();

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

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