Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Line(s) | |||||
285 | void DolphinMainWindow::updateFilterBarAction(bool show) | 285 | void DolphinMainWindow::updateFilterBarAction(bool show) | ||
286 | { | 286 | { | ||
287 | QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar")); | 287 | QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar")); | ||
288 | showFilterBarAction->setChecked(show); | 288 | showFilterBarAction->setChecked(show); | ||
289 | } | 289 | } | ||
290 | 290 | | |||
291 | void DolphinMainWindow::openNewMainWindow() | 291 | void DolphinMainWindow::openNewMainWindow() | ||
292 | { | 292 | { | ||
293 | KRun::run(QStringLiteral("dolphin %u"), QList<QUrl>(), this); | 293 | Dolphin::openNewWindow({}, this); | ||
294 | } | 294 | } | ||
295 | 295 | | |||
296 | void DolphinMainWindow::openNewActivatedTab() | 296 | void DolphinMainWindow::openNewActivatedTab() | ||
297 | { | 297 | { | ||
298 | m_tabWidget->openNewActivatedTab(); | 298 | m_tabWidget->openNewActivatedTab(); | ||
299 | } | 299 | } | ||
300 | 300 | | |||
301 | void DolphinMainWindow::openNewTab(const QUrl& url) | 301 | void DolphinMainWindow::openNewTab(const QUrl& url) | ||
Show All 24 Lines | 322 | { | |||
326 | if (list.isEmpty()) { | 326 | if (list.isEmpty()) { | ||
327 | newWindowUrl = m_activeViewContainer->url(); | 327 | newWindowUrl = m_activeViewContainer->url(); | ||
328 | } else if (list.count() == 1) { | 328 | } else if (list.count() == 1) { | ||
329 | const KFileItem& item = list.first(); | 329 | const KFileItem& item = list.first(); | ||
330 | newWindowUrl = DolphinView::openItemAsFolderUrl(item); | 330 | newWindowUrl = DolphinView::openItemAsFolderUrl(item); | ||
331 | } | 331 | } | ||
332 | 332 | | |||
333 | if (!newWindowUrl.isEmpty()) { | 333 | if (!newWindowUrl.isEmpty()) { | ||
334 | KRun::run(QStringLiteral("dolphin %u"), {newWindowUrl}, this); | 334 | Dolphin::openNewWindow({newWindowUrl}, this); | ||
335 | } | 335 | } | ||
336 | } | 336 | } | ||
337 | 337 | | |||
338 | void DolphinMainWindow::showEvent(QShowEvent* event) | 338 | void DolphinMainWindow::showEvent(QShowEvent* event) | ||
339 | { | 339 | { | ||
340 | KXmlGuiWindow::showEvent(event); | 340 | KXmlGuiWindow::showEvent(event); | ||
341 | 341 | | |||
342 | if (!event->spontaneous()) { | 342 | if (!event->spontaneous()) { | ||
▲ Show 20 Lines • Show All 424 Lines • ▼ Show 20 Line(s) | 765 | { | |||
767 | contextMenu.data()->setCustomActions(customActions); | 767 | contextMenu.data()->setCustomActions(customActions); | ||
768 | const DolphinContextMenu::Command command = contextMenu.data()->open(); | 768 | const DolphinContextMenu::Command command = contextMenu.data()->open(); | ||
769 | 769 | | |||
770 | switch (command) { | 770 | switch (command) { | ||
771 | case DolphinContextMenu::OpenParentFolder: | 771 | case DolphinContextMenu::OpenParentFolder: | ||
772 | changeUrl(KIO::upUrl(item.url())); | 772 | changeUrl(KIO::upUrl(item.url())); | ||
773 | break; | 773 | break; | ||
774 | 774 | | |||
775 | case DolphinContextMenu::OpenParentFolderInNewWindow: { | 775 | case DolphinContextMenu::OpenParentFolderInNewWindow: | ||
776 | 776 | Dolphin::openNewWindow({KIO::upUrl(item.url())}, this); | |||
777 | KRun::run(QStringLiteral("dolphin %u"), {KIO::upUrl(item.url())}, this); | | |||
778 | break; | 777 | break; | ||
779 | } | | |||
780 | 778 | | |||
781 | case DolphinContextMenu::OpenParentFolderInNewTab: | 779 | case DolphinContextMenu::OpenParentFolderInNewTab: | ||
782 | openNewTab(KIO::upUrl(item.url())); | 780 | openNewTab(KIO::upUrl(item.url())); | ||
783 | break; | 781 | break; | ||
784 | 782 | | |||
785 | case DolphinContextMenu::None: | 783 | case DolphinContextMenu::None: | ||
786 | default: | 784 | default: | ||
787 | break; | 785 | break; | ||
▲ Show 20 Lines • Show All 756 Lines • Show Last 20 Lines |