mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-07 10:51:45 +00:00
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
This commit is contained in:
parent
c2887688f1
commit
2f045c6010
|
@ -1,2 +1,2 @@
|
|||
|
||||
add_definitions(-Wno-deprecated-declarations)
|
||||
add_subdirectory(src)
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
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;
|
||||
}
|
||||
|
||||
item.run();
|
||||
new KRun(item.targetUrl(), this);
|
||||
}
|
||||
|
||||
void DolphinViewContainer::slotItemsActivated(const KFileItemList& items)
|
||||
|
@ -654,7 +655,7 @@ void DolphinViewContainer::requestFocus()
|
|||
m_view->setFocus();
|
||||
}
|
||||
|
||||
void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
|
||||
void DolphinViewContainer::saveUrlCompletionMode(KCompletion::CompletionMode completion)
|
||||
{
|
||||
GeneralSettings::setUrlCompletionMode(completion);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <KFileItem>
|
||||
#include <KFileItemDelegate>
|
||||
#include <KGlobalSettings>
|
||||
#include <KCompletion>
|
||||
#include <KIO/Job>
|
||||
|
||||
#include <KUrlNavigator>
|
||||
|
@ -290,7 +290,7 @@ private slots:
|
|||
* Saves the currently used URL completion mode of
|
||||
* the URL navigator.
|
||||
*/
|
||||
void saveUrlCompletionMode(KGlobalSettings::Completion completion);
|
||||
void saveUrlCompletionMode(KCompletion::CompletionMode completion);
|
||||
|
||||
void slotHistoryChanged();
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <KDebug>
|
||||
#include <KIcon>
|
||||
#include <KTextEdit>
|
||||
#include <KIconLoader>
|
||||
#include <KDateTime>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QTextLine>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <KLocale>
|
||||
#include <KStringHandler>
|
||||
#include <KDebug>
|
||||
#include <kstringhandler_deprecated.h> //TODO: port to QCollator
|
||||
|
||||
#include "private/kfileitemmodelsortalgorithm.h"
|
||||
#include "private/kfileitemmodeldirlister.h"
|
||||
|
@ -363,7 +364,7 @@ KFileItem KFileItemModel::fileItem(const KUrl& url) const
|
|||
|
||||
int KFileItemModel::index(const KFileItem& item) const
|
||||
{
|
||||
return index(item.url());
|
||||
return index(KUrl(item.url()));
|
||||
}
|
||||
|
||||
int KFileItemModel::index(const KUrl& url) const
|
||||
|
@ -866,7 +867,7 @@ void KFileItemModel::slotItemsAdded(const KUrl& directoryUrl, const KFileItemLis
|
|||
// might result in emitting the same items twice due to the Keep-parameter.
|
||||
// This case happens if an item gets expanded, collapsed and expanded again
|
||||
// before the items could be loaded for the first expansion.
|
||||
if (index(items.first().url()) >= 0) {
|
||||
if (index(KUrl(items.first().url())) >= 0) {
|
||||
// The items are already part of the model.
|
||||
return;
|
||||
}
|
||||
|
@ -1461,8 +1462,8 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item,
|
|||
// Don't use KFileItem::timeString() as this is too expensive when
|
||||
// having several thousands of items. Instead the formatting of the
|
||||
// date-time will be done on-demand by the view when the date will be shown.
|
||||
const KDateTime dateTime = item.time(KFileItem::ModificationTime);
|
||||
data.insert(sharedValue("date"), dateTime.dateTime());
|
||||
const QDateTime dateTime = item.time(KFileItem::ModificationTime);
|
||||
data.insert(sharedValue("date"), dateTime);
|
||||
}
|
||||
|
||||
if (m_requestRole[PermissionsRole]) {
|
||||
|
@ -1487,7 +1488,7 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item,
|
|||
|
||||
if (m_requestRole[PathRole]) {
|
||||
QString path;
|
||||
if (item.url().protocol() == QLatin1String("trash")) {
|
||||
if (item.url().scheme() == QLatin1String("trash")) {
|
||||
path = item.entry().stringValue(KIO::UDSEntry::UDS_EXTRA);
|
||||
} else {
|
||||
// For performance reasons cache the home-path in a static QString
|
||||
|
@ -1666,8 +1667,8 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b) const
|
|||
}
|
||||
|
||||
case DateRole: {
|
||||
const KDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
|
||||
const KDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
|
||||
const QDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
|
||||
const QDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
|
||||
if (dateTimeA < dateTimeB) {
|
||||
result = -1;
|
||||
} else if (dateTimeA > dateTimeB) {
|
||||
|
@ -1859,7 +1860,7 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
|
|||
const int maxIndex = count() - 1;
|
||||
QList<QPair<int, QVariant> > groups;
|
||||
|
||||
const QDate currentDate = KDateTime::currentLocalDateTime().date();
|
||||
const QDate currentDate = QDate::currentDate();
|
||||
|
||||
QDate previousModifiedDate;
|
||||
QString groupValue;
|
||||
|
@ -1868,7 +1869,7 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
|
|||
continue;
|
||||
}
|
||||
|
||||
const KDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
|
||||
const QDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
|
||||
const QDate modifiedDate = modifiedTime.date();
|
||||
if (modifiedDate == previousModifiedDate) {
|
||||
// The current item is in the same group as the previous item
|
||||
|
@ -1955,7 +1956,7 @@ QList<QPair<int, QVariant> > KFileItemModel::permissionRoleGroups() const
|
|||
}
|
||||
permissionsString = newPermissionsString;
|
||||
|
||||
const QFileInfo info(itemData->item.url().pathOrUrl());
|
||||
const QFileInfo info(itemData->item.url().toLocalFile());
|
||||
|
||||
// Set user string
|
||||
QString user;
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <KDebug>
|
||||
#include <KFileItem>
|
||||
#include <KGlobal>
|
||||
#include <KIconLoader>
|
||||
#include <KJobWidgets>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KIO/PreviewJob>
|
||||
|
||||
|
@ -897,7 +899,7 @@ void KFileItemModelRolesUpdater::startPreviewJob()
|
|||
|
||||
job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile());
|
||||
if (job->ui()) {
|
||||
job->ui()->setWindow(qApp->activeWindow());
|
||||
KJobWidgets::setWindow(job, qApp->activeWindow());
|
||||
}
|
||||
|
||||
connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)),
|
||||
|
|
|
@ -46,7 +46,13 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#if 0
|
||||
#include "kitemlistviewaccessible.h"
|
||||
#else
|
||||
#include <QAccessible>
|
||||
#define QT_NO_ACCESSIBILITY 1
|
||||
#pragma message("TODO: port accessibility to Qt5")
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
// Time in ms until reaching the autoscroll margin triggers
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <libdolphin_export.h>
|
||||
#include <KDirLister>
|
||||
#include <KUrl>
|
||||
|
||||
/**
|
||||
* @brief Extends the class KDirLister by emitting a signal when an
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#define KFILEITEMMODELSORTALGORITHM_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -22,20 +22,22 @@
|
|||
|
||||
#include "dolphinmainwindow.h"
|
||||
|
||||
#include <KAboutData>
|
||||
#include <k4aboutdata.h>
|
||||
#include <KCmdLineArgs>
|
||||
#include <KLocale>
|
||||
#include <kmainwindow.h>
|
||||
#include <kdemacros.h>
|
||||
#include <kdeversion.h>
|
||||
#include <KDebug>
|
||||
|
||||
extern "C"
|
||||
KDE_EXPORT int kdemain(int argc, char **argv)
|
||||
{
|
||||
KAboutData about("dolphin", 0,
|
||||
K4AboutData about("dolphin", 0,
|
||||
ki18nc("@title", "Dolphin"),
|
||||
KDE_VERSION_STRING,
|
||||
ki18nc("@title", "File Manager"),
|
||||
KAboutData::License_GPL,
|
||||
K4AboutData::License_GPL,
|
||||
ki18nc("@info:credit", "(C) 2006-2014 Peter Penz and Frank Reininghaus"));
|
||||
about.setHomepage("http://dolphin.kde.org");
|
||||
about.addAuthor(ki18nc("@info:credit", "Frank Reininghaus"),
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
#include <KIconLoader>
|
||||
#include <KIO/DeleteJob>
|
||||
#include <KMenu>
|
||||
#include <KIcon>
|
||||
#include <KSharedConfig>
|
||||
#include <KConfigGroup>
|
||||
#include <konqmimedata.h>
|
||||
#include <KFileItemListProperties>
|
||||
#include <konq_operations.h>
|
||||
|
@ -34,6 +37,7 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
|
||||
TreeViewContextMenu::TreeViewContextMenu(FoldersPanel* parent,
|
||||
const KFileItem& fileInfo) :
|
||||
|
@ -192,12 +196,12 @@ void TreeViewContextMenu::rename()
|
|||
|
||||
void TreeViewContextMenu::moveToTrash()
|
||||
{
|
||||
KonqOperations::del(m_parent, KonqOperations::TRASH, m_fileItem.url());
|
||||
KonqOperations::del(m_parent, KonqOperations::TRASH, KUrl::List() << m_fileItem.url());
|
||||
}
|
||||
|
||||
void TreeViewContextMenu::deleteItem()
|
||||
{
|
||||
KonqOperations::del(m_parent, KonqOperations::DEL, m_fileItem.url());
|
||||
KonqOperations::del(m_parent, KonqOperations::DEL, KUrl::List() << m_fileItem.url());
|
||||
}
|
||||
|
||||
void TreeViewContextMenu::showProperties()
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <QObject>
|
||||
#include <KFileItem>
|
||||
|
||||
class QMimeData;
|
||||
class FoldersPanel;
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,10 +22,12 @@
|
|||
#include "informationpanelcontent.h"
|
||||
#include <KIO/Job>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KJobWidgets>
|
||||
#include <KDirNotify>
|
||||
#include <QApplication>
|
||||
#include <QShowEvent>
|
||||
#include <QVBoxLayout>
|
||||
#include <QTimer>
|
||||
|
||||
InformationPanel::InformationPanel(QWidget* parent) :
|
||||
Panel(parent),
|
||||
|
@ -184,7 +186,7 @@ void InformationPanel::showItemInfo()
|
|||
// an item for the currently shown directory.
|
||||
m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
|
||||
if (m_folderStatJob->ui()) {
|
||||
m_folderStatJob->ui()->setWindow(this);
|
||||
KJobWidgets::setWindow(m_folderStatJob, this);
|
||||
}
|
||||
connect(m_folderStatJob, SIGNAL(result(KJob*)),
|
||||
this, SLOT(slotFolderStatFinished(KJob*)));
|
||||
|
|
|
@ -24,8 +24,10 @@
|
|||
#include <KGlobalSettings>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KIO/PreviewJob>
|
||||
#include <KJobWidgets>
|
||||
#include <KIconEffect>
|
||||
#include <KIconLoader>
|
||||
#include <KIcon>
|
||||
#include <KLocale>
|
||||
#include <KMenu>
|
||||
#include <kseparator.h>
|
||||
|
@ -193,7 +195,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
|
|||
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
|
||||
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
|
||||
if (m_previewJob->ui()) {
|
||||
m_previewJob->ui()->setWindow(this);
|
||||
KJobWidgets::setWindow(m_previewJob, this);
|
||||
}
|
||||
|
||||
connect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
|
||||
|
@ -283,7 +285,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
|
|||
KMenu popup(this);
|
||||
|
||||
QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
|
||||
previewAction->setIcon(KIcon("view-preview"));
|
||||
previewAction->setIcon(QIcon::fromTheme("view-preview"));
|
||||
previewAction->setCheckable(true);
|
||||
previewAction->setChecked(InformationPanelSettings::previewsShown());
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <KDialog>
|
||||
#include <KIcon>
|
||||
#include <KIconLoader>
|
||||
#include <KUrl>
|
||||
#include <KLocale>
|
||||
|
||||
|
|
|
@ -24,9 +24,11 @@
|
|||
#include "placesitemeditdialog.h"
|
||||
|
||||
#include <KAboutData>
|
||||
#include <k4aboutdata.h>
|
||||
#include <KComponentData>
|
||||
#include <KDebug>
|
||||
#include <KFile>
|
||||
#include <KGlobal>
|
||||
#include <KIconButton>
|
||||
#include <KLineEdit>
|
||||
#include <KLocale>
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <KLocale>
|
||||
#include <KStandardDirs>
|
||||
#include <KUser>
|
||||
#include <KGlobal>
|
||||
#include "placesitem.h"
|
||||
#include <QAction>
|
||||
#include <QDate>
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include <KIcon>
|
||||
#include <KIO/Job>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KJobWidgets>
|
||||
#include <KLocale>
|
||||
#include <KIconLoader>
|
||||
#include <kitemviews/kitemlistcontainer.h>
|
||||
#include <kitemviews/kitemlistcontroller.h>
|
||||
#include <kitemviews/kitemlistselectionmanager.h>
|
||||
|
@ -48,6 +50,7 @@
|
|||
#include <QGraphicsSceneDragDropEvent>
|
||||
#include <QVBoxLayout>
|
||||
#include <QShowEvent>
|
||||
#include <QMimeData>
|
||||
|
||||
PlacesPanel::PlacesPanel(QWidget* parent) :
|
||||
Panel(parent),
|
||||
|
@ -422,7 +425,7 @@ void PlacesPanel::slotTrashUpdated(KJob* job)
|
|||
if (job->error()) {
|
||||
emit errorMessage(job->errorString());
|
||||
}
|
||||
org::kde::KDirNotify::emitFilesAdded("trash:/");
|
||||
org::kde::KDirNotify::emitFilesAdded(QUrl("trash:/"));
|
||||
}
|
||||
|
||||
void PlacesPanel::slotStorageSetupDone(int index, bool success)
|
||||
|
@ -459,7 +462,7 @@ void PlacesPanel::emptyTrash()
|
|||
stream << int(1);
|
||||
KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs);
|
||||
KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent);
|
||||
job->ui()->setWindow(parentWidget());
|
||||
KJobWidgets::setWindow(job, parentWidget());
|
||||
connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,11 +24,12 @@
|
|||
#include <KPluginLoader>
|
||||
#include <KPluginFactory>
|
||||
#include <KService>
|
||||
#include <kde_terminal_interface_v2.h>
|
||||
#include <kde_terminal_interface.h>
|
||||
#include <KParts/Part>
|
||||
#include <KShell>
|
||||
#include <KIO/Job>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KJobWidgets>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QDir>
|
||||
|
@ -112,7 +113,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
|
|||
connect(m_konsolePart, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
|
||||
m_terminalWidget = m_konsolePart->widget();
|
||||
m_layout->addWidget(m_terminalWidget);
|
||||
m_terminal = qobject_cast<TerminalInterfaceV2 *>(m_konsolePart);
|
||||
m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart);
|
||||
}
|
||||
}
|
||||
if (m_terminal) {
|
||||
|
@ -136,7 +137,7 @@ void TerminalPanel::changeDir(const KUrl& url)
|
|||
} else {
|
||||
m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
|
||||
if (m_mostLocalUrlJob->ui()) {
|
||||
m_mostLocalUrlJob->ui()->setWindow(this);
|
||||
KJobWidgets::setWindow(m_mostLocalUrlJob, this);
|
||||
}
|
||||
connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*)));
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <panels/panel.h>
|
||||
|
||||
class TerminalInterfaceV2;
|
||||
class TerminalInterface;
|
||||
class QVBoxLayout;
|
||||
class QWidget;
|
||||
|
||||
|
@ -78,7 +78,7 @@ private:
|
|||
KIO::StatJob* m_mostLocalUrlJob;
|
||||
|
||||
QVBoxLayout* m_layout;
|
||||
TerminalInterfaceV2* m_terminal;
|
||||
TerminalInterface* m_terminal;
|
||||
QWidget* m_terminalWidget;
|
||||
KParts::ReadOnlyPart* m_konsolePart;
|
||||
QString m_konsolePartCurrentDirectory;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <KLineEdit>
|
||||
#include <KLocale>
|
||||
#include <KSeparator>
|
||||
#include <KGlobalSettings>
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QDir>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <KIO/NetAccess>
|
||||
#include <KIO/Job>
|
||||
#include <KUrl>
|
||||
#include <kdemacros.h>
|
||||
#include <ktemporaryfile.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#include <KMessageBox>
|
||||
#include <KIcon>
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
|
||||
KPageDialog(parent),
|
||||
m_pages()
|
||||
|
@ -43,10 +46,12 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
|
|||
setMinimumSize(QSize(512, minSize.height()));
|
||||
|
||||
setFaceType(List);
|
||||
setCaption(i18nc("@title:window", "Dolphin Preferences"));
|
||||
setButtons(Ok | Apply | Cancel | Default);
|
||||
enableButtonApply(false);
|
||||
setDefaultButton(Ok);
|
||||
setWindowTitle(i18nc("@title:window", "Dolphin Preferences"));
|
||||
QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||
| QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
|
||||
box->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
box->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||
setButtonBox(box);
|
||||
|
||||
// Startup
|
||||
StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this);
|
||||
|
@ -91,7 +96,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
|
|||
connect(generalSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
|
||||
|
||||
const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
|
||||
restoreDialogSize(dialogConfig);
|
||||
#pragma message("TODO: port")
|
||||
//restoreDialogSize(dialogConfig);
|
||||
|
||||
m_pages.append(startupSettingsPage);
|
||||
m_pages.append(viewSettingsPage);
|
||||
|
@ -104,23 +110,25 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
|
|||
DolphinSettingsDialog::~DolphinSettingsDialog()
|
||||
{
|
||||
KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
|
||||
saveDialogSize(dialogConfig);
|
||||
#pragma message("TODO: port")
|
||||
//saveDialogSize(dialogConfig);
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::slotButtonClicked(int button)
|
||||
{
|
||||
if ((button == Ok) || (button == Apply)) {
|
||||
if ((button == QDialogButtonBox::Ok) || (button == QDialogButtonBox::Apply)) {
|
||||
applySettings();
|
||||
} else if (button == Default) {
|
||||
} else if (button == QDialogButtonBox::RestoreDefaults) {
|
||||
restoreDefaults();
|
||||
}
|
||||
|
||||
KPageDialog::slotButtonClicked(button);
|
||||
#pragma message("TODO: port")
|
||||
//KPageDialog::slotButtonClicked(button);
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::enableApply()
|
||||
{
|
||||
enableButtonApply(true);
|
||||
buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(true);
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::applySettings()
|
||||
|
@ -138,8 +146,7 @@ void DolphinSettingsDialog::applySettings()
|
|||
settings->setModifiedStartupSettings(false);
|
||||
settings->writeConfig();
|
||||
}
|
||||
|
||||
enableButtonApply(false);
|
||||
buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::restoreDefaults()
|
||||
|
|
|
@ -115,7 +115,7 @@ void BehaviorSettingsPage::applySettings()
|
|||
|
||||
const bool naturalSorting = m_naturalSorting->isChecked();
|
||||
if (KGlobalSettings::naturalSorting() != naturalSorting) {
|
||||
KConfigGroup group(KGlobal::config(), "KDE");
|
||||
KConfigGroup group(KSharedConfig::openConfig(), "KDE");
|
||||
group.writeEntry("NaturalSorting", naturalSorting, KConfig::Persistent | KConfig::Global);
|
||||
KGlobalSettings::emitChange(KGlobalSettings::NaturalSortingChanged);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QVBoxLayout>
|
||||
#include <QUrl>
|
||||
|
||||
ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& pluginName,
|
||||
const QString& desktopEntryName,
|
||||
|
@ -73,7 +74,7 @@ void ConfigurePreviewPluginDialog::slotOk()
|
|||
// for a specific MIME-type should be regenerated. As this is not available yet we
|
||||
// delete the whole thumbnails directory.
|
||||
QApplication::changeOverrideCursor(Qt::BusyCursor);
|
||||
KIO::NetAccess::del(QString(QDir::homePath() + "/.thumbnails/"), this);
|
||||
KIO::NetAccess::del(QUrl::fromLocalFile(QDir::homePath() + "/.thumbnails/"), this);
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ void PreviewsSettingsPage::loadPreviewPlugins()
|
|||
QAbstractItemModel* model = m_listView->model();
|
||||
|
||||
const KService::List plugins = KServiceTypeTrader::self()->query(QLatin1String("ThumbCreator"));
|
||||
foreach (const KSharedPtr<KService>& service, plugins) {
|
||||
foreach (const KService::Ptr& service, plugins) {
|
||||
const bool configurable = service->property("Configurable", QVariant::Bool).toBool();
|
||||
const bool show = m_enabledPreviewPlugins.contains(service->desktopEntryName());
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <KLocale>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <settings/general/behaviorsettingspage.h>
|
||||
#include <settings/general/previewssettingspage.h>
|
||||
|
@ -36,7 +37,7 @@ K_PLUGIN_FACTORY(KCMDolphinGeneralConfigFactory, registerPlugin<DolphinGeneralCo
|
|||
K_EXPORT_PLUGIN(KCMDolphinGeneralConfigFactory("kcmdolphingeneral"))
|
||||
|
||||
DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KCMDolphinGeneralConfigFactory::componentData(), parent),
|
||||
KCModule(parent),
|
||||
m_pages()
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <KLocale>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <settings/navigation/navigationsettingspage.h>
|
||||
|
||||
|
@ -33,7 +34,7 @@ K_PLUGIN_FACTORY(KCMDolphinNavigationConfigFactory, registerPlugin<DolphinNaviga
|
|||
K_EXPORT_PLUGIN(KCMDolphinNavigationConfigFactory("kcmdolphinnavigation"))
|
||||
|
||||
DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KCMDolphinNavigationConfigFactory::componentData(), parent),
|
||||
KCModule(parent),
|
||||
m_navigation(0)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <KLocale>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <settings/services/servicessettingspage.h>
|
||||
|
||||
|
@ -33,7 +34,7 @@ K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServices
|
|||
K_EXPORT_PLUGIN(KCMDolphinServicesConfigFactory("kcmdolphinservices"))
|
||||
|
||||
DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KCMDolphinServicesConfigFactory::componentData(), parent),
|
||||
KCModule(parent),
|
||||
m_services(0)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KIcon>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <settings/viewmodes/viewsettingstab.h>
|
||||
|
||||
|
@ -38,7 +39,7 @@ K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin<DolphinViewMod
|
|||
K_EXPORT_PLUGIN(KCMDolphinViewModesConfigFactory("kcmdolphinviewmodes"))
|
||||
|
||||
DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KCMDolphinViewModesConfigFactory::componentData(), parent),
|
||||
KCModule(parent),
|
||||
m_tabs()
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
|
|
|
@ -66,7 +66,7 @@ void ServiceItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
QList<QWidget*> ServiceItemDelegate::createItemWidgets() const
|
||||
QList<QWidget*> ServiceItemDelegate::createItemWidgets(const QModelIndex&) const
|
||||
{
|
||||
QCheckBox* checkBox = new QCheckBox();
|
||||
QPalette palette = checkBox->palette();
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const;
|
||||
|
||||
virtual QList<QWidget*> createItemWidgets() const;
|
||||
virtual QList<QWidget*> createItemWidgets(const QModelIndex&) const Q_DECL_OVERRIDE;
|
||||
|
||||
virtual void updateItemWidgets(const QList<QWidget*> widgets,
|
||||
const QStyleOptionViewItem& option,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <KIcon>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <knewstuff3/knewstuffbutton.h>
|
||||
#include <KNS3/Button>
|
||||
#include <KService>
|
||||
#include <KServiceTypeTrader>
|
||||
#include <KStandardDirs>
|
||||
|
@ -194,7 +194,7 @@ void ServicesSettingsPage::loadServices()
|
|||
|
||||
// Load generic services
|
||||
const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin");
|
||||
foreach (const KSharedPtr<KService>& service, entries) {
|
||||
foreach (const KService::Ptr& service, entries) {
|
||||
const QString file = KStandardDirs::locate("services", service->entryPath());
|
||||
const QList<KServiceAction> serviceActions =
|
||||
KDesktopFileActions::userDefinedServices(file, true);
|
||||
|
@ -220,7 +220,7 @@ void ServicesSettingsPage::loadServices()
|
|||
|
||||
// Load service plugins that implement the KFileItemActionPlugin interface
|
||||
const KService::List pluginServices = KServiceTypeTrader::self()->query("KFileItemAction/Plugin");
|
||||
foreach (const KSharedPtr<KService>& service, pluginServices) {
|
||||
foreach (const KService::Ptr& service, pluginServices) {
|
||||
const QString desktopEntryName = service->desktopEntryName();
|
||||
if (!isInServicesList(desktopEntryName)) {
|
||||
const bool checked = showGroup.readEntry(desktopEntryName, true);
|
||||
|
|
|
@ -42,17 +42,17 @@ ViewSettingsPage::ViewSettingsPage(QWidget* parent) :
|
|||
|
||||
// Initialize 'Icons' tab
|
||||
ViewSettingsTab* iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
|
||||
tabWidget->addTab(iconsTab, KIcon("view-list-icons"), i18nc("@title:tab", "Icons"));
|
||||
tabWidget->addTab(iconsTab, QIcon::fromTheme("view-list-icons"), i18nc("@title:tab", "Icons"));
|
||||
connect(iconsTab, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
|
||||
// Initialize 'Compact' tab
|
||||
ViewSettingsTab* compactTab = new ViewSettingsTab(ViewSettingsTab::CompactMode, tabWidget);
|
||||
tabWidget->addTab(compactTab, KIcon("view-list-details"), i18nc("@title:tab", "Compact"));
|
||||
tabWidget->addTab(compactTab, QIcon::fromTheme("view-list-details"), i18nc("@title:tab", "Compact"));
|
||||
connect(compactTab, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
|
||||
// Initialize 'Details' tab
|
||||
ViewSettingsTab* detailsTab = new ViewSettingsTab(ViewSettingsTab::DetailsMode, tabWidget);
|
||||
tabWidget->addTab(detailsTab, KIcon("view-list-tree"), i18nc("@title:tab", "Details"));
|
||||
tabWidget->addTab(detailsTab, QIcon::fromTheme("view-list-tree"), i18nc("@title:tab", "Details"));
|
||||
connect(detailsTab, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
|
||||
m_tabs.append(iconsTab);
|
||||
|
|
|
@ -92,9 +92,9 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
|
||||
QLabel* viewModeLabel = new QLabel(i18nc("@label:listbox", "View mode:"), propsGrid);
|
||||
m_viewMode = new KComboBox(propsGrid);
|
||||
m_viewMode->addItem(KIcon("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView);
|
||||
m_viewMode->addItem(KIcon("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView);
|
||||
m_viewMode->addItem(KIcon("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView);
|
||||
m_viewMode->addItem(QIcon::fromTheme("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView);
|
||||
m_viewMode->addItem(QIcon::fromTheme("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView);
|
||||
m_viewMode->addItem(QIcon::fromTheme("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView);
|
||||
|
||||
QLabel* sortingLabel = new QLabel(i18nc("@label:listbox", "Sorting:"), propsGrid);
|
||||
QWidget* sortingBox = new QWidget(propsGrid);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <kitemviews/kitemliststyleoption.h>
|
||||
|
||||
#include <KGlobalSettings>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <views/viewmodecontroller.h>
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ void DolphinRemoteEncoding::slotAboutToOpenUrl()
|
|||
|
||||
void DolphinRemoteEncoding::fillMenu()
|
||||
{
|
||||
KMenu* menu = m_menu->menu();
|
||||
QMenu* menu = m_menu->menu();
|
||||
menu->clear();
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include <QItemSelection>
|
||||
#include <QTimer>
|
||||
#include <QScrollBar>
|
||||
#include <QPointer>
|
||||
#include <QMenu>
|
||||
|
||||
#include <KDesktopFile>
|
||||
#include <KProtocolManager>
|
||||
|
@ -55,7 +57,9 @@
|
|||
#include <KIO/PreviewJob>
|
||||
#include <KJob>
|
||||
#include <KMenu>
|
||||
#include <KGlobal>
|
||||
#include <KMessageBox>
|
||||
#include <KJobWidgets>
|
||||
#include <konq_fileitemcapabilities.h>
|
||||
#include <konq_operations.h>
|
||||
#include <konqmimedata.h>
|
||||
|
@ -295,7 +299,7 @@ void DolphinView::setHiddenFilesShown(bool show)
|
|||
|
||||
const KFileItemList itemList = selectedItems();
|
||||
m_selectedUrls.clear();
|
||||
m_selectedUrls = itemList.urlList();
|
||||
m_selectedUrls = KUrl::List(itemList.urlList());
|
||||
|
||||
ViewProperties props(viewPropertiesUrl());
|
||||
props.setHiddenFilesShown(show);
|
||||
|
@ -472,7 +476,7 @@ void DolphinView::reload()
|
|||
|
||||
const KFileItemList itemList = selectedItems();
|
||||
m_selectedUrls.clear();
|
||||
m_selectedUrls = itemList.urlList();
|
||||
m_selectedUrls = KUrl::List(itemList.urlList());
|
||||
|
||||
setUrl(url());
|
||||
loadDirectory(url(), true);
|
||||
|
@ -684,7 +688,7 @@ void DolphinView::deleteSelectedItems()
|
|||
if (del) {
|
||||
KIO::Job* job = KIO::del(list);
|
||||
if (job->ui()) {
|
||||
job->ui()->setWindow(this);
|
||||
KJobWidgets::setWindow(job, this);
|
||||
}
|
||||
connect(job, SIGNAL(result(KJob*)),
|
||||
this, SLOT(slotDeleteFileFinished(KJob*)));
|
||||
|
@ -1091,7 +1095,7 @@ void DolphinView::slotAboutToCreate(const KUrl::List& urls)
|
|||
markUrlAsCurrent(urls.first());
|
||||
m_markFirstNewlySelectedItemAsCurrent = false;
|
||||
}
|
||||
m_selectedUrls << KDirModel::simplifiedUrlList(urls);
|
||||
m_selectedUrls << KUrl::List(KDirModel::simplifiedUrlList(urls));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <KFileItemDelegate>
|
||||
#include <kio/fileundomanager.h>
|
||||
#include <KIO/Job>
|
||||
#include <KUrl>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include "views/zoomlevelinfo.h"
|
||||
#include <konq_operations.h>
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
#include <KAction>
|
||||
#include <KActionCollection>
|
||||
#include <KActionMenu>
|
||||
|
@ -97,7 +99,7 @@ void DolphinViewActionHandler::createActions()
|
|||
{
|
||||
// This action doesn't appear in the GUI, it's for the shortcut only.
|
||||
// KNewFileMenu takes care of the GUI stuff.
|
||||
KAction* newDirAction = m_actionCollection->addAction("create_dir");
|
||||
QAction* newDirAction = m_actionCollection->addAction("create_dir");
|
||||
newDirAction->setText(i18nc("@action", "Create Folder..."));
|
||||
newDirAction->setShortcut(Qt::Key_F10);
|
||||
newDirAction->setIcon(KIcon("folder-new"));
|
||||
|
@ -106,20 +108,20 @@ void DolphinViewActionHandler::createActions()
|
|||
|
||||
// File menu
|
||||
|
||||
KAction* rename = m_actionCollection->addAction("rename");
|
||||
QAction* rename = m_actionCollection->addAction("rename");
|
||||
rename->setText(i18nc("@action:inmenu File", "Rename..."));
|
||||
rename->setShortcut(Qt::Key_F2);
|
||||
rename->setIcon(KIcon("edit-rename"));
|
||||
connect(rename, SIGNAL(triggered()), this, SLOT(slotRename()));
|
||||
|
||||
KAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
|
||||
QAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
|
||||
moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash"));
|
||||
moveToTrash->setIcon(KIcon("user-trash"));
|
||||
moveToTrash->setShortcut(QKeySequence::Delete);
|
||||
connect(moveToTrash, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),
|
||||
this, SLOT(slotTrashActivated(Qt::MouseButtons,Qt::KeyboardModifiers)));
|
||||
|
||||
KAction* deleteAction = m_actionCollection->addAction("delete");
|
||||
QAction* deleteAction = m_actionCollection->addAction("delete");
|
||||
deleteAction->setIcon(KIcon("edit-delete"));
|
||||
deleteAction->setText(i18nc("@action:inmenu File", "Delete"));
|
||||
deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete);
|
||||
|
@ -129,14 +131,14 @@ void DolphinViewActionHandler::createActions()
|
|||
// disabled and "delete" is enabled (e.g. non-local files), so that Key_Del
|
||||
// can be used for deleting the file (#76016). It needs to be a separate action
|
||||
// so that the Edit menu isn't affected.
|
||||
KAction* deleteWithTrashShortcut = m_actionCollection->addAction("delete_shortcut");
|
||||
QAction* deleteWithTrashShortcut = m_actionCollection->addAction("delete_shortcut");
|
||||
// The descriptive text is just for the shortcuts editor.
|
||||
deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)"));
|
||||
deleteWithTrashShortcut->setShortcut(QKeySequence::Delete);
|
||||
deleteWithTrashShortcut->setEnabled(false);
|
||||
connect(deleteWithTrashShortcut, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
|
||||
|
||||
KAction *propertiesAction = m_actionCollection->addAction( "properties" );
|
||||
QAction *propertiesAction = m_actionCollection->addAction( "properties" );
|
||||
// Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
|
||||
propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
|
||||
propertiesAction->setIcon(KIcon("document-properties"));
|
||||
|
@ -213,7 +215,7 @@ void DolphinViewActionHandler::createActions()
|
|||
showHiddenFiles->setShortcuts(QList<QKeySequence>() << Qt::ALT + Qt::Key_Period << Qt::Key_F8);
|
||||
connect(showHiddenFiles, SIGNAL(triggered(bool)), this, SLOT(toggleShowHiddenFiles(bool)));
|
||||
|
||||
KAction* adjustViewProps = m_actionCollection->addAction("view_properties");
|
||||
QAction* adjustViewProps = m_actionCollection->addAction("view_properties");
|
||||
adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
|
||||
connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(slotAdjustViewProperties()));
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <KLocale>
|
||||
#include <konq_operations.h>
|
||||
#include <KStringHandler>
|
||||
#include <kstringhandler_deprecated.h> //TODO port to QCollator
|
||||
#include <knuminput.h>
|
||||
#include <kmimetype.h>
|
||||
|
||||
|
@ -87,7 +88,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
|||
|
||||
int selectionLength = m_newName.length();
|
||||
if (m_renameOneItem) {
|
||||
const QString fileName = items.first().url().prettyUrl();
|
||||
const QString fileName = items.first().url().toDisplayString();
|
||||
const QString extension = KMimeType::extractKnownExtension(fileName.toLower());
|
||||
|
||||
// If the current item is a directory, select the whole file name.
|
||||
|
@ -110,7 +111,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
|||
if (!m_renameOneItem) {
|
||||
QSet<QString> extensions;
|
||||
foreach (const KFileItem& item, m_items) {
|
||||
const QString extension = KMimeType::extractKnownExtension(item.url().prettyUrl().toLower());
|
||||
const QString extension = KMimeType::extractKnownExtension(item.url().toDisplayString().toLower());
|
||||
|
||||
if (extensions.contains(extension)) {
|
||||
m_allExtensionsDifferent = false;
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include <KColorScheme>
|
||||
#include <KSeparator>
|
||||
#include <KWindowSystem>
|
||||
// For the blurred tooltip background
|
||||
#include <KWindowEffects>
|
||||
#include <KStringHandler>
|
||||
|
||||
#include <QLabel>
|
||||
|
@ -40,9 +42,6 @@
|
|||
#include <baloo/filemetadatawidget.h>
|
||||
#endif
|
||||
|
||||
// For the blurred tooltip background
|
||||
#include <plasma/windoweffects.h>
|
||||
|
||||
FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
m_preview(0),
|
||||
|
@ -174,8 +173,9 @@ void FileMetaDataToolTip::paintEvent(QPaintEvent* event)
|
|||
|
||||
void FileMetaDataToolTip::showEvent(QShowEvent *)
|
||||
{
|
||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, mask());
|
||||
#pragma message("TODO: port Plasma::WindowEffects::overrideShadow")
|
||||
//Plasma::WindowEffects::overrideShadow(winId(), true);
|
||||
KWindowEffects::enableBlurBehind(winId(), true, mask());
|
||||
}
|
||||
|
||||
#include "filemetadatatooltip.moc"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <KIcon>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KIO/PreviewJob>
|
||||
#include <KJobWidgets>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
@ -132,7 +133,7 @@ void ToolTipManager::startContentRetrieval()
|
|||
KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
|
||||
job->setIgnoreMaximumSize(m_item.isLocalFile());
|
||||
if (job->ui()) {
|
||||
job->ui()->setWindow(qApp->activeWindow());
|
||||
KJobWidgets::setWindow(job, qApp->activeWindow());
|
||||
}
|
||||
|
||||
connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)),
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "updateitemstatesthread.h"
|
||||
|
||||
#include <kversioncontrolplugin2.h>
|
||||
#include <QVector>
|
||||
|
||||
#include <QMutexLocker>
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <KLocale>
|
||||
#include <KService>
|
||||
#include <KDebug>
|
||||
#include <KServiceTypeTrader>
|
||||
#include <kitemviews/kfileitemmodel.h>
|
||||
#include <kversioncontrolplugin2.h>
|
||||
|
@ -116,7 +117,7 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
|
|||
if (items.count() == 1) {
|
||||
const KFileItem rootItem = m_model->rootItem();
|
||||
if (!rootItem.isNull() && items.first().url() == rootItem.url()) {
|
||||
directory = rootItem.url().path(KUrl::AddTrailingSlash);
|
||||
directory = rootItem.url().path();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <libdolphin_export.h>
|
||||
|
||||
#include <KFileItem>
|
||||
#include <KUrl>
|
||||
#include <kversioncontrolplugin2.h>
|
||||
#include <QList>
|
||||
#include <QMutex>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <KLocale>
|
||||
#include <KStandardDirs>
|
||||
#include <KUrl>
|
||||
#include <KDebug>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <QCryptographicHash>
|
||||
#include <QDate>
|
||||
|
|
Loading…
Reference in New Issue
Block a user