From 2f045c60109e0a5811f68bcce617236e3478e402 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sun, 6 Apr 2014 03:32:55 +0200 Subject: 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 --- src/panels/folders/treeviewcontextmenu.cpp | 8 ++++++-- src/panels/folders/treeviewcontextmenu.h | 1 + src/panels/information/informationpanel.cpp | 4 +++- src/panels/information/informationpanelcontent.cpp | 6 ++++-- src/panels/information/phononwidget.cpp | 1 + src/panels/places/placesitemeditdialog.cpp | 2 ++ src/panels/places/placesitemmodel.cpp | 1 + src/panels/places/placespanel.cpp | 7 +++++-- src/panels/terminal/terminalpanel.cpp | 7 ++++--- src/panels/terminal/terminalpanel.h | 4 ++-- 10 files changed, 29 insertions(+), 12 deletions(-) (limited to 'src/panels') diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index fa8844dfa..b15badde1 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -34,6 +37,7 @@ #include #include +#include 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() diff --git a/src/panels/folders/treeviewcontextmenu.h b/src/panels/folders/treeviewcontextmenu.h index 0b3fd79bd..598ffaed6 100644 --- a/src/panels/folders/treeviewcontextmenu.h +++ b/src/panels/folders/treeviewcontextmenu.h @@ -23,6 +23,7 @@ #include #include +class QMimeData; class FoldersPanel; /** diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index eda74f3b5..3da076956 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -22,10 +22,12 @@ #include "informationpanelcontent.h" #include #include +#include #include #include #include #include +#include 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*))); diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index b2dd1582e..ee5e350af 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -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& 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()); diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index a36ada180..092b5dd5b 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 08c910d17..2dd47d793 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -24,9 +24,11 @@ #include "placesitemeditdialog.h" #include +#include #include #include #include +#include #include #include #include diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index baa770dfd..5ec34956e 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "placesitem.h" #include #include diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index d5308eabe..1f4d3d4b7 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -48,6 +50,7 @@ #include #include #include +#include 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*))); } } diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index bfd3002f0..2ddc9f598 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -24,11 +24,12 @@ #include #include #include -#include +#include #include #include #include #include +#include #include #include @@ -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(m_konsolePart); + m_terminal = qobject_cast(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*))); } diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 374476e1c..987ee4753 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -22,7 +22,7 @@ #include -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; -- cgit v1.3