[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:       2008-02-22 16:46:54
Message-ID: 1203698814.143669.18820.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 778144 by mutz:

QIcon doesn't grok kiconloader icon names, and KIcon never results in a isNull() == \
true. Fixed. Makes icons appear in the list view

 M  +5 -5      keylistmodel.cpp  


--- trunk/KDE/kdepim/kleopatra/models/keylistmodel.cpp #778143:778144
@@ -40,9 +40,9 @@
 #include <kleo/keyfilter.h>
 
 #include <KLocale>
+#include <KIcon>
 
 #include <QDateTime>
-#include <QIcon>
 #include <QFont>
 #include <QColor>
 #include <QApplication>
@@ -179,9 +179,9 @@
         return QVariant();
 }
 
-static QVariant returnIfValid( const QIcon & t ) {
-    if ( !t.isNull() )
-        return t;
+static QVariant returnIfValidIcon( const QString & t ) {
+    if ( !t.isEmpty() )
+        return QIcon( KIcon( t ) );
     else
         return QVariant();
 }
@@ -229,7 +229,7 @@
     } else if ( role == Qt::DecorationRole || role == Qt::BackgroundRole || role == \
                Qt::ForegroundRole ) {
         if ( const shared_ptr<KeyFilter> & filter = \
KeyFilterManager::instance()->filterMatching( key, KeyFilter::Appearance ) ) {  \
                switch ( role ) {
-            case Qt::DecorationRole: return column == Icon ? returnIfValid( QIcon( \
filter->icon() ) ) : QVariant() ; +            case Qt::DecorationRole: return column \
                == Icon ? returnIfValidIcon( filter->icon() ) : QVariant() ;
             case Qt::BackgroundRole: return returnIfValid( filter->bgColor() );
             case Qt::ForegroundRole: return returnIfValid( filter->fgColor() );
             default: ; // silence compiler


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

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