X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f8187b982afbcd16d15756d8a9840222cfe91d2d..42e52a1eea1c70b38cb1a8bed8aafdcb5fdea804:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 1360a42e5..da6c5319d 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -21,7 +21,6 @@ #include "dolphinmainwindow.h" -#include "dolphinapplication.h" #include "dolphindockwidget.h" #include "dolphincontextmenu.h" #include "dolphinnewfilemenu.h" @@ -49,13 +48,10 @@ #include #include #include -#include #include -#include #include #include #include -#include #include #include #include @@ -70,6 +66,7 @@ #include #include +#include #include #include #include @@ -78,6 +75,7 @@ #include #include #include +#include namespace { // Used for GeneralSettings::version() to determine whether @@ -353,17 +351,16 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event) // Find out if Dolphin is closed directly by the user or // by the session manager because the session is closed bool closedByUser = true; - DolphinApplication *application = qobject_cast(qApp); - if (application && application->sessionSaving()) { + if (qApp->isSessionRestored()) { closedByUser = false; } if (m_tabWidget->count() > 1 && GeneralSettings::confirmClosingMultipleTabs() && closedByUser) { // Ask the user if he really wants to quit and close all tabs. // Open a confirmation dialog with 3 buttons: - // KDialog::Yes -> Quit - // KDialog::No -> Close only the current tab - // KDialog::Cancel -> do nothing + // QDialogButtonBox::Yes -> Quit + // QDialogButtonBox::No -> Close only the current tab + // QDialogButtonBox::Cancel -> do nothing QDialog *dialog = new QDialog(this, Qt::Dialog); dialog->setWindowTitle(i18nc("@title:window", "Confirmation")); dialog->setModal(true); @@ -688,7 +685,10 @@ void DolphinMainWindow::openTerminal() // If the given directory is not local, it can still be the URL of an // ioslave using UDS_LOCAL_PATH which to be converted first. - QUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this); + KIO::StatJob* statJob = KIO::mostLocalUrl(m_activeViewContainer->url()); + KJobWidgets::setWindow(statJob, this); + statJob->exec(); + QUrl url = statJob->mostLocalUrl(); //If the URL is local after the above conversion, set the directory. if (url.isLocalFile()) { @@ -969,7 +969,7 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url) caption.append(fileName); - setCaption(caption); + setWindowTitle(caption); } void DolphinMainWindow::setupActions()