2 * SPDX-FileCopyrightText: 2008-2012 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2010 Christian Muehlhaeuser <muesli@gmail.com>
5 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include "panels/panel.h"
15 class KItemListController
;
16 class PlacesItemModel
;
18 class QGraphicsSceneDragDropEvent
;
22 * @brief Combines bookmarks and mounted devices as list.
24 class PlacesPanel
: public Panel
29 explicit PlacesPanel(QWidget
* parent
);
30 ~PlacesPanel() override
;
31 void proceedWithTearDown();
34 void placeActivated(const QUrl
& url
);
35 void placeMiddleClicked(const QUrl
& url
);
36 void errorMessage(const QString
& error
);
37 void storageTearDownRequested(const QString
& mountPath
);
38 void storageTearDownExternallyRequested(const QString
& mountPath
);
39 void showHiddenEntriesChanged(bool shown
);
42 bool urlChanged() override
;
43 void showEvent(QShowEvent
* event
) override
;
46 void readSettings() override
;
47 void showHiddenEntries(bool shown
);
48 int hiddenListCount();
51 void slotItemActivated(int index
);
52 void slotItemMiddleClicked(int index
);
53 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
54 void slotViewContextMenuRequested(const QPointF
& pos
);
55 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
56 void slotItemDropEventStorageSetupDone(int index
, bool success
);
57 void slotAboveItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
58 void slotUrlsDropped(const QUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
59 void slotStorageSetupDone(int index
, bool success
);
63 void editEntry(int index
);
66 * Selects the item that has the closest URL for the URL set
67 * for the panel (see Panel::setUrl()).
69 void selectClosestItem();
71 void triggerItem(int index
, Qt::MouseButton button
);
73 QAction
* buildGroupContextMenu(QMenu
* menu
, int index
);
76 KItemListController
* m_controller
;
77 PlacesItemModel
* m_model
;
80 QUrl m_storageSetupFailedUrl
;
81 Qt::MouseButton m_triggerStorageSetupButton
;
83 int m_itemDropEventIndex
;
84 QMimeData
* m_itemDropEventMimeData
;
85 QDropEvent
* m_itemDropEvent
;
88 #endif // PLACESPANEL_H