From 70ad086ccaf69cf4592db90a641daf0a23ab1428 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 9 Jan 2011 10:36:13 +0100 Subject: Use folderIcon in NewMovieWizard Also show the folderIcon in the NewMovieWizard QTreeViews. --- mappingtablemodel.cpp | 3 +++ mappingtablewidget.cpp | 7 ++++++- newmoviewizard.cpp | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mappingtablemodel.cpp b/mappingtablemodel.cpp index 47e3136..412e37f 100644 --- a/mappingtablemodel.cpp +++ b/mappingtablemodel.cpp @@ -89,6 +89,9 @@ QVariant MappingTableModel::data(const QModelIndex &index, int role) const{ if(role == ItemIdRole){ return item->data(ItemId); } + if(role == Qt::DecorationRole){ + return SmTreeModel::data(index, role); + } return QVariant(); } diff --git a/mappingtablewidget.cpp b/mappingtablewidget.cpp index d36749b..dc406b4 100644 --- a/mappingtablewidget.cpp +++ b/mappingtablewidget.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "mappingtablewidget.h" #include "mappingtablemodel.h" @@ -112,7 +113,11 @@ void MappingTableWidget::removeItem(){ } } -MappingTableItemModel::MappingTableItemModel(QObject *parent) : QStringListModel(parent) {} +MappingTableItemModel::MappingTableItemModel(QObject *parent) : QStringListModel(parent){ + QSettings s; + QString iconName = s.value("ui/folderIcon").toString(); + mDecorationIcon = QIcon(SmGlobals::instance()->icons().value(iconName)); +} QVariant MappingTableItemModel::data(const QModelIndex &index, int role) const{ if(role == Qt::DecorationRole){ diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp index bf9f112..4c4e7c9 100644 --- a/newmoviewizard.cpp +++ b/newmoviewizard.cpp @@ -468,6 +468,9 @@ QVariant WizardTreeModel::data(const QModelIndex &index, int role) const{ if(role == FilePartRole){ return item->data(FilePart); } + if(role == Qt::DecorationRole){ + return SmTreeModel::data(index, role); + } return QVariant(); } -- cgit v1.2.3-70-g09d2