Changeset View
Changeset View
Standalone View
Standalone View
src/dolphincontextmenu.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | #include <QMimeDatabase> | 51 | #include <QMimeDatabase> | ||
52 | 52 | | |||
53 | #include <panels/places/placesitem.h> | 53 | #include <panels/places/placesitem.h> | ||
54 | #include <panels/places/placesitemmodel.h> | 54 | #include <panels/places/placesitemmodel.h> | ||
55 | 55 | | |||
56 | 56 | | |||
57 | #include "views/dolphinview.h" | 57 | #include "views/dolphinview.h" | ||
58 | #include "views/viewmodecontroller.h" | 58 | #include "views/viewmodecontroller.h" | ||
59 | #include "trash/dolphintrash.h" | ||||
59 | 60 | | |||
60 | DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, | 61 | DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, | ||
61 | const QPoint& pos, | 62 | const QPoint& pos, | ||
62 | const KFileItem& fileInfo, | 63 | const KFileItem& fileInfo, | ||
63 | const QUrl& baseUrl) : | 64 | const QUrl& baseUrl) : | ||
64 | QMenu(parent), | 65 | QMenu(parent), | ||
65 | m_pos(pos), | 66 | m_pos(pos), | ||
66 | m_mainWindow(parent), | 67 | m_mainWindow(parent), | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 142 | { | |||
149 | addCustomActions(); | 150 | addCustomActions(); | ||
150 | 151 | | |||
151 | QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties")); | 152 | QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties")); | ||
152 | addAction(propertiesAction); | 153 | addAction(propertiesAction); | ||
153 | 154 | | |||
154 | addShowMenuBarAction(); | 155 | addShowMenuBarAction(); | ||
155 | 156 | | |||
156 | if (exec(m_pos) == emptyTrashAction) { | 157 | if (exec(m_pos) == emptyTrashAction) { | ||
157 | KIO::JobUiDelegate uiDelegate; | 158 | emptyTrash(m_mainWindow); | ||
158 | uiDelegate.setWindow(m_mainWindow); | | |||
159 | if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) { | | |||
160 | KIO::Job* job = KIO::emptyTrash(); | | |||
161 | KJobWidgets::setWindow(job, m_mainWindow); | | |||
162 | job->uiDelegate()->setAutoErrorHandlingEnabled(true); | | |||
163 | } | | |||
164 | } | 159 | } | ||
165 | } | 160 | } | ||
166 | 161 | | |||
167 | void DolphinContextMenu::openTrashItemContextMenu() | 162 | void DolphinContextMenu::openTrashItemContextMenu() | ||
168 | { | 163 | { | ||
169 | Q_ASSERT(m_context & TrashContext); | 164 | Q_ASSERT(m_context & TrashContext); | ||
170 | Q_ASSERT(m_context & ItemContext); | 165 | Q_ASSERT(m_context & ItemContext); | ||
171 | 166 | | |||
▲ Show 20 Lines • Show All 330 Lines • Show Last 20 Lines |