X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a5e266e538cb32c3689cf02f23246812acbf2d8c..76a46fd9094b17eb99e8a42cca8562fdc0b3814c:/src/kitemviews/kitemlistselectionmanager.h diff --git a/src/kitemviews/kitemlistselectionmanager.h b/src/kitemviews/kitemlistselectionmanager.h index c4decd39e..6b0435139 100644 --- a/src/kitemviews/kitemlistselectionmanager.h +++ b/src/kitemviews/kitemlistselectionmanager.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -23,10 +22,9 @@ #ifndef KITEMLISTSELECTIONMANAGER_H #define KITEMLISTSELECTIONMANAGER_H -#include - -#include -#include +#include "dolphin_export.h" +#include "kitemviews/kitemmodelbase.h" +#include "kitemviews/kitemset.h" #include @@ -35,7 +33,7 @@ class KItemModelBase; /** * @brief Allows to select and deselect items of a KItemListView. */ -class LIBDOLPHINPRIVATE_EXPORT KItemListSelectionManager : public QObject +class DOLPHIN_EXPORT KItemListSelectionManager : public QObject { Q_OBJECT @@ -51,8 +49,8 @@ public: Toggle }; - KItemListSelectionManager(QObject* parent = 0); - virtual ~KItemListSelectionManager(); + explicit KItemListSelectionManager(QObject* parent = nullptr); + ~KItemListSelectionManager() override; void setCurrentItem(int current); int currentItem() const; @@ -63,6 +61,13 @@ public: bool hasSelection() const; void setSelected(int index, int count = 1, SelectionMode mode = Select); + /** + * Equivalent to: + * clearSelection(); + * setSelected(index, count); + * but emitting once only selectionChanged signal + */ + void replaceSelection(int index, int count = 1); void clearSelection(); void beginAnchoredSelection(int anchor);