Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/PanelView/krinterview.h
Show All 39 Lines | |||||
40 | * It contains the methods common to all implementing subclasses of KrView. | 40 | * It contains the methods common to all implementing subclasses of KrView. | ||
41 | */ | 41 | */ | ||
42 | class KrInterView : public KrView | 42 | class KrInterView : public KrView | ||
43 | { | 43 | { | ||
44 | friend class KrViewItem; | 44 | friend class KrViewItem; | ||
45 | public: | 45 | public: | ||
46 | KrInterView(KrViewInstance &instance, KConfig *cfg, QAbstractItemView *itemView); | 46 | KrInterView(KrViewInstance &instance, KConfig *cfg, QAbstractItemView *itemView); | ||
47 | virtual ~KrInterView(); | 47 | virtual ~KrInterView(); | ||
48 | QModelIndex getCurrentIndex() Q_DECL_OVERRIDE { | 48 | QModelIndex getCurrentIndex() override { | ||
49 | return _itemView->currentIndex(); | 49 | return _itemView->currentIndex(); | ||
50 | } | 50 | } | ||
51 | bool isSelected(const QModelIndex &ndx) Q_DECL_OVERRIDE; | 51 | bool isSelected(const QModelIndex &ndx) override; | ||
52 | uint numSelected() const Q_DECL_OVERRIDE { | 52 | uint numSelected() const override { | ||
53 | return _selection.count(); | 53 | return _selection.count(); | ||
54 | } | 54 | } | ||
55 | QList<QUrl> selectedUrls() Q_DECL_OVERRIDE; | 55 | QList<QUrl> selectedUrls() override; | ||
56 | void setSelectionUrls(const QList<QUrl> urls) Q_DECL_OVERRIDE; | 56 | void setSelectionUrls(const QList<QUrl> urls) override; | ||
57 | KrViewItem* getFirst() Q_DECL_OVERRIDE; | 57 | KrViewItem* getFirst() override; | ||
58 | KrViewItem* getLast() Q_DECL_OVERRIDE; | 58 | KrViewItem* getLast() override; | ||
59 | KrViewItem* getNext(KrViewItem *current) Q_DECL_OVERRIDE; | 59 | KrViewItem* getNext(KrViewItem *current) override; | ||
60 | KrViewItem* getPrev(KrViewItem *current) Q_DECL_OVERRIDE; | 60 | KrViewItem* getPrev(KrViewItem *current) override; | ||
61 | KrViewItem* getCurrentKrViewItem() Q_DECL_OVERRIDE; | 61 | KrViewItem* getCurrentKrViewItem() override; | ||
62 | KrViewItem* findItemByName(const QString &name) Q_DECL_OVERRIDE; | 62 | KrViewItem* findItemByName(const QString &name) override; | ||
63 | KrViewItem *findItemByUrl(const QUrl &url) Q_DECL_OVERRIDE; | 63 | KrViewItem *findItemByUrl(const QUrl &url) override; | ||
64 | QString getCurrentItem() const Q_DECL_OVERRIDE; | 64 | QString getCurrentItem() const override; | ||
65 | KrViewItem *getKrViewItemAt(const QPoint &vp) Q_DECL_OVERRIDE; | 65 | KrViewItem *getKrViewItemAt(const QPoint &vp) override; | ||
66 | void setCurrentItem(const QString &name, bool scrollToCurrent = true, | 66 | void setCurrentItem(const QString &name, bool scrollToCurrent = true, | ||
67 | const QModelIndex &fallbackToIndex = QModelIndex()) Q_DECL_OVERRIDE; | 67 | const QModelIndex &fallbackToIndex = QModelIndex()) override; | ||
68 | void setCurrentKrViewItem(KrViewItem *item, bool scrollToCurrent = true) Q_DECL_OVERRIDE; | 68 | void setCurrentKrViewItem(KrViewItem *item, bool scrollToCurrent = true) override; | ||
69 | void makeItemVisible(const KrViewItem *item) Q_DECL_OVERRIDE; | 69 | void makeItemVisible(const KrViewItem *item) override; | ||
70 | bool isItemVisible(const KrViewItem *item) Q_DECL_OVERRIDE; | 70 | bool isItemVisible(const KrViewItem *item) override; | ||
71 | void clear() Q_DECL_OVERRIDE; | 71 | void clear() override; | ||
72 | void sort() Q_DECL_OVERRIDE; | 72 | void sort() override; | ||
73 | void refreshColors() Q_DECL_OVERRIDE; | 73 | void refreshColors() override; | ||
74 | void redraw() Q_DECL_OVERRIDE; | 74 | void redraw() override; | ||
75 | void prepareForActive() Q_DECL_OVERRIDE; | 75 | void prepareForActive() override; | ||
76 | void prepareForPassive() Q_DECL_OVERRIDE; | 76 | void prepareForPassive() override; | ||
77 | void selectRegion(KrViewItem *i1, KrViewItem *i2, bool select) Q_DECL_OVERRIDE; | 77 | void selectRegion(KrViewItem *i1, KrViewItem *i2, bool select) override; | ||
78 | 78 | | |||
79 | void sortModeUpdated(int column, Qt::SortOrder order); | 79 | void sortModeUpdated(int column, Qt::SortOrder order); | ||
80 | 80 | | |||
81 | void redrawItem(FileItem *fileitem) { | 81 | void redrawItem(FileItem *fileitem) { | ||
82 | _itemView->viewport()->update(itemRect(fileitem)); | 82 | _itemView->viewport()->update(itemRect(fileitem)); | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | protected: | 85 | protected: | ||
86 | class DummySelectionModel : public QItemSelectionModel | 86 | class DummySelectionModel : public QItemSelectionModel | ||
87 | { | 87 | { | ||
88 | public: | 88 | public: | ||
89 | DummySelectionModel(QAbstractItemModel *model, QObject *parent) : | 89 | DummySelectionModel(QAbstractItemModel *model, QObject *parent) : | ||
90 | QItemSelectionModel(model, parent) {} | 90 | QItemSelectionModel(model, parent) {} | ||
91 | // do nothing - selection is managed by KrInterView | 91 | // do nothing - selection is managed by KrInterView | ||
92 | void select(const QModelIndex &, QItemSelectionModel::SelectionFlags) Q_DECL_OVERRIDE {} | 92 | void select(const QModelIndex &, QItemSelectionModel::SelectionFlags) override {} | ||
93 | void select(const QItemSelection &, QItemSelectionModel::SelectionFlags) Q_DECL_OVERRIDE {} | 93 | void select(const QItemSelection &, QItemSelectionModel::SelectionFlags) override {} | ||
94 | }; | 94 | }; | ||
95 | 95 | | |||
96 | KIO::filesize_t calcSize() Q_DECL_OVERRIDE; | 96 | KIO::filesize_t calcSize() override; | ||
97 | KIO::filesize_t calcSelectedSize() Q_DECL_OVERRIDE; | 97 | KIO::filesize_t calcSelectedSize() override; | ||
98 | void populate(const QList<FileItem*> &fileItems, FileItem *dummy) Q_DECL_OVERRIDE; | 98 | void populate(const QList<FileItem*> &fileItems, FileItem *dummy) override; | ||
99 | KrViewItem* preAddItem(FileItem *fileitem) Q_DECL_OVERRIDE; | 99 | KrViewItem* preAddItem(FileItem *fileitem) override; | ||
100 | /** | 100 | /** | ||
101 | * Remove an item. Does not handle new current selection. | 101 | * Remove an item. Does not handle new current selection. | ||
102 | */ | 102 | */ | ||
103 | void preDeleteItem(KrViewItem *item) Q_DECL_OVERRIDE; | 103 | void preDeleteItem(KrViewItem *item) override; | ||
104 | void intSetSelected(const FileItem* fileitem, bool select) Q_DECL_OVERRIDE; | 104 | void intSetSelected(const FileItem* fileitem, bool select) override; | ||
105 | 105 | | |||
106 | virtual QRect itemRect(const FileItem *fileitem) = 0; | 106 | virtual QRect itemRect(const FileItem *fileitem) = 0; | ||
107 | 107 | | |||
108 | KrViewItem * getKrViewItem(FileItem *fileitem); | 108 | KrViewItem * getKrViewItem(FileItem *fileitem); | ||
109 | KrViewItem * getKrViewItem(const QModelIndex &); | 109 | KrViewItem * getKrViewItem(const QModelIndex &); | ||
110 | bool isSelected(const FileItem *fileitem) const { | 110 | bool isSelected(const FileItem *fileitem) const { | ||
111 | return _selection.contains(fileitem); | 111 | return _selection.contains(fileitem); | ||
112 | } | 112 | } | ||
Show All 12 Lines |