2 * SPDX-FileCopyrightText: 2008-2012 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2010 Christian Muehlhaeuser <muesli@gmail.com>
4 * SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de>
6 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "panels/panel.h"
14 #include <KFilePlacesView>
17 #include <Solid/SolidNamespace> // Solid::ErrorType
26 * @brief Combines bookmarks and mounted devices as list.
28 class PlacesPanel
: public KFilePlacesView
33 explicit PlacesPanel(QWidget
*parent
);
34 ~PlacesPanel() override
;
36 void setUrl(const QUrl
&url
); // override
38 // for compatibility with Panel, actions that are shown
39 // on the view's context menu
40 QList
<QAction
*> customContextMenuActions() const;
41 void setCustomContextMenuActions(const QList
<QAction
*> &actions
);
43 void requestTearDown();
44 void proceedWithTearDown();
50 void errorMessage(const QString
&error
);
51 void storageTearDownRequested(const QString
&mountPath
);
52 void storageTearDownExternallyRequested(const QString
&mountPath
);
53 void storageTearDownSuccessful();
54 void openInSplitViewRequested(const QUrl
&url
);
57 void showEvent(QShowEvent
*event
) override
;
58 void dragMoveEvent(QDragMoveEvent
*event
) override
;
61 void slotConfigureTrash();
62 void slotUrlsDropped(const QUrl
&dest
, QDropEvent
*event
, QWidget
*parent
);
63 void slotContextMenuAboutToShow(const QModelIndex
&index
, QMenu
*menu
);
64 void slotTearDownRequested(const QModelIndex
&index
);
65 void slotTearDownRequestedExternally(const QString
&udi
);
66 void slotTearDownDone(const QModelIndex
&index
, Solid::ErrorType error
, const QVariant
&errorData
);
67 void slotRowsInserted(const QModelIndex
&parent
, int first
, int last
);
68 void slotRowsAboutToBeRemoved(const QModelIndex
&parent
, int first
, int last
);
71 void connectDeviceSignals(const QModelIndex
&idx
);
73 QUrl m_url
; // only used for initial setUrl
74 QList
<QAction
*> m_customContextMenuActions
;
76 QPersistentModelIndex m_indexToTearDown
;
78 QAction
*m_configureTrashAction
;
79 QAction
*m_openInSplitView
;
80 QAction
*m_lockPanelsAction
;
83 #endif // PLACESPANEL_H