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
);
40 void storageTearDownSuccessful();
43 bool urlChanged() override
;
44 void showEvent(QShowEvent
* event
) override
;
47 void readSettings() override
;
48 void showHiddenEntries(bool shown
);
49 int hiddenListCount();
52 void slotItemActivated(int index
);
53 void slotItemMiddleClicked(int index
);
54 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
55 void slotViewContextMenuRequested(const QPointF
& pos
);
56 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
57 void slotItemDropEventStorageSetupDone(int index
, bool success
);
58 void slotAboveItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
59 void slotUrlsDropped(const QUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
60 void slotStorageSetupDone(int index
, bool success
);
64 void editEntry(int index
);
67 * Selects the item that has the closest URL for the URL set
68 * for the panel (see Panel::setUrl()).
70 void selectClosestItem();
72 void triggerItem(int index
, Qt::MouseButton button
);
74 QAction
* buildGroupContextMenu(QMenu
* menu
, int index
);
77 KItemListController
* m_controller
;
78 PlacesItemModel
* m_model
;
81 QUrl m_storageSetupFailedUrl
;
82 Qt::MouseButton m_triggerStorageSetupButton
;
84 int m_itemDropEventIndex
;
85 QMimeData
* m_itemDropEventMimeData
;
86 QDropEvent
* m_itemDropEvent
;
89 #endif // PLACESPANEL_H