X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a07d63d419469592b2600e668795cea2f9bee403..581ee6d0c85bfd18ef39b68ffbea2fb8c8bdf607:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index cfde90ada..1c0d611b9 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -21,25 +21,22 @@ #include "dolphinremoveaction.h" #include -#include #include #include -#include +#include "dolphindebug.h" #include #include #include #include #include -#include #include #include #include -#include -#include #include #include #include +#include #include "dolphinpart_ext.h" #include "dolphinnewfilemenu.h" @@ -57,10 +54,9 @@ #include #include #include - +#include K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) -K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) : KParts::ReadOnlyPart(parent) @@ -141,7 +137,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems); connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted); } else { - kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported"; + qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported"; } createActions(); @@ -343,7 +339,7 @@ void DolphinPart::slotMessage(const QString& msg) void DolphinPart::slotErrorMessage(const QString& msg) { - kDebug() << msg; + qCDebug(DolphinDebug) << msg; emit canceled(msg); //KMessageBox::error(m_view, msg); } @@ -474,7 +470,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos, void DolphinPart::slotDirectoryRedirection(const QUrl &oldUrl, const QUrl &newUrl) { - //kDebug() << oldUrl << newUrl << "currentUrl=" << url(); + qCDebug(DolphinDebug) << oldUrl << newUrl << "currentUrl=" << url(); if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) { KParts::ReadOnlyPart::setUrl(newUrl); const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile); @@ -508,7 +504,7 @@ void DolphinPart::slotUnselectItemsMatchingPattern() void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems) { bool okClicked; - QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view); + const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, "*", &okClicked); if (okClicked && !pattern.isEmpty()) { QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard); @@ -544,7 +540,10 @@ void DolphinPart::slotOpenTerminal() // 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. - u = KIO::NetAccess::mostLocalUrl(u, widget()); + KIO::StatJob* statJob = KIO::mostLocalUrl(u); + KJobWidgets::setWindow(statJob, widget()); + statJob->exec(); + u = statJob->mostLocalUrl(); //If the URL is local after the above conversion, set the directory. if (u.isLocalFile()) {