From ae4d11d918938fd9087f2035dac247969c1f2313 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 21 Apr 2012 21:28:16 +0200 Subject: Prepare view-engine for non-KFileItem usecase Up to now the view-engine only provided a model-implementation that supports file-items. The view-engine always had been designed to be able to work with any kind of model, so now a KStandardItemModel is available. The plan is to convert the places panel to the new view-engine. It should be no problem to fix this until the feature freeze - in the worst case the places-panel code could be reverted while still keeping the KStandardItemModel changes. --- src/kitemviews/kfileitemlistview.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/kitemviews/kfileitemlistview.h') diff --git a/src/kitemviews/kfileitemlistview.h b/src/kitemviews/kfileitemlistview.h index 8f7ca9063..c8a3385fd 100644 --- a/src/kitemviews/kfileitemlistview.h +++ b/src/kitemviews/kfileitemlistview.h @@ -22,7 +22,7 @@ #include -#include +#include class KFileItemModelRolesUpdater; class QTimer; @@ -36,18 +36,11 @@ class QTimer; * KItemListView::setWidgetCreator() and KItemListView::setGroupHeaderCreator() * to apply customized generators. */ -class LIBDOLPHINPRIVATE_EXPORT KFileItemListView : public KItemListView +class LIBDOLPHINPRIVATE_EXPORT KFileItemListView : public KStandardItemListView { Q_OBJECT public: - enum Layout - { - IconsLayout, - CompactLayout, - DetailsLayout - }; - KFileItemListView(QGraphicsWidget* parent = 0); virtual ~KFileItemListView(); @@ -62,9 +55,6 @@ public: void setEnlargeSmallPreviews(bool enlarge); bool enlargeSmallPreviews() const; - void setItemLayout(Layout layout); - Layout itemLayout() const; - /** * Sets the list of enabled thumbnail plugins that are used for previews. * Per default all plugins enabled in the KConfigGroup "PreviewSettings" @@ -86,8 +76,10 @@ public: virtual QPixmap createDragPixmap(const QSet& indexes) const; protected: - virtual void initializeItemListWidget(KItemListWidget* item); - virtual bool itemSizeHintUpdateRequired(const QSet& changedRoles) const; + virtual KItemListWidgetCreatorBase* defaultWidgetCreator() const; + virtual KItemListGroupHeaderCreatorBase* defaultGroupHeaderCreator() const; + virtual void onPreviewsShownChanged(bool shown); + virtual void onItemLayoutChanged(ItemLayout current, ItemLayout previous); virtual void onModelChanged(KItemModelBase* current, KItemModelBase* previous); virtual void onScrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous); virtual void onItemSizeChanged(const QSizeF& current, const QSizeF& previous); @@ -111,7 +103,6 @@ private slots: void updateIconSize(); private: - void updateLayoutOfVisibleItems(); void updateTimersInterval(); /** @@ -130,8 +121,6 @@ private: QSize availableIconSize() const; private: - Layout m_itemLayout; - KFileItemModelRolesUpdater* m_modelRolesUpdater; QTimer* m_updateVisibleIndexRangeTimer; QTimer* m_updateIconSizeTimer; -- cgit v1.3.1