#include <kdeversion.h>
#include <KSharedConfig>
#include <KConfigGroup>
-#include <KComponentData>
+#include <KMimeTypeEditor>
#include "dolphinpart_ext.h"
#include "dolphinnewfilemenu.h"
#include <QApplication>
#include <QClipboard>
#include <QDir>
+#include <QKeyEvent>
K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();)
// make sure that other apps using this part find Dolphin's view-file-columns icons
KIconLoader::global()->addAppDir("dolphin");
- m_view = new DolphinView(KUrl(), parentWidget);
+ m_view = new DolphinView(QUrl(), parentWidget);
m_view->setTabsForFilesEnabled(true);
setWidget(m_view);
this, &DolphinPart::slotGoTriggered);
createGoAction("go_applications", "start-here-kde",
- i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"),
+ i18nc("@action:inmenu Go", "App&lications"), QStringLiteral("programs:/"),
goActionGroup);
createGoAction("go_network_folders", "folder-remote",
- i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"),
+ i18nc("@action:inmenu Go", "&Network Folders"), QStringLiteral("remote:/"),
goActionGroup);
createGoAction("go_settings", "preferences-system",
- i18nc("@action:inmenu Go", "Sett&ings"), QString("settings:/"),
+ i18nc("@action:inmenu Go", "Sett&ings"), QStringLiteral("settings:/"),
goActionGroup);
createGoAction("go_trash", "user-trash",
- i18nc("@action:inmenu Go", "Trash"), QString("trash:/"),
+ i18nc("@action:inmenu Go", "Trash"), QStringLiteral("trash:/"),
goActionGroup);
createGoAction("go_autostart", "",
i18nc("@action:inmenu Go", "Autostart"), QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/autostart",
void DolphinPart::slotGoTriggered(QAction* action)
{
const QString url = action->data().toString();
- emit m_extension->openUrlRequest(KUrl(url));
+ emit m_extension->openUrlRequest(QUrl(url));
}
void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
return true;
}
setUrl(url); // remember it at the KParts level
- KUrl visibleUrl(url);
+ QUrl visibleUrl(url);
if (!m_nameFilter.isEmpty()) {
- visibleUrl.addPath(m_nameFilter);
+ visibleUrl.setPath(visibleUrl.path() + '/' + m_nameFilter);
}
- QString prettyUrl = visibleUrl.pathOrUrl();
+ QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile);
emit setWindowCaption(prettyUrl);
emit m_extension->setLocationBarUrl(prettyUrl);
emit started(0); // get the wheel to spin
{
const KFileItemList items = m_view->selectedItems();
if (!items.isEmpty()) {
- KonqOperations::editMimeType(items.first().mimetype(), m_view);
+ KMimeTypeEditor::editMimeType(items.first().mimetype(), m_view);
}
}
{
QString dir(QDir::homePath());
- KUrl u(url());
+ QUrl u(url());
// 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.
void DolphinPart::slotFindFile()
{
- KRun::run("kfind", QList<QUrl>() << url(), widget());
+ KRun::run("kfind", {url()}, widget());
}
void DolphinPart::updateNewMenu()