Commit 2f045c60 authored by Alex Richardson's avatar Alex Richardson
Browse files

Allow compiling Dolphin with KF5

This does not work properly yet, there are probably quite a few bad signal/
slot connections due to KUrl -> QUrl. However dolphin starts without
crashing.

Accessibility is not ported since that changed quite a lot from Qt4 -> Qt5
and I have no idea how it is supposed to be used.

This is the first commit for review 117395
parent c2887688
add_definitions(-Wno-deprecated-declarations)
add_subdirectory(src)
macro_optional_find_package(Baloo)
find_package(Baloo)
set_package_properties(Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
URL "http://www.kde.org"
TYPE OPTIONAL
PURPOSE "For adding desktop-wide search and tagging support to dolphin"
)
macro_optional_find_package(BalooWidgets)
find_package(BalooWidgets)
set_package_properties(BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
URL "http://www.kde.org"
TYPE OPTIONAL
)
macro_optional_find_package(KFileMetaData)
find_package(KFileMetaData)
set_package_properties(KFileMetaData PROPERTIES
URL "https://projects.kde.org/kfilemetadata"
TYPE OPTIONAL
......@@ -22,6 +22,10 @@ if (Baloo_FOUND AND BalooWidgets_FOUND AND KFileMetaData_FOUND)
set(HAVE_BALOO TRUE)
endif()
find_package(KF5NewStuff CONFIG REQUIRED)
find_package(KF5KCMUtils CONFIG REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h )
macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER)
......@@ -49,7 +53,7 @@ set(dolphinprivate_LIB_SRCS
kitemviews/kitemlistselectionmanager.cpp
kitemviews/kitemliststyleoption.cpp
kitemviews/kitemlistview.cpp
kitemviews/kitemlistviewaccessible.cpp
# kitemviews/kitemlistviewaccessible.cpp
kitemviews/kitemlistwidget.cpp
kitemviews/kitemmodelbase.cpp
kitemviews/kitemset.cpp
......@@ -117,9 +121,9 @@ kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS})
target_link_libraries(
dolphinprivate
${KDE4_KFILE_LIBS}
konq
${KDE4_KNEWSTUFF3_LIBS}
KF5::NewStuff
KF5::KDE4Support
)
if(HAVE_BALOO)
......@@ -144,15 +148,9 @@ install(TARGETS dolphinprivate ${INSTALL_TARGETS_DEFAULT_ARGS})
set(dolphinpart_SRCS
dolphinpart.cpp
dolphinpart_ext.cpp
)
# Add dolphinpart_ext.cpp conditionally, only with KDE > 4.9.1.
if (${KDE_VERSION} VERSION_GREATER "4.9.1")
set(dolphinpart_SRCS
${dolphinpart_SRCS}
dolphinpart_ext.cpp)
endif (${KDE_VERSION} VERSION_GREATER "4.9.1")
kde4_add_plugin(dolphinpart ${dolphinpart_SRCS})
target_link_libraries(dolphinpart dolphinprivate konq ${KDE4_KPARTS_LIBS} ${KDE4_KFILE_LIBS})
......@@ -235,16 +233,17 @@ kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-fi
kde4_add_kdeinit_executable(dolphin ${dolphin_SRCS})
target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES})
target_link_libraries(kdeinit_dolphin
${KDE4_KDEPRINT_LIBS}
${KDE4_KFILE_LIBS}
${KDE4_KPARTS_LIBS}
${KDE4_KCMUTILS_LIBRARY}
konq
dolphinprivate
knewstuff3
${KDE4_SOLID_LIBS}
${KDE4_PHONON_LIBS}
KF5::NewStuff
KF5::Parts
KF5::KCMUtils
KF5::Solid
Phonon::phonon4qt5
KF5::KDE4Support
)
if(HAVE_BALOO)
......
......@@ -26,6 +26,7 @@
#include <KDebug>
#include <KRun>
#include <KUrl>
#include <KGlobal>
DolphinApplication::DolphinApplication() :
m_mainWindow(0)
......
......@@ -39,6 +39,7 @@
#include <KMenuBar>
#include <KMessageBox>
#include <KMimeTypeTrader>
#include <KMimeType>
#include <KNewFileMenu>
#include <konqmimedata.h>
#include <konq_operations.h>
......@@ -205,7 +206,7 @@ void DolphinContextMenu::openItemContextMenu()
connect(newFileMenu, SIGNAL(fileCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
connect(newFileMenu, SIGNAL(directoryCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
KMenu* menu = newFileMenu->menu();
QMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(KIcon("document-new"));
addMenu(menu);
......@@ -490,7 +491,7 @@ void DolphinContextMenu::addFileItemPluginActions()
const KConfig config("kservicemenurc", KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
foreach (const KSharedPtr<KService>& service, pluginServices) {
foreach (const KService::Ptr& service, pluginServices) {
if (!showGroup.readEntry(service->desktopEntryName(), true)) {
// The plugin has been disabled
continue;
......
......@@ -53,6 +53,9 @@
#include <kdualaction.h>
#include <KFileDialog>
#include <KGlobal>
#include <KDialog>
#include <KJobWidgets>
#include <KMimeType>
#include <KLineEdit>
#include <KToolBar>
#include <KIcon>
......@@ -86,6 +89,8 @@
#include <QClipboard>
#include <QToolButton>
#include <QSplitter>
#include <QTimer>
#include <QPushButton>
namespace {
// Used for GeneralSettings::version() to determine whether
......@@ -550,7 +555,7 @@ void DolphinMainWindow::openInNewWindow()
}
if (!newWindowUrl.isEmpty()) {
KRun::run("dolphin %u", KUrl::List() << newWindowUrl, this);
KRun::run("dolphin %u", QList<QUrl>() << newWindowUrl, this);
}
}
......@@ -593,18 +598,19 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
// KDialog::Yes -> Quit
// KDialog::No -> Close only the current tab
// KDialog::Cancel -> do nothing
KDialog *dialog = new KDialog(this, Qt::Dialog);
dialog->setCaption(i18nc("@title:window", "Confirmation"));
dialog->setButtons(KDialog::Yes | KDialog::No | KDialog::Cancel);
QDialog *dialog = new QDialog(this, Qt::Dialog);
dialog->setWindowTitle(i18nc("@title:window", "Confirmation"));
dialog->setModal(true);
dialog->setButtonGuiItem(KDialog::Yes, KStandardGuiItem::quit());
dialog->setButtonGuiItem(KDialog::No, KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")));
dialog->setButtonGuiItem(KDialog::Cancel, KStandardGuiItem::cancel());
dialog->setDefaultButton(KDialog::Yes);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);
KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KStandardGuiItem::quit());
KGuiItem::assign(buttons->button(QDialogButtonBox::No), KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")));
KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
buttons->button(QDialogButtonBox::Yes)->setDefault(true);
bool doNotAskAgainCheckboxResult = false;
const int result = KMessageBox::createKMessageBox(dialog,
buttons,
QMessageBox::Warning,
i18n("You have multiple tabs open in this window, are you sure you want to quit?"),
QStringList(),
......@@ -1232,7 +1238,7 @@ void DolphinMainWindow::handleUrl(const KUrl& url)
// stat the URL to see if it is a dir or not
m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
if (m_lastHandleUrlStatJob->ui()) {
m_lastHandleUrlStatJob->ui()->setWindow(this);
KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
}
connect(m_lastHandleUrlStatJob, SIGNAL(result(KJob*)),
this, SLOT(slotHandleUrlStatFinished(KJob*)));
......@@ -1285,12 +1291,13 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
switch (command) {
case DolphinContextMenu::OpenParentFolderInNewWindow: {
KRun::run("dolphin %u", KUrl::List() << item.url().upUrl(), this);
KRun::run("dolphin %u", QList<QUrl>() << KIO::upUrl(item.url()), this);
break;
}
case DolphinContextMenu::OpenParentFolderInNewTab:
openNewTab(item.url().upUrl());
openNewTab(KIO::upUrl(item.url()));
break;
case DolphinContextMenu::None:
......@@ -1480,26 +1487,26 @@ void DolphinMainWindow::setupActions()
{
// setup 'File' menu
m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
KMenu* menu = m_newFileMenu->menu();
QMenu* menu = m_newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(KIcon("document-new"));
m_newFileMenu->setDelayed(false);
connect(menu, SIGNAL(aboutToShow()),
this, SLOT(updateNewMenu()));
KAction* newWindow = actionCollection()->addAction("new_window");
QAction* newWindow = actionCollection()->addAction("new_window");
newWindow->setIcon(KIcon("window-new"));
newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
newWindow->setShortcut(Qt::CTRL | Qt::Key_N);
connect(newWindow, SIGNAL(triggered()), this, SLOT(openNewMainWindow()));
KAction* newTab = actionCollection()->addAction("new_tab");
QAction* newTab = actionCollection()->addAction("new_tab");
newTab->setIcon(KIcon("tab-new"));
newTab->setText(i18nc("@action:inmenu File", "New Tab"));
newTab->setShortcut(KShortcut(Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N));
newTab->setShortcuts(QList<QKeySequence>() << QKeySequence(Qt::CTRL | Qt::Key_T) << QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_N));
connect(newTab, SIGNAL(triggered()), this, SLOT(openNewTab()));
KAction* closeTab = actionCollection()->addAction("close_tab");
QAction* closeTab = actionCollection()->addAction("close_tab");
closeTab->setIcon(KIcon("tab-close"));
closeTab->setText(i18nc("@action:inmenu File", "Close Tab"));
closeTab->setShortcut(Qt::CTRL | Qt::Key_W);
......@@ -1515,12 +1522,12 @@ void DolphinMainWindow::setupActions()
// need to remove shift+del from cut action, else the shortcut for deletejob
// doesn't work
KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
KShortcut cutShortcut = cut->shortcut();
cutShortcut.remove(Qt::SHIFT | Qt::Key_Delete, KShortcut::KeepEmpty);
cut->setShortcut(cutShortcut);
QAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
auto cutShortcuts = cut->shortcuts();
cutShortcuts.removeAll(QKeySequence(Qt::SHIFT | Qt::Key_Delete));
cut->setShortcuts(cutShortcuts);
KStandardAction::copy(this, SLOT(copy()), actionCollection());
KAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
QAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
// The text of the paste-action is modified dynamically by Dolphin
// (e. g. to "Paste One Folder"). To prevent that the size of the toolbar changes
// due to the long text, the text "Paste" is used:
......@@ -1528,12 +1535,12 @@ void DolphinMainWindow::setupActions()
KStandardAction::find(this, SLOT(find()), actionCollection());
KAction* selectAll = actionCollection()->addAction("select_all");
QAction* selectAll = actionCollection()->addAction("select_all");
selectAll->setText(i18nc("@action:inmenu Edit", "Select All"));
selectAll->setShortcut(Qt::CTRL | Qt::Key_A);
connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
KAction* invertSelection = actionCollection()->addAction("invert_selection");
QAction* invertSelection = actionCollection()->addAction("invert_selection");
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection()));
......@@ -1541,18 +1548,18 @@ void DolphinMainWindow::setupActions()
// setup 'View' menu
// (note that most of it is set up in DolphinViewActionHandler)
KAction* split = actionCollection()->addAction("split_view");
QAction* split = actionCollection()->addAction("split_view");
split->setShortcut(Qt::Key_F3);
updateSplitAction();
connect(split, SIGNAL(triggered()), this, SLOT(toggleSplitView()));
KAction* reload = actionCollection()->addAction("reload");
QAction* reload = actionCollection()->addAction("reload");
reload->setText(i18nc("@action:inmenu View", "Reload"));
reload->setShortcut(Qt::Key_F5);
reload->setIcon(KIcon("view-refresh"));
connect(reload, SIGNAL(triggered()), this, SLOT(reloadView()));
KAction* stop = actionCollection()->addAction("stop");
QAction* stop = actionCollection()->addAction("stop");
stop->setText(i18nc("@action:inmenu View", "Stop"));
stop->setToolTip(i18nc("@info", "Stop loading"));
stop->setIcon(KIcon("process-stop"));
......@@ -1563,17 +1570,17 @@ void DolphinMainWindow::setupActions()
editableLocation->setShortcut(Qt::Key_F6);
connect(editableLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
KAction* replaceLocation = actionCollection()->addAction("replace_location");
QAction* replaceLocation = actionCollection()->addAction("replace_location");
replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location"));
replaceLocation->setShortcut(Qt::CTRL | Qt::Key_L);
connect(replaceLocation, SIGNAL(triggered()), this, SLOT(replaceLocation()));
// setup 'Go' menu
KAction* backAction = KStandardAction::back(this, SLOT(goBack()), actionCollection());
QAction* backAction = KStandardAction::back(this, SLOT(goBack()), actionCollection());
connect(backAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goBack(Qt::MouseButtons)));
KShortcut backShortcut = backAction->shortcut();
backShortcut.setAlternate(Qt::Key_Backspace);
backAction->setShortcut(backShortcut);
auto backShortcuts = backAction->shortcuts();
backShortcuts.append(QKeySequence(Qt::Key_Backspace));
backAction->setShortcuts(backShortcuts);
m_recentTabsMenu = new KActionMenu(i18n("Recently Closed Tabs"), this);
m_recentTabsMenu->setIcon(KIcon("edit-undo"));
......@@ -1589,29 +1596,29 @@ void DolphinMainWindow::setupActions()
m_recentTabsMenu->addSeparator();
m_recentTabsMenu->setEnabled(false);
KAction* forwardAction = KStandardAction::forward(this, SLOT(goForward()), actionCollection());
QAction* forwardAction = KStandardAction::forward(this, SLOT(goForward()), actionCollection());
connect(forwardAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goForward(Qt::MouseButtons)));
KAction* upAction = KStandardAction::up(this, SLOT(goUp()), actionCollection());
QAction* upAction = KStandardAction::up(this, SLOT(goUp()), actionCollection());
connect(upAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goUp(Qt::MouseButtons)));
KAction* homeAction = KStandardAction::home(this, SLOT(goHome()), actionCollection());
QAction* homeAction = KStandardAction::home(this, SLOT(goHome()), actionCollection());
connect(homeAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goHome(Qt::MouseButtons)));
// setup 'Tools' menu
KAction* showFilterBar = actionCollection()->addAction("show_filter_bar");
QAction* showFilterBar = actionCollection()->addAction("show_filter_bar");
showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar"));
showFilterBar->setIcon(KIcon("view-filter"));
showFilterBar->setShortcut(Qt::CTRL | Qt::Key_I);
connect(showFilterBar, SIGNAL(triggered()), this, SLOT(showFilterBar()));
KAction* compareFiles = actionCollection()->addAction("compare_files");
QAction* compareFiles = actionCollection()->addAction("compare_files");
compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
compareFiles->setIcon(KIcon("kompare"));
compareFiles->setEnabled(false);
connect(compareFiles, SIGNAL(triggered()), this, SLOT(compareFiles()));
KAction* openTerminal = actionCollection()->addAction("open_terminal");
QAction* openTerminal = actionCollection()->addAction("open_terminal");
openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal"));
openTerminal->setIcon(KIcon("utilities-terminal"));
openTerminal->setShortcut(Qt::SHIFT | Qt::Key_F4);
......@@ -1625,35 +1632,35 @@ void DolphinMainWindow::setupActions()
// not in menu actions
QList<QKeySequence> nextTabKeys;
nextTabKeys.append(KStandardShortcut::tabNext().primary());
nextTabKeys.append(KStandardShortcut::tabNext().first()); //TODO: is this correct
nextTabKeys.append(QKeySequence(Qt::CTRL | Qt::Key_Tab));
QList<QKeySequence> prevTabKeys;
prevTabKeys.append(KStandardShortcut::tabPrev().primary());
prevTabKeys.append(KStandardShortcut::tabPrev().first()); //TODO: is this correct
prevTabKeys.append(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Tab));
KAction* activateNextTab = actionCollection()->addAction("activate_next_tab");
QAction* activateNextTab = actionCollection()->addAction("activate_next_tab");
activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab"));
connect(activateNextTab, SIGNAL(triggered()), SLOT(activateNextTab()));
activateNextTab->setShortcuts(QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys);
KAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab");
QAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab");
activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab"));
connect(activatePrevTab, SIGNAL(triggered()), SLOT(activatePrevTab()));
activatePrevTab->setShortcuts(QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys);
// for context menu
KAction* openInNewTab = actionCollection()->addAction("open_in_new_tab");
QAction* openInNewTab = actionCollection()->addAction("open_in_new_tab");
openInNewTab->setText(i18nc("@action:inmenu", "Open in New Tab"));
openInNewTab->setIcon(KIcon("tab-new"));
connect(openInNewTab, SIGNAL(triggered()), this, SLOT(openInNewTab()));
KAction* openInNewTabs = actionCollection()->addAction("open_in_new_tabs");
QAction* openInNewTabs = actionCollection()->addAction("open_in_new_tabs");
openInNewTabs->setText(i18nc("@action:inmenu", "Open in New Tabs"));
openInNewTabs->setIcon(KIcon("tab-new"));
connect(openInNewTabs, SIGNAL(triggered()), this, SLOT(openInNewTab()));
KAction* openInNewWindow = actionCollection()->addAction("open_in_new_window");
QAction* openInNewWindow = actionCollection()->addAction("open_in_new_window");
openInNewWindow->setText(i18nc("@action:inmenu", "Open in New Window"));
openInNewWindow->setIcon(KIcon("window-new"));
connect(openInNewWindow, SIGNAL(triggered()), this, SLOT(openInNewWindow()));
......@@ -1895,7 +1902,7 @@ bool DolphinMainWindow::addActionToMenu(QAction* action, KMenu* menu)
void DolphinMainWindow::rememberClosedTab(int index)
{
KMenu* tabsMenu = m_recentTabsMenu->menu();
QMenu* tabsMenu = m_recentTabsMenu->menu();
const QString primaryPath = m_viewTab[index].primaryView->url().path();
const QString iconName = KMimeType::iconNameForUrl(primaryPath);
......@@ -2115,7 +2122,7 @@ void DolphinMainWindow::createPanelAction(const KIcon& icon,
QAction* dockAction,
const QString& actionName)
{
KAction* panelAction = actionCollection()->addAction(actionName);
QAction* panelAction = actionCollection()->addAction(actionName);
panelAction->setCheckable(true);
panelAction->setChecked(dockAction->isChecked());
panelAction->setText(dockAction->text());
......
......@@ -34,6 +34,7 @@
#include <KPluginFactory>
#include <KRun>
#include <KToggleAction>
#include <KGlobal>
#include <KIO/NetAccess>
#include <KToolInvocation>
#include <kauthorized.h>
......@@ -42,9 +43,7 @@
#include <KProtocolInfo>
#include <kdeversion.h>
#if KDE_IS_VERSION(4, 9, 2)
#include "dolphinpart_ext.h"
#endif
#include "dolphinnewfilemenu.h"
#include "views/dolphinview.h"
......@@ -69,7 +68,8 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
,m_removeAction(0)
{
Q_UNUSED(args)
setComponentData(DolphinPartFactory::componentData(), false);
#pragma message("TODO: port to KF5")
//setComponentData(DolphinPartFactory::componentData(), false);
m_extension = new DolphinPartBrowserExtension(this);
// make sure that other apps using this part find Dolphin's view-file-columns icons
......@@ -134,7 +134,6 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
// NOTE: Listing filter needs to be instantiated after the creation of the view.
new DolphinPartFileInfoExtension(this);
#if KDE_IS_VERSION(4, 9, 2)
new DolphinPartListingFilterExtension(this);
KDirLister* lister = m_view->m_model->m_dirLister;
......@@ -145,7 +144,6 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
} else {
kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
}
#endif
createActions();
m_actionHandler->updateViewActions();
......@@ -174,26 +172,26 @@ void DolphinPart::createActions()
connect(m_newFileMenu->menu(), SIGNAL(aboutToShow()),
this, SLOT(updateNewMenu()));
KAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
QAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
editMimeTypeAction->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) );
connect(editMimeTypeAction, SIGNAL(triggered()), SLOT(slotEditMimeType()));
KAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
QAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching..."));
selectItemsMatching->setShortcut(Qt::CTRL | Qt::Key_S);
connect(selectItemsMatching, SIGNAL(triggered()), this, SLOT(slotSelectItemsMatchingPattern()));
KAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
QAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching..."));
connect(unselectItemsMatching, SIGNAL(triggered()), this, SLOT(slotUnselectItemsMatchingPattern()));
actionCollection()->addAction(KStandardAction::SelectAll, "select_all", m_view, SLOT(selectAll()));
KAction* unselectAll = actionCollection()->addAction("unselect_all");
QAction* unselectAll = actionCollection()->addAction("unselect_all");
unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All"));
connect(unselectAll, SIGNAL(triggered()), m_view, SLOT(clearSelection()));
KAction* invertSelection = actionCollection()->addAction("invert_selection");
QAction* invertSelection = actionCollection()->addAction("invert_selection");
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
connect(invertSelection, SIGNAL(triggered()), m_view, SLOT(invertSelection()));
......@@ -219,19 +217,19 @@ void DolphinPart::createActions()
i18nc("@action:inmenu Go", "Trash"), QString("trash:/"),
goActionGroup);
createGoAction("go_autostart", "",
i18nc("@action:inmenu Go", "Autostart"), KGlobalSettings::autostartPath(),
i18nc("@action:inmenu Go", "Autostart"), QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/autostart",
goActionGroup);
// Tools menu
m_findFileAction = actionCollection()->addAction("find_file");
m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File..."));
m_findFileAction->setShortcut(Qt::CTRL | Qt::Key_F);
m_findFileAction->setIcon(KIcon("edit-find"));
m_findFileAction->setIcon(QIcon::fromTheme("edit-find"));
connect(m_findFileAction, SIGNAL(triggered()), this, SLOT(slotFindFile()));
if (KAuthorized::authorizeKAction("shell_access")) {
m_openTerminalAction = actionCollection()->addAction("open_terminal");
m_openTerminalAction->setIcon(KIcon("utilities-terminal"));
m_openTerminalAction->setIcon(QIcon::fromTheme("utilities-terminal"));
m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));
connect(m_openTerminalAction, SIGNAL(triggered()), SLOT(slotOpenTerminal()));
m_openTerminalAction->setShortcut(Qt::Key_F4);
......@@ -242,8 +240,8 @@ void DolphinPart::createGoAction(const char* name, const char* iconName,
const QString& text, const QString& url,
QActionGroup* actionGroup)
{
KAction* action = actionCollection()->addAction(name);
action->setIcon(KIcon(iconName));
QAction* action = actionCollection()->addAction(name);
action->setIcon(QIcon::fromTheme(iconName));
action->setText(text);
action->setData(url);
action->setActionGroup(actionGroup);
......@@ -301,7 +299,7 @@ void DolphinPart::updatePasteAction()
KAboutData* DolphinPart::createAboutData()
{
return new KAboutData("dolphinpart", "dolphin", ki18nc("@title", "Dolphin Part"), "0.1");
return new KAboutData("dolphinpart", "dolphin", i18nc("@title", "Dolphin Part"), "0.1");
}
bool DolphinPart::openUrl(const KUrl& url)
......@@ -559,7 +557,7 @@ void DolphinPart::slotOpenTerminal()
void DolphinPart::slotFindFile()
{
KRun::run("kfind", url(), widget());
KRun::run("kfind", QList<QUrl>() << url(), widget());
}
void DolphinPart::updateNewMenu()
......
......@@ -20,14 +20,14 @@
#ifndef DOLPHINPART_H
#define DOLPHINPART_H
#include <kparts/part.h>
#include <KParts/ReadOnlyPart>
#include <KUrl>
#include <QItemSelectionModel>
class DolphinNewFileMenu;
class DolphinViewActionHandler;
class QActionGroup;
class KAction;
class KFileItemList;
class KFileItem;
class DolphinPartBrowserExtension;
......@@ -243,8 +243,8 @@ private:
DolphinRemoteEncoding* m_remoteEncoding;
DolphinPartBrowserExtension* m_extension;
DolphinNewFileMenu* m_newFileMenu;
KAction* m_findFileAction;
KAction* m_openTerminalAction;
QAction* m_findFileAction;
QAction* m_openTerminalAction;
QString m_nameFilter;
DolphinRemoveAction* m_removeAction;
Q_DISABLE_COPY(DolphinPart)
......
......@@ -23,6 +23,7 @@
#include <kparts/browserextension.h>
#include <kparts/fileinfoextension.h>
#include <kparts/listingextension.h>
#include <KUrl>
class DolphinPart;
......
......@@ -26,6 +26,7 @@
#include <QBoxLayout>
#include <QTimer>
#include <QScrollBar>
#include <QMimeData>
#include <KDesktopFile>
#include <KFileItemDelegate>
......@@ -86,15 +87,15 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
this, SLOT(dropUrls(KUrl,QDropEvent*)));
connect(m_urlNavigator, SIGNAL(activated()),
this, SLOT(activate()));
connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KCompletion::CompletionMode)),
this, SLOT(saveUrlCompletionMode(KCompletion::CompletionMode)));
const GeneralSettings* settings = GeneralSettings::self();
m_urlNavigator->setUrlEditable(settings->editableUrl());
m_urlNavigator->setShowFullPath(settings->showFullPath());
m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
KUrlComboBox* editor = m_urlNavigator->editor();
editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));
editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
m_searchBox = new DolphinSearchBox(this);
m_searchBox->hide();
......@@ -492,7 +493,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item)
return;
}