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"
13 #include "views/draganddrophelper.h"
15 #include <KFilePlacesView>
18 #include <Solid/SolidNamespace> // Solid::ErrorType
27 * @brief Combines bookmarks and mounted devices as list.
29 class PlacesPanel
: public KFilePlacesView
34 explicit PlacesPanel(QWidget
*parent
);
35 ~PlacesPanel() override
;
37 void setUrl(const QUrl
&url
); // override
39 // for compatibility with Panel, actions that are shown
40 // on the view's context menu
41 QList
<QAction
*> customContextMenuActions() const;
42 void setCustomContextMenuActions(const QList
<QAction
*> &actions
);
44 void requestTearDown();
45 void proceedWithTearDown();
51 void errorMessage(const QString
&error
);
52 void storageTearDownRequested(const QString
&mountPath
);
53 void storageTearDownExternallyRequested(const QString
&mountPath
);
54 void storageTearDownSuccessful();
55 void openInSplitViewRequested(const QUrl
&url
);
58 void showEvent(QShowEvent
*event
) override
;
59 void dragMoveEvent(QDragMoveEvent
*event
) override
;
62 void slotConfigureTrash();
63 void slotUrlsDropped(const QUrl
&dest
, QDropEvent
*event
, QWidget
*parent
);
64 void slotContextMenuAboutToShow(const QModelIndex
&index
, QMenu
*menu
);
65 void slotTearDownRequested(const QModelIndex
&index
);
66 void slotTearDownRequestedExternally(const QString
&udi
);
67 void slotTearDownDone(const QModelIndex
&index
, Solid::ErrorType error
, const QVariant
&errorData
);
68 void slotRowsInserted(const QModelIndex
&parent
, int first
, int last
);
69 void slotRowsAboutToBeRemoved(const QModelIndex
&parent
, int first
, int last
);
72 void connectDeviceSignals(const QModelIndex
&idx
);
74 QUrl m_url
; // only used for initial setUrl
75 QList
<QAction
*> m_customContextMenuActions
;
77 QPersistentModelIndex m_indexToTearDown
;
79 QAction
*m_configureTrashAction
;
80 QAction
*m_openInSplitView
;
81 QAction
*m_lockPanelsAction
;
83 DragAndDropHelper m_dragAndDropHelper
;
86 #endif // PLACESPANEL_H