summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <[email protected]>2017-10-09 22:05:24 +0200
committerFriedrich W. H. Kossebau <[email protected]>2017-10-09 22:05:24 +0200
commitda66c297f5816d3fce616a6ae887557cce5ce607 (patch)
treeb1d7172b1fd709d23e683d43b1b254c8a5b59f01
parentb551181a86299d6cdbe950028fb48bc95d847923 (diff)
Use QIcon::fromTheme instead of SmallIcon
* leaves size to treeview/style * avoids lots of pixmap copies
-rw-r--r--komparenavtreepart/komparenavtreepart.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/komparenavtreepart/komparenavtreepart.cpp b/komparenavtreepart/komparenavtreepart.cpp
index 3655a0a..27173cf 100644
--- a/komparenavtreepart/komparenavtreepart.cpp
+++ b/komparenavtreepart/komparenavtreepart.cpp
@@ -24,7 +24,6 @@
#include <klocalizedstring.h>
#include <kaboutdata.h>
#include <kpluginfactory.h>
-#include <kiconloader.h>
#include <libkomparediff2/difference.h>
#include <libkomparediff2/diffmodel.h>
@@ -518,8 +517,8 @@ KFileLVI::KFileLVI( QTreeWidget* parent, DiffModel* model ) : QTreeWidgetItem( p
setText( 0, src );
setText( 1, dst );
- setIcon( 0, SmallIcon( getIcon( src ) ) );
- setIcon( 1, SmallIcon( getIcon( dst ) ) );
+ setIcon(0, QIcon::fromTheme(getIcon(src)));
+ setIcon(1, QIcon::fromTheme(getIcon(dst)));
}
bool KFileLVI::hasExtension(const QString& extensions, const QString& fileName)
@@ -623,7 +622,7 @@ KDirLVI::KDirLVI( QTreeWidget* parent, QString& dir ) : QTreeWidgetItem( parent
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (QTreeWidget) constructor called with dir = " << dir ;
m_rootItem = true;
m_dirName = dir;
- setIcon(0, SmallIcon(QStringLiteral("folder")));
+ setIcon(0, QIcon::fromTheme(QStringLiteral("folder")));
setExpanded( true );
if ( m_dirName.isEmpty() )
setText( 0, i18n( "Unknown" ) );
@@ -636,7 +635,7 @@ KDirLVI::KDirLVI( KDirLVI* parent, QString& dir ) : QTreeWidgetItem( parent )
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (KDirLVI) constructor called with dir = " << dir ;
m_rootItem = false;
m_dirName = dir;
- setIcon( 0, SmallIcon(QStringLiteral("folder")));
+ setIcon(0, QIcon::fromTheme(QStringLiteral("folder")));
setExpanded( true );
setText( 0, m_dirName );
}