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"
15 #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();
56 void showEvent(QShowEvent
* event
) override
;
59 void slotConfigureTrash();
60 void slotUrlsDropped(const QUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
61 void slotContextMenuAboutToShow(const QModelIndex
&index
, QMenu
*menu
);
62 void slotTearDownRequested(const QModelIndex
&index
);
63 void slotTearDownRequestedExternally(const QString
&udi
);
64 void slotTearDownDone(Solid::ErrorType error
, const QVariant
& errorData
);
65 void slotRowsInserted(const QModelIndex
&parent
, int first
, int last
);
66 void slotRowsAboutToBeRemoved(const QModelIndex
&parent
, int first
, int last
);
69 void connectDeviceSignals(const QModelIndex
&idx
);
71 QUrl m_url
; // only used for initial setUrl
72 QList
<QAction
*> m_customContextMenuActions
;
74 Solid::StorageAccess
*m_deviceToTearDown
= nullptr;
76 QAction
*m_configureTrashAction
;
77 QAction
*m_lockPanelsAction
;
80 #endif // PLACESPANEL_H