From 9c31a55b0658950f59c5f5bf8c1d7a8209bf1116 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 25 Nov 2007 00:13:49 +0000 Subject: [PATCH] use the corrrect signature for the virtual method svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=741173 --- appletbrowser/kcategorizeditemsviewmodels.cpp | 12 +++++++++--- appletbrowser/kcategorizeditemsviewmodels_p.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/appletbrowser/kcategorizeditemsviewmodels.cpp b/appletbrowser/kcategorizeditemsviewmodels.cpp index 6586b48d9..05f60bfb1 100644 --- a/appletbrowser/kcategorizeditemsviewmodels.cpp +++ b/appletbrowser/kcategorizeditemsviewmodels.cpp @@ -80,10 +80,16 @@ DefaultItemFilterProxyModel::DefaultItemFilterProxyModel(QObject * parent) : { } -void DefaultItemFilterProxyModel::setSourceModel( - QStandardItemModel * sourceModel) +void DefaultItemFilterProxyModel::setSourceModel(QAbstractItemModel * sourceModel) { - m_innerModel.setSourceModel(sourceModel); + QStandardItemModel *model = qobject_cast(sourceModel); + + if (!model) { + kWarning() << "DefaultItemFilterProxyModel::setSourceModel expects a QStandardItemModel!"; + return; + } + + m_innerModel.setSourceModel(model); QSortFilterProxyModel::setSourceModel(&m_innerModel); } diff --git a/appletbrowser/kcategorizeditemsviewmodels_p.h b/appletbrowser/kcategorizeditemsviewmodels_p.h index 3c6296723..467d6ce16 100644 --- a/appletbrowser/kcategorizeditemsviewmodels_p.h +++ b/appletbrowser/kcategorizeditemsviewmodels_p.h @@ -105,7 +105,7 @@ public: void setSearch(const QString & pattern); void setFilter(const Filter & filter); - void setSourceModel(QStandardItemModel * sourceModel); + void setSourceModel(QAbstractItemModel * sourceModel); QStandardItemModel * sourceModel() const;