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/views/viewproperties.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/views/viewproperties.cpp') diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index d4ecfafa0..bcea06253 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include -- cgit v1.3 From 1d590aa7d50bcf955e3356a09dcaa88e1989aa3a Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Fri, 26 Sep 2014 20:38:57 +0200 Subject: Make constants const, avoids unnecessary symbols in the .data section. --- src/panels/places/placesitemmodel.cpp | 2 +- src/settings/services/servicessettingspage.cpp | 6 +++--- src/views/viewproperties.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index d59d0b03a..abfe1d62f 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -65,7 +65,7 @@ namespace { // be independent from changes in the Baloo-search-URL-syntax. // Hence a prefix to the application-name of the stored bookmarks is // added, which is only read by PlacesItemModel. - const char* AppNamePrefix = "-places-panel"; + const char AppNamePrefix[] = "-places-panel"; } PlacesItemModel::PlacesItemModel(QObject* parent) : diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index 78a865d43..be43ae656 100644 --- a/src/settings/services/servicessettingspage.cpp +++ b/src/settings/services/servicessettingspage.cpp @@ -49,9 +49,9 @@ namespace { const bool ShowDeleteDefault = false; - const char* VersionControlServicePrefix = "_version_control_"; - const char* DeleteService = "_delete"; - const char* CopyToMoveToService ="_copy_to_move_to"; + const char VersionControlServicePrefix[] = "_version_control_"; + const char DeleteService[] = "_delete"; + const char CopyToMoveToService[] ="_copy_to_move_to"; } ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) : diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index bcea06253..46c836274 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -43,10 +43,10 @@ namespace { // String representation to mark the additional properties of // the details view as customized by the user. See // ViewProperties::visibleRoles() for more information. - const char* CustomizedDetailsString = "CustomizedDetails"; + const char CustomizedDetailsString[] = "CustomizedDetails"; // Filename that is used for storing the properties - const char* ViewPropertiesFileName = ".directory"; + const char ViewPropertiesFileName[] = ".directory"; } ViewProperties::ViewProperties(const KUrl& url) : -- cgit v1.3 From 6a09781a3b99bbca2b2c66ee3041208a02ead0ca Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Wed, 1 Oct 2014 12:34:49 +0200 Subject: Ported Dolphin away from KStandardDirs removed unused mirroredDirectory method REVIEW: 120194 --- src/dolphincontextmenu.cpp | 1 - src/dolphinmainwindow.cpp | 4 ++-- src/panels/places/placesitemmodel.cpp | 4 ++-- src/settings/services/servicessettingspage.cpp | 4 ++-- src/settings/viewpropertiesdialog.cpp | 1 - src/views/viewproperties.cpp | 19 +++++++------------ src/views/viewproperties.h | 9 --------- 7 files changed, 13 insertions(+), 29 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index e74adca55..d8f101454 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 629faa154..8668601b6 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -87,6 +86,7 @@ #include #include #include +#include #include namespace { @@ -1481,7 +1481,7 @@ bool DolphinMainWindow::isKompareInstalled() const if (!initialized) { // TODO: maybe replace this approach later by using a menu // plugin like kdiff3plugin.cpp - installed = !KGlobal::dirs()->findExe("kompare").isEmpty(); + installed = !QStandardPaths::findExecutable(QStringLiteral("kompare")).isEmpty(); initialized = true; } return installed; diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index abfe1d62f..aa7f720b4 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include "placesitem.h" @@ -87,7 +87,7 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : Baloo::IndexerConfig config; m_fileIndexingEnabled = config.fileIndexingEnabled(); #endif - const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml"); + const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kfileplaces/bookmarks.xml"); m_bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces"); createSystemBookmarks(); diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index be43ae656..e4f5b3fab 100644 --- a/src/settings/services/servicessettingspage.cpp +++ b/src/settings/services/servicessettingspage.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -195,7 +195,7 @@ void ServicesSettingsPage::loadServices() // Load generic services const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin"); foreach (const KService::Ptr& service, entries) { - const QString file = KStandardDirs::locate("services", service->entryPath()); + const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kservices5/" % service->entryPath()); const QList serviceActions = KDesktopFileActions::userDefinedServices(file, true); diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 41a39f2a7..576154f2b 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 46c836274..95c44bc84 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include namespace { const int AdditionalInfoViewPropertiesVersion = 1; @@ -364,7 +364,8 @@ void ViewProperties::update() void ViewProperties::save() { kDebug() << "Saving view-properties to" << m_filePath; - KStandardDirs::makeDir(m_filePath); + QDir dir; + dir.mkpath(m_filePath); m_node->setVersion(CurrentViewPropertiesVersion); m_node->writeConfig(); m_changedProps = false; @@ -378,9 +379,10 @@ bool ViewProperties::exist() const QString ViewProperties::destinationDir(const QString& subDir) const { - QString basePath = KGlobal::mainComponent().componentName(); - basePath.append("/view_properties/").append(subDir); - return KStandardDirs::locateLocal("data", basePath); + QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation); + path.append(KGlobal::mainComponent().componentName()); + path.append("/view_properties/").append(subDir); + return path; } QString ViewProperties::viewModePrefix() const @@ -471,10 +473,3 @@ QString ViewProperties::directoryHashForUrl(const KUrl& url) hashString.replace('/', '-'); return hashString; } - -KUrl ViewProperties::mirroredDirectory() -{ - QString basePath = KGlobal::mainComponent().componentName(); - basePath.append("/view_properties/"); - return KUrl(KStandardDirs::locateLocal("data", basePath)); -} diff --git a/src/views/viewproperties.h b/src/views/viewproperties.h index 69b507f1b..d794edf65 100644 --- a/src/views/viewproperties.h +++ b/src/views/viewproperties.h @@ -164,15 +164,6 @@ private: */ static QString directoryHashForUrl(const KUrl& url); - /** - * Returns the URL of the directory, where the mirrored view properties - * are stored into. Mirrored view properties are used if: - * - there is no write access for storing the view properties into - * the original directory - * - for non local directories - */ - static KUrl mirroredDirectory(); - Q_DISABLE_COPY(ViewProperties) private: -- cgit v1.3 From 31a0c4fbd59c93a48f093be62b8ef19e6839de37 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sat, 18 Oct 2014 14:42:41 +0200 Subject: Fix includes --- src/dolphincontextmenu.cpp | 2 +- src/dolphinmainwindow.cpp | 2 +- src/dolphinpart.cpp | 2 +- src/dolphinviewcontainer.cpp | 2 +- src/filterbar/filterbar.cpp | 2 +- src/kitemviews/kfileitemlistview.cpp | 2 +- src/kitemviews/kfileitemmodel.cpp | 2 +- src/kitemviews/kstandarditemlistwidget.cpp | 2 +- src/kitemviews/private/kbaloorolesprovider.cpp | 2 +- src/kitemviews/private/kfileitemmodeldirlister.cpp | 2 +- src/main.cpp | 2 +- src/panels/folders/treeviewcontextmenu.cpp | 2 +- src/panels/information/filemetadataconfigurationdialog.cpp | 4 ++-- src/panels/information/informationpanelcontent.cpp | 2 +- src/panels/information/phononwidget.cpp | 2 +- src/panels/places/placesitem.cpp | 2 +- src/panels/places/placesitemeditdialog.cpp | 2 +- src/panels/places/placesitemmodel.cpp | 2 +- src/panels/places/placespanel.cpp | 2 +- src/search/dolphinfacetswidget.cpp | 2 +- src/search/dolphinsearchbox.cpp | 2 +- src/settings/additionalinfodialog.cpp | 3 ++- src/settings/dolphinsettingsdialog.cpp | 2 +- src/settings/general/behaviorsettingspage.cpp | 2 +- src/settings/general/configurepreviewplugindialog.cpp | 2 +- src/settings/general/confirmationssettingspage.cpp | 2 +- src/settings/general/generalsettingspage.cpp | 2 +- src/settings/general/previewssettingspage.cpp | 2 +- src/settings/general/statusbarsettingspage.cpp | 2 +- src/settings/kcm/kcmdolphingeneral.cpp | 2 +- src/settings/kcm/kcmdolphinnavigation.cpp | 2 +- src/settings/kcm/kcmdolphinservices.cpp | 2 +- src/settings/kcm/kcmdolphinviewmodes.cpp | 2 +- src/settings/navigation/navigationsettingspage.cpp | 2 +- src/settings/services/servicessettingspage.cpp | 2 +- src/settings/startup/startupsettingspage.cpp | 2 +- src/settings/viewmodes/dolphinfontrequester.cpp | 2 +- src/settings/viewmodes/viewsettingspage.cpp | 2 +- src/settings/viewmodes/viewsettingstab.cpp | 2 +- src/settings/viewpropertiesdialog.cpp | 2 +- src/settings/viewpropsprogressinfo.cpp | 2 +- src/statusbar/dolphinstatusbar.cpp | 2 +- src/statusbar/statusbarspaceinfo.cpp | 2 +- src/views/dolphinremoteencoding.cpp | 2 +- src/views/dolphinview.cpp | 2 +- src/views/dolphinviewactionhandler.cpp | 2 +- src/views/draganddrophelper.cpp | 2 +- src/views/renamedialog.cpp | 2 +- src/views/versioncontrol/versioncontrolobserver.cpp | 2 +- src/views/viewproperties.cpp | 2 +- 50 files changed, 52 insertions(+), 51 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 84a09f4d2..f3337a691 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e99788621..e6ef74ef3 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index e3479d3b8..9d4de3fe9 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 0f3aa9761..25207b5b7 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/filterbar/filterbar.cpp b/src/filterbar/filterbar.cpp index b850469bf..4a43dbd23 100644 --- a/src/filterbar/filterbar.cpp +++ b/src/filterbar/filterbar.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include FilterBar::FilterBar(QWidget* parent) : diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index aee10b5bd..bb918d0de 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -22,7 +22,7 @@ #include "kfileitemmodelrolesupdater.h" #include "kfileitemlistwidget.h" #include "kfileitemmodel.h" -#include +#include #include #include "private/kpixmapmodifier.h" diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 4d5879f4d..25507c23d 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -22,7 +22,7 @@ #include "kfileitemmodel.h" #include -#include +#include #include #include #include //TODO: port to QCollator diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index eaed056e5..b8557c67f 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index 74f789e23..5ca56c58b 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/kitemviews/private/kfileitemmodeldirlister.cpp b/src/kitemviews/private/kfileitemmodeldirlister.cpp index 9dfd17d8e..d5c8bbb18 100644 --- a/src/kitemviews/private/kfileitemmodeldirlister.cpp +++ b/src/kitemviews/private/kfileitemmodeldirlister.cpp @@ -18,7 +18,7 @@ ***************************************************************************/ #include "kfileitemmodeldirlister.h" -#include +#include #include KFileItemModelDirLister::KFileItemModelDirLister(QObject* parent) : diff --git a/src/main.cpp b/src/main.cpp index ca047bd16..91d32a08a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 56e6d44b3..445b261b9 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/panels/information/filemetadataconfigurationdialog.cpp b/src/panels/information/filemetadataconfigurationdialog.cpp index 15f1f4f5f..08723bc0c 100644 --- a/src/panels/information/filemetadataconfigurationdialog.cpp +++ b/src/panels/information/filemetadataconfigurationdialog.cpp @@ -24,8 +24,8 @@ #else #include #endif - -#include +#include +#include #include #include diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 259b672d3..0ec82a424 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index 16dbabfed..27cd3e746 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include class EmbeddedVideoPlayer : public Phonon::VideoWidget { diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index b82e50256..e667af302 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "placesitemsignalhandler.h" #include #include diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 9a239b786..87fbf4c29 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index aa7f720b4..344e176a3 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 16686f92e..cdc1ebb1a 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp index 8e1a9c470..b183eb8a1 100644 --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -19,7 +19,7 @@ #include "dolphinfacetswidget.h" -#include +#include #include #include #include diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index b8b1dbbca..94365c7de 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/additionalinfodialog.cpp b/src/settings/additionalinfodialog.cpp index 9cce603f5..4d1b69c83 100644 --- a/src/settings/additionalinfodialog.cpp +++ b/src/settings/additionalinfodialog.cpp @@ -21,7 +21,8 @@ #include -#include +#include +#include #include "kitemviews/kfileitemmodel.h" #include #include diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 533a7f089..43d95a0c6 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -30,7 +30,7 @@ #include "viewmodes/viewsettingspage.h" #include "trash/trashsettingspage.h" -#include +#include #include #include diff --git a/src/settings/general/behaviorsettingspage.cpp b/src/settings/general/behaviorsettingspage.cpp index 635a1b2c4..af5308028 100644 --- a/src/settings/general/behaviorsettingspage.cpp +++ b/src/settings/general/behaviorsettingspage.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/general/configurepreviewplugindialog.cpp b/src/settings/general/configurepreviewplugindialog.cpp index ce70e2bad..9e0f5152b 100644 --- a/src/settings/general/configurepreviewplugindialog.cpp +++ b/src/settings/general/configurepreviewplugindialog.cpp @@ -20,7 +20,7 @@ #include "configurepreviewplugindialog.h" #include -#include +#include #include #include diff --git a/src/settings/general/confirmationssettingspage.cpp b/src/settings/general/confirmationssettingspage.cpp index 532821159..b04ab6192 100644 --- a/src/settings/general/confirmationssettingspage.cpp +++ b/src/settings/general/confirmationssettingspage.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/general/generalsettingspage.cpp b/src/settings/general/generalsettingspage.cpp index 3b196e837..07a31bc49 100644 --- a/src/settings/general/generalsettingspage.cpp +++ b/src/settings/general/generalsettingspage.cpp @@ -27,7 +27,7 @@ #include "statusbarsettingspage.h" #include -#include +#include #include #include diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp index 7ca5506fa..bd087f1ea 100644 --- a/src/settings/general/previewssettingspage.cpp +++ b/src/settings/general/previewssettingspage.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/settings/general/statusbarsettingspage.cpp b/src/settings/general/statusbarsettingspage.cpp index 78ee3856b..cb6ae6cd4 100644 --- a/src/settings/general/statusbarsettingspage.cpp +++ b/src/settings/general/statusbarsettingspage.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp index 821e37a04..82b216c3c 100644 --- a/src/settings/kcm/kcmdolphingeneral.cpp +++ b/src/settings/kcm/kcmdolphingeneral.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/kcm/kcmdolphinnavigation.cpp b/src/settings/kcm/kcmdolphinnavigation.cpp index 6265df586..e7892a246 100644 --- a/src/settings/kcm/kcmdolphinnavigation.cpp +++ b/src/settings/kcm/kcmdolphinnavigation.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/kcm/kcmdolphinservices.cpp b/src/settings/kcm/kcmdolphinservices.cpp index 150ea6d6d..ff0b09318 100644 --- a/src/settings/kcm/kcmdolphinservices.cpp +++ b/src/settings/kcm/kcmdolphinservices.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp index 9f2829c1b..83d697712 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.cpp +++ b/src/settings/kcm/kcmdolphinviewmodes.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/navigation/navigationsettingspage.cpp b/src/settings/navigation/navigationsettingspage.cpp index 5894599a1..10e009faa 100644 --- a/src/settings/navigation/navigationsettingspage.cpp +++ b/src/settings/navigation/navigationsettingspage.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index da49c7d0a..f258b53e2 100644 --- a/src/settings/services/servicessettingspage.cpp +++ b/src/settings/services/servicessettingspage.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 8e8cf9e73..f1cdfecb8 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/viewmodes/dolphinfontrequester.cpp b/src/settings/viewmodes/dolphinfontrequester.cpp index 278fb0933..e5427f9f3 100644 --- a/src/settings/viewmodes/dolphinfontrequester.cpp +++ b/src/settings/viewmodes/dolphinfontrequester.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/viewmodes/viewsettingspage.cpp b/src/settings/viewmodes/viewsettingspage.cpp index 941b211ef..2639c8bb4 100644 --- a/src/settings/viewmodes/viewsettingspage.cpp +++ b/src/settings/viewmodes/viewsettingspage.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/settings/viewmodes/viewsettingstab.cpp b/src/settings/viewmodes/viewsettingstab.cpp index 6f442099f..2169ca955 100644 --- a/src/settings/viewmodes/viewsettingstab.cpp +++ b/src/settings/viewmodes/viewsettingstab.cpp @@ -25,7 +25,7 @@ #include "dolphin_iconsmodesettings.h" #include -#include +#include #include #include diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 576154f2b..20229a34b 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index 13998cf87..a75547609 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 5feeaa361..4892ee7a8 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index 43d9f342d..dd909beb4 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -22,7 +22,7 @@ #include "spaceinfoobserver.h" -#include +#include #include #include diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 97a15313a..059b898e5 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index b3df1ebd6..189849376 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 41c3a5dca..c3d4319a2 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index 5bae50ef7..0dada5e55 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -21,7 +21,7 @@ #include "draganddrophelper.h" #include -#include +#include #include #include #include diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index e9fda4a56..82c4c8b9d 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -20,7 +20,7 @@ #include "renamedialog.h" #include -#include +#include #include #include #include diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index c7677de53..dca99ed11 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -21,7 +21,7 @@ #include "dolphin_versioncontrolsettings.h" -#include +#include #include #include #include diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 95c44bc84..06097977d 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -24,7 +24,7 @@ #include "dolphin_generalsettings.h" #include -#include +#include #include #include #include -- cgit v1.3 From 0a6257bce3de877e4ae869f974df645c428d32c9 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sat, 18 Oct 2014 15:00:17 +0200 Subject: Fix includes --- src/dolphinapplication.cpp | 2 -- src/dolphincontextmenu.cpp | 11 +---------- src/dolphincontextmenu.h | 4 ---- src/dolphinmainwindow.cpp | 17 ++++------------- src/dolphinmainwindow.h | 1 - src/dolphinpart.cpp | 12 +++++------- src/dolphinpart.h | 1 - src/dolphinrecenttabsmenu.cpp | 2 +- src/dolphintabpage.cpp | 1 + src/dolphinviewcontainer.cpp | 11 +---------- src/dolphinviewcontainer.h | 1 - src/kitemviews/kfileitemlistview.cpp | 5 ----- src/kitemviews/kfileitemlistwidget.cpp | 1 - src/kitemviews/kfileitemmodel.cpp | 1 - src/kitemviews/kfileitemmodelrolesupdater.cpp | 1 - src/kitemviews/kitemlistcontainer.cpp | 1 - src/kitemviews/kitemlistcontainer.h | 1 - src/kitemviews/kitemlistcontroller.h | 3 +-- src/kitemviews/kitemliststyleoption.cpp | 1 - src/kitemviews/kitemlistview.cpp | 2 -- src/kitemviews/kstandarditem.h | 1 - src/kitemviews/kstandarditemlistwidget.cpp | 2 -- .../private/kdirectorycontentscounterworker.h | 1 - src/kitemviews/private/kitemlistheaderwidget.cpp | 1 - .../private/kitemlistkeyboardsearchmanager.cpp | 2 -- src/kitemviews/private/kitemlistselectiontoggle.cpp | 1 - src/panels/folders/folderspanel.h | 2 +- src/panels/folders/treeviewcontextmenu.cpp | 1 - src/panels/information/informationpanel.h | 2 +- src/panels/information/informationpanelcontent.cpp | 3 +-- src/panels/information/informationpanelcontent.h | 3 +-- src/panels/information/pixmapviewer.cpp | 2 -- src/panels/panel.h | 1 - src/panels/places/placesitem.cpp | 1 - src/panels/places/placesitemeditdialog.cpp | 4 +--- src/panels/places/placesitemmodel.cpp | 2 +- src/panels/places/placespanel.cpp | 1 + src/panels/places/placespanel.h | 2 +- src/panels/terminal/terminalpanel.cpp | 2 +- src/panels/terminal/terminalpanel.h | 2 +- src/search/dolphinsearchbox.cpp | 2 -- src/search/dolphinsearchbox.h | 1 - src/settings/applyviewpropsjob.h | 1 - src/settings/dolphinsettingsdialog.cpp | 1 - src/settings/general/behaviorsettingspage.cpp | 4 ---- src/settings/general/generalsettingspage.cpp | 1 - src/settings/kcm/kcmdolphingeneral.cpp | 1 - src/settings/kcm/kcmdolphinnavigation.cpp | 3 --- src/settings/kcm/kcmdolphinservices.cpp | 3 --- src/settings/kcm/kcmdolphinviewmodes.cpp | 2 -- src/settings/navigation/navigationsettingspage.cpp | 1 - src/settings/services/servicessettingspage.h | 1 - src/settings/startup/startupsettingspage.cpp | 2 +- src/settings/viewmodes/dolphinfontrequester.cpp | 2 -- src/settings/viewmodes/viewsettingspage.cpp | 1 - src/settings/viewpropertiesdialog.cpp | 5 ----- src/settings/viewpropsprogressinfo.cpp | 2 +- src/statusbar/dolphinstatusbar.cpp | 6 +++--- src/statusbar/statusbarspaceinfo.cpp | 1 - src/statusbar/statusbarspaceinfo.h | 3 --- src/tests/kfileitemmodeltest.cpp | 1 - src/tests/viewpropertiestest.cpp | 1 - src/views/dolphinitemlistview.cpp | 2 -- src/views/dolphinremoteencoding.cpp | 2 -- src/views/dolphinview.cpp | 9 +-------- src/views/dolphinview.h | 6 +----- src/views/dolphinviewactionhandler.cpp | 2 +- src/views/dolphinviewactionhandler.h | 2 -- src/views/renamedialog.cpp | 4 +--- src/views/tooltips/filemetadatatooltip.cpp | 3 +-- src/views/tooltips/tooltipmanager.cpp | 2 -- src/views/versioncontrol/versioncontrolobserver.cpp | 1 - src/views/versioncontrol/versioncontrolobserver.h | 1 - src/views/viewproperties.cpp | 3 +-- 74 files changed, 35 insertions(+), 162 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp index 41812aaa9..8a6b4cc03 100644 --- a/src/dolphinapplication.cpp +++ b/src/dolphinapplication.cpp @@ -24,9 +24,7 @@ #include #include -#include #include -#include DolphinApplication::DolphinApplication() : m_mainWindow(0) diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index f3337a691..f597d52e3 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -27,37 +27,28 @@ #include "dolphinremoveaction.h" #include -#include #include #include #include #include -#include -#include #include #include #include -#include #include #include -#include -#include #include #include #include #include #include #include -#include #include #include +#include #include #include -#include -#include -#include #include "views/dolphinview.h" #include "views/viewmodecontroller.h" diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h index 62dffd074..f082e1c6c 100644 --- a/src/dolphincontextmenu.h +++ b/src/dolphincontextmenu.h @@ -21,16 +21,12 @@ #define DOLPHINCONTEXTMENU_H #include -#include #include #include #include -#include -#include -#include class QAction; class DolphinMainWindow; diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e6ef74ef3..3f83d054b 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -46,48 +46,39 @@ #include "dolphin_generalsettings.h" -#include #include #include #include -#include #include #include -#include -#include #include #include #include #include -#include #include #include -#include #include #include #include -#include #include #include -#include #include #include #include #include #include #include -#include #include +#include -#include -#include -#include +#include #include #include -#include #include #include #include +#include +#include namespace { // Used for GeneralSettings::version() to determine whether diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 3ea4e0e17..0505037ce 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -24,7 +24,6 @@ #include -#include #include #include #include diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 9d4de3fe9..6f84ab1d8 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -25,26 +25,22 @@ #include #include -#include #include -#include #include #include #include #include #include -#include -#include #include #include #include #include #include -#include #include +#include +#include #include "dolphinpart_ext.h" - #include "dolphinnewfilemenu.h" #include "views/dolphinview.h" #include "views/dolphinviewactionhandler.h" @@ -53,11 +49,13 @@ #include "kitemviews/kfileitemmodel.h" #include "kitemviews/private/kfileitemmodeldirlister.h" +#include #include +#include #include #include #include -#include + K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 70886d10d..18ea0bfbf 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -23,7 +23,6 @@ #include #include -#include class DolphinNewFileMenu; class DolphinViewActionHandler; diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp index f4492a214..bce3996f6 100644 --- a/src/dolphinrecenttabsmenu.cpp +++ b/src/dolphinrecenttabsmenu.cpp @@ -94,4 +94,4 @@ void DolphinRecentTabsMenu::handleAction(QAction* action) if (menu()->actions().count() <= 2) { setEnabled(false); } -} \ No newline at end of file +} diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index f7000ea66..763cd8f94 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -23,6 +23,7 @@ #include "dolphin_generalsettings.h" #include +#include DolphinTabPage::DolphinTabPage(const KUrl& primaryUrl, const KUrl& secondaryUrl, QWidget* parent) : QWidget(parent), diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 25207b5b7..14bc4b7bc 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -20,24 +20,16 @@ #include "dolphinviewcontainer.h" #include -#include -#include -#include -#include #include -#include #include +#include -#include -#include #include #include #include -#include #include #include #include -#include #include #include #include @@ -46,7 +38,6 @@ #include #ifdef KActivities_FOUND -#include #endif #include "dolphin_generalsettings.h" diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 4ca76961c..ce2f606d5 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -21,7 +21,6 @@ #define DOLPHINVIEWCONTAINER_H #include -#include #include #include diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index bb918d0de..32d390331 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -22,18 +22,13 @@ #include "kfileitemmodelrolesupdater.h" #include "kfileitemlistwidget.h" #include "kfileitemmodel.h" -#include -#include #include "private/kpixmapmodifier.h" #include #include -#include #include -#include #include -#include #include // #define KFILEITEMLISTVIEW_DEBUG diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp index 4938e9d6d..a304ea69c 100644 --- a/src/kitemviews/kfileitemlistwidget.cpp +++ b/src/kitemviews/kfileitemlistwidget.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 25507c23d..489e4edb4 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -30,7 +30,6 @@ #include "private/kfileitemmodelsortalgorithm.h" #include "private/kfileitemmodeldirlister.h" -#include #include #include #include diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 256527c9e..8e9b9dd98 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 5e45a1766..46ac4745e 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/src/kitemviews/kitemlistcontainer.h b/src/kitemviews/kitemlistcontainer.h index e599992df..3373059d1 100644 --- a/src/kitemviews/kitemlistcontainer.h +++ b/src/kitemviews/kitemlistcontainer.h @@ -25,7 +25,6 @@ #include -#include #include class KItemListController; diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index b07f117d0..99df53104 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -28,9 +28,8 @@ #include "kitemset.h" #include -#include #include - +class QTimer; class KItemModelBase; class KItemListKeyboardSearchManager; class KItemListSelectionManager; diff --git a/src/kitemviews/kitemliststyleoption.cpp b/src/kitemviews/kitemliststyleoption.cpp index edd6363c8..1ebcad141 100644 --- a/src/kitemviews/kitemliststyleoption.cpp +++ b/src/kitemviews/kitemliststyleoption.cpp @@ -19,7 +19,6 @@ #include "kitemliststyleoption.h" -#include KItemListStyleOption::KItemListStyleOption() : rect(), diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 8c93361e0..ea1ec3f3a 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -35,11 +35,9 @@ #include "private/kitemlistviewlayouter.h" #include "private/kitemlistviewanimation.h" -#include #include #include #include -#include #include #include #include diff --git a/src/kitemviews/kstandarditem.h b/src/kitemviews/kstandarditem.h index 689db4251..59190bfd5 100644 --- a/src/kitemviews/kstandarditem.h +++ b/src/kitemviews/kstandarditem.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index b8557c67f..9a08a53db 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include "private/kitemlistroleeditor.h" #include "private/kpixmapmodifier.h" -#include #include #include #include diff --git a/src/kitemviews/private/kdirectorycontentscounterworker.h b/src/kitemviews/private/kdirectorycontentscounterworker.h index 96831ef81..b2e31ef0f 100644 --- a/src/kitemviews/private/kdirectorycontentscounterworker.h +++ b/src/kitemviews/private/kdirectorycontentscounterworker.h @@ -20,7 +20,6 @@ #ifndef KDIRECTORYCONTENTENTSCOUNTERWORKER_H #define KDIRECTORYCONTENTENTSCOUNTERWORKER_H -#include #include #include diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp index 6b6530fd2..e820bd789 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.cpp +++ b/src/kitemviews/private/kitemlistheaderwidget.cpp @@ -19,7 +19,6 @@ #include "kitemlistheaderwidget.h" -#include #include #include diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp index 3bd1b01f3..ffa92a1cf 100644 --- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp +++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp @@ -22,8 +22,6 @@ #include "kitemlistkeyboardsearchmanager.h" -#include -#include KItemListKeyboardSearchManager::KItemListKeyboardSearchManager(QObject* parent) : QObject(parent), diff --git a/src/kitemviews/private/kitemlistselectiontoggle.cpp b/src/kitemviews/private/kitemlistselectiontoggle.cpp index c33c15ec2..4daa55f9a 100644 --- a/src/kitemviews/private/kitemlistselectiontoggle.cpp +++ b/src/kitemviews/private/kitemlistselectiontoggle.cpp @@ -19,7 +19,6 @@ #include "kitemlistselectiontoggle.h" -#include #include #include diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h index 14d8e8782..1d3039d1f 100644 --- a/src/panels/folders/folderspanel.h +++ b/src/panels/folders/folderspanel.h @@ -26,7 +26,7 @@ class KFileItemModel; class KItemListController; class QGraphicsSceneDragDropEvent; - +class KFileItem; /** * @brief Shows a tree view of the directories starting from * the currently selected place. diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 445b261b9..330e18560 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -21,7 +21,6 @@ #include "treeviewcontextmenu.h" #include -#include #include #include #include diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h index c68b66ee1..8a1237b95 100644 --- a/src/panels/information/informationpanel.h +++ b/src/panels/information/informationpanel.h @@ -21,7 +21,7 @@ #define INFORMATIONPANEL_H #include - +#include class InformationPanelContent; namespace KIO { diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 0ec82a424..ce138baee 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #ifndef HAVE_BALOO #include @@ -49,10 +50,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h index 67fdf6c5a..6e4faec82 100644 --- a/src/panels/information/informationpanelcontent.h +++ b/src/panels/information/informationpanelcontent.h @@ -21,12 +21,11 @@ #define INFORMATIONPANELCONTENT_H #include "config-baloo.h" -#include #include #include -#include #include +#include class KFileItemList; class PhononWidget; diff --git a/src/panels/information/pixmapviewer.cpp b/src/panels/information/pixmapviewer.cpp index 7b3a212f2..0053e43f9 100644 --- a/src/panels/information/pixmapviewer.cpp +++ b/src/panels/information/pixmapviewer.cpp @@ -21,10 +21,8 @@ #include -#include #include #include -#include PixmapViewer::PixmapViewer(QWidget* parent, Transition transition) : QWidget(parent), diff --git a/src/panels/panel.h b/src/panels/panel.h index a0b25d6cc..b2562dd6b 100644 --- a/src/panels/panel.h +++ b/src/panels/panel.h @@ -23,7 +23,6 @@ #include #include -#include /** * @brief Base widget for all panels that can be docked on the window borders. diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index e667af302..edfe02343 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "placesitemsignalhandler.h" #include diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 87fbf4c29..0fae3f248 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -23,9 +23,7 @@ #include "placesitemeditdialog.h" -#include #include -#include #include #include #include @@ -34,11 +32,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 344e176a3..14d97de5b 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -28,11 +28,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index cdc1ebb1a..68c7fa558 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -25,6 +25,7 @@ #include "dolphin_generalsettings.h" +#include #include #include #include diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 3078f0222..1f7979eca 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -29,7 +29,7 @@ class PlacesItem; class PlacesItemModel; class PlacesView; class QGraphicsSceneDragDropEvent; - +class KJob; /** * @brief Combines bookmarks and mounted devices as list. */ diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index c8352f73a..964479628 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -31,9 +31,9 @@ #include #include -#include #include #include +#include TerminalPanel::TerminalPanel(QWidget* parent) : Panel(parent), diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 987ee4753..6a0b38f5b 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -33,7 +33,7 @@ namespace KIO { namespace KParts { class ReadOnlyPart; } - +class KJob; /** * @brief Shows the terminal which is synchronized with the URL of the * active view. diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 94365c7de..050ae394d 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -26,12 +26,10 @@ #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index eba81346d..16a6ec0c1 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -21,7 +21,6 @@ #define DOLPHINSEARCHBOX_H #include -#include #include #include diff --git a/src/settings/applyviewpropsjob.h b/src/settings/applyviewpropsjob.h index 68fdcc46b..1d817fe56 100644 --- a/src/settings/applyviewpropsjob.h +++ b/src/settings/applyviewpropsjob.h @@ -24,7 +24,6 @@ #define APPLYVIEWPROPSJOB_H #include -#include #include class ViewProperties; diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 43d95a0c6..678ef7b8e 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -31,7 +31,6 @@ #include "trash/trashsettingspage.h" #include -#include #include #include diff --git a/src/settings/general/behaviorsettingspage.cpp b/src/settings/general/behaviorsettingspage.cpp index af5308028..8d3e0ffb5 100644 --- a/src/settings/general/behaviorsettingspage.cpp +++ b/src/settings/general/behaviorsettingspage.cpp @@ -22,14 +22,10 @@ #include "dolphin_generalsettings.h" -#include -#include #include #include #include -#include -#include #include #include diff --git a/src/settings/general/generalsettingspage.cpp b/src/settings/general/generalsettingspage.cpp index 07a31bc49..f749c33ce 100644 --- a/src/settings/general/generalsettingspage.cpp +++ b/src/settings/general/generalsettingspage.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp index 82b216c3c..68f515ac3 100644 --- a/src/settings/kcm/kcmdolphingeneral.cpp +++ b/src/settings/kcm/kcmdolphingeneral.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/settings/kcm/kcmdolphinnavigation.cpp b/src/settings/kcm/kcmdolphinnavigation.cpp index e7892a246..5a0be61be 100644 --- a/src/settings/kcm/kcmdolphinnavigation.cpp +++ b/src/settings/kcm/kcmdolphinnavigation.cpp @@ -19,12 +19,9 @@ #include "kcmdolphinnavigation.h" -#include #include -#include #include #include -#include #include diff --git a/src/settings/kcm/kcmdolphinservices.cpp b/src/settings/kcm/kcmdolphinservices.cpp index ff0b09318..b00f58abc 100644 --- a/src/settings/kcm/kcmdolphinservices.cpp +++ b/src/settings/kcm/kcmdolphinservices.cpp @@ -19,12 +19,9 @@ #include "kcmdolphinservices.h" -#include #include -#include #include #include -#include #include diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp index 83d697712..fc211cdab 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.cpp +++ b/src/settings/kcm/kcmdolphinviewmodes.cpp @@ -25,13 +25,11 @@ #include #include #include -#include #include #include #include -#include #include #include diff --git a/src/settings/navigation/navigationsettingspage.cpp b/src/settings/navigation/navigationsettingspage.cpp index 10e009faa..7ffb81115 100644 --- a/src/settings/navigation/navigationsettingspage.cpp +++ b/src/settings/navigation/navigationsettingspage.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/src/settings/services/servicessettingspage.h b/src/settings/services/servicessettingspage.h index 7a56abd68..5dbb691af 100644 --- a/src/settings/services/servicessettingspage.h +++ b/src/settings/services/servicessettingspage.h @@ -21,7 +21,6 @@ #include -#include #include class QListView; diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index f1cdfecb8..2c436b541 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -31,11 +31,11 @@ #include #include +#include #include #include #include #include -#include #include "views/dolphinview.h" diff --git a/src/settings/viewmodes/dolphinfontrequester.cpp b/src/settings/viewmodes/dolphinfontrequester.cpp index e5427f9f3..4d8b4813c 100644 --- a/src/settings/viewmodes/dolphinfontrequester.cpp +++ b/src/settings/viewmodes/dolphinfontrequester.cpp @@ -20,11 +20,9 @@ #include "dolphinfontrequester.h" #include -#include #include #include -#include #include #include #include diff --git a/src/settings/viewmodes/viewsettingspage.cpp b/src/settings/viewmodes/viewsettingspage.cpp index 2639c8bb4..2b657c264 100644 --- a/src/settings/viewmodes/viewsettingspage.cpp +++ b/src/settings/viewmodes/viewsettingspage.cpp @@ -27,7 +27,6 @@ #include #include -#include #include ViewSettingsPage::ViewSettingsPage(QWidget* parent) : diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 20229a34b..2e0b172b9 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -29,24 +29,19 @@ #include -#include #include -#include #include #include #include #include -#include #include #include #include #include #include -#include #include #include -#include #include diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index a75547609..091003416 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 4892ee7a8..c5d7b45f6 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -21,11 +21,9 @@ #include "dolphin_generalsettings.h" -#include #include #include #include -#include #include "statusbarspaceinfo.h" @@ -33,10 +31,12 @@ #include #include #include -#include #include #include #include +#include +#include +#include #include #include diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index dd909beb4..1c9048304 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -25,7 +25,6 @@ #include #include -#include StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) : KCapacityBar(KCapacityBar::DrawTextInline, parent), diff --git a/src/statusbar/statusbarspaceinfo.h b/src/statusbar/statusbarspaceinfo.h index 1065d9f45..597d91ef6 100644 --- a/src/statusbar/statusbarspaceinfo.h +++ b/src/statusbar/statusbarspaceinfo.h @@ -22,9 +22,6 @@ #include -#include -#include -#include #include diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index c584c5e62..3d505c766 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -20,7 +20,6 @@ #include -#include #include #include "kitemviews/kfileitemmodel.h" diff --git a/src/tests/viewpropertiestest.cpp b/src/tests/viewpropertiestest.cpp index 6c72a5706..d5584ce82 100644 --- a/src/tests/viewpropertiestest.cpp +++ b/src/tests/viewpropertiestest.cpp @@ -23,7 +23,6 @@ #include "views/viewproperties.h" #include "testdir.h" -#include #include class ViewPropertiesTest : public QObject diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index cd16aead0..60c8bb97c 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -30,8 +30,6 @@ #include #include -#include -#include #include diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 059b898e5..3b5fbcd71 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 189849376..4ed32ed43 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -24,23 +24,18 @@ #include #include -#include #include #include #include -#include -#include #include #include #include #include - +#include #include #include -#include #include #include -#include #include #include #include @@ -59,11 +54,9 @@ #include #include #include -#include #include #include #include -#include #include #include "dolphinnewfilemenuobserver.h" diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 1616bcaa6..d6daf2826 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -27,18 +27,14 @@ #include #include -#include #include #include #include -#include -#include -#include #include typedef KIO::FileUndoManager::CommandType CommandType; - +class QVBoxLayout; class DolphinItemListView; class KFileItemModel; class KItemListContainer; diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index c3d4319a2..84025a5f8 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -28,12 +28,12 @@ #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/views/dolphinviewactionhandler.h b/src/views/dolphinviewactionhandler.h index 58cdb5416..bf664f731 100644 --- a/src/views/dolphinviewactionhandler.h +++ b/src/views/dolphinviewactionhandler.h @@ -23,8 +23,6 @@ #define DOLPHINVIEWACTIONHANDLER_H #include "libdolphin_export.h" -#include -#include #include "views/dolphinview.h" #include diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index 82c4c8b9d..458b9ef79 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -22,19 +22,17 @@ #include #include #include -#include #include #include -#include #include //TODO port to QCollator #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp index afb1a32d3..11b9ecd1d 100644 --- a/src/views/tooltips/filemetadatatooltip.cpp +++ b/src/views/tooltips/filemetadatatooltip.cpp @@ -23,16 +23,15 @@ #include #include -#include // For the blurred tooltip background #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 25fa8e0ed..0636df795 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -28,8 +28,6 @@ #include #include #include -#include -#include #include #include diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index dca99ed11..ca8ef3bbc 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -31,7 +31,6 @@ #include "updateitemstatesthread.h" #include -#include #include VersionControlObserver::VersionControlObserver(QObject* parent) : diff --git a/src/views/versioncontrol/versioncontrolobserver.h b/src/views/versioncontrol/versioncontrolobserver.h index 562a599d2..b9ab13427 100644 --- a/src/views/versioncontrol/versioncontrolobserver.h +++ b/src/views/versioncontrol/versioncontrolobserver.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 06097977d..100b1ad2d 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -23,12 +23,11 @@ #include "dolphin_directoryviewpropertysettings.h" #include "dolphin_generalsettings.h" -#include -#include #include #include #include +#include #include #include #include -- cgit v1.3 From 1b4572dac9fb529d31b786f93e4f02c6f8aeeb21 Mon Sep 17 00:00:00 2001 From: Lukáš Tinkl Date: Tue, 21 Oct 2014 21:18:43 +0200 Subject: port Dolphin from KUrl to QUrl REVIEW: 120688 --- src/dolphinapplication.cpp | 6 +- src/dolphincontextmenu.cpp | 18 ++--- src/dolphincontextmenu.h | 8 +-- src/dolphinmainwindow.cpp | 60 ++++++++-------- src/dolphinmainwindow.h | 20 +++--- src/dolphinpart.cpp | 12 ++-- src/dolphinpart.h | 2 +- src/dolphinpart_ext.cpp | 2 +- src/dolphinpart_ext.h | 4 +- src/dolphinrecenttabsmenu.cpp | 2 +- src/dolphinrecenttabsmenu.h | 6 +- src/dolphintabbar.cpp | 9 +-- src/dolphintabpage.cpp | 40 +++++------ src/dolphintabpage.h | 10 +-- src/dolphintabwidget.cpp | 18 ++--- src/dolphintabwidget.h | 14 ++-- src/dolphinviewcontainer.cpp | 46 ++++++------ src/dolphinviewcontainer.h | 24 +++---- src/kitemviews/kfileitemmodel.cpp | 61 ++++++++-------- src/kitemviews/kfileitemmodel.h | 8 +-- src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 +- src/kitemviews/kstandarditemlistwidget.cpp | 6 +- .../private/kdirectorycontentscounter.cpp | 6 +- src/kitemviews/private/kfileitemclipboard.cpp | 11 ++- src/kitemviews/private/kfileitemclipboard.h | 8 +-- src/kitemviews/private/kfileitemmodeldirlister.h | 4 +- src/panels/folders/folderspanel.cpp | 6 +- src/panels/folders/folderspanel.h | 8 +-- src/panels/folders/treeviewcontextmenu.cpp | 12 ++-- src/panels/information/informationpanel.cpp | 26 +++---- src/panels/information/informationpanel.h | 10 +-- src/panels/information/informationpanelcontent.cpp | 8 +-- src/panels/information/informationpanelcontent.h | 6 +- src/panels/information/phononwidget.cpp | 6 +- src/panels/information/phononwidget.h | 9 ++- src/panels/panel.cpp | 10 +-- src/panels/panel.h | 8 +-- src/panels/places/placesitem.cpp | 16 ++--- src/panels/places/placesitem.h | 8 +-- src/panels/places/placesitemeditdialog.cpp | 10 +-- src/panels/places/placesitemeditdialog.h | 8 +-- src/panels/places/placesitemmodel.cpp | 83 +++++++++++----------- src/panels/places/placesitemmodel.h | 20 +++--- src/panels/places/placespanel.cpp | 18 ++--- src/panels/places/placespanel.h | 11 +-- src/panels/terminal/terminalpanel.cpp | 9 ++- src/panels/terminal/terminalpanel.h | 4 +- src/search/dolphinsearchbox.cpp | 31 ++++---- src/search/dolphinsearchbox.h | 16 ++--- src/settings/applyviewpropsjob.cpp | 7 +- src/settings/applyviewpropsjob.h | 6 +- src/settings/dolphin_generalsettings.kcfg | 4 +- src/settings/dolphinsettingsdialog.cpp | 2 +- src/settings/dolphinsettingsdialog.h | 4 +- src/settings/general/behaviorsettingspage.cpp | 2 +- src/settings/general/behaviorsettingspage.h | 6 +- src/settings/general/generalsettingspage.cpp | 2 +- src/settings/general/generalsettingspage.h | 4 +- src/settings/startup/startupsettingspage.cpp | 22 +++--- src/settings/startup/startupsettingspage.h | 6 +- src/settings/viewpropertiesdialog.cpp | 4 +- src/settings/viewpropsprogressinfo.cpp | 2 +- src/settings/viewpropsprogressinfo.h | 6 +- src/statusbar/dolphinstatusbar.cpp | 4 +- src/statusbar/dolphinstatusbar.h | 6 +- src/statusbar/spaceinfoobserver.cpp | 6 +- src/statusbar/spaceinfoobserver.h | 6 +- src/statusbar/statusbarspaceinfo.cpp | 4 +- src/statusbar/statusbarspaceinfo.h | 8 +-- src/tests/kfileitemmodelbenchmark.cpp | 3 +- src/tests/testdir.cpp | 4 +- src/tests/testdir.h | 4 +- src/views/dolphinremoteencoding.cpp | 8 +-- src/views/dolphinremoteencoding.h | 4 +- src/views/dolphinview.cpp | 55 +++++++------- src/views/dolphinview.h | 31 ++++---- src/views/dolphinviewactionhandler.cpp | 2 +- src/views/draganddrophelper.cpp | 14 ++-- src/views/draganddrophelper.h | 4 +- .../versioncontrol/versioncontrolobserver.cpp | 16 ++--- src/views/versioncontrol/versioncontrolobserver.h | 4 +- src/views/viewmodecontroller.cpp | 6 +- src/views/viewmodecontroller.h | 12 ++-- src/views/viewproperties.cpp | 17 +++-- src/views/viewproperties.h | 8 +-- 85 files changed, 523 insertions(+), 530 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp index 8d4af66df..acd938317 100644 --- a/src/dolphinapplication.cpp +++ b/src/dolphinapplication.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include DolphinApplication::DolphinApplication() : m_mainWindow(0) @@ -41,7 +41,7 @@ DolphinApplication::DolphinApplication() : QList urls; for (int i = 0; i < argsCount; ++i) { - const KUrl url = args->url(i); + const QUrl url = args->url(i); if (url.isValid()) { urls.append(url); } @@ -71,7 +71,7 @@ DolphinApplication::DolphinApplication() : m_mainWindow->openDirectories(urls); } } else { - const KUrl homeUrl(GeneralSettings::homeUrl()); + const QUrl homeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl())); m_mainWindow->openNewActivatedTab(homeUrl); } diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index f597d52e3..9a47faef7 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -56,7 +56,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, const QPoint& pos, const KFileItem& fileInfo, - const KUrl& baseUrl) : + const QUrl& baseUrl) : QMenu(parent), m_pos(pos), m_mainWindow(parent), @@ -91,7 +91,7 @@ void DolphinContextMenu::setCustomActions(const QList& actions) DolphinContextMenu::Command DolphinContextMenu::open() { // get the context information - if (m_baseUrl.protocol() == QLatin1String("trash")) { + if (m_baseUrl.scheme() == QLatin1String("trash")) { m_context |= TrashContext; } @@ -175,7 +175,7 @@ void DolphinContextMenu::openTrashItemContextMenu() addAction(propertiesAction); if (exec(m_pos) == restoreAction) { - KUrl::List selectedUrls; + QList selectedUrls; foreach (const KFileItem &item, m_selectedItems) { selectedUrls.append(item.url()); } @@ -226,7 +226,7 @@ void DolphinContextMenu::openItemContextMenu() } addSeparator(); - } else if (m_baseUrl.protocol().contains("search") || m_baseUrl.protocol().contains("timeline")) { + } else if (m_baseUrl.scheme().contains("search") || m_baseUrl.scheme().contains("timeline")) { openParentAction = new QAction(QIcon::fromTheme("document-open-folder"), i18nc("@action:inmenu", "Open Path"), @@ -256,7 +256,7 @@ void DolphinContextMenu::openItemContextMenu() } else { bool selectionHasOnlyDirs = true; foreach (const KFileItem& item, m_selectedItems) { - const KUrl& url = DolphinView::openItemAsFolderUrl(item); + const QUrl& url = DolphinView::openItemAsFolderUrl(item); if (url.isEmpty()) { selectionHasOnlyDirs = false; break; @@ -296,7 +296,7 @@ void DolphinContextMenu::openItemContextMenu() QAction* activatedAction = exec(m_pos); if (activatedAction) { if (activatedAction == addToPlacesAction) { - const KUrl selectedUrl(m_fileInfo.url()); + const QUrl selectedUrl(m_fileInfo.url()); if (selectedUrl.isValid()) { PlacesItemModel model; const QString text = selectedUrl.fileName(); @@ -420,14 +420,14 @@ void DolphinContextMenu::addShowMenuBarAction() } } -bool DolphinContextMenu::placeExists(const KUrl& url) const +bool DolphinContextMenu::placeExists(const QUrl& url) const { PlacesItemModel model; const int count = model.count(); for (int i = 0; i < count; ++i) { - const KUrl placeUrl = model.placesItem(i)->url(); - if (placeUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) { + const QUrl placeUrl = model.placesItem(i)->url(); + if (placeUrl.matches(url, QUrl::StripTrailingSlash)) { return true; } } diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h index f082e1c6c..8ed22dda5 100644 --- a/src/dolphincontextmenu.h +++ b/src/dolphincontextmenu.h @@ -21,7 +21,7 @@ #define DOLPHINCONTEXTMENU_H #include -#include +#include #include #include @@ -72,7 +72,7 @@ public: DolphinContextMenu(DolphinMainWindow* parent, const QPoint& pos, const KFileItem& fileInfo, - const KUrl& baseUrl); + const QUrl& baseUrl); virtual ~DolphinContextMenu(); @@ -106,7 +106,7 @@ private: */ void addShowMenuBarAction(); - bool placeExists(const KUrl& url) const; + bool placeExists(const QUrl& url) const; QAction* createPasteAction(); @@ -162,7 +162,7 @@ private: KFileItem m_fileInfo; - KUrl m_baseUrl; + QUrl m_baseUrl; KFileItem* m_baseFileItem; /// File item for m_baseUrl KFileItemList m_selectedItems; diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 1053f15b6..f44d3236f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -128,8 +128,8 @@ DolphinMainWindow::DolphinMainWindow() : this, SLOT(activeViewChanged(DolphinViewContainer*))); connect(m_tabWidget, SIGNAL(tabCountChanged(int)), this, SLOT(tabCountChanged(int))); - connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)), - this, SLOT(setUrlAsCaption(KUrl))); + connect(m_tabWidget, SIGNAL(currentUrlChanged(QUrl)), + this, SLOT(setUrlAsCaption(QUrl))); setCentralWidget(m_tabWidget); setupActions(); @@ -216,7 +216,7 @@ void DolphinMainWindow::pasteIntoFolder() m_activeViewContainer->view()->pasteIntoFolder(); } -void DolphinMainWindow::changeUrl(const KUrl& url) +void DolphinMainWindow::changeUrl(const QUrl &url) { if (!KProtocolManager::supportsListing(url)) { // The URL navigator only checks for validity, not @@ -234,7 +234,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url) emit urlChanged(url); } -void DolphinMainWindow::slotTerminalDirectoryChanged(const KUrl& url) +void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url) { m_activeViewContainer->setAutoGrabFocus(false); changeUrl(url); @@ -295,7 +295,7 @@ void DolphinMainWindow::updateFilterBarAction(bool show) void DolphinMainWindow::openNewMainWindow() { - KRun::run("dolphin %u", KUrl::List(), this); + KRun::run("dolphin %u", QList(), this); } void DolphinMainWindow::openNewActivatedTab() @@ -303,12 +303,12 @@ void DolphinMainWindow::openNewActivatedTab() m_tabWidget->openNewActivatedTab(); } -void DolphinMainWindow::openNewTab(const KUrl& url) +void DolphinMainWindow::openNewTab(const QUrl& url) { m_tabWidget->openNewTab(url); } -void DolphinMainWindow::openNewActivatedTab(const KUrl& url) +void DolphinMainWindow::openNewActivatedTab(const QUrl& url) { m_tabWidget->openNewActivatedTab(url); } @@ -320,7 +320,7 @@ void DolphinMainWindow::openInNewTab() openNewTab(m_activeViewContainer->url()); } else { foreach (const KFileItem& item, list) { - const KUrl& url = DolphinView::openItemAsFolderUrl(item); + const QUrl& url = DolphinView::openItemAsFolderUrl(item); if (!url.isEmpty()) { openNewTab(url); } @@ -330,7 +330,7 @@ void DolphinMainWindow::openInNewTab() void DolphinMainWindow::openInNewWindow() { - KUrl newWindowUrl; + QUrl newWindowUrl; const KFileItemList list = m_activeViewContainer->view()->selectedItems(); if (list.isEmpty()) { @@ -640,7 +640,7 @@ void DolphinMainWindow::goUp(Qt::MouseButtons buttons) { // The default case (left button pressed) is handled in goUp(). if (buttons == Qt::MidButton) { - openNewTab(activeViewContainer()->url().upUrl()); + openNewTab(KIO::upUrl(activeViewContainer()->url())); } } @@ -661,13 +661,13 @@ void DolphinMainWindow::compareFiles() return; } - KUrl urlA = items.at(0).url(); - KUrl urlB = items.at(1).url(); + QUrl urlA = items.at(0).url(); + QUrl urlB = items.at(1).url(); QString command("kompare -c \""); - command.append(urlA.pathOrUrl()); + command.append(urlA.toDisplayString(QUrl::PreferLocalFile)); command.append("\" \""); - command.append(urlB.pathOrUrl()); + command.append(urlB.toDisplayString(QUrl::PreferLocalFile)); command.append('\"'); KRun::runCommand(command, "Kompare", "kompare", this); } @@ -689,7 +689,7 @@ void DolphinMainWindow::openTerminal() // If the given directory is not local, it can still be the URL of an // ioslave using UDS_LOCAL_PATH which to be converted first. - KUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this); + QUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this); //If the URL is local after the above conversion, set the directory. if (url.isLocalFile()) { @@ -705,7 +705,7 @@ void DolphinMainWindow::editSettings() DolphinViewContainer* container = activeViewContainer(); container->view()->writeSettings(); - const KUrl url = container->url(); + const QUrl url = container->url(); DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this); connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews); settingsDialog->setAttribute(Qt::WA_DeleteOnClose); @@ -716,7 +716,7 @@ void DolphinMainWindow::editSettings() } } -void DolphinMainWindow::handleUrl(const KUrl& url) +void DolphinMainWindow::handleUrl(const QUrl& url) { delete m_lastHandleUrlStatJob; m_lastHandleUrlStatJob = 0; @@ -741,7 +741,7 @@ void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job) { m_lastHandleUrlStatJob = 0; const KIO::UDSEntry entry = static_cast(job)->statResult(); - const KUrl url = static_cast(job)->url(); + const QUrl url = static_cast(job)->url(); if (entry.isDir()) { activeViewContainer()->setUrl(url); } else { @@ -756,7 +756,7 @@ void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) void DolphinMainWindow::openContextMenu(const QPoint& pos, const KFileItem& item, - const KUrl& url, + const QUrl& url, const QList& customActions) { QWeakPointer contextMenu = new DolphinContextMenu(this, pos, item, url); @@ -900,7 +900,7 @@ void DolphinMainWindow::slotPanelErrorMessage(const QString& error) activeViewContainer()->showMessage(error, DolphinViewContainer::Error); } -void DolphinMainWindow::slotPlaceActivated(const KUrl& url) +void DolphinMainWindow::slotPlaceActivated(const QUrl& url) { DolphinViewContainer* view = activeViewContainer(); @@ -943,7 +943,7 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer) updateViewActions(); updateGoActions(); - const KUrl url = viewContainer->url(); + const QUrl url = viewContainer->url(); emit urlChanged(url); } @@ -955,12 +955,12 @@ void DolphinMainWindow::tabCountChanged(int count) actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions); } -void DolphinMainWindow::setUrlAsCaption(const KUrl& url) +void DolphinMainWindow::setUrlAsCaption(const QUrl& url) { QString caption; if (!url.isLocalFile()) { - caption.append(url.protocol() + " - "); - if (url.hasHost()) { + caption.append(url.scheme() + " - "); + if (!url.host().isEmpty()) { caption.append(url.host() + " - "); } } @@ -1070,8 +1070,8 @@ void DolphinMainWindow::setupActions() DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this); actionCollection()->addAction("closed_tabs", recentTabsMenu); - connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)), - recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray))); + connect(m_tabWidget, SIGNAL(rememberClosedTab(QUrl,QByteArray)), + recentTabsMenu, SLOT(rememberClosedTab(QUrl,QByteArray))); connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)), m_tabWidget, SLOT(restoreClosedTab(QByteArray))); connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)), @@ -1255,8 +1255,8 @@ void DolphinMainWindow::setupDockWidgets() addDockWidget(Qt::LeftDockWidgetArea, placesDock); connect(placesPanel, &PlacesPanel::placeActivated, this, &DolphinMainWindow::slotPlaceActivated); - connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)), - this, SLOT(openNewTab(KUrl))); + connect(placesPanel, SIGNAL(placeMiddleClicked(QUrl)), + this, SLOT(openNewTab(QUrl))); connect(placesPanel, &PlacesPanel::errorMessage, this, &DolphinMainWindow::slotPanelErrorMessage); connect(this, &DolphinMainWindow::urlChanged, @@ -1326,8 +1326,8 @@ void DolphinMainWindow::updateViewActions() void DolphinMainWindow::updateGoActions() { QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up)); - const KUrl currentUrl = m_activeViewContainer->url(); - goUpAction->setEnabled(currentUrl.upUrl() != currentUrl); + const QUrl currentUrl = m_activeViewContainer->url(); + goUpAction->setEnabled(KIO::upUrl(currentUrl) != currentUrl); } void DolphinMainWindow::createControlButton() diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 893394abc..36a16e518 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -109,14 +109,14 @@ public slots: * Inform all affected dolphin components (panels, views) of an URL * change. */ - void changeUrl(const KUrl& url); + void changeUrl(const QUrl& url); /** * The current directory of the Terminal Panel has changed, probably because * the user entered a 'cd' command. This slot calls changeUrl(url) and makes * sure that the panel keeps the keyboard focus. */ - void slotTerminalDirectoryChanged(const KUrl& url); + void slotTerminalDirectoryChanged(const QUrl& url); /** Stores all settings and quits Dolphin. */ void quit(); @@ -132,7 +132,7 @@ signals: * Is sent if the url of the currently active view has * been changed. */ - void urlChanged(const KUrl& url); + void urlChanged(const QUrl& url); /** * Is emitted if information of an item is requested to be shown e. g. in the panel. @@ -336,12 +336,12 @@ private slots: /** * Opens a new tab in the background showing the URL \a url. */ - void openNewTab(const KUrl& url); + void openNewTab(const QUrl& url); /** * Opens a new tab showing the URL \a url and activates the tab. */ - void openNewActivatedTab(const KUrl& url); + void openNewActivatedTab(const QUrl& url); /** * Opens the selected folder in a new tab. @@ -363,7 +363,7 @@ private slots: * If the URL can be listed, open it in the current view, otherwise * run it through KRun. */ - void handleUrl(const KUrl& url); + void handleUrl(const QUrl& url); /** * handleUrl() can trigger a stat job to see if the url can actually @@ -388,7 +388,7 @@ private slots: */ void openContextMenu(const QPoint& pos, const KFileItem& item, - const KUrl& url, + const QUrl& url, const QList& customActions); void updateControlMenu(); @@ -406,7 +406,7 @@ private slots: * Reloads the view if \a url is the current URL already, and changes the * current URL otherwise. */ - void slotPlaceActivated(const KUrl& url); + void slotPlaceActivated(const QUrl& url); /** * Is called if the another view has been activated by changing the current @@ -430,7 +430,7 @@ private slots: * Sets the window caption to url.fileName() if this is non-empty, * "/" if the URL is "file:///", and url.protocol() otherwise. */ - void setUrlAsCaption(const KUrl& url); + void setUrlAsCaption(const QUrl& url); private: void setupActions(); diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 43eae8a67..6d1c79b2e 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -73,7 +73,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL // make sure that other apps using this part find Dolphin's view-file-columns icons KIconLoader::global()->addAppDir("dolphin"); - m_view = new DolphinView(KUrl(), parentWidget); + m_view = new DolphinView(QUrl(), parentWidget); m_view->setTabsForFilesEnabled(true); setWidget(m_view); @@ -248,7 +248,7 @@ void DolphinPart::createGoAction(const char* name, const char* iconName, void DolphinPart::slotGoTriggered(QAction* action) { const QString url = action->data().toString(); - emit m_extension->openUrlRequest(KUrl(url)); + emit m_extension->openUrlRequest(QUrl(url)); } void DolphinPart::slotSelectionChanged(const KFileItemList& selection) @@ -311,11 +311,11 @@ bool DolphinPart::openUrl(const QUrl &url) return true; } setUrl(url); // remember it at the KParts level - KUrl visibleUrl(url); + QUrl visibleUrl(url); if (!m_nameFilter.isEmpty()) { - visibleUrl.addPath(m_nameFilter); + visibleUrl.setPath(visibleUrl.path() + '/' + m_nameFilter); } - QString prettyUrl = visibleUrl.pathOrUrl(); + QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile); emit setWindowCaption(prettyUrl); emit m_extension->setLocationBarUrl(prettyUrl); emit started(0); // get the wheel to spin @@ -539,7 +539,7 @@ void DolphinPart::slotOpenTerminal() { QString dir(QDir::homePath()); - KUrl u(url()); + QUrl u(url()); // If the given directory is not local, it can still be the URL of an // ioslave using UDS_LOCAL_PATH which to be converted first. diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 56e049b22..9439a17bc 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -21,7 +21,7 @@ #define DOLPHINPART_H #include -#include +#include class DolphinNewFileMenu; diff --git a/src/dolphinpart_ext.cpp b/src/dolphinpart_ext.cpp index 8e2985878..d275e8627 100644 --- a/src/dolphinpart_ext.cpp +++ b/src/dolphinpart_ext.cpp @@ -61,7 +61,7 @@ void DolphinPartBrowserExtension::paste() m_part->view()->paste(); } -void DolphinPartBrowserExtension::pasteTo(const KUrl&) +void DolphinPartBrowserExtension::pasteTo(const QUrl&) { m_part->view()->pasteIntoFolder(); } diff --git a/src/dolphinpart_ext.h b/src/dolphinpart_ext.h index 5272df69d..bebde3ada 100644 --- a/src/dolphinpart_ext.h +++ b/src/dolphinpart_ext.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include class DolphinPart; @@ -39,7 +39,7 @@ public Q_SLOTS: void cut(); void copy(); void paste(); - void pasteTo(const KUrl&); + void pasteTo(const QUrl &); void reparseConfiguration(); private: diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp index bce3996f6..1087a38e4 100644 --- a/src/dolphinrecenttabsmenu.cpp +++ b/src/dolphinrecenttabsmenu.cpp @@ -40,7 +40,7 @@ DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) : this, SLOT(handleAction(QAction*))); } -void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& url, const QByteArray& state) +void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state) { QAction* action = new QAction(menu()); action->setText(url.path()); diff --git a/src/dolphinrecenttabsmenu.h b/src/dolphinrecenttabsmenu.h index dce032128..fe92a516d 100644 --- a/src/dolphinrecenttabsmenu.h +++ b/src/dolphinrecenttabsmenu.h @@ -21,7 +21,7 @@ #define DOLPHIN_RECENT_TABS_MENU_H #include -#include +#include class QAction; @@ -33,7 +33,7 @@ public: explicit DolphinRecentTabsMenu(QObject* parent); public slots: - void rememberClosedTab(const KUrl& url, const QByteArray& state); + void rememberClosedTab(const QUrl& url, const QByteArray& state); void undoCloseTab(); signals: @@ -47,4 +47,4 @@ private: QAction* m_clearListAction; }; -#endif \ No newline at end of file +#endif diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp index 8e5fb2dce..dbd324db5 100644 --- a/src/dolphintabbar.cpp +++ b/src/dolphintabbar.cpp @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include DolphinTabBar::DolphinTabBar(QWidget* parent) : QTabBar(parent), @@ -47,7 +48,7 @@ void DolphinTabBar::dragEnterEvent(QDragEnterEvent* event) const QMimeData* mimeData = event->mimeData(); const int index = tabAt(event->pos()); - if (KUrl::List::canDecode(mimeData)) { + if (mimeData->hasUrls()) { event->acceptProposedAction(); updateAutoActivationTimer(index); } @@ -67,7 +68,7 @@ void DolphinTabBar::dragMoveEvent(QDragMoveEvent* event) const QMimeData* mimeData = event->mimeData(); const int index = tabAt(event->pos()); - if (KUrl::List::canDecode(mimeData)) { + if (mimeData->hasUrls()) { updateAutoActivationTimer(index); } @@ -82,7 +83,7 @@ void DolphinTabBar::dropEvent(QDropEvent* event) const QMimeData* mimeData = event->mimeData(); const int index = tabAt(event->pos()); - if (index >= 0 && KUrl::List::canDecode(mimeData)) { + if (index >= 0 && mimeData->hasUrls()) { emit tabDropEvent(index, event); } diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index 2d02ff049..6d55ebeb2 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -40,10 +40,10 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl, // Create a new primary view m_primaryViewContainer = createViewContainer(primaryUrl); - connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - connect(m_primaryViewContainer->view(), SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); + connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + connect(m_primaryViewContainer->view(), SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); m_splitter->addWidget(m_primaryViewContainer); m_primaryViewContainer->show(); @@ -52,7 +52,7 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl, // Provide a secondary view, if the given secondary url is valid or if the // startup settings are set this way (use the url of the primary view). m_splitViewEnabled = true; - const KUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl; + const QUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl; m_secondaryViewContainer = createViewContainer(url); m_splitter->addWidget(m_secondaryViewContainer); m_secondaryViewContainer->show(); @@ -77,7 +77,7 @@ void DolphinTabPage::setSplitViewEnabled(bool enabled) m_splitViewEnabled = enabled; if (enabled) { - const KUrl& url = m_primaryViewContainer->url(); + const QUrl& url = m_primaryViewContainer->url(); m_secondaryViewContainer = createViewContainer(url); const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible(); @@ -213,7 +213,7 @@ void DolphinTabPage::restoreState(const QByteArray& state) stream >> isSplitViewEnabled; setSplitViewEnabled(isSplitViewEnabled); - KUrl primaryUrl; + QUrl primaryUrl; stream >> primaryUrl; m_primaryViewContainer->setUrl(primaryUrl); bool primaryUrlEditable; @@ -222,7 +222,7 @@ void DolphinTabPage::restoreState(const QByteArray& state) m_primaryViewContainer->view()->restoreState(stream); if (isSplitViewEnabled) { - KUrl secondaryUrl; + QUrl secondaryUrl; stream >> secondaryUrl; m_secondaryViewContainer->setUrl(secondaryUrl); bool secondaryUrlEditable; @@ -257,7 +257,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state) stream >> isSplitViewEnabled; setSplitViewEnabled(isSplitViewEnabled); - KUrl primaryUrl; + QUrl primaryUrl; stream >> primaryUrl; m_primaryViewContainer->setUrl(primaryUrl); bool primaryUrlEditable; @@ -265,7 +265,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state) m_primaryViewContainer->urlNavigator()->setUrlEditable(primaryUrlEditable); if (isSplitViewEnabled) { - KUrl secondaryUrl; + QUrl secondaryUrl; stream >> secondaryUrl; m_secondaryViewContainer->setUrl(secondaryUrl); bool secondaryUrlEditable; @@ -302,28 +302,28 @@ void DolphinTabPage::slotViewActivated() const DolphinView* newActiveView = activeViewContainer()->view(); if (newActiveView != oldActiveView) { - disconnect(oldActiveView, SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - disconnect(oldActiveView, SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); - connect(newActiveView, SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - connect(newActiveView, SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); + disconnect(oldActiveView, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + disconnect(oldActiveView, SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); + connect(newActiveView, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + connect(newActiveView, SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); } emit activeViewUrlChanged(activeViewContainer()->url()); emit activeViewChanged(activeViewContainer()); } -void DolphinTabPage::slotViewUrlRedirection(const KUrl& oldUrl, const KUrl& newUrl) +void DolphinTabPage::slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl) { Q_UNUSED(oldUrl); emit activeViewUrlChanged(newUrl); } -DolphinViewContainer* DolphinTabPage::createViewContainer(const KUrl& url) const +DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const { DolphinViewContainer* container = new DolphinViewContainer(url, m_splitter); container->setActive(false); diff --git a/src/dolphintabpage.h b/src/dolphintabpage.h index e4a5ad6c7..b46daf350 100644 --- a/src/dolphintabpage.h +++ b/src/dolphintabpage.h @@ -22,7 +22,7 @@ #include #include -#include +#include class QSplitter; class DolphinViewContainer; @@ -33,7 +33,7 @@ class DolphinTabPage : public QWidget Q_OBJECT public: - explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = KUrl(), QWidget* parent = 0); + explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl(), QWidget* parent = 0); /** * @return True if primary view is the active view in this tab. @@ -131,7 +131,7 @@ public: signals: void activeViewChanged(DolphinViewContainer* viewContainer); - void activeViewUrlChanged(const KUrl& url); + void activeViewUrlChanged(const QUrl& url); private slots: /** @@ -147,13 +147,13 @@ private slots: * * It emits the activeViewUrlChanged signal with the url \a newUrl. */ - void slotViewUrlRedirection(const KUrl& oldUrl, const KUrl& newUrl); + void slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl); private: /** * Creates a new view container and does the default initialization. */ - DolphinViewContainer* createViewContainer(const KUrl& url) const; + DolphinViewContainer* createViewContainer(const QUrl& url) const; private: QSplitter* m_splitter; diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 65cc824f0..7a4869421 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -130,7 +130,7 @@ void DolphinTabWidget::openNewActivatedTab() } } -void DolphinTabWidget::openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl) +void DolphinTabWidget::openNewActivatedTab(const QUrl& primaryUrl, const QUrl& secondaryUrl) { openNewTab(primaryUrl, secondaryUrl); setCurrentIndex(count() - 1); @@ -144,8 +144,8 @@ void DolphinTabWidget::openNewTab(const QUrl& primaryUrl, const QUrl& secondaryU tabPage->setPlacesSelectorVisible(m_placesSelectorVisible); connect(tabPage, SIGNAL(activeViewChanged(DolphinViewContainer*)), this, SIGNAL(activeViewChanged(DolphinViewContainer*))); - connect(tabPage, SIGNAL(activeViewUrlChanged(KUrl)), - this, SLOT(tabUrlChanged(KUrl))); + connect(tabPage, SIGNAL(activeViewUrlChanged(QUrl)), + this, SLOT(tabUrlChanged(QUrl))); addTab(tabPage, QIcon::fromTheme(KIO::iconNameForUrl(primaryUrl)), tabName(primaryUrl)); if (focusWidget) { @@ -183,8 +183,8 @@ void DolphinTabWidget::openFiles(const QList& files) // for each directory. If the "split view" option is enabled, two // directories are shown inside one tab (see openDirectories()). QList dirs; - foreach (const KUrl& url, files) { - const KUrl dir(url.directory()); + foreach (const QUrl& url, files) { + const QUrl dir(url.adjusted(QUrl::RemoveFilename).path()); if (!dirs.contains(dir)) { dirs.append(dir); } @@ -296,7 +296,7 @@ void DolphinTabWidget::tabDropEvent(int index, QDropEvent* event) } } -void DolphinTabWidget::tabUrlChanged(const KUrl& url) +void DolphinTabWidget::tabUrlChanged(const QUrl& url) { const int index = indexOf(qobject_cast(sender())); if (index >= 0) { @@ -342,15 +342,15 @@ void DolphinTabWidget::tabRemoved(int index) emit tabCountChanged(count()); } -QString DolphinTabWidget::tabName(const KUrl& url) const +QString DolphinTabWidget::tabName(const QUrl& url) const { QString name; - if (url.equals(KUrl("file:///"))) { + if (url == QUrl("file:///")) { name = '/'; } else { name = url.fileName(); if (name.isEmpty()) { - name = url.protocol(); + name = url.scheme(); } else { // Make sure that a '&' inside the directory name is displayed correctly // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText() diff --git a/src/dolphintabwidget.h b/src/dolphintabwidget.h index c5ab8c260..93213ac61 100644 --- a/src/dolphintabwidget.h +++ b/src/dolphintabwidget.h @@ -21,7 +21,7 @@ #define DOLPHIN_TAB_WIDGET_H #include -#include +#include class DolphinViewContainer; class DolphinTabPage; @@ -70,13 +70,13 @@ signals: /** * Is emitted when a tab has been closed. */ - void rememberClosedTab(const KUrl& url, const QByteArray& state); + void rememberClosedTab(const QUrl& url, const QByteArray& state); /** * Is emitted when the url of the current tab has been changed. This signal * is also emitted when the active view has been changed. */ - void currentUrlChanged(const KUrl& url); + void currentUrlChanged(const QUrl& url); public slots: /** @@ -89,13 +89,13 @@ public slots: * Opens a new tab showing the URL \a primaryUrl and the optional URL * \a secondaryUrl and activates the tab. */ - void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl()); + void openNewActivatedTab(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl()); /** * Opens a new tab in the background showing the URL \a primaryUrl and the * optional URL \a secondaryUrl. */ - void openNewTab(const QUrl &primaryUrl, const QUrl &secondaryUrl = KUrl()); + void openNewTab(const QUrl &primaryUrl, const QUrl &secondaryUrl = QUrl()); /** * Opens each directory in \p dirs in a separate tab. If the "split view" @@ -168,7 +168,7 @@ private slots: * The active view url of a tab has been changed so update the text and the * icon of the corresponding tab. */ - void tabUrlChanged(const KUrl& url); + void tabUrlChanged(const QUrl& url); void currentTabChanged(int index); @@ -180,7 +180,7 @@ private: /** * Returns the name of the tab for the URL \a url. */ - QString tabName(const KUrl& url) const; + QString tabName(const QUrl& url) const; private: /** Caches the (negated) places panel visibility */ diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 14bc4b7bc..aecf7ae2f 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ #include "views/viewmodecontroller.h" #include "views/viewproperties.h" -DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : +DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : QWidget(parent), m_topLayout(0), m_urlNavigator(0), @@ -83,7 +83,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : const GeneralSettings* settings = GeneralSettings::self(); m_urlNavigator->setUrlEditable(settings->editableUrl()); m_urlNavigator->setShowFullPath(settings->showFullPath()); - m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl())); + m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(settings->homeUrl())); KUrlComboBox* editor = m_urlNavigator->editor(); editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode())); @@ -207,7 +207,7 @@ DolphinViewContainer::~DolphinViewContainer() { } -KUrl DolphinViewContainer::url() const +QUrl DolphinViewContainer::url() const { return m_view->url(); } @@ -308,7 +308,7 @@ void DolphinViewContainer::readSettings() // settings of the URL navigator and the filterbar. m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl()); m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath()); - m_urlNavigator->setHomeUrl(KUrl(GeneralSettings::homeUrl())); + m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl())); setFilterBarVisible(GeneralSettings::filterBar()); } @@ -335,16 +335,16 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled) m_urlNavigator->setVisible(!enabled); if (enabled) { - const KUrl& locationUrl = m_urlNavigator->locationUrl(); + const QUrl& locationUrl = m_urlNavigator->locationUrl(); m_searchBox->fromSearchUrl(locationUrl); } else { m_view->setViewPropertiesContext(QString()); // Restore the URL for the URL navigator. If Dolphin has been // started with a search-URL, the home URL is used as fallback. - KUrl url = m_searchBox->searchPath(); + QUrl url = m_searchBox->searchPath(); if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) { - url = GeneralSettings::self()->homeUrl(); + url = QUrl::fromLocalFile(GeneralSettings::self()->homeUrl()); } m_urlNavigator->setLocationUrl(url); } @@ -371,7 +371,7 @@ QString DolphinViewContainer::placesText() const return text; } -void DolphinViewContainer::setUrl(const KUrl& newUrl) +void DolphinViewContainer::setUrl(const QUrl& newUrl) { if (newUrl != m_urlNavigator->locationUrl()) { m_urlNavigator->setLocationUrl(newUrl); @@ -476,14 +476,14 @@ void DolphinViewContainer::slotDirectoryLoadingCanceled() m_statusBar->setText(QString()); } -void DolphinViewContainer::slotUrlIsFileError(const KUrl& url) +void DolphinViewContainer::slotUrlIsFileError(const QUrl& url) { const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); // Find out if the file can be opened in the view (for example, this is the // case if the file is an archive). The mime type must be known for that. item.determineMimeType(); - const KUrl& folderUrl = DolphinView::openItemAsFolderUrl(item, true); + const QUrl& folderUrl = DolphinView::openItemAsFolderUrl(item, true); if (!folderUrl.isEmpty()) { m_view->setUrl(folderUrl); } else { @@ -498,7 +498,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item) // results in an active view. m_view->setActive(true); - const KUrl& url = DolphinView::openItemAsFolderUrl(item, GeneralSettings::browseThroughArchives()); + const QUrl& url = DolphinView::openItemAsFolderUrl(item, GeneralSettings::browseThroughArchives()); if (!url.isEmpty()) { m_view->setUrl(url); return; @@ -542,7 +542,7 @@ void DolphinViewContainer::activate() setActive(true); } -void DolphinViewContainer::slotViewUrlAboutToBeChanged(const KUrl& url) +void DolphinViewContainer::slotViewUrlAboutToBeChanged(const QUrl& url) { // URL changes of the view can happen in two ways: // 1. The URL navigator gets changed and will trigger the view to update its URL @@ -554,7 +554,7 @@ void DolphinViewContainer::slotViewUrlAboutToBeChanged(const KUrl& url) } } -void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url) +void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const QUrl& url) { // URL changes of the view can happen in two ways: // 1. The URL navigator gets changed and will trigger the view to update its URL @@ -566,7 +566,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl& } } -void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) +void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url) { slotReturnPressed(); @@ -582,7 +582,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) } } else if (KProtocolManager::isSourceProtocol(url)) { QString app = "konqueror"; - if (url.protocol().startsWith(QLatin1String("http"))) { + if (url.scheme().startsWith(QLatin1String("http"))) { showMessage(i18nc("@info:status", // krazy:exclude=qmethods "Dolphin does not support web pages, the web browser has been launched"), Information); @@ -602,7 +602,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) Information); } - const QString secureUrl = KShell::quoteArg(url.pathOrUrl()); + const QString secureUrl = KShell::quoteArg(url.toDisplayString(QUrl::PreferLocalFile)); const QString command = app + ' ' + secureUrl; KRun::runCommand(command, app, app, this); } else { @@ -610,7 +610,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) } } -void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event) +void DolphinViewContainer::dropUrls(const QUrl& destination, QDropEvent* event) { m_dropDestination = destination; @@ -645,7 +645,7 @@ void DolphinViewContainer::dropUrlsDelayed() m_dropEvent.reset(); } -void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl) +void DolphinViewContainer::redirect(const QUrl& oldUrl, const QUrl& newUrl) { Q_UNUSED(oldUrl); const bool block = m_urlNavigator->signalsBlocked(); @@ -689,7 +689,7 @@ void DolphinViewContainer::slotReturnPressed() void DolphinViewContainer::startSearching() { - const KUrl url = m_searchBox->urlForSearching(); + const QUrl url = m_searchBox->urlForSearching(); if (url.isValid() && !url.isEmpty()) { m_view->setViewPropertiesContext("search"); m_urlNavigator->setLocationUrl(url); @@ -717,10 +717,9 @@ void DolphinViewContainer::showErrorMessage(const QString& msg) showMessage(msg, Error); } -bool DolphinViewContainer::isSearchUrl(const KUrl& url) const +bool DolphinViewContainer::isSearchUrl(const QUrl& url) const { - const QString protocol = url.protocol(); - return protocol.contains("search"); + return url.scheme().contains("search"); } void DolphinViewContainer::saveViewState() @@ -730,4 +729,3 @@ void DolphinViewContainer::saveViewState() m_view->saveState(stream); m_urlNavigator->saveLocationState(locationState); } - diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index ce2f606d5..bd4141db5 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -40,7 +40,7 @@ namespace KActivities { class FilterBar; class KMessageWidget; -class KUrl; +class QUrl; class KUrlNavigator; class DolphinSearchBox; class DolphinStatusBar; @@ -69,14 +69,14 @@ public: Error }; - DolphinViewContainer(const KUrl& url, QWidget* parent); + DolphinViewContainer(const QUrl& url, QWidget* parent); virtual ~DolphinViewContainer(); /** * Returns the current active URL, where all actions are applied. * The URL navigator is synchronized with this URL. */ - KUrl url() const; + QUrl url() const; /** * If \a active is true, the view container will marked as active. The active @@ -137,7 +137,7 @@ public slots: * are emitted. * @see DolphinViewContainer::urlNavigator() */ - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); /** * Popups the filter bar above the status bar if \a visible is true. @@ -204,7 +204,7 @@ private slots: * Is called if the URL set by DolphinView::setUrl() represents * a file and not a directory. Takes care to activate the file. */ - void slotUrlIsFileError(const KUrl& url); + void slotUrlIsFileError(const QUrl& url); /** * Handles clicking on an item. If the item is a directory, the @@ -243,19 +243,19 @@ private slots: * Is invoked if the signal urlAboutToBeChanged() from the DolphinView * is emitted. Tries to save the view-state. */ - void slotViewUrlAboutToBeChanged(const KUrl& url); + void slotViewUrlAboutToBeChanged(const QUrl& url); /** * Is invoked if the signal urlAboutToBeChanged() from the URL navigator * is emitted. Tries to save the view-state. */ - void slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url); + void slotUrlNavigatorLocationAboutToBeChanged(const QUrl& url); /** * Restores the current view to show \a url and assures * that the root URL of the view is respected. */ - void slotUrlNavigatorLocationChanged(const KUrl& url); + void slotUrlNavigatorLocationChanged(const QUrl& url); /** * Is connected with the URL navigator and drops the URLs @@ -264,7 +264,7 @@ private slots: * Creates a copy of \a event and invokes \a dropUrlsDelayed with a * queued connection. */ - void dropUrls(const KUrl& destination, QDropEvent* event); + void dropUrls(const QUrl& destination, QDropEvent* event); /** * Is invoked with a queued connection by \a dropUrls to prevent that the @@ -280,7 +280,7 @@ private slots: * URL of the URL navigator to \a newUrl without triggering * a reloading of the directory. */ - void redirect(const KUrl& oldUrl, const KUrl& newUrl); + void redirect(const QUrl& oldUrl, const QUrl& newUrl); /** Requests the focus for the view \a m_view. */ void requestFocus(); @@ -318,7 +318,7 @@ private: /** * @return True if the URL protocol is a search URL (e. g. baloosearch:// or filenamesearch://). */ - bool isSearchUrl(const KUrl& url) const; + bool isSearchUrl(const QUrl& url) const; /** * Saves the state of the current view: contents position, @@ -341,7 +341,7 @@ private: QElapsedTimer m_statusBarTimestamp; // Time in ms since last update bool m_autoGrabFocus; - KUrl m_dropDestination; + QUrl m_dropDestination; QScopedPointer m_dropEvent; #ifdef KF5Activities_FOUND diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 524b4f59a..711b0797b 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -189,8 +189,9 @@ bool KFileItemModel::setData(int index, const QHash& value m_itemData[index]->values = currentValues; if (changedRoles.contains("text")) { - KUrl url = m_itemData[index]->item.url(); - url.setFileName(currentValues["text"].toString()); + QUrl url = m_itemData[index]->item.url(); + url = url.adjusted(QUrl::RemoveFilename); + url.setPath(url.path() + currentValues["text"].toString()); m_itemData[index]->item.setUrl(url); } @@ -243,8 +244,8 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const // The following code has been taken from KDirModel::mimeData() // (kdelibs/kio/kio/kdirmodel.cpp) // Copyright (C) 2006 David Faure - KUrl::List urls; - KUrl::List mostLocalUrls; + QList urls; + QList mostLocalUrls; bool canUseMostLocalUrls = true; const ItemData* lastAddedItem = 0; @@ -276,9 +277,9 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const const bool different = canUseMostLocalUrls && mostLocalUrls != urls; if (different) { - urls.populateMimeData(mostLocalUrls, data); + data->setUrls(mostLocalUrls); } else { - urls.populateMimeData(data); + data->setUrls(urls); } return data; @@ -369,8 +370,7 @@ int KFileItemModel::index(const KFileItem& item) const int KFileItemModel::index(const QUrl& url) const { - KUrl urlToFind = url; - urlToFind.adjustPath(KUrl::RemoveTrailingSlash); + const QUrl urlToFind = url.adjusted(QUrl::StripTrailingSlash); const int itemCount = m_itemData.count(); int itemsInHash = m_items.count(); @@ -388,7 +388,7 @@ int KFileItemModel::index(const QUrl& url) const const int blockSize = 1000; const int currentBlockEnd = qMin(itemsInHash + blockSize, itemCount); for (int i = itemsInHash; i < currentBlockEnd; ++i) { - const KUrl nextUrl = m_itemData.at(i)->item.url(); + const QUrl nextUrl = m_itemData.at(i)->item.url(); m_items.insert(nextUrl, i); } @@ -412,12 +412,12 @@ int KFileItemModel::index(const QUrl& url) const kWarning() << "m_itemData.count() ==" << m_itemData.count(); // Check if there are multiple items with the same URL. - QMultiHash indexesForUrl; + QMultiHash indexesForUrl; for (int i = 0; i < m_itemData.count(); ++i) { indexesForUrl.insert(m_itemData.at(i)->item.url(), i); } - foreach (const KUrl& url, indexesForUrl.uniqueKeys()) { + foreach (const QUrl& url, indexesForUrl.uniqueKeys()) { if (indexesForUrl.count(url) > 1) { kWarning() << "Multiple items found with the URL" << url; foreach (int index, indexesForUrl.values(url)) { @@ -511,15 +511,15 @@ bool KFileItemModel::setExpanded(int index, bool expanded) } const KFileItem item = m_itemData.at(index)->item; - const KUrl url = item.url(); - const KUrl targetUrl = item.targetUrl(); + const QUrl url = item.url(); + const QUrl targetUrl = item.targetUrl(); if (expanded) { m_expandedDirs.insert(targetUrl, url); m_dirLister->openUrl(url, KDirLister::Keep); - const KUrl::List previouslyExpandedChildren = m_itemData.at(index)->values.value("previouslyExpandedChildren").value(); - foreach (const KUrl& url, previouslyExpandedChildren) { - m_urlsToExpand.insert(url); + const QVariantList previouslyExpandedChildren = m_itemData.at(index)->values.value("previouslyExpandedChildren").value(); + foreach (const QVariant& var, previouslyExpandedChildren) { + m_urlsToExpand.insert(var.toUrl()); } } else { // Note that there might be (indirect) children of the folder which is to be collapsed in @@ -541,14 +541,14 @@ bool KFileItemModel::setExpanded(int index, bool expanded) const int itemCount = m_itemData.count(); const int firstChildIndex = index + 1; - KUrl::List expandedChildren; + QVariantList expandedChildren; int childIndex = firstChildIndex; while (childIndex < itemCount && expandedParentsCount(childIndex) > parentLevel) { ItemData* itemData = m_itemData.at(childIndex); if (itemData->values.value("isExpanded").toBool()) { - const KUrl targetUrl = itemData->item.targetUrl(); - const KUrl url = itemData->item.url(); + const QUrl targetUrl = itemData->item.targetUrl(); + const QUrl url = itemData->item.url(); m_expandedDirs.remove(targetUrl); m_dirLister->stop(url); // TODO: try to unit-test this, see https://bugs.kde.org/show_bug.cgi?id=332102#c11 expandedChildren.append(targetUrl); @@ -610,10 +610,10 @@ void KFileItemModel::expandParentDirectories(const QUrl &url) // expanded is added to m_urlsToExpand. KDirLister // does not care whether the parent-URL has already been // expanded. - KUrl urlToExpand = m_dirLister->url(); + QUrl urlToExpand = m_dirLister->url(); const QStringList subDirs = url.path().mid(pos).split(QDir::separator()); for (int i = 0; i < subDirs.count() - 1; ++i) { - urlToExpand.addPath(subDirs.at(i)); + urlToExpand.setPath(urlToExpand.path() + '/' + subDirs.at(i)); m_urlsToExpand.insert(urlToExpand); } @@ -801,7 +801,7 @@ void KFileItemModel::resortAllItems() // Remember the order of the current URLs so // that it can be determined which indexes have // been moved because of the resorting. - QList oldUrls; + QList oldUrls; oldUrls.reserve(itemCount); foreach (const ItemData* itemData, m_itemData) { oldUrls.append(itemData->item.url()); @@ -870,7 +870,7 @@ void KFileItemModel::slotCompleted() // Note that the parent folder must be expanded before any of its subfolders become visible. // Therefore, some URLs in m_restoredExpandedUrls might not be visible yet // -> we expand the first visible URL we find in m_restoredExpandedUrls. - foreach (const KUrl& url, m_urlsToExpand) { + foreach (const QUrl& url, m_urlsToExpand) { const int indexForUrl = index(url); if (indexForUrl >= 0) { m_urlsToExpand.remove(url); @@ -902,12 +902,11 @@ void KFileItemModel::slotItemsAdded(const QUrl &directoryUrl, const KFileItemLis { Q_ASSERT(!items.isEmpty()); - KUrl parentUrl; + QUrl parentUrl; if (m_expandedDirs.contains(directoryUrl)) { parentUrl = m_expandedDirs.value(directoryUrl); } else { - parentUrl = directoryUrl; - parentUrl.adjustPath(KUrl::RemoveTrailingSlash); + parentUrl = directoryUrl.adjusted(QUrl::StripTrailingSlash); } if (m_requestRole[ExpandedParentsCountRole]) { @@ -916,7 +915,7 @@ void KFileItemModel::slotItemsAdded(const QUrl &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(KUrl(items.first().url())) >= 0) { + if (index(items.first().url()) >= 0) { // The items are already part of the model. return; } @@ -1202,7 +1201,7 @@ void KFileItemModel::insertItems(QList& newItems) } // The indexes in m_items are not correct anymore. Therefore, we clear m_items. - // It will be re-populated with the updated indices if index(const KUrl&) is called. + // It will be re-populated with the updated indices if index(const QUrl&) is called. m_items.clear(); emit itemsInserted(itemRanges); @@ -1255,13 +1254,13 @@ void KFileItemModel::removeItems(const KItemRangeList& itemRanges, RemoveItemsBe m_itemData.erase(m_itemData.end() - removedItemsCount, m_itemData.end()); // The indexes in m_items are not correct anymore. Therefore, we clear m_items. - // It will be re-populated with the updated indices if index(const KUrl&) is called. + // It will be re-populated with the updated indices if index(const QUrl&) is called. m_items.clear(); emit itemsRemoved(itemRanges); } -QList KFileItemModel::createItemDataList(const KUrl& parentUrl, const KFileItemList& items) const +QList KFileItemModel::createItemDataList(const QUrl& parentUrl, const KFileItemList& items) const { if (m_sortRole == TypeRole) { // Try to resolve the MIME-types synchronously to prevent a reordering of @@ -2200,7 +2199,7 @@ QByteArray KFileItemModel::sharedValue(const QByteArray& value) bool KFileItemModel::isConsistent() const { // m_items may contain less items than m_itemData because m_items - // is populated lazily, see KFileItemModel::index(const KUrl& url). + // is populated lazily, see KFileItemModel::index(const QUrl& url). if (m_items.count() > m_itemData.count()) { return false; } diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index aea0341ea..1a4f6928e 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -317,7 +317,7 @@ private: * Note that the ItemData instances are created dynamically and * must be deleted by the caller. */ - QList createItemDataList(const KUrl& parentUrl, const KFileItemList& items) const; + QList createItemDataList(const QUrl& parentUrl, const KFileItemList& items) const; /** * Prepares the items for sorting. Normally, the hash 'values' in ItemData is filled @@ -470,11 +470,11 @@ private: QList m_itemData; - // m_items is a cache for the method index(const KUrl&). If it contains N + // m_items is a cache for the method index(const QUrl&). If it contains N // entries, it is guaranteed that these correspond to the first N items in // the model, i.e., that (for every i between 0 and N - 1) // m_items.value(fileItem(i).url()) == i - mutable QHash m_items; + mutable QHash m_items; KFileItemModelFilter m_filter; QHash m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter() diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 8e9b9dd98..2353f106f 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -741,7 +741,7 @@ void KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived(const QStrin const bool getIsExpandableRole = m_roles.contains("isExpandable"); if (getSizeRole || getIsExpandableRole) { - const int index = m_model->index(KUrl(path)); + const int index = m_model->index(QUrl::fromLocalFile(path)); if (index >= 0) { QHash data; diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 9a08a53db..ec48f19db 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -680,7 +680,7 @@ void KStandardItemListWidget::dataChanged(const QHash& cur // The URL might have changed (i.e., if the sort order of the items has // been changed). Therefore, the "is cut" state must be updated. KFileItemClipboard* clipboard = KFileItemClipboard::instance(); - const KUrl itemUrl = data().value("url").value(); + const QUrl itemUrl = data().value("url").value(); m_isCut = clipboard->isCut(itemUrl); // The icon-state might depend from other roles and hence is @@ -831,7 +831,7 @@ void KStandardItemListWidget::showEvent(QShowEvent* event) // Listen to changes of the clipboard to mark the item as cut/uncut KFileItemClipboard* clipboard = KFileItemClipboard::instance(); - const KUrl itemUrl = data().value("url").value(); + const QUrl itemUrl = data().value("url").value(); m_isCut = clipboard->isCut(itemUrl); connect(clipboard, &KFileItemClipboard::cutItemsChanged, @@ -848,7 +848,7 @@ void KStandardItemListWidget::hideEvent(QHideEvent* event) void KStandardItemListWidget::slotCutItemsChanged() { - const KUrl itemUrl = data().value("url").value(); + const QUrl itemUrl = data().value("url").value(); const bool isCut = KFileItemClipboard::instance()->isCut(itemUrl); if (m_isCut != isCut) { m_isCut = isCut; diff --git a/src/kitemviews/private/kdirectorycontentscounter.cpp b/src/kitemviews/private/kdirectorycontentscounter.cpp index cd448e233..af7312ad2 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.cpp +++ b/src/kitemviews/private/kdirectorycontentscounter.cpp @@ -122,7 +122,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count) void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path) { - const int index = m_model->index(KUrl(path)); + const int index = m_model->index(QUrl::fromLocalFile(path)); if (index >= 0) { if (!m_model->fileItem(index).isDir()) { // If INotify is used, KDirWatch issues the dirty() signal @@ -151,7 +151,7 @@ void KDirectoryContentsCounter::slotItemsRemoved() QMutableSetIterator it(m_watchedDirs); while (it.hasNext()) { const QString& path = it.next(); - if (m_model->index(KUrl(path)) < 0) { + if (m_model->index(QUrl::fromLocalFile(path)) < 0) { m_dirWatcher->removeDir(path); it.remove(); } @@ -181,4 +181,4 @@ void KDirectoryContentsCounter::startWorker(const QString& path) } QThread* KDirectoryContentsCounter::m_workerThread = 0; -int KDirectoryContentsCounter::m_workersCount = 0; \ No newline at end of file +int KDirectoryContentsCounter::m_workersCount = 0; diff --git a/src/kitemviews/private/kfileitemclipboard.cpp b/src/kitemviews/private/kfileitemclipboard.cpp index 1fb147716..e12767853 100644 --- a/src/kitemviews/private/kfileitemclipboard.cpp +++ b/src/kitemviews/private/kfileitemclipboard.cpp @@ -19,17 +19,17 @@ #include "kfileitemclipboard.h" -#include #include #include #include +#include class KFileItemClipboardSingleton { public: KFileItemClipboard instance; }; -K_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard) +Q_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard) @@ -38,12 +38,12 @@ KFileItemClipboard* KFileItemClipboard::instance() return &s_KFileItemClipboard->instance; } -bool KFileItemClipboard::isCut(const KUrl& url) const +bool KFileItemClipboard::isCut(const QUrl& url) const { return m_cutItems.contains(url); } -QList KFileItemClipboard::cutItems() const +QList KFileItemClipboard::cutItems() const { return m_cutItems.toList(); } @@ -66,7 +66,7 @@ void KFileItemClipboard::updateCutItems() const QByteArray data = mimeData->data("application/x-kde-cutselection"); const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1')); if (isCutSelection) { - m_cutItems = KUrl::List::fromMimeData(mimeData).toSet(); + m_cutItems = KUrlMimeData::urlsFromMimeData(mimeData).toSet(); } else { m_cutItems.clear(); } @@ -82,4 +82,3 @@ KFileItemClipboard::KFileItemClipboard() : connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KFileItemClipboard::updateCutItems); } - diff --git a/src/kitemviews/private/kfileitemclipboard.h b/src/kitemviews/private/kfileitemclipboard.h index 86eb8e9fc..d02fc0d47 100644 --- a/src/kitemviews/private/kfileitemclipboard.h +++ b/src/kitemviews/private/kfileitemclipboard.h @@ -20,7 +20,7 @@ #ifndef KFILEITEMCLIPBOARD_H #define KFILEITEMCLIPBOARD_H -#include +#include #include #include #include @@ -38,9 +38,9 @@ class LIBDOLPHINPRIVATE_EXPORT KFileItemClipboard : public QObject public: static KFileItemClipboard* instance(); - bool isCut(const KUrl& url) const; + bool isCut(const QUrl& url) const; - QList cutItems() const; + QList cutItems() const; signals: void cutItemsChanged(); @@ -54,7 +54,7 @@ private slots: private: KFileItemClipboard(); - QSet m_cutItems; + QSet m_cutItems; friend class KFileItemClipboardSingleton; }; diff --git a/src/kitemviews/private/kfileitemmodeldirlister.h b/src/kitemviews/private/kfileitemmodeldirlister.h index da01d20bd..94a0e39fd 100644 --- a/src/kitemviews/private/kfileitemmodeldirlister.h +++ b/src/kitemviews/private/kfileitemmodeldirlister.h @@ -22,7 +22,7 @@ #include #include -#include +#include /** * @brief Extends the class KDirLister by emitting a signal when an @@ -45,7 +45,7 @@ signals: * Is emitted when the URL of the directory lister represents a file. * In this case no signal errorMessage() will be emitted. */ - void urlIsFileError(const KUrl& url); + void urlIsFileError(const QUrl& url); protected: virtual void handleError(KIO::Job* job); diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index afeeb64a9..5bfc88c2a 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -108,7 +108,7 @@ void FoldersPanel::rename(const KFileItem& item) bool FoldersPanel::urlChanged() { - if (!url().isValid() || url().protocol().contains("search")) { + if (!url().isValid() || url().scheme().contains("search")) { // Skip results shown by a search, as possible identical // directory names are useless without parent-path information. return false; @@ -296,13 +296,13 @@ void FoldersPanel::startFadeInAnimation() anim->setDuration(200); } -void FoldersPanel::loadTree(const KUrl& url) +void FoldersPanel::loadTree(const QUrl& url) { Q_ASSERT(m_controller); m_updateCurrentItem = false; - KUrl baseUrl; + QUrl baseUrl; if (url.isLocalFile()) { // Use the root directory as base for local URLs (#150941) baseUrl = QDir::rootPath(); diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h index 1d3039d1f..2cbd28f28 100644 --- a/src/panels/folders/folderspanel.h +++ b/src/panels/folders/folderspanel.h @@ -20,7 +20,7 @@ #ifndef FOLDERSPANEL_H #define FOLDERSPANEL_H -#include +#include #include class KFileItemModel; @@ -51,8 +51,8 @@ public: void rename(const KFileItem& item); signals: - void folderActivated(const KUrl& url); - void folderMiddleClicked(const KUrl& url); + void folderActivated(const QUrl& url); + void folderMiddleClicked(const QUrl& url); void errorMessage(const QString& error); protected: @@ -87,7 +87,7 @@ private: * directories until \a url. * @param url URL of the leaf directory that should get expanded. */ - void loadTree(const KUrl& url); + void loadTree(const QUrl& url); /** * Sets the item with the index \a index as current item, selects diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 330e18560..4afe9e8e3 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -92,7 +92,7 @@ void TreeViewContextMenu::open() KConfigGroup configGroup(globalConfig, "KDE"); bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false); - const KUrl url = m_fileItem.url(); + const QUrl url = m_fileItem.url(); if (url.isLocalFile()) { QAction* moveToTrashAction = new QAction(QIcon::fromTheme("user-trash"), i18nc("@action:inmenu", "Move to Trash"), this); @@ -155,9 +155,9 @@ void TreeViewContextMenu::open() void TreeViewContextMenu::populateMimeData(QMimeData* mimeData, bool cut) { - KUrl::List kdeUrls; + QList kdeUrls; kdeUrls.append(m_fileItem.url()); - KUrl::List mostLocalUrls; + QList mostLocalUrls; bool dummy; mostLocalUrls.append(m_fileItem.mostLocalUrl(dummy)); KIO::setClipboardDataCut(mimeData, cut); @@ -190,12 +190,12 @@ void TreeViewContextMenu::rename() void TreeViewContextMenu::moveToTrash() { - KUrl::List list = KUrl::List() << m_fileItem.url(); + const QList list {QList() << m_fileItem.url()}; KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(m_parent); if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) { KIO::Job* job = KIO::trash(list); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job); + KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl("trash:/"), job); KJobWidgets::setWindow(job, m_parent); job->ui()->setAutoErrorHandlingEnabled(true); } @@ -203,7 +203,7 @@ void TreeViewContextMenu::moveToTrash() void TreeViewContextMenu::deleteItem() { - KUrl::List list = KUrl::List() << m_fileItem.url(); + const QList list {QList() << m_fileItem.url()}; KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(m_parent); if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) { diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index 5c4da7fbc..3d7a05f03 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -213,7 +213,7 @@ void InformationPanel::slotInfoTimeout() void InformationPanel::reset() { if (m_invalidUrlCandidate == m_shownUrl) { - m_invalidUrlCandidate = KUrl(); + m_invalidUrlCandidate = QUrl(); // The current URL is still invalid. Reset // the content to show the directory URL. @@ -226,11 +226,11 @@ void InformationPanel::reset() void InformationPanel::slotFileRenamed(const QString& source, const QString& dest) { - if (m_shownUrl == KUrl(source)) { - m_shownUrl = KUrl(dest); + if (m_shownUrl == QUrl::fromLocalFile(source)) { + m_shownUrl = QUrl::fromLocalFile(dest); m_fileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl); - if ((m_selection.count() == 1) && (m_selection[0].url() == KUrl(source))) { + if ((m_selection.count() == 1) && (m_selection[0].url() == QUrl::fromLocalFile(source))) { m_selection[0] = m_fileItem; // Implementation note: Updating the selection is only required if exactly one // item is selected, as the name of the item is shown. If this should change @@ -244,10 +244,10 @@ void InformationPanel::slotFileRenamed(const QString& source, const QString& des void InformationPanel::slotFilesAdded(const QString& directory) { - if (m_shownUrl == KUrl(directory)) { + if (m_shownUrl == QUrl::fromLocalFile(directory)) { // If the 'trash' icon changes because the trash has been emptied or got filled, // the signal filesAdded("trash:/") will be emitted. - KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory)); + KFileItem item(KFileItem::Unknown, KFileItem::Unknown, QUrl::fromLocalFile(directory)); requestDelayedItemInfo(item); } } @@ -255,7 +255,7 @@ void InformationPanel::slotFilesAdded(const QString& directory) void InformationPanel::slotFilesChanged(const QStringList& files) { foreach (const QString& fileName, files) { - if (m_shownUrl == KUrl(fileName)) { + if (m_shownUrl == QUrl::fromLocalFile(fileName)) { showItemInfo(); break; } @@ -265,7 +265,7 @@ void InformationPanel::slotFilesChanged(const QStringList& files) void InformationPanel::slotFilesRemoved(const QStringList& files) { foreach (const QString& fileName, files) { - if (m_shownUrl == KUrl(fileName)) { + if (m_shownUrl == QUrl::fromLocalFile(fileName)) { // the currently shown item has been removed, show // the parent directory as fallback markUrlAsInvalid(); @@ -276,15 +276,15 @@ void InformationPanel::slotFilesRemoved(const QStringList& files) void InformationPanel::slotEnteredDirectory(const QString& directory) { - if (m_shownUrl == KUrl(directory)) { - KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory)); + if (m_shownUrl == QUrl::fromLocalFile(directory)) { + KFileItem item(KFileItem::Unknown, KFileItem::Unknown, QUrl::fromLocalFile(directory)); requestDelayedItemInfo(item); } } void InformationPanel::slotLeftDirectory(const QString& directory) { - if (m_shownUrl == KUrl(directory)) { + if (m_shownUrl == QUrl::fromLocalFile(directory)) { // The signal 'leftDirectory' is also emitted when a media // has been unmounted. In this case no directory change will be // done in Dolphin, but the Information Panel must be updated to @@ -308,9 +308,9 @@ void InformationPanel::cancelRequest() m_urlCandidate.clear(); } -bool InformationPanel::isEqualToShownUrl(const KUrl& url) const +bool InformationPanel::isEqualToShownUrl(const QUrl& url) const { - return m_shownUrl.equals(url, KUrl::CompareWithoutTrailingSlash); + return m_shownUrl.matches(url, QUrl::StripTrailingSlash); } void InformationPanel::markUrlAsInvalid() diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h index 8a1237b95..9a1e6351d 100644 --- a/src/panels/information/informationpanel.h +++ b/src/panels/information/informationpanel.h @@ -40,7 +40,7 @@ public: virtual ~InformationPanel(); signals: - void urlActivated(const KUrl& url); + void urlActivated(const QUrl& url); public slots: /** @@ -116,7 +116,7 @@ private: /** * Returns true, if \a url is equal to the shown URL m_shownUrl. */ - bool isEqualToShownUrl(const KUrl& url) const; + bool isEqualToShownUrl(const QUrl& url) const; /** * Marks the URL as invalid and will reset the Information Panel @@ -136,17 +136,17 @@ private: QTimer* m_resetUrlTimer; // URL that is currently shown in the Information Panel. - KUrl m_shownUrl; + QUrl m_shownUrl; // URL candidate that will replace m_shownURL after a delay. // Used to remember URLs when hovering items. - KUrl m_urlCandidate; + QUrl m_urlCandidate; // URL candidate that is marked as invalid (e. g. because the directory // has been deleted or the shown item has been renamed). The Information // Panel will be reset asynchronously to prevent unnecessary resets when // a directory has been changed. - KUrl m_invalidUrlCandidate; + QUrl m_invalidUrlCandidate; KFileItem m_fileItem; // file item for m_shownUrl if available (otherwise null) KFileItemList m_selection; diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index ce138baee..4e32a7974 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -169,8 +169,8 @@ void InformationPanelContent::showItem(const KFileItem& item) m_previewJob->kill(); } - const KUrl itemUrl = item.url(); - const bool isSearchUrl = itemUrl.protocol().contains("search") && item.localPath().isEmpty(); + const QUrl itemUrl = item.url(); + const bool isSearchUrl = itemUrl.scheme().contains("search") && item.localPath().isEmpty(); if (!applyPlace(itemUrl)) { setNameLabelText(item.text()); if (isSearchUrl) { @@ -370,12 +370,12 @@ void InformationPanelContent::refreshMetaData() } } -bool InformationPanelContent::applyPlace(const KUrl& url) +bool InformationPanelContent::applyPlace(const QUrl& url) { const int count = m_placesItemModel->count(); for (int i = 0; i < count; ++i) { const PlacesItem* item = m_placesItemModel->placesItem(i); - if (item->url().equals(url, KUrl::CompareWithoutTrailingSlash)) { + if (item->url().matches(url, QUrl::StripTrailingSlash)) { setNameLabelText(item->text()); m_preview->setPixmap(QIcon::fromTheme(item->icon()).pixmap(128, 128)); return true; diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h index 6e4faec82..f4103853e 100644 --- a/src/panels/information/informationpanelcontent.h +++ b/src/panels/information/informationpanelcontent.h @@ -22,7 +22,7 @@ #include "config-baloo.h" #include -#include +#include #include #include @@ -81,7 +81,7 @@ public: void configureSettings(const QList& customContextMenuActions); signals: - void urlActivated( const KUrl& url ); + void urlActivated( const QUrl& url ); protected: /** @see QObject::eventFilter() */ @@ -121,7 +121,7 @@ private: * @return True, if the URL represents exactly a place. * @param url The url to check. */ - bool applyPlace(const KUrl& url); + bool applyPlace(const QUrl& url); /** * Sets the text for the label \a m_nameLabel and assures that the diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index 27cd3e746..0de587bf8 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include class EmbeddedVideoPlayer : public Phonon::VideoWidget @@ -73,7 +73,7 @@ PhononWidget::PhononWidget(QWidget *parent) { } -void PhononWidget::setUrl(const KUrl &url) +void PhononWidget::setUrl(const QUrl &url) { if (m_url != url) { stop(); // emits playingStopped() signal @@ -81,7 +81,7 @@ void PhononWidget::setUrl(const KUrl &url) } } -KUrl PhononWidget::url() const +QUrl PhononWidget::url() const { return m_url; } diff --git a/src/panels/information/phononwidget.h b/src/panels/information/phononwidget.h index b5aedfe4f..09b4ee26f 100644 --- a/src/panels/information/phononwidget.h +++ b/src/panels/information/phononwidget.h @@ -21,8 +21,7 @@ #ifndef PHONONWIDGET_H #define PHONONWIDGET_H -#include - +#include #include #include @@ -46,8 +45,8 @@ class PhononWidget : public QWidget public: PhononWidget(QWidget *parent = 0); - void setUrl(const KUrl &url); - KUrl url() const; + void setUrl(const QUrl &url); + QUrl url() const; void setVideoSize(const QSize& size); QSize videoSize() const; @@ -77,7 +76,7 @@ class PhononWidget : public QWidget void applyVideoSize(); private: - KUrl m_url; + QUrl m_url; QSize m_videoSize; QToolButton *m_playButton; diff --git a/src/panels/panel.cpp b/src/panels/panel.cpp index 767313445..348191c98 100644 --- a/src/panels/panel.cpp +++ b/src/panels/panel.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "panel.h" -#include +#include Panel::Panel(QWidget* parent) : QWidget(parent), @@ -32,7 +32,7 @@ Panel::~Panel() { } -KUrl Panel::url() const +QUrl Panel::url() const { return m_url; } @@ -57,13 +57,13 @@ QSize Panel::sizeHint() const return QSize(180, 180); } -void Panel::setUrl(const KUrl& url) +void Panel::setUrl(const QUrl& url) { - if (url.equals(m_url, KUrl::CompareWithoutTrailingSlash)) { + if (url.matches(m_url, QUrl::StripTrailingSlash)) { return; } - const KUrl oldUrl = m_url; + const QUrl oldUrl = m_url; m_url = url; const bool accepted = urlChanged(); if (!accepted) { diff --git a/src/panels/panel.h b/src/panels/panel.h index b2562dd6b..f43ebe9d9 100644 --- a/src/panels/panel.h +++ b/src/panels/panel.h @@ -22,7 +22,7 @@ #define PANEL_H #include -#include +#include /** * @brief Base widget for all panels that can be docked on the window borders. @@ -39,7 +39,7 @@ public: virtual ~Panel(); /** Returns the current set URL of the active Dolphin view. */ - KUrl url() const; + QUrl url() const; /** * Sets custom context menu actions that are added to the panel specific @@ -57,7 +57,7 @@ public slots: * This is invoked every time the folder being displayed in the * active Dolphin view changes. */ - void setUrl(const KUrl& url); + void setUrl(const QUrl &url); /** * Refreshes the view to get synchronized with the settings. @@ -75,7 +75,7 @@ protected: virtual bool urlChanged() = 0; private: - KUrl m_url; + QUrl m_url; QList m_customContextMenuActions; }; diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index edfe02343..b1f62b982 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -51,16 +51,16 @@ PlacesItem::~PlacesItem() delete m_trashDirLister; } -void PlacesItem::setUrl(const KUrl& url) +void PlacesItem::setUrl(const QUrl &url) { // The default check in KStandardItem::setDataValue() // for equal values does not work with a custom value - // like KUrl. Hence do a manual check to prevent that + // like QUrl. Hence do a manual check to prevent that // setting an equal URL results in an itemsChanged() // signal. - if (dataValue("url").value() != url) { + if (dataValue("url").value() != url) { delete m_trashDirLister; - if (url.protocol() == QLatin1String("trash")) { + if (url.scheme() == QLatin1String("trash")) { // The trash icon must always be updated dependent on whether // the trash is empty or not. We use a KDirLister that automatically // watches for changes if the number of items has been changed. @@ -77,9 +77,9 @@ void PlacesItem::setUrl(const KUrl& url) } } -KUrl PlacesItem::url() const +QUrl PlacesItem::url() const { - return dataValue("url").value(); + return dataValue("url").value(); } void PlacesItem::setUdi(const QString& udi) @@ -170,7 +170,7 @@ KBookmark PlacesItem::bookmark() const PlacesItem::GroupType PlacesItem::groupType() const { if (udi().isEmpty()) { - const QString protocol = url().protocol(); + const QString protocol = url().scheme(); if (protocol == QLatin1String("timeline")) { return RecentlySavedType; } @@ -196,7 +196,7 @@ bool PlacesItem::storageSetupNeeded() const KBookmark PlacesItem::createBookmark(KBookmarkManager* manager, const QString& text, - const KUrl& url, + const QUrl& url, const QString& iconName) { KBookmarkGroup root = manager->root(); diff --git a/src/panels/places/placesitem.h b/src/panels/places/placesitem.h index 4c636ec63..0bb116e57 100644 --- a/src/panels/places/placesitem.h +++ b/src/panels/places/placesitem.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -51,8 +51,8 @@ public: explicit PlacesItem(const KBookmark& bookmark, PlacesItem* parent = 0); virtual ~PlacesItem(); - void setUrl(const KUrl& url); - KUrl url() const; + void setUrl(const QUrl& url); + QUrl url() const; void setUdi(const QString& udi); QString udi() const; @@ -74,7 +74,7 @@ public: static KBookmark createBookmark(KBookmarkManager* manager, const QString& text, - const KUrl& url, + const QUrl& url, const QString& iconName); static KBookmark createDeviceBookmark(KBookmarkManager* manager, const QString& udi); diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 0fae3f248..257d06833 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -72,18 +72,18 @@ QString PlacesItemEditDialog::text() const { QString text = m_textEdit->text(); if (text.isEmpty()) { - const KUrl url = m_urlEdit->url(); - text = url.fileName().isEmpty() ? url.prettyUrl() : url.fileName(); + const QUrl url = m_urlEdit->url(); + text = url.fileName().isEmpty() ? url.toDisplayString(QUrl::PreferLocalFile) : url.fileName(); } return text; } -void PlacesItemEditDialog::setUrl(const KUrl& url) +void PlacesItemEditDialog::setUrl(const QUrl& url) { m_url = url; } -KUrl PlacesItemEditDialog::url() const +QUrl PlacesItemEditDialog::url() const { return m_urlEdit->url(); } @@ -142,7 +142,7 @@ void PlacesItemEditDialog::initialize() m_textEdit->setText(m_text); m_textEdit->setClickMessage(i18n("Enter descriptive label here")); - m_urlEdit = new KUrlRequester(m_url.prettyUrl(), mainWidget); + m_urlEdit = new KUrlRequester(m_url, mainWidget); m_urlEdit->setMode(KFile::Directory); formLayout->addRow(i18nc("@label", "Location:"), m_urlEdit); // Provide room for at least 40 chars (average char width is half of height) diff --git a/src/panels/places/placesitemeditdialog.h b/src/panels/places/placesitemeditdialog.h index 3944b5a35..53e62379d 100644 --- a/src/panels/places/placesitemeditdialog.h +++ b/src/panels/places/placesitemeditdialog.h @@ -25,7 +25,7 @@ #define PLACESITEMEDITDIALOG_H #include -#include +#include class KIconButton; class KLineEdit; @@ -47,8 +47,8 @@ public: void setText(const QString& text); QString text() const; - void setUrl(const KUrl& url); - KUrl url() const; + void setUrl(const QUrl& url); + QUrl url() const; void setAllowGlobal(bool allow); bool allowGlobal() const; @@ -65,7 +65,7 @@ private: private: QString m_icon; QString m_text; - KUrl m_url; + QUrl m_url; bool m_allowGlobal; KUrlRequester* m_urlEdit; diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 14d97de5b..e49a6a9da 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -120,7 +121,7 @@ PlacesItemModel::~PlacesItemModel() } PlacesItem* PlacesItemModel::createPlacesItem(const QString& text, - const KUrl& url, + const QUrl& url, const QString& iconName) { const KBookmark bookmark = PlacesItem::createBookmark(m_bookmarkManager, text, url, iconName); @@ -206,15 +207,15 @@ bool PlacesItemModel::hiddenItemsShown() const return m_hiddenItemsShown; } -int PlacesItemModel::closestItem(const KUrl& url) const +int PlacesItemModel::closestItem(const QUrl& url) const { int foundIndex = -1; int maxLength = 0; for (int i = 0; i < count(); ++i) { - const KUrl itemUrl = placesItem(i)->url(); + const QUrl itemUrl = placesItem(i)->url(); if (itemUrl.isParentOf(url)) { - const int length = itemUrl.prettyUrl().length(); + const int length = itemUrl.toDisplayString().length(); if (length > maxLength) { foundIndex = i; maxLength = length; @@ -368,13 +369,13 @@ void PlacesItemModel::requestStorageSetup(int index) QMimeData* PlacesItemModel::createMimeData(const KItemSet& indexes) const { - KUrl::List urls; + QList urls; QByteArray itemData; QDataStream stream(&itemData, QIODevice::WriteOnly); foreach (int index, indexes) { - const KUrl itemUrl = placesItem(index)->url(); + const QUrl itemUrl = placesItem(index)->url(); if (itemUrl.isValid()) { urls << itemUrl; } @@ -383,7 +384,7 @@ QMimeData* PlacesItemModel::createMimeData(const KItemSet& indexes) const QMimeData* mimeData = new QMimeData(); if (!urls.isEmpty()) { - urls.populateMimeData(mimeData); + mimeData->setUrls(urls); } mimeData->setData(internalMimeType(), itemData); @@ -424,9 +425,9 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) insertItem(dropIndex, newItem); } else if (mimeData->hasFormat("text/uri-list")) { // One or more items must be added to the model - const KUrl::List urls = KUrl::List::fromMimeData(mimeData); + const QList urls = KUrlMimeData::urlsFromMimeData(mimeData); for (int i = urls.count() - 1; i >= 0; --i) { - const KUrl& url = urls[i]; + const QUrl& url = urls[i]; QString text = url.fileName(); if (text.isEmpty()) { @@ -434,7 +435,7 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) } if ((url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir()) - || url.protocol() == "trash") { + || url.scheme() == "trash") { // Only directories outside the trash are allowed continue; } @@ -446,12 +447,12 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) } } -KUrl PlacesItemModel::convertedUrl(const KUrl& url) +QUrl PlacesItemModel::convertedUrl(const QUrl& url) { - KUrl newUrl = url; - if (url.protocol() == QLatin1String("timeline")) { + QUrl newUrl = url; + if (url.scheme() == QLatin1String("timeline")) { newUrl = createTimelineUrl(url); - } else if (url.protocol() == QLatin1String("search")) { + } else if (url.scheme() == QLatin1String("search")) { newUrl = createSearchUrl(url); } @@ -606,7 +607,7 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error, return; } - if (error) { + if (error != Solid::NoError) { if (errorData.isValid()) { emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2", item->text(), @@ -729,7 +730,7 @@ void PlacesItemModel::loadBookmarks() KBookmark bookmark = root.first(); QSet devices = m_availableDevices; - QSet missingSystemBookmarks; + QSet missingSystemBookmarks; foreach (const SystemBookmarkData& data, m_systemBookmarks) { missingSystemBookmarks.insert(data.url); } @@ -750,7 +751,7 @@ void PlacesItemModel::loadBookmarks() devices.remove(item->udi()); devicesItems.append(item); } else { - const KUrl url = bookmark.url(); + const QUrl url = bookmark.url(); if (missingSystemBookmarks.contains(url)) { missingSystemBookmarks.remove(url); @@ -823,15 +824,15 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark, const QSet& availableDevices) const { const QString udi = bookmark.metaDataItem("UDI"); - const KUrl url = bookmark.url(); + const QUrl url = bookmark.url(); const QString appName = bookmark.metaDataItem("OnlyInApp"); const bool deviceAvailable = availableDevices.contains(udi); const bool allowedHere = (appName.isEmpty() || appName == KGlobal::mainComponent().componentName() || appName == KGlobal::mainComponent().componentName() + AppNamePrefix) - && (m_fileIndexingEnabled || (url.protocol() != QLatin1String("timeline") && - url.protocol() != QLatin1String("search"))); + && (m_fileIndexingEnabled || (url.scheme() != QLatin1String("timeline") && + url.scheme() != QLatin1String("search"))); return (udi.isEmpty() && allowedHere) || deviceAvailable; } @@ -843,7 +844,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da data.url, data.icon); - const QString protocol = data.url.protocol(); + const QString protocol = data.url.scheme(); if (protocol == QLatin1String("timeline") || protocol == QLatin1String("search")) { // As long as the KFilePlacesView from kdelibs is available, the system-bookmarks // for "Recently Saved" and "Search For" should be a setting available only @@ -881,7 +882,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da props.setViewMode(DolphinView::IconsView); props.setPreviewsShown(true); props.setVisibleRoles(QList() << "text"); - } else if (data.url.protocol() == "timeline") { + } else if (data.url.scheme() == "timeline") { props.setViewMode(DolphinView::DetailsView); props.setVisibleRoles(QList() << "text" << "date"); } @@ -900,42 +901,42 @@ void PlacesItemModel::createSystemBookmarks() // i18nc call is done after reading the bookmark. The reason why the i18nc call is not // done here is because otherwise switching the language would not result in retranslating the // bookmarks. - m_systemBookmarks.append(SystemBookmarkData(KUrl(KUser().homeDir()), + m_systemBookmarks.append(SystemBookmarkData(QUrl::fromLocalFile(KUser().homeDir()), "user-home", I18N_NOOP2("KFile System Bookmarks", "Home"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("remote:/"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("remote:/"), "network-workgroup", I18N_NOOP2("KFile System Bookmarks", "Network"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("/"), + m_systemBookmarks.append(SystemBookmarkData(QUrl::fromLocalFile("/"), "folder-red", I18N_NOOP2("KFile System Bookmarks", "Root"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("trash:/"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("trash:/"), "user-trash", I18N_NOOP2("KFile System Bookmarks", "Trash"))); if (m_fileIndexingEnabled) { - m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/today"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/today"), "go-jump-today", I18N_NOOP2("KFile System Bookmarks", "Today"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/yesterday"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/yesterday"), "view-calendar-day", I18N_NOOP2("KFile System Bookmarks", "Yesterday"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/thismonth"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/thismonth"), "view-calendar-month", I18N_NOOP2("KFile System Bookmarks", "This Month"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/lastmonth"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/lastmonth"), "view-calendar-month", I18N_NOOP2("KFile System Bookmarks", "Last Month"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/documents"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/documents"), "folder-txt", I18N_NOOP2("KFile System Bookmarks", "Documents"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/images"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/images"), "folder-image", I18N_NOOP2("KFile System Bookmarks", "Images"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/audio"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/audio"), "folder-sound", I18N_NOOP2("KFile System Bookmarks", "Audio Files"))); - m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/videos"), + m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/videos"), "folder-video", I18N_NOOP2("KFile System Bookmarks", "Videos"))); } @@ -1105,14 +1106,14 @@ bool PlacesItemModel::equalBookmarkIdentifiers(const KBookmark& b1, const KBookm } } -KUrl PlacesItemModel::createTimelineUrl(const KUrl& url) +QUrl PlacesItemModel::createTimelineUrl(const QUrl& url) { // TODO: Clarify with the Baloo-team whether it makes sense // provide default-timeline-URLs like 'yesterday', 'this month' // and 'last month'. - KUrl timelineUrl; + QUrl timelineUrl; - const QString path = url.pathOrUrl(); + const QString path = url.toDisplayString(QUrl::PreferLocalFile); if (path.endsWith(QLatin1String("yesterday"))) { const QDate date = QDate::currentDate().addDays(-1); const int year = date.year(); @@ -1153,12 +1154,12 @@ QString PlacesItemModel::timelineDateString(int year, int month, int day) return date; } -KUrl PlacesItemModel::createSearchUrl(const KUrl& url) +QUrl PlacesItemModel::createSearchUrl(const QUrl& url) { - KUrl searchUrl; + QUrl searchUrl; #ifdef HAVE_BALOO - const QString path = url.pathOrUrl(); + const QString path = url.toDisplayString(QUrl::PreferLocalFile); if (path.endsWith(QLatin1String("documents"))) { searchUrl = searchUrlForType("Document"); } else if (path.endsWith(QLatin1String("images"))) { @@ -1178,7 +1179,7 @@ KUrl PlacesItemModel::createSearchUrl(const KUrl& url) } #ifdef HAVE_BALOO -KUrl PlacesItemModel::searchUrlForType(const QString& type) +QUrl PlacesItemModel::searchUrlForType(const QString& type) { Baloo::Query query; query.addType("File"); diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 4a374e502..229841dc5 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ public: * attributes. */ PlacesItem* createPlacesItem(const QString& text, - const KUrl& url, + const QUrl& url, const QString& iconName = QString()); PlacesItem* placesItem(int index) const; @@ -87,7 +87,7 @@ public: * range of the URL. -1 is returned if no closest item * could be found. */ - int closestItem(const KUrl& url) const; + int closestItem(const QUrl& url) const; /** * Appends the item \a item as last element of the group @@ -121,7 +121,7 @@ public: * the corresponding IO-slave. Virtual URLs for bookmarks are used to * be independent from internal format changes. */ - static KUrl convertedUrl(const KUrl& url); + static QUrl convertedUrl(const QUrl& url); virtual void clear(); signals: @@ -223,7 +223,7 @@ private: /** * @return URL using the timeline-protocol for searching (see convertedUrl()). */ - static KUrl createTimelineUrl(const KUrl& url); + static QUrl createTimelineUrl(const QUrl& url); /** * Helper method for createTimelineUrl(). @@ -237,7 +237,7 @@ private: * for a given term. The URL \a url represents a places-internal * URL like e.g. "search:/documents" (see convertedUrl()). */ - static KUrl createSearchUrl(const KUrl& url); + static QUrl createSearchUrl(const QUrl& url); #ifdef HAVE_BALOO /** @@ -245,7 +245,7 @@ private: * @return URL that can be listed by KIO and results in searching * for the given type */ - static KUrl searchUrlForType(const QString& type); + static QUrl searchUrlForType(const QString& type); #endif #ifdef PLACESITEMMODEL_DEBUG @@ -262,17 +262,17 @@ private: struct SystemBookmarkData { - SystemBookmarkData(const KUrl& url, + SystemBookmarkData(const QUrl& url, const QString& icon, const QString& text) : url(url), icon(icon), text(text) {} - KUrl url; + QUrl url; QString icon; QString text; }; QList m_systemBookmarks; - QHash m_systemBookmarksIndexes; + QHash m_systemBookmarksIndexes; // Contains hidden and unhidden items that are stored as // bookmark (the model itself only contains items that diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 68c7fa558..a84c47480 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -72,7 +72,7 @@ PlacesPanel::~PlacesPanel() bool PlacesPanel::urlChanged() { - if (!url().isValid() || url().protocol().contains("search")) { + if (!url().isValid() || url().scheme().contains("search")) { // Skip results shown by a search, as possible identical // directory names are useless without parent-path information. return false; @@ -185,7 +185,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) mainSeparator = menu.addSeparator(); } } else { - if (item->url() == KUrl("trash:/")) { + if (item->url() == QUrl("trash:/")) { emptyTrashAction = menu.addAction(QIcon::fromTheme("trash-empty"), i18nc("@action:inmenu", "Empty Trash")); emptyTrashAction->setEnabled(item->icon() == "user-trash-full"); menu.addSeparator(); @@ -368,7 +368,7 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even return; } - KUrl destUrl = destItem->url(); + QUrl destUrl = destItem->url(); QDropEvent dropEvent(event->pos().toPoint(), event->possibleActions(), event->mimeData(), @@ -389,7 +389,7 @@ void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success) if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) { if (success) { - KUrl destUrl = m_model->placesItem(index)->url(); + QUrl destUrl = m_model->placesItem(index)->url(); QString error; DragAndDropHelper::dropUrls(KFileItem(), destUrl, m_itemDropEvent, error); @@ -412,7 +412,7 @@ void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* m_model->dropMimeDataBefore(index, event->mimeData()); } -void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent) +void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent) { Q_UNUSED(parent); QString error; @@ -447,7 +447,7 @@ void PlacesPanel::slotStorageSetupDone(int index, bool success) m_triggerStorageSetupButton = Qt::NoButton; } else { setUrl(m_storageSetupFailedUrl); - m_storageSetupFailedUrl = KUrl(); + m_storageSetupFailedUrl = QUrl(); } } @@ -465,7 +465,7 @@ void PlacesPanel::emptyTrash() void PlacesPanel::addEntry() { const int index = m_controller->selectionManager()->currentItem(); - const KUrl url = m_model->data(index).value("url").value(); + const QUrl url = m_model->data(index).value("url").value(); QPointer dialog = new PlacesItemEditDialog(this); dialog->setWindowTitle(i18nc("@title:window", "Add Places Entry")); @@ -487,7 +487,7 @@ void PlacesPanel::editEntry(int index) dialog->setWindowTitle(i18nc("@title:window", "Edit Places Entry")); dialog->setIcon(data.value("iconName").toString()); dialog->setText(data.value("text").toString()); - dialog->setUrl(data.value("url").value()); + dialog->setUrl(data.value("url").value()); dialog->setAllowGlobal(true); if (dialog->exec() == QDialog::Accepted) { PlacesItem* oldItem = m_model->placesItem(index); @@ -528,7 +528,7 @@ void PlacesPanel::triggerItem(int index, Qt::MouseButton button) } else { m_triggerStorageSetupButton = Qt::NoButton; - const KUrl url = m_model->data(index).value("url").value(); + const QUrl url = m_model->data(index).value("url").value(); if (!url.isEmpty()) { if (button == Qt::MiddleButton) { emit placeMiddleClicked(PlacesItemModel::convertedUrl(url)); diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 1f7979eca..3604e9986 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -21,7 +21,8 @@ #ifndef PLACESPANEL_H #define PLACESPANEL_H -#include +#include +#include #include class KItemListController; @@ -42,8 +43,8 @@ public: virtual ~PlacesPanel(); signals: - void placeActivated(const KUrl& url); - void placeMiddleClicked(const KUrl& url); + void placeActivated(const QUrl& url); + void placeMiddleClicked(const QUrl& url); void errorMessage(const QString& error); protected: @@ -61,7 +62,7 @@ private slots: void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); void slotItemDropEventStorageSetupDone(int index, bool success); void slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); - void slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent); + void slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent); void slotTrashUpdated(KJob* job); void slotStorageSetupDone(int index, bool success); @@ -83,7 +84,7 @@ private: PlacesItemModel* m_model; PlacesView* m_view; - KUrl m_storageSetupFailedUrl; + QUrl m_storageSetupFailedUrl; Qt::MouseButton m_triggerStorageSetupButton; int m_itemDropEventIndex; diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 964479628..02489d40e 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -127,7 +127,7 @@ void TerminalPanel::showEvent(QShowEvent* event) Panel::showEvent(event); } -void TerminalPanel::changeDir(const KUrl& url) +void TerminalPanel::changeDir(const QUrl& url) { delete m_mostLocalUrlJob; m_mostLocalUrlJob = 0; @@ -173,7 +173,7 @@ void TerminalPanel::sendCdToTerminal(const QString& dir) void TerminalPanel::slotMostLocalUrlResult(KJob* job) { KIO::StatJob* statJob = static_cast(job); - const KUrl url = statJob->mostLocalUrl(); + const QUrl url = statJob->mostLocalUrl(); if (url.isLocalFile()) { sendCdToTerminal(url.toLocalFile()); } @@ -188,10 +188,9 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir) // Only change the view URL if 'dir' is different from the current view URL. // Note that the current view URL could also be a symbolic link to 'dir' // -> use QDir::canonicalPath() to check that. - const KUrl oldUrl(url()); - const KUrl newUrl(dir); + const QUrl oldUrl(url()); + const QUrl newUrl(QUrl::fromLocalFile(dir)); if (newUrl != oldUrl && dir != QDir(oldUrl.path()).canonicalPath()) { emit changeUrl(newUrl); } } - diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 6a0b38f5b..5d012a332 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -56,7 +56,7 @@ signals: /** * Is emitted if the an URL change is requested. */ - void changeUrl(const KUrl& url); + void changeUrl(const QUrl& url); protected: /** @see Panel::urlChanged() */ @@ -70,7 +70,7 @@ private slots: void slotKonsolePartCurrentDirectoryChanged(const QString& dir); private: - void changeDir(const KUrl& url); + void changeDir(const QUrl& url); void sendCdToTerminal(const QString& path); private: diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 050ae394d..65d35539c 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -82,7 +82,7 @@ QString DolphinSearchBox::text() const return m_searchInput->text(); } -void DolphinSearchBox::setSearchPath(const KUrl& url) +void DolphinSearchBox::setSearchPath(const QUrl& url) { m_searchPath = url; @@ -94,7 +94,7 @@ void DolphinSearchBox::setSearchPath(const KUrl& url) if (url.isLocalFile()) { location = QLatin1String("/"); } else { - location = url.protocol() + QLatin1String(" - ") + url.host(); + location = url.scheme() + QLatin1String(" - ") + url.host(); } } @@ -114,14 +114,14 @@ void DolphinSearchBox::setSearchPath(const KUrl& url) m_facetsWidget->setEnabled(hasFacetsSupport); } -KUrl DolphinSearchBox::searchPath() const +QUrl DolphinSearchBox::searchPath() const { return m_searchPath; } -KUrl DolphinSearchBox::urlForSearching() const +QUrl DolphinSearchBox::urlForSearching() const { - KUrl url; + QUrl url; bool useBalooSearch = false; #ifdef HAVE_BALOO const Baloo::IndexerConfig searchInfo; @@ -130,7 +130,7 @@ KUrl DolphinSearchBox::urlForSearching() const if (useBalooSearch) { url = balooUrlForSearching(); } else { - url.setProtocol("filenamesearch"); + url.setScheme("filenamesearch"); url.addQueryItem("search", m_searchInput->text()); if (m_contentButton->isChecked()) { url.addQueryItem("checkContent", "yes"); @@ -151,15 +151,14 @@ KUrl DolphinSearchBox::urlForSearching() const return url; } -void DolphinSearchBox::fromSearchUrl(const KUrl& url) +void DolphinSearchBox::fromSearchUrl(const QUrl& url) { - if (url.protocol() == "baloosearch") { + if (url.scheme() == "baloosearch") { fromBalooSearchUrl(url); - } else if (url.protocol() == "filenamesearch") { - const QMap& queryItems = url.queryItems(); - setText(queryItems.value("search")); - setSearchPath(queryItems.value("url")); - m_contentButton->setChecked(queryItems.value("checkContent") == "yes"); + } else if (url.scheme() == "filenamesearch") { + setText(url.queryItemValue("search")); + setSearchPath(url.queryItemValue("url")); + m_contentButton->setChecked(url.queryItemValue("checkContent") == "yes"); } else { setText(QString()); setSearchPath(url); @@ -449,7 +448,7 @@ void DolphinSearchBox::init() updateFacetsToggleButton(); } -KUrl DolphinSearchBox::balooUrlForSearching() const +QUrl DolphinSearchBox::balooUrlForSearching() const { #ifdef HAVE_BALOO const QString text = m_searchInput->text(); @@ -483,11 +482,11 @@ KUrl DolphinSearchBox::balooUrlForSearching() const return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.", "Query Results from '%1'", text)); #else - return KUrl(); + return QUrl(); #endif } -void DolphinSearchBox::fromBalooSearchUrl(const KUrl& url) +void DolphinSearchBox::fromBalooSearchUrl(const QUrl& url) { #ifdef HAVE_BALOO const Baloo::Query query = Baloo::Query::fromSearchUrl(url); diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 16a6ec0c1..2de4c457c 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -20,7 +20,7 @@ #ifndef DOLPHINSEARCHBOX_H #define DOLPHINSEARCHBOX_H -#include +#include #include #include @@ -71,17 +71,17 @@ public: * Sets the current path that is used as root for * searching files, if "From Here" has been selected. */ - void setSearchPath(const KUrl& url); - KUrl searchPath() const; + void setSearchPath(const QUrl& url); + QUrl searchPath() const; /** @return URL that will start the searching of files. */ - KUrl urlForSearching() const; + QUrl urlForSearching() const; /** * Extracts information from the given search \a url to * initialize the search box properly. */ - void fromSearchUrl(const KUrl& url); + void fromSearchUrl(const QUrl& url); /** * Selects the whole text of the search box. @@ -155,13 +155,13 @@ private: /** * @return URL that represents the Baloo query for starting the search. */ - KUrl balooUrlForSearching() const; + QUrl balooUrlForSearching() const; /** * Extracts information from the given Baloo search \a url to * initialize the search box properly. */ - void fromBalooSearchUrl(const KUrl& url); + void fromBalooSearchUrl(const QUrl& url); void updateFacetsToggleButton(); private: @@ -186,7 +186,7 @@ private: QToolButton* m_facetsToggleButton; DolphinFacetsWidget* m_facetsWidget; - KUrl m_searchPath; + QUrl m_searchPath; QTimer* m_startSearchTimer; }; diff --git a/src/settings/applyviewpropsjob.cpp b/src/settings/applyviewpropsjob.cpp index d33d4430f..591966759 100644 --- a/src/settings/applyviewpropsjob.cpp +++ b/src/settings/applyviewpropsjob.cpp @@ -23,7 +23,7 @@ #include "applyviewpropsjob.h" #include -ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir, +ApplyViewPropsJob::ApplyViewPropsJob(const QUrl& dir, const ViewProperties& viewProps) : KIO::Job(), m_viewProps(0), @@ -56,8 +56,9 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list) if (name != QLatin1String(".") && name != QLatin1String("..") && entry.isDir()) { ++m_progress; - KUrl url(m_dir); - url.addPath(name); + QUrl url(m_dir); + url = url.adjusted(QUrl::StripTrailingSlash); + url.setPath(url.path() + '/' + name); Q_ASSERT(m_viewProps); diff --git a/src/settings/applyviewpropsjob.h b/src/settings/applyviewpropsjob.h index 1d817fe56..297adb823 100644 --- a/src/settings/applyviewpropsjob.h +++ b/src/settings/applyviewpropsjob.h @@ -24,7 +24,7 @@ #define APPLYVIEWPROPSJOB_H #include -#include +#include class ViewProperties; @@ -59,7 +59,7 @@ public: * @param viewProps View properties for the directory \a dir including its * sub directories. */ - ApplyViewPropsJob(const KUrl& dir, const ViewProperties& viewProps); + ApplyViewPropsJob(const QUrl& dir, const ViewProperties& viewProps); virtual ~ApplyViewPropsJob(); int progress() const; @@ -71,7 +71,7 @@ private: ViewProperties* m_viewProps; int m_currentItem; int m_progress; - KUrl m_dir; + QUrl m_dir; }; inline int ApplyViewPropsJob::progress() const diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index 849a9c75c..de7bbf878 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"> QDir - KUrl + QUrl kglobalsettings.h @@ -31,7 +31,7 @@ - KUrl(QDir::homePath()).prettyUrl() + QUrl::fromLocalFile(QDir::homePath()).toDisplayString(QUrl::PreferLocalFile) diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 678ef7b8e..d9240d97c 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -36,7 +36,7 @@ #include #include -DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) : +DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) : KPageDialog(parent), m_pages() diff --git a/src/settings/dolphinsettingsdialog.h b/src/settings/dolphinsettingsdialog.h index 56d924c7d..93f714799 100644 --- a/src/settings/dolphinsettingsdialog.h +++ b/src/settings/dolphinsettingsdialog.h @@ -23,7 +23,7 @@ #include -class KUrl; +class QUrl; class SettingsPageBase; /** @@ -36,7 +36,7 @@ class DolphinSettingsDialog : public KPageDialog Q_OBJECT public: - explicit DolphinSettingsDialog(const KUrl& url, QWidget* parent = 0); + explicit DolphinSettingsDialog(const QUrl& url, QWidget* parent = 0); virtual ~DolphinSettingsDialog(); signals: diff --git a/src/settings/general/behaviorsettingspage.cpp b/src/settings/general/behaviorsettingspage.cpp index 8d3e0ffb5..f311b1a3c 100644 --- a/src/settings/general/behaviorsettingspage.cpp +++ b/src/settings/general/behaviorsettingspage.cpp @@ -31,7 +31,7 @@ #include -BehaviorSettingsPage::BehaviorSettingsPage(const KUrl& url, QWidget* parent) : +BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) : SettingsPageBase(parent), m_url(url), m_localViewProps(0), diff --git a/src/settings/general/behaviorsettingspage.h b/src/settings/general/behaviorsettingspage.h index 2221862e0..71ee2849a 100644 --- a/src/settings/general/behaviorsettingspage.h +++ b/src/settings/general/behaviorsettingspage.h @@ -21,7 +21,7 @@ #define BEHAVIORSETTINGSPAGE_H #include -#include +#include class QCheckBox; class QLabel; @@ -35,7 +35,7 @@ class BehaviorSettingsPage : public SettingsPageBase Q_OBJECT public: - BehaviorSettingsPage(const KUrl& url, QWidget* parent); + BehaviorSettingsPage(const QUrl &url, QWidget* parent); virtual ~BehaviorSettingsPage(); /** @see SettingsPageBase::applySettings() */ @@ -48,7 +48,7 @@ private: void loadSettings(); private: - KUrl m_url; + QUrl m_url; QRadioButton* m_localViewProps; QRadioButton* m_globalViewProps; diff --git a/src/settings/general/generalsettingspage.cpp b/src/settings/general/generalsettingspage.cpp index f749c33ce..f24b1bf22 100644 --- a/src/settings/general/generalsettingspage.cpp +++ b/src/settings/general/generalsettingspage.cpp @@ -32,7 +32,7 @@ #include -GeneralSettingsPage::GeneralSettingsPage(const KUrl& url, QWidget* parent) : +GeneralSettingsPage::GeneralSettingsPage(const QUrl& url, QWidget* parent) : SettingsPageBase(parent), m_pages() { diff --git a/src/settings/general/generalsettingspage.h b/src/settings/general/generalsettingspage.h index 0d28664f5..245773aee 100644 --- a/src/settings/general/generalsettingspage.h +++ b/src/settings/general/generalsettingspage.h @@ -23,7 +23,7 @@ #include #include -class KUrl; +class QUrl; class SettingsPageBase; /** @@ -40,7 +40,7 @@ class GeneralSettingsPage : public SettingsPageBase Q_OBJECT public: - GeneralSettingsPage(const KUrl& url, QWidget* parent); + GeneralSettingsPage(const QUrl& url, QWidget* parent); virtual ~GeneralSettingsPage(); /** @see SettingsPageBase::applySettings() */ diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 2c436b541..b4ca9ac2c 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -39,7 +39,7 @@ #include "views/dolphinview.h" -StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) : +StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : SettingsPageBase(parent), m_url(url), m_homeUrl(0), @@ -117,10 +117,10 @@ void StartupSettingsPage::applySettings() { GeneralSettings* settings = GeneralSettings::self(); - const KUrl url(m_homeUrl->text()); + const QUrl url(QUrl::fromLocalFile(m_homeUrl->text())); KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url); - if ((url.isValid() && fileItem.isDir()) || (url.protocol() == QLatin1String("timeline"))) { - settings->setHomeUrl(url.prettyUrl()); + if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) { + settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile)); } else { KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied.")); } @@ -153,31 +153,29 @@ void StartupSettingsPage::slotSettingsChanged() void StartupSettingsPage::selectHomeUrl() { const QString homeUrl = m_homeUrl->text(); - KUrl url = KFileDialog::getExistingDirectoryUrl(homeUrl, this); + QUrl url = KFileDialog::getExistingDirectoryUrl(QUrl::fromLocalFile(homeUrl), this); if (!url.isEmpty()) { - m_homeUrl->setText(url.prettyUrl()); + m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); slotSettingsChanged(); } } void StartupSettingsPage::useCurrentLocation() { - m_homeUrl->setText(m_url.prettyUrl()); + m_homeUrl->setText(m_url.toDisplayString(QUrl::PreferLocalFile)); } void StartupSettingsPage::useDefaultLocation() { - KUrl url(QDir::homePath()); - m_homeUrl->setText(url.prettyUrl()); + m_homeUrl->setText(QDir::homePath()); } void StartupSettingsPage::loadSettings() { - const KUrl url(GeneralSettings::homeUrl()); - m_homeUrl->setText(url.prettyUrl()); + const QUrl url(QUrl::fromLocalFile(GeneralSettings::homeUrl())); + m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); m_splitView->setChecked(GeneralSettings::splitView()); m_editableUrl->setChecked(GeneralSettings::editableUrl()); m_showFullPath->setChecked(GeneralSettings::showFullPath()); m_filterBar->setChecked(GeneralSettings::filterBar()); } - diff --git a/src/settings/startup/startupsettingspage.h b/src/settings/startup/startupsettingspage.h index 29cdc6300..d8b15cf5b 100644 --- a/src/settings/startup/startupsettingspage.h +++ b/src/settings/startup/startupsettingspage.h @@ -20,7 +20,7 @@ #define STARTUPSETTINGSPAGE_H #include -#include +#include class KLineEdit; class QCheckBox; @@ -36,7 +36,7 @@ class StartupSettingsPage : public SettingsPageBase Q_OBJECT public: - StartupSettingsPage(const KUrl& url, QWidget* parent); + StartupSettingsPage(const QUrl& url, QWidget* parent); virtual ~StartupSettingsPage(); /** @see SettingsPageBase::applySettings() */ @@ -55,7 +55,7 @@ private: void loadSettings(); private: - KUrl m_url; + QUrl m_url; KLineEdit* m_homeUrl; QCheckBox* m_splitView; diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 2e0b172b9..338a14277 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : setCaption(i18nc("@title:window", "View Properties")); setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply); - const KUrl& url = dolphinView->url(); + const QUrl& url = dolphinView->url(); m_viewProps = new ViewProperties(url); m_viewProps->setAutoSaveEnabled(false); diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index 091003416..9ce3d2de4 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -32,7 +32,7 @@ #include ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent, - const KUrl& dir, + const QUrl& dir, const ViewProperties& viewProps) : KDialog(parent), m_dir(dir), diff --git a/src/settings/viewpropsprogressinfo.h b/src/settings/viewpropsprogressinfo.h index 6f8c763c3..7522cf84c 100644 --- a/src/settings/viewpropsprogressinfo.h +++ b/src/settings/viewpropsprogressinfo.h @@ -22,7 +22,7 @@ #include #include -#include +#include class ApplyViewPropsJob; class QLabel; @@ -50,7 +50,7 @@ public: * sub directories. */ ViewPropsProgressInfo(QWidget* parent, - const KUrl& dir, + const QUrl& dir, const ViewProperties& viewProps); virtual ~ViewPropsProgressInfo(); @@ -64,7 +64,7 @@ private slots: void cancelApplying(); private: - KUrl m_dir; + QUrl m_dir; ViewProperties* m_viewProps; QLabel* m_label; diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index c5d7b45f6..166f6ab14 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -228,12 +228,12 @@ QString DolphinStatusBar::defaultText() const return m_defaultText; } -void DolphinStatusBar::setUrl(const KUrl& url) +void DolphinStatusBar::setUrl(const QUrl& url) { m_spaceInfo->setUrl(url); } -KUrl DolphinStatusBar::url() const +QUrl DolphinStatusBar::url() const { return m_spaceInfo->url(); } diff --git a/src/statusbar/dolphinstatusbar.h b/src/statusbar/dolphinstatusbar.h index 4d6dbb20f..7ceb2acf8 100644 --- a/src/statusbar/dolphinstatusbar.h +++ b/src/statusbar/dolphinstatusbar.h @@ -23,7 +23,7 @@ #include #include -class KUrl; +class QUrl; class StatusBarSpaceInfo; class QLabel; class QProgressBar; @@ -79,7 +79,7 @@ public: void setDefaultText(const QString& text); QString defaultText() const; - KUrl url() const; + QUrl url() const; int zoomLevel() const; /** @@ -89,7 +89,7 @@ public: public slots: void setText(const QString& text); - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); void setZoomLevel(int zoomLevel); signals: diff --git a/src/statusbar/spaceinfoobserver.cpp b/src/statusbar/spaceinfoobserver.cpp index 10efdd7fb..0fb018727 100644 --- a/src/statusbar/spaceinfoobserver.cpp +++ b/src/statusbar/spaceinfoobserver.cpp @@ -21,9 +21,9 @@ #include "mountpointobserver.h" -#include +#include -SpaceInfoObserver::SpaceInfoObserver(const KUrl& url, QObject* parent) : +SpaceInfoObserver::SpaceInfoObserver(const QUrl& url, QObject* parent) : QObject(parent), m_mountPointObserver(0), m_dataSize(0), @@ -53,7 +53,7 @@ quint64 SpaceInfoObserver::available() const return m_dataAvailable; } -void SpaceInfoObserver::setUrl(const KUrl& url) +void SpaceInfoObserver::setUrl(const QUrl& url) { MountPointObserver* newObserver = MountPointObserver::observerForUrl(url); if (newObserver != m_mountPointObserver) { diff --git a/src/statusbar/spaceinfoobserver.h b/src/statusbar/spaceinfoobserver.h index 68c559ec9..e1311abde 100644 --- a/src/statusbar/spaceinfoobserver.h +++ b/src/statusbar/spaceinfoobserver.h @@ -24,7 +24,7 @@ #include -class KUrl; +class QUrl; class MountPointObserver; class SpaceInfoObserver : public QObject @@ -32,13 +32,13 @@ class SpaceInfoObserver : public QObject Q_OBJECT public: - explicit SpaceInfoObserver(const KUrl& url, QObject* parent = 0); + explicit SpaceInfoObserver(const QUrl& url, QObject* parent = 0); virtual ~SpaceInfoObserver(); quint64 size() const; quint64 available() const; - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); signals: /** diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index 1c9048304..046cbbb23 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -36,7 +36,7 @@ StatusBarSpaceInfo::~StatusBarSpaceInfo() { } -void StatusBarSpaceInfo::setUrl(const KUrl& url) +void StatusBarSpaceInfo::setUrl(const QUrl& url) { if (m_url != url) { m_url = url; @@ -46,7 +46,7 @@ void StatusBarSpaceInfo::setUrl(const KUrl& url) } } -KUrl StatusBarSpaceInfo::url() const +QUrl StatusBarSpaceInfo::url() const { return m_url; } diff --git a/src/statusbar/statusbarspaceinfo.h b/src/statusbar/statusbarspaceinfo.h index 597d91ef6..48313a81c 100644 --- a/src/statusbar/statusbarspaceinfo.h +++ b/src/statusbar/statusbarspaceinfo.h @@ -20,7 +20,7 @@ #ifndef STATUSBARSPACEINFO_H #define STATUSBARSPACEINFO_H -#include +#include #include @@ -42,8 +42,8 @@ public: explicit StatusBarSpaceInfo(QWidget* parent = 0); virtual ~StatusBarSpaceInfo(); - void setUrl(const KUrl& url); - KUrl url() const; + void setUrl(const QUrl& url); + QUrl url() const; protected: void showEvent(QShowEvent* event); @@ -54,7 +54,7 @@ private slots: private: QScopedPointer m_observer; - KUrl m_url; + QUrl m_url; }; #endif diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp index 2e942222c..0da1137c4 100644 --- a/src/tests/kfileitemmodelbenchmark.cpp +++ b/src/tests/kfileitemmodelbenchmark.cpp @@ -322,8 +322,7 @@ KFileItemList KFileItemModelBenchmark::createFileItemList(const QStringList& fil KFileItemList result; foreach (const QString& name, fileNames) { - const KUrl url(prefix + name); - const KFileItem item(url, QString(), KFileItem::Unknown); + const KFileItem item(QUrl::fromLocalFile(prefix + name), QString(), KFileItem::Unknown); result << item; } return result; diff --git a/src/tests/testdir.cpp b/src/tests/testdir.cpp index 8938e6082..dcc4c87a5 100644 --- a/src/tests/testdir.cpp +++ b/src/tests/testdir.cpp @@ -36,9 +36,9 @@ TestDir::~TestDir() { } -KUrl TestDir::url() const +QUrl TestDir::url() const { - return KUrl(name()); + return QUrl::fromLocalFile(name()); } /** The following function is taken from kdelibs/kio/tests/kiotesthelper.h, copyright (C) 2006 by David Faure */ diff --git a/src/tests/testdir.h b/src/tests/testdir.h index 0d3c5dd8d..24c4d77b0 100644 --- a/src/tests/testdir.h +++ b/src/tests/testdir.h @@ -21,7 +21,7 @@ #define TESTDIR_H #include -#include +#include #include @@ -36,7 +36,7 @@ public: TestDir(const QString& directoryPrefix = QString()); virtual ~TestDir(); - KUrl url() const; + QUrl url() const; /** * The following functions create either a file, a list of files, or a directory. diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 3b5fbcd71..fbf21c08f 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -75,10 +75,10 @@ void DolphinRemoteEncoding::loadSettings() void DolphinRemoteEncoding::slotAboutToOpenUrl() { - KUrl oldURL = m_currentURL; + QUrl oldURL = m_currentURL; m_currentURL = m_actionHandler->currentView()->url(); - if (m_currentURL.protocol() != oldURL.protocol()) { + if (m_currentURL.scheme() != oldURL.scheme()) { // This plugin works on ftp, fish, etc. // everything whose type is T_FILESYSTEM except for local files if (!m_currentURL.isLocalFile() && @@ -167,7 +167,7 @@ void DolphinRemoteEncoding::slotItemSelected(QAction* action) if (action) { int id = action->data().toInt(); - KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1()); + KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1()); QString host = m_currentURL.host(); if (m_menu->menu()->actions().at(id)->isChecked()) { QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id)); @@ -185,7 +185,7 @@ void DolphinRemoteEncoding::slotDefault() { // We have no choice but delete all higher domain level // settings here since it affects what will be matched. - KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1()); + KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1()); QStringList partList = m_currentURL.host().split('.', QString::SkipEmptyParts); if (!partList.isEmpty()) { diff --git a/src/views/dolphinremoteencoding.h b/src/views/dolphinremoteencoding.h index 8dec518d0..0351abad7 100644 --- a/src/views/dolphinremoteencoding.h +++ b/src/views/dolphinremoteencoding.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libdolphin_export.h" @@ -59,7 +59,7 @@ private: KActionMenu* m_menu; QStringList m_encodingDescriptions; - KUrl m_currentURL; + QUrl m_currentURL; DolphinViewActionHandler* m_actionHandler; bool m_loaded; diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 0b3209aee..f35c9e6ca 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include "dolphinnewfilemenuobserver.h" #include "dolphin_detailsmodesettings.h" @@ -293,7 +293,7 @@ void DolphinView::setHiddenFilesShown(bool show) const KFileItemList itemList = selectedItems(); m_selectedUrls.clear(); - m_selectedUrls = KUrl::List(itemList.urlList()); + m_selectedUrls = itemList.urlList(); ViewProperties props(viewPropertiesUrl()); props.setHiddenFilesShown(show); @@ -470,7 +470,7 @@ void DolphinView::reload() const KFileItemList itemList = selectedItems(); m_selectedUrls.clear(); - m_selectedUrls = KUrl::List(itemList.urlList()); + m_selectedUrls = itemList.urlList(); setUrl(url()); loadDirectory(url(), true); @@ -591,7 +591,7 @@ QList DolphinView::versionControlActions(const KFileItemList& items) c return actions; } -void DolphinView::setUrl(const KUrl& url) +void DolphinView::setUrl(const QUrl& url) { if (url == m_url) { return; @@ -667,12 +667,12 @@ void DolphinView::renameSelectedItems() void DolphinView::trashSelectedItems() { - const KUrl::List list = simplifiedSelectedUrls(); + const QList list = simplifiedSelectedUrls(); KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(window()); if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) { KIO::Job* job = KIO::trash(list); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job); + KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl("trash:/"), job); KJobWidgets::setWindow(job, this); connect(job, &KIO::Job::result, this, &DolphinView::slotTrashFileFinished); @@ -681,7 +681,7 @@ void DolphinView::trashSelectedItems() void DolphinView::deleteSelectedItems() { - const KUrl::List list = simplifiedSelectedUrls(); + const QList list = simplifiedSelectedUrls(); KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(window()); @@ -819,7 +819,7 @@ void DolphinView::slotItemsActivated(const KItemSet& indexes) foreach (int index, indexes) { KFileItem item = m_model->fileItem(index); - const KUrl& url = openItemAsFolderUrl(item); + const QUrl& url = openItemAsFolderUrl(item); if (!url.isEmpty()) { // Open folders in new tabs emit tabRequested(url); @@ -838,7 +838,7 @@ void DolphinView::slotItemsActivated(const KItemSet& indexes) void DolphinView::slotItemMiddleClicked(int index) { const KFileItem& item = m_model->fileItem(index); - const KUrl& url = openItemAsFolderUrl(item); + const QUrl& url = openItemAsFolderUrl(item); if (!url.isEmpty()) { emit tabRequested(url); } else if (isTabsForFilesEnabled()) { @@ -1021,7 +1021,7 @@ void DolphinView::slotItemUnhovered(int index) void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) { - KUrl destUrl; + QUrl destUrl; KFileItem destItem = m_model->fileItem(index); if (destItem.isNull() || (!destItem.isDir() && !destItem.isDesktopFile())) { // Use the URL of the view as drop target if the item is no directory @@ -1198,10 +1198,10 @@ void DolphinView::saveState(QDataStream& stream) if (currentIndex != -1) { KFileItem item = m_model->fileItem(currentIndex); Q_ASSERT(!item.isNull()); // If the current index is valid a item must exist - KUrl currentItemUrl = item.url(); + QUrl currentItemUrl = item.url(); stream << currentItemUrl; } else { - stream << KUrl(); + stream << QUrl(); } // Save view position @@ -1228,13 +1228,13 @@ QString DolphinView::viewPropertiesContext() const return m_viewPropertiesContext; } -KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives) +QUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives) { if (item.isNull()) { - return KUrl(); + return QUrl(); } - KUrl url = item.targetUrl(); + QUrl url = item.targetUrl(); if (item.isDir()) { return url; @@ -1251,7 +1251,7 @@ KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh // open OpenDocument files as zip folders... const QString& protocol = KProtocolManager::protocolForArchiveMimetype(mimetype); if (!protocol.isEmpty()) { - url.setProtocol(protocol); + url.setScheme(protocol); return url; } } @@ -1268,7 +1268,7 @@ KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh } } - return KUrl(); + return QUrl(); } void DolphinView::observeCreatedItem(const QUrl& url) @@ -1484,12 +1484,12 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con const KFileItem oldItem = m_model->fileItem(index); const QString newName = value.toString(); if (!newName.isEmpty() && newName != oldItem.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) { - const KUrl oldUrl = oldItem.url(); + const QUrl oldUrl = oldItem.url(); QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename); newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName)); - const bool newNameExistsAlready = (m_model->index(KUrl(newUrl)) >= 0); + const bool newNameExistsAlready = (m_model->index(newUrl) >= 0); if (!newNameExistsAlready) { // Only change the data in the model if no item with the new name // is in the model yet. If there is an item with the new name @@ -1515,10 +1515,10 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con } } -void DolphinView::loadDirectory(const KUrl& url, bool reload) +void DolphinView::loadDirectory(const QUrl& url, bool reload) { if (!url.isValid()) { - const QString location(url.pathOrUrl()); + const QString location(url.toDisplayString(QUrl::PreferLocalFile)); if (location.isEmpty()) { emit errorMessage(i18nc("@info:status", "The location is empty.")); } else { @@ -1644,7 +1644,7 @@ void DolphinView::applyModeToView() } } -void DolphinView::pasteToUrl(const KUrl& url) +void DolphinView::pasteToUrl(const QUrl& url) { KonqOperations* op = KonqOperations::doPaste(this, url); if (op) { @@ -1654,9 +1654,9 @@ void DolphinView::pasteToUrl(const KUrl& url) } } -KUrl::List DolphinView::simplifiedSelectedUrls() const +QList DolphinView::simplifiedSelectedUrls() const { - KUrl::List urls; + QList urls; const KFileItemList items = selectedItems(); foreach (const KFileItem& item, items) { @@ -1699,15 +1699,14 @@ void DolphinView::updateWritableState() } } -KUrl DolphinView::viewPropertiesUrl() const +QUrl DolphinView::viewPropertiesUrl() const { if (m_viewPropertiesContext.isEmpty()) { return m_url; } - KUrl url; - url.setProtocol(m_url.protocol()); + QUrl url; + url.setScheme(m_url.scheme()); url.setPath(m_viewPropertiesContext); return url; } - diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 9435206d9..17add7420 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -29,8 +29,8 @@ #include #include #include -#include - +#include +#include #include typedef KIO::FileUndoManager::CommandType CommandType; @@ -40,7 +40,6 @@ class KFileItemModel; class KItemListContainer; class KItemModelBase; class KItemSet; -class KUrl; class ToolTipManager; class VersionControlObserver; class ViewProperties; @@ -304,14 +303,14 @@ public: * @return a valid and adjusted url if the item can be opened as folder, * otherwise return an empty url. */ - static KUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true); + static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true); public slots: /** * Changes the directory to \a url. If the current directory is equal to * \a url, nothing will be done (use DolphinView::reload() instead). */ - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); /** * Selects all items. @@ -379,10 +378,10 @@ signals: * After the URL has been changed the signal urlChanged() will * be emitted. */ - void urlAboutToBeChanged(const KUrl& url); + void urlAboutToBeChanged(const QUrl& url); /** Is emitted if the URL of the view has been changed to \a url. */ - void urlChanged(const KUrl& url); + void urlChanged(const QUrl& url); /** * Is emitted when clicking on an item with the left mouse button. @@ -403,7 +402,7 @@ signals: /** * Is emitted if a new tab should be opened for the URL \a url. */ - void tabRequested(const KUrl& url); + void tabRequested(const QUrl& url); /** * Is emitted if the view mode (IconsView, DetailsView, @@ -458,7 +457,7 @@ signals: */ void requestContextMenu(const QPoint& pos, const KFileItem& item, - const KUrl& url, + const QUrl& url, const QList& customActions); /** @@ -515,13 +514,13 @@ signals: * Emitted when the file-item-model emits redirection. * Testcase: fish://localhost */ - void redirection(const KUrl& oldUrl, const KUrl& newUrl); + void redirection(const QUrl& oldUrl, const QUrl& newUrl); /** * Is emitted when the URL set by DolphinView::setUrl() represents a file. * In this case no signal errorMessage() will be emitted. */ - void urlIsFileError(const KUrl& url); + void urlIsFileError(const QUrl& url); /** * Is emitted when the write state of the folder has been changed. The application @@ -696,7 +695,7 @@ private slots: void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const; private: - void loadDirectory(const KUrl& url, bool reload = false); + void loadDirectory(const QUrl& url, bool reload = false); /** * Applies the view properties which are defined by the current URL @@ -721,14 +720,14 @@ private: * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder(). * Pastes the clipboard data into the URL \a url. */ - void pasteToUrl(const KUrl& url); + void pasteToUrl(const QUrl& url); /** * Returns a list of URLs for all selected items. The list is * simplified, so that when the URLs are part of different tree * levels, only the parent is returned. */ - KUrl::List simplifiedSelectedUrls() const; + QList simplifiedSelectedUrls() const; /** * Returns the MIME data for all selected items. @@ -747,7 +746,7 @@ private: * DolphinView::viewPropertiesContext(), otherwise the context * is returned. */ - KUrl viewPropertiesUrl() const; + QUrl viewPropertiesUrl() const; private: bool m_active; @@ -757,7 +756,7 @@ private: bool m_dragging; // True if a dragging is done. Required to be able to decide whether a // tooltip may be shown when hovering an item. - KUrl m_url; + QUrl m_url; QString m_viewPropertiesContext; Mode m_mode; QList m_visibleRoles; diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 84025a5f8..668623c8c 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -586,7 +586,7 @@ void DolphinViewActionHandler::slotProperties() KPropertiesDialog* dialog = 0; const KFileItemList list = m_currentView->selectedItems(); if (list.isEmpty()) { - const KUrl url = m_currentView->url(); + const QUrl url = m_currentView->url(); dialog = new KPropertiesDialog(url, m_currentView); } else { dialog = new KPropertiesDialog(list, m_currentView); diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index 0dada5e55..1f3f4ba82 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -23,17 +23,19 @@ #include #include #include -#include +#include #include #include #include +#include -KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const KUrl& destUrl, QDropEvent* event, QString& error) +KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const QUrl& destUrl, QDropEvent* event, QString& error) { error.clear(); if (!destItem.isNull() && !destItem.isWritable()) { - error = xi18nc("@info:status", "Access denied. Could not write to %1", destUrl.pathOrUrl()); + error = xi18nc("@info:status", "Access denied. Could not write to %1", + destUrl.toDisplayString(QUrl::PreferLocalFile)); return 0; } @@ -45,12 +47,12 @@ KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const KUr QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, remoteDBusPath, "org.kde.ark.DndExtract", "extractSelectedFilesTo"); - message.setArguments(QVariantList() << destUrl.pathOrUrl()); + message.setArguments(QVariantList() << destUrl.toDisplayString(QUrl::PreferLocalFile)); QDBusConnection::sessionBus().call(message); } else if (!destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile())) { // Drop into a directory or a desktop-file - const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData()); - foreach (const KUrl& url, urls) { + const QList urls = KUrlMimeData::urlsFromMimeData(mimeData); + foreach (const QUrl& url, urls) { if (url == destUrl) { error = i18nc("@info:status", "A folder cannot be dropped into itself"); return 0; diff --git a/src/views/draganddrophelper.h b/src/views/draganddrophelper.h index a6fbb7c7f..c4ae974b5 100644 --- a/src/views/draganddrophelper.h +++ b/src/views/draganddrophelper.h @@ -26,7 +26,7 @@ #include class KFileItem; -class KUrl; +class QUrl; class QDropEvent; class KonqOperations; @@ -52,7 +52,7 @@ public: * @return KonqOperations pointer */ static KonqOperations* dropUrls(const KFileItem& destItem, - const KUrl& destUrl, + const QUrl& destUrl, QDropEvent* event, QString& error); }; diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index ca8ef3bbc..9a1079e7f 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -280,14 +280,14 @@ int VersionControlObserver::createItemStatesList(QMap 0) { - const KUrl& url = items.first().first.url(); - itemStates.insert(url.directory(KUrl::AppendTrailingSlash), items); + const QUrl& url = items.first().first.url(); + itemStates.insert(url.adjusted(QUrl::RemoveFilename).path(), items); } return index - firstIndex; // number of processed items } -KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& directory) const +KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& directory) const { static bool pluginsAvailable = true; static QList plugins; @@ -326,7 +326,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director // Verify whether the current directory contains revision information // like .svn, .git, ... foreach (KVersionControlPlugin* plugin, plugins) { - const QString fileName = directory.path(KUrl::AddTrailingSlash) + plugin->fileName(); + const QString fileName = directory.path() + plugin->fileName(); if (QFile::exists(fileName)) { // The score of this plugin is 0 (best), so we can just return this plugin, // instead of going through the plugin scoring procedure, we can't find a better one ;) @@ -340,11 +340,11 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director // m_versionedDirectory. Drawback: Until e. g. Git is recognized, the root directory // must be shown at least once. if (m_versionedDirectory) { - KUrl dirUrl(directory); - KUrl upUrl = dirUrl.upUrl(); + QUrl dirUrl(directory); + QUrl upUrl = KIO::upUrl(dirUrl); int upUrlCounter = 1; while ((upUrlCounter < bestScore) && (upUrl != dirUrl)) { - const QString fileName = dirUrl.path(KUrl::AddTrailingSlash) + plugin->fileName(); + const QString fileName = dirUrl.path() + plugin->fileName(); if (QFile::exists(fileName)) { if (upUrlCounter < bestScore) { bestPlugin = plugin; @@ -353,7 +353,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director break; } dirUrl = upUrl; - upUrl = dirUrl.upUrl(); + upUrl = KIO::upUrl(dirUrl); ++upUrlCounter; } } diff --git a/src/views/versioncontrol/versioncontrolobserver.h b/src/views/versioncontrol/versioncontrolobserver.h index b9ab13427..034ef8bfe 100644 --- a/src/views/versioncontrol/versioncontrolobserver.h +++ b/src/views/versioncontrol/versioncontrolobserver.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -124,7 +124,7 @@ private: * Returns a matching plugin for the given directory. * 0 is returned, if no matching plugin has been found. */ - KVersionControlPlugin* searchPlugin(const KUrl& directory) const; + KVersionControlPlugin* searchPlugin(const QUrl& directory) const; /** * Returns true, if the directory contains a version control information. diff --git a/src/views/viewmodecontroller.cpp b/src/views/viewmodecontroller.cpp index da6066887..28f9ea472 100644 --- a/src/views/viewmodecontroller.cpp +++ b/src/views/viewmodecontroller.cpp @@ -33,12 +33,12 @@ ViewModeController::~ViewModeController() { } -KUrl ViewModeController::url() const +QUrl ViewModeController::url() const { return m_url; } -void ViewModeController::redirectToUrl(const KUrl& url) +void ViewModeController::redirectToUrl(const QUrl& url) { m_url = url; } @@ -76,7 +76,7 @@ int ViewModeController::zoomLevel() const return m_zoomLevel; } -void ViewModeController::setUrl(const KUrl& url) +void ViewModeController::setUrl(const QUrl& url) { if (m_url != url) { m_url = url; diff --git a/src/views/viewmodecontroller.h b/src/views/viewmodecontroller.h index f4765955b..9ea717ad3 100644 --- a/src/views/viewmodecontroller.h +++ b/src/views/viewmodecontroller.h @@ -20,7 +20,7 @@ #ifndef VIEWMODECONTROLLER_H #define VIEWMODECONTROLLER_H -#include +#include #include #include #include @@ -44,13 +44,13 @@ public: /** * @return URL that is shown by the view mode implementation. */ - KUrl url() const; + QUrl url() const; /** * Sets the URL to \a url and does nothing else. Called when * a redirection happens. See ViewModeController::setUrl() */ - void redirectToUrl(const KUrl& url); + void redirectToUrl(const QUrl& url); /** * Informs the view mode implementation about a change of the activation @@ -83,13 +83,13 @@ public slots: * Sets the URL to \a url and emits the signals cancelPreviews() and * urlChanged() if \a url is different for the current URL. */ - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); signals: /** * Is emitted if the URL has been changed by ViewModeController::setUrl(). */ - void urlChanged(const KUrl& url); + void urlChanged(const QUrl& url); /** * Is emitted, if ViewModeController::indicateActivationChange() has been @@ -118,7 +118,7 @@ signals: private: int m_zoomLevel; QString m_nameFilter; - KUrl m_url; + QUrl m_url; }; #endif diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 100b1ad2d..018f42d2b 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -23,7 +23,7 @@ #include "dolphin_directoryviewpropertysettings.h" #include "dolphin_generalsettings.h" -#include +#include #include #include @@ -48,7 +48,7 @@ namespace { const char ViewPropertiesFileName[] = ".directory"; } -ViewProperties::ViewProperties(const KUrl& url) : +ViewProperties::ViewProperties(const QUrl& url) : m_changedProps(false), m_autoSave(true), m_node(0) @@ -62,10 +62,10 @@ ViewProperties::ViewProperties(const KUrl& url) : // we store the properties information in a local file. if (useGlobalViewProps) { m_filePath = destinationDir("global"); - } else if (url.protocol().contains("search")) { + } else if (url.scheme().contains("search")) { m_filePath = destinationDir("search/") + directoryHashForUrl(url); useDetailsViewWithPath = true; - } else if (url.protocol() == QLatin1String("trash")) { + } else if (url.scheme() == QLatin1String("trash")) { m_filePath = destinationDir("trash"); useDetailsViewWithPath = true; } else if (url.isLocalFile()) { @@ -102,9 +102,9 @@ ViewProperties::ViewProperties(const KUrl& url) : } else { // The global view-properties act as default for directories without // any view-property configuration. Constructing a ViewProperties - // instance for an empty KUrl ensures that the global view-properties + // instance for an empty QUrl ensures that the global view-properties // are loaded. - KUrl emptyUrl; + QUrl emptyUrl; ViewProperties defaultProps(emptyUrl); setDirProperties(defaultProps); @@ -464,10 +464,9 @@ bool ViewProperties::isPartOfHome(const QString& filePath) return filePath.startsWith(homePath); } -QString ViewProperties::directoryHashForUrl(const KUrl& url) +QString ViewProperties::directoryHashForUrl(const QUrl& url) { - const QByteArray hashValue = QCryptographicHash::hash(url.prettyUrl().toLatin1(), - QCryptographicHash::Sha1); + const QByteArray hashValue = QCryptographicHash::hash(url.toEncoded(), QCryptographicHash::Sha1); QString hashString = hashValue.toBase64(); hashString.replace('/', '-'); return hashString; diff --git a/src/views/viewproperties.h b/src/views/viewproperties.h index d794edf65..d3ea4280f 100644 --- a/src/views/viewproperties.h +++ b/src/views/viewproperties.h @@ -22,7 +22,7 @@ #define VIEWPROPERTIES_H #include -#include +#include #include class ViewPropertySettings; @@ -35,7 +35,7 @@ class ViewPropertySettings; * just construct an instance by passing the path of the directory: * * \code - * ViewProperties props(KUrl("/home/peter/Documents")); + * ViewProperties props(QUrl::fromLocalFile("/home/peter/Documents")); * const DolphinView::Mode mode = props.viewMode(); * const bool hiddenFilesShown = props.hiddenFilesShown(); * \endcode @@ -50,7 +50,7 @@ class ViewPropertySettings; class LIBDOLPHINPRIVATE_EXPORT ViewProperties { public: - explicit ViewProperties(const KUrl& url); + explicit ViewProperties(const QUrl& url); virtual ~ViewProperties(); void setViewMode(DolphinView::Mode mode); @@ -162,7 +162,7 @@ private: * @return A hash-value for an URL that can be used as directory name. * Is used to be able to remember view-properties for long baloo-URLs. */ - static QString directoryHashForUrl(const KUrl& url); + static QString directoryHashForUrl(const QUrl &url); Q_DISABLE_COPY(ViewProperties) -- cgit v1.3 From 5ed011357c42170805a4e20ec6526e79f8a0ea39 Mon Sep 17 00:00:00 2001 From: Lukáš Tinkl Date: Sun, 26 Oct 2014 19:02:03 +0100 Subject: don't save view_properties in ~/.local/share/dolphindolphin looks like writableLocation() already includes the app name --- src/views/viewproperties.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 018f42d2b..5eb5d23fd 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -379,7 +379,6 @@ bool ViewProperties::exist() const QString ViewProperties::destinationDir(const QString& subDir) const { QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation); - path.append(KGlobal::mainComponent().componentName()); path.append("/view_properties/").append(subDir); return path; } -- cgit v1.3 From d0f0f1f2e2644e3738c03374d062dab9acc61eaf Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Mon, 10 Nov 2014 08:45:38 +0100 Subject: make use of initializer lists --- src/dolphinmainwindow.cpp | 14 +++++------ src/dolphinpart.cpp | 2 +- src/kitemviews/kfileitemlistview.cpp | 4 +-- src/kitemviews/kstandarditemlistview.cpp | 2 +- src/panels/folders/folderspanel.cpp | 2 +- src/panels/folders/treeviewcontextmenu.cpp | 4 +-- src/panels/places/placesitemmodel.cpp | 10 ++++---- src/settings/serviceitemdelegate.cpp | 2 +- src/tests/kfileitemlistviewtest.cpp | 4 +-- src/tests/kfileitemmodelbenchmark.cpp | 2 +- src/tests/kfileitemmodeltest.cpp | 14 +++++------ src/tests/kitemlistselectionmanagertest.cpp | 26 ++++++++++---------- src/tests/kitemrangetest.cpp | 38 ++++++++++++++--------------- src/views/dolphinview.cpp | 6 ++--- src/views/dolphinviewactionhandler.cpp | 4 +-- src/views/draganddrophelper.cpp | 2 +- src/views/renamedialog.cpp | 2 +- src/views/viewproperties.cpp | 5 ++-- 18 files changed, 71 insertions(+), 72 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index eece5b878..637d46a01 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -340,7 +340,7 @@ void DolphinMainWindow::openInNewWindow() } if (!newWindowUrl.isEmpty()) { - KRun::run("dolphin %u", QList() << newWindowUrl, this); + KRun::run("dolphin %u", {newWindowUrl}, this); } } @@ -774,7 +774,7 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos, case DolphinContextMenu::OpenParentFolderInNewWindow: { - KRun::run("dolphin %u", QList() << KIO::upUrl(item.url()), this); + KRun::run("dolphin %u", {KIO::upUrl(item.url())}, this); break; } @@ -995,7 +995,7 @@ void DolphinMainWindow::setupActions() QAction* newTab = actionCollection()->addAction("new_tab"); newTab->setIcon(QIcon::fromTheme("tab-new")); newTab->setText(i18nc("@action:inmenu File", "New Tab")); - actionCollection()->setDefaultShortcuts(newTab, QList() << QKeySequence(Qt::CTRL | Qt::Key_T) << QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_N)); + actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N}); connect(newTab, &QAction::triggered, this, static_cast(&DolphinMainWindow::openNewActivatedTab)); QAction* closeTab = actionCollection()->addAction("close_tab"); @@ -1173,7 +1173,7 @@ void DolphinMainWindow::setupDockWidgets() infoDock->setObjectName("infoDock"); infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); InformationPanel* infoPanel = new InformationPanel(infoDock); - infoPanel->setCustomContextMenuActions(QList() << lockLayoutAction); + infoPanel->setCustomContextMenuActions({lockLayoutAction}); connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl); infoDock->setWidget(infoPanel); @@ -1194,7 +1194,7 @@ void DolphinMainWindow::setupDockWidgets() foldersDock->setObjectName("foldersDock"); foldersDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); FoldersPanel* foldersPanel = new FoldersPanel(foldersDock); - foldersPanel->setCustomContextMenuActions(QList() << lockLayoutAction); + foldersPanel->setCustomContextMenuActions({lockLayoutAction}); foldersDock->setWidget(foldersPanel); QAction* foldersAction = foldersDock->toggleViewAction(); @@ -1217,7 +1217,7 @@ void DolphinMainWindow::setupDockWidgets() terminalDock->setObjectName("terminalDock"); terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); TerminalPanel* terminalPanel = new TerminalPanel(terminalDock); - terminalPanel->setCustomContextMenuActions(QList() << lockLayoutAction); + terminalPanel->setCustomContextMenuActions({lockLayoutAction}); terminalDock->setWidget(terminalPanel); connect(terminalPanel, &TerminalPanel::hideTerminalPanel, terminalDock, &DolphinDockWidget::hide); @@ -1248,7 +1248,7 @@ void DolphinMainWindow::setupDockWidgets() placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); PlacesPanel* placesPanel = new PlacesPanel(placesDock); - placesPanel->setCustomContextMenuActions(QList() << lockLayoutAction); + placesPanel->setCustomContextMenuActions({lockLayoutAction}); placesDock->setWidget(placesPanel); QAction* placesAction = placesDock->toggleViewAction(); diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 1c79a5980..8484b7ef9 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -556,7 +556,7 @@ void DolphinPart::slotOpenTerminal() void DolphinPart::slotFindFile() { - KRun::run("kfind", QList() << url(), widget()); + KRun::run("kfind", {url()}, widget()); } void DolphinPart::updateNewMenu() diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index f5535a653..4bdd8ff67 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -66,7 +66,7 @@ KFileItemListView::KFileItemListView(QGraphicsWidget* parent) : m_updateIconSizeTimer->setInterval(LongInterval); connect(m_updateIconSizeTimer, &QTimer::timeout, this, &KFileItemListView::updateIconSize); - setVisibleRoles(QList() << "text"); + setVisibleRoles({"text"}); } KFileItemListView::~KFileItemListView() @@ -205,7 +205,7 @@ void KFileItemListView::initializeItemListWidget(KItemListWidget* item) const KFileItem fileItem = fileItemModel->fileItem(item->index()); data.insert("iconName", fileItem.iconName()); - item->setData(data, QSet() << "iconName"); + item->setData(data, {"iconName"}); } } diff --git a/src/kitemviews/kstandarditemlistview.cpp b/src/kitemviews/kstandarditemlistview.cpp index 4ef5bed09..0e6c84ffd 100644 --- a/src/kitemviews/kstandarditemlistview.cpp +++ b/src/kitemviews/kstandarditemlistview.cpp @@ -30,7 +30,7 @@ KStandardItemListView::KStandardItemListView(QGraphicsWidget* parent) : { setAcceptDrops(true); setScrollOrientation(Qt::Vertical); - setVisibleRoles(QList() << "text"); + setVisibleRoles({"text"}); } KStandardItemListView::~KStandardItemListView() diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 5bfc88c2a..f56f5a139 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -259,7 +259,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co KIO::Job* job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, this); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList() << oldUrl, newUrl, job); + KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); job->ui()->setAutoErrorHandlingEnabled(true); } } diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 4fdaef3b6..6120261d0 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -193,7 +193,7 @@ void TreeViewContextMenu::rename() void TreeViewContextMenu::moveToTrash() { - const QList list {m_fileItem.url()}; + const QList list{m_fileItem.url()}; KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(m_parent); if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) { @@ -206,7 +206,7 @@ void TreeViewContextMenu::moveToTrash() void TreeViewContextMenu::deleteItem() { - const QList list {m_fileItem.url()}; + const QList list{m_fileItem.url()}; KIO::JobUiDelegate uiDelegate; uiDelegate.setWindow(m_parent); if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) { diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 057a8b2d7..cfe6d2e46 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -873,22 +873,22 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da if (path == QLatin1String("/documents")) { props.setViewMode(DolphinView::DetailsView); props.setPreviewsShown(false); - props.setVisibleRoles(QList() << "text" << "path"); + props.setVisibleRoles({"text", "path"}); } else if (path == QLatin1String("/images")) { props.setViewMode(DolphinView::IconsView); props.setPreviewsShown(true); - props.setVisibleRoles(QList() << "text" << "imageSize"); + props.setVisibleRoles({"text", "imageSize"}); } else if (path == QLatin1String("/audio")) { props.setViewMode(DolphinView::DetailsView); props.setPreviewsShown(false); - props.setVisibleRoles(QList() << "text" << "artist" << "album"); + props.setVisibleRoles({"text", "artist", "album"}); } else if (path == QLatin1String("/videos")) { props.setViewMode(DolphinView::IconsView); props.setPreviewsShown(true); - props.setVisibleRoles(QList() << "text"); + props.setVisibleRoles({"text"}); } else if (data.url.scheme() == "timeline") { props.setViewMode(DolphinView::DetailsView); - props.setVisibleRoles(QList() << "text" << "date"); + props.setVisibleRoles({"text", "date"}); } } } diff --git a/src/settings/serviceitemdelegate.cpp b/src/settings/serviceitemdelegate.cpp index 62ab60fd9..774ea78ae 100644 --- a/src/settings/serviceitemdelegate.cpp +++ b/src/settings/serviceitemdelegate.cpp @@ -77,7 +77,7 @@ QList ServiceItemDelegate::createItemWidgets(const QModelIndex&) const QPushButton* configureButton = new QPushButton(); connect(configureButton, &QPushButton::clicked, this, &ServiceItemDelegate::slotConfigureButtonClicked); - return QList() << checkBox << configureButton; + return {checkBox, configureButton}; } void ServiceItemDelegate::updateItemWidgets(const QList widgets, diff --git a/src/tests/kfileitemlistviewtest.cpp b/src/tests/kfileitemlistviewtest.cpp index 4987e8d65..696580c0a 100644 --- a/src/tests/kfileitemlistviewtest.cpp +++ b/src/tests/kfileitemlistviewtest.cpp @@ -93,14 +93,14 @@ void KFileItemListViewTest::testGroupedItemChanges() { m_model->setGroupedSorting(true); - m_testDir->createFiles(QStringList() << "1" << "3" << "5"); + m_testDir->createFiles({"1", "3", "5"}); m_model->loadDirectory(m_testDir->url()); QSignalSpy psy(m_model, SIGNAL(itemsInserted(KItemRangeList))); QVERIFY(psy.wait(DefaultTimeout)); QCOMPARE(m_model->count(), 3); - m_testDir->createFiles(QStringList() << "2" << "4"); + m_testDir->createFiles({"2", "4"}); m_model->m_dirLister->updateDirectory(m_testDir->url()); QSignalSpy psyItemsInserted(m_model, SIGNAL(itemsInserted(KItemRangeList))); QVERIFY(psyItemsInserted.wait(DefaultTimeout)); diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp index 0da1137c4..43d7173de 100644 --- a/src/tests/kfileitemmodelbenchmark.cpp +++ b/src/tests/kfileitemmodelbenchmark.cpp @@ -167,7 +167,7 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems() // Avoid overhead caused by natural sorting // and determining the isDir/isLink roles. model.m_naturalSorting = false; - model.setRoles(QSet() << "text"); + model.setRoles({"text"}); QSignalSpy spyItemsInserted(&model, SIGNAL(itemsInserted(KItemRangeList))); QSignalSpy spyItemsRemoved(&model, SIGNAL(itemsRemoved(KItemRangeList))); diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index ec13a8b2a..d224e1a2e 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -199,7 +199,7 @@ void KFileItemModelTest::testDirLoadingCompleted() QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList))); QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList))); - m_testDir->createFiles(QStringList() << "a.txt" << "b.txt" << "c.txt"); + m_testDir->createFiles({"a.txt", "b.txt", "c.txt"}); m_model->loadDirectory(m_testDir->url()); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(directoryLoadingCompleted()), DefaultTimeout)); @@ -208,7 +208,7 @@ void KFileItemModelTest::testDirLoadingCompleted() QCOMPARE(itemsRemovedSpy.count(), 0); QCOMPARE(m_model->count(), 3); - m_testDir->createFiles(QStringList() << "d.txt" << "e.txt"); + m_testDir->createFiles({"d.txt", "e.txt"}); m_model->m_dirLister->updateDirectory(m_testDir->url()); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(directoryLoadingCompleted()), DefaultTimeout)); QCOMPARE(loadingCompletedSpy.count(), 2); @@ -408,7 +408,7 @@ void KFileItemModelTest::testResortAfterChangingName() urlA.setPath(urlA.path() + "a.txt"); fileItemA.setUrl(urlA); - m_model->slotRefreshItems(QList >() << qMakePair(fileItemD, fileItemA)); + m_model->slotRefreshItems({qMakePair(fileItemD, fileItemA)}); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsMoved(KItemRange,QList)), DefaultTimeout)); QCOMPARE(itemsInModel(), QStringList() << "a.txt" << "b.txt" << "c.txt"); @@ -1060,7 +1060,7 @@ void KFileItemModelTest::testRefreshExpandedItem() QSignalSpy spyItemsChanged(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet))); const KFileItem item = m_model->fileItem(0); - m_model->slotRefreshItems(QList >() << qMakePair(item, item)); + m_model->slotRefreshItems({qMakePair(item, item)}); QVERIFY(!spyItemsChanged.isEmpty()); QCOMPARE(m_model->count(), 5); // "a/", "a/1", "a/2", "3", "4" @@ -1077,7 +1077,7 @@ void KFileItemModelTest::testRemoveHiddenItems() m_testDir->createDir(".b"); m_testDir->createDir("c"); m_testDir->createDir("d"); - m_testDir->createFiles(QStringList() << ".f" << ".g" << "h" << "i"); + m_testDir->createFiles({".f", ".g", "h", "i"}); QSignalSpy spyItemsInserted(m_model, SIGNAL(itemsInserted(KItemRangeList))); QSignalSpy spyItemsRemoved(m_model, SIGNAL(itemsRemoved(KItemRangeList))); @@ -1361,7 +1361,7 @@ void KFileItemModelTest::testNameRoleGroups() urlC.setPath(urlC.path() + "c.txt"); fileItemC.setUrl(urlC); - m_model->slotRefreshItems(QList >() << qMakePair(fileItemD, fileItemC)); + m_model->slotRefreshItems({qMakePair(fileItemD, fileItemC)}); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(groupsChanged()), DefaultTimeout)); QCOMPARE(itemsInModel(), QStringList() << "a.txt" << "b.txt" << "c.txt" << "e.txt"); @@ -1588,7 +1588,7 @@ void KFileItemModelTest::testRefreshFilteredItems() urlE.setPath(urlE.path() + "e.jpg"); fileItemE.setUrl(urlE); - m_model->slotRefreshItems(QList >() << qMakePair(fileItemC, fileItemE)); + m_model->slotRefreshItems({qMakePair(fileItemC, fileItemE)}); // Show all files again, and verify that the model has updated the file name. m_model->setNameFilter(QString()); diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp index b41b699a9..fb0f4fc2b 100644 --- a/src/tests/kitemlistselectionmanagertest.cpp +++ b/src/tests/kitemlistselectionmanagertest.cpp @@ -369,7 +369,7 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 2 << 3 << (KItemSet() << 2 << 3 << 5 << 6) << NoChange - << QList() + << QList{} << (KItemSet() << 2 << 3 << 5 << 6); QTest::newRow("Insert Items") @@ -377,7 +377,7 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 2 << 3 << (KItemSet() << 2 << 3 << 5 << 6) << InsertItems - << (QList() << QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2) << KItemRange(10, 5))) + << QList{QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2) << KItemRange(10, 5))} << (KItemSet() << 3 << 4 << 8 << 9); QTest::newRow("Remove Items") @@ -385,7 +385,7 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 2 << 3 << (KItemSet() << 2 << 3 << 5 << 6) << RemoveItems - << (QList() << QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(3, 1) << KItemRange(10, 5))) + << QList{QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(3, 1) << KItemRange(10, 5))} << (KItemSet() << 1 << 2 << 3 << 4); QTest::newRow("Empty Anchored Selection") @@ -393,7 +393,7 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 2 << 2 << KItemSet() << EndAnchoredSelection - << QList() + << QList{} << KItemSet(); QTest::newRow("Toggle selection") @@ -401,7 +401,7 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 6 << 8 << (KItemSet() << 1 << 3 << 4 << 6 << 7 << 8) << SetSelected - << (QList() << 0 << 10 << QVariant::fromValue(KItemListSelectionManager::Toggle)) + << QList{0, 10, QVariant::fromValue(KItemListSelectionManager::Toggle)} << (KItemSet() << 0 << 2 << 5 << 9); // Swap items 2, 3 and 4, 5 @@ -410,8 +410,8 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << -1 << -1 << (KItemSet() << 0 << 1 << 2 << 3) << MoveItems - << (QList() << QVariant::fromValue(KItemRange(2, 4)) - << QVariant::fromValue(QList() << 4 << 5 << 2 << 3)) + << QList{QVariant::fromValue(KItemRange(2, 4)), + QVariant::fromValue(QList{4, 5, 2, 3})} << (KItemSet() << 0 << 1 << 4 << 5); QTest::newRow("Move items with active anchored selection") @@ -419,8 +419,8 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 0 << 3 << (KItemSet() << 0 << 1 << 2 << 3) << MoveItems - << (QList() << QVariant::fromValue(KItemRange(2, 4)) - << QVariant::fromValue(QList() << 4 << 5 << 2 << 3)) + << QList{QVariant::fromValue(KItemRange(2, 4)), + QVariant::fromValue(QList{4, 5, 2, 3})} << (KItemSet() << 0 << 1 << 4 << 5); // Revert sort order @@ -429,8 +429,8 @@ void KItemListSelectionManagerTest::testChangeSelection_data() << 3 << 4 << (KItemSet() << 0 << 1 << 3 << 4) << MoveItems - << (QList() << QVariant::fromValue(KItemRange(0, 10)) - << QVariant::fromValue(QList() << 9 << 8 << 7 << 6 << 5 << 4 << 3 << 2 << 1 << 0)) + << QList{QVariant::fromValue(KItemRange(0, 10)), + QVariant::fromValue(QList{9, 8, 7, 6, 5, 4, 3, 2, 1, 0})} << (KItemSet() << 5 << 6 << 8 << 9); } @@ -476,7 +476,7 @@ void KItemListSelectionManagerTest::testChangeSelection() break; case MoveItems: m_selectionManager->itemsMoved(data.at(0).value(), - data.at(1).value >()); + data.at(1).value>()); break; case EndAnchoredSelection: m_selectionManager->endAnchoredSelection(); @@ -535,7 +535,7 @@ void KItemListSelectionManagerTest::testAnchoredSelectionAfterMovingItems() m_selectionManager->beginAnchoredSelection(4); // Reverse the items between 0 and 5. - m_selectionManager->itemsMoved(KItemRange(0, 6), QList() << 5 << 4 << 3 << 2 << 1 << 0); + m_selectionManager->itemsMoved(KItemRange(0, 6), {5, 4, 3, 2, 1, 0}); QCOMPARE(m_selectionManager->currentItem(), 1); QCOMPARE(m_selectionManager->m_anchorItem, 1); diff --git a/src/tests/kitemrangetest.cpp b/src/tests/kitemrangetest.cpp index 960530a7b..011f5ae86 100644 --- a/src/tests/kitemrangetest.cpp +++ b/src/tests/kitemrangetest.cpp @@ -40,25 +40,25 @@ void KItemRangeTest::testFromSortedContainer_data() QTest::addColumn >("sortedNumbers"); QTest::addColumn("expected"); - QTest::newRow("empty") << QVector() << KItemRangeList(); - QTest::newRow("[1]") << (QVector() << 1) << (KItemRangeList() << KItemRange(1, 1)); - QTest::newRow("[9]") << (QVector() << 9) << (KItemRangeList() << KItemRange(9, 1)); - QTest::newRow("[1-2]") << (QVector() << 1 << 2) << (KItemRangeList() << KItemRange(1, 2)); - QTest::newRow("[1-3]") << (QVector() << 1 << 2 << 3) << (KItemRangeList() << KItemRange(1, 3)); - QTest::newRow("[1] [4]") << (QVector() << 1 << 4) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(4, 1)); - QTest::newRow("[1-3] [5]") << (QVector() << 1 << 2 << 3 << 5) << (KItemRangeList() << KItemRange(1, 3) << KItemRange(5, 1)); - QTest::newRow("[1] [5-6]") << (QVector() << 1 << 5 << 6) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2)); - QTest::newRow("duplicates: 1 1") << (QVector() << 1 << 1) << (KItemRangeList() << KItemRange(1, 1)); - QTest::newRow("duplicates: 1 1 1") << (QVector() << 1 << 1 << 1) << (KItemRangeList() << KItemRange(1, 1)); - QTest::newRow("duplicates: 1 1 5") << (QVector() << 1 << 1 << 5) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); - QTest::newRow("duplicates: 1 5 5") << (QVector() << 1 << 5 << 5) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); - QTest::newRow("duplicates: 1 1 1 5") << (QVector() << 1 << 1 << 1 << 5) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); - QTest::newRow("duplicates: 1 5 5 5") << (QVector() << 1 << 5 << 5 << 5) << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); - QTest::newRow("duplicates: 1 1 2") << (QVector() << 1 << 1 << 2) << (KItemRangeList() << KItemRange(1, 2)); - QTest::newRow("duplicates: 1 2 2") << (QVector() << 1 << 2 << 2) << (KItemRangeList() << KItemRange(1, 2)); - QTest::newRow("duplicates: 1 1 2 3") << (QVector() << 1 << 1 << 2 << 3) << (KItemRangeList() << KItemRange(1, 3)); - QTest::newRow("duplicates: 1 2 2 3") << (QVector() << 1 << 2 << 2 << 3) << (KItemRangeList() << KItemRange(1, 3)); - QTest::newRow("duplicates: 1 2 3 3") << (QVector() << 1 << 2 << 3 << 3) << (KItemRangeList() << KItemRange(1, 3)); + QTest::newRow("empty") << QVector{} << KItemRangeList(); + QTest::newRow("[1]") << QVector{1} << (KItemRangeList() << KItemRange(1, 1)); + QTest::newRow("[9]") << QVector{9} << (KItemRangeList() << KItemRange(9, 1)); + QTest::newRow("[1-2]") << QVector{1, 2} << (KItemRangeList() << KItemRange(1, 2)); + QTest::newRow("[1-3]") << QVector{1, 2, 3} << (KItemRangeList() << KItemRange(1, 3)); + QTest::newRow("[1] [4]") << QVector{1, 4} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(4, 1)); + QTest::newRow("[1-3] [5]") << QVector{1, 2, 3, 5} << (KItemRangeList() << KItemRange(1, 3) << KItemRange(5, 1)); + QTest::newRow("[1] [5-6]") << QVector{1, 5, 6} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2)); + QTest::newRow("duplicates: 1 1") << QVector{1, 1} << (KItemRangeList() << KItemRange(1, 1)); + QTest::newRow("duplicates: 1 1 1") << QVector{1, 1, 1} << (KItemRangeList() << KItemRange(1, 1)); + QTest::newRow("duplicates: 1 1 5") << QVector{1, 1, 5} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); + QTest::newRow("duplicates: 1 5 5") << QVector{1, 5, 5} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); + QTest::newRow("duplicates: 1 1 1 5") << QVector{1, 1, 1, 5} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); + QTest::newRow("duplicates: 1 5 5 5") << QVector{1, 5, 5, 5} << (KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 1)); + QTest::newRow("duplicates: 1 1 2") << QVector{1, 1, 2} << (KItemRangeList() << KItemRange(1, 2)); + QTest::newRow("duplicates: 1 2 2") << QVector{1, 2, 2} << (KItemRangeList() << KItemRange(1, 2)); + QTest::newRow("duplicates: 1 1 2 3") << QVector{1, 1, 2, 3} << (KItemRangeList() << KItemRange(1, 3)); + QTest::newRow("duplicates: 1 2 2 3") << QVector{1, 2, 2, 3} << (KItemRangeList() << KItemRange(1, 3)); + QTest::newRow("duplicates: 1 2 3 3") << QVector{1, 2, 3, 3} << (KItemRangeList() << KItemRange(1, 3)); } void KItemRangeTest::testFromSortedContainer() diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 782cc19f2..00281af73 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -125,7 +125,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : m_model = new KFileItemModel(this); m_view = new DolphinItemListView(); m_view->setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); - m_view->setVisibleRoles(QList() << "text"); + m_view->setVisibleRoles({"text"}); applyModeToView(); KItemListController* controller = new KItemListController(m_model, m_view, this); @@ -1286,7 +1286,7 @@ void DolphinView::observeCreatedItem(const QUrl& url) if (m_active) { clearSelection(); markUrlAsCurrent(url); - markUrlsAsSelected(QList() << url); + markUrlsAsSelected({url}); } } @@ -1513,7 +1513,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con KIO::Job * job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, this); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList() << oldUrl, newUrl, job); + KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); job->ui()->setAutoErrorHandlingEnabled(true); if (!newNameExistsAlready) { diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 668623c8c..08d140c01 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -141,7 +141,7 @@ void DolphinViewActionHandler::createActions() // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :) propertiesAction->setText( i18nc("@action:inmenu File", "Properties") ); propertiesAction->setIcon(QIcon::fromTheme("document-properties")); - m_actionCollection->setDefaultShortcuts(propertiesAction, QList() << Qt::ALT + Qt::Key_Return << Qt::ALT + Qt::Key_Enter); + m_actionCollection->setDefaultShortcuts(propertiesAction, {Qt::ALT + Qt::Key_Return, Qt::ALT + Qt::Key_Enter}); connect(propertiesAction, &QAction::triggered, this, &DolphinViewActionHandler::slotProperties); // View menu @@ -211,7 +211,7 @@ void DolphinViewActionHandler::createActions() KToggleAction* showHiddenFiles = m_actionCollection->add("show_hidden_files"); showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); - m_actionCollection->setDefaultShortcuts(showHiddenFiles, QList() << Qt::ALT + Qt::Key_Period << Qt::Key_F8); + m_actionCollection->setDefaultShortcuts(showHiddenFiles, {Qt::ALT + Qt::Key_Period, Qt::Key_F8}); connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles); QAction* adjustViewProps = m_actionCollection->addAction("view_properties"); diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index 1f3f4ba82..a09faa345 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -47,7 +47,7 @@ KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const QUr QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, remoteDBusPath, "org.kde.ark.DndExtract", "extractSelectedFilesTo"); - message.setArguments(QVariantList() << destUrl.toDisplayString(QUrl::PreferLocalFile)); + message.setArguments({destUrl.toDisplayString(QUrl::PreferLocalFile)}); QDBusConnection::sessionBus().call(message); } else if (!destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile())) { // Drop into a directory or a desktop-file diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index 458b9ef79..7fdb486e1 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -159,7 +159,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName) KIO::Job * job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, widget); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList() << oldUrl, newUrl, job); + KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); job->ui()->setAutoErrorHandlingEnabled(true); } diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 5eb5d23fd..36c6338fe 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -98,7 +98,7 @@ ViewProperties::ViewProperties(const QUrl& url) : if (useDefaultProps) { if (useDetailsViewWithPath) { setViewMode(DolphinView::DetailsView); - setVisibleRoles(QList() << "path"); + setVisibleRoles({"path"}); } else { // The global view-properties act as default for directories without // any view-property configuration. Constructing a ViewProperties @@ -286,8 +286,7 @@ QList ViewProperties::visibleRoles() const // by "CustomizedDetails"), also a details-view with no additional information // is accepted. - QList roles; - roles.append("text"); + QList roles{"text"}; // Iterate through all stored keys and append all roles that match to // the current view mode. -- cgit v1.3 From b5fc0369993986c2e47abf223dd659f8820894bf Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Sun, 14 Dec 2014 19:11:39 +0100 Subject: use save() instead of writeConfig() --- src/panels/places/placesview.cpp | 2 +- src/settings/dolphinsettingsdialog.cpp | 2 +- src/settings/general/behaviorsettingspage.cpp | 2 +- src/settings/general/confirmationssettingspage.cpp | 2 +- src/settings/general/statusbarsettingspage.cpp | 2 +- src/settings/navigation/navigationsettingspage.cpp | 2 +- src/settings/startup/startupsettingspage.cpp | 2 +- src/settings/viewmodes/viewmodesettings.cpp | 2 +- src/settings/viewmodes/viewmodesettings.h | 2 +- src/settings/viewmodes/viewsettingstab.cpp | 2 +- src/settings/viewpropertiesdialog.cpp | 2 +- src/views/viewproperties.cpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp index 7c455b4bc..d755d46b5 100644 --- a/src/panels/places/placesview.cpp +++ b/src/panels/places/placesview.cpp @@ -35,7 +35,7 @@ void PlacesView::setIconSize(int size) if (size != iconSize()) { PlacesPanelSettings* settings = PlacesPanelSettings::self(); settings->setIconSize(size); - settings->writeConfig(); + settings->save(); KItemListStyleOption option = styleOption(); option.iconSize = size; diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index d9240d97c..0bbc3ed7f 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -135,7 +135,7 @@ void DolphinSettingsDialog::applySettings() // Reset the modified startup settings hint. The changed startup settings // have been applied already due to emitting settingsChanged(). settings->setModifiedStartupSettings(false); - settings->writeConfig(); + settings->save(); } buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(false); } diff --git a/src/settings/general/behaviorsettingspage.cpp b/src/settings/general/behaviorsettingspage.cpp index f311b1a3c..83515beb0 100644 --- a/src/settings/general/behaviorsettingspage.cpp +++ b/src/settings/general/behaviorsettingspage.cpp @@ -98,7 +98,7 @@ void BehaviorSettingsPage::applySettings() settings->setShowToolTips(m_showToolTips->isChecked()); settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); settings->setRenameInline(m_renameInline->isChecked()); - settings->writeConfig(); + settings->save(); if (useGlobalViewProps) { // Remember the global view properties by applying the current view properties. diff --git a/src/settings/general/confirmationssettingspage.cpp b/src/settings/general/confirmationssettingspage.cpp index 54cc49043..617d31c7d 100644 --- a/src/settings/general/confirmationssettingspage.cpp +++ b/src/settings/general/confirmationssettingspage.cpp @@ -98,7 +98,7 @@ void ConfirmationsSettingsPage::applySettings() GeneralSettings* settings = GeneralSettings::self(); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); - settings->writeConfig(); + settings->save(); } void ConfirmationsSettingsPage::restoreDefaults() diff --git a/src/settings/general/statusbarsettingspage.cpp b/src/settings/general/statusbarsettingspage.cpp index cb6ae6cd4..d12a0c1fc 100644 --- a/src/settings/general/statusbarsettingspage.cpp +++ b/src/settings/general/statusbarsettingspage.cpp @@ -56,7 +56,7 @@ void StatusBarSettingsPage::applySettings() GeneralSettings* settings = GeneralSettings::self(); settings->setShowZoomSlider(m_showZoomSlider->isChecked()); settings->setShowSpaceInfo(m_showSpaceInfo->isChecked()); - settings->writeConfig(); + settings->save(); } void StatusBarSettingsPage::restoreDefaults() diff --git a/src/settings/navigation/navigationsettingspage.cpp b/src/settings/navigation/navigationsettingspage.cpp index 133e94350..69feed3ee 100644 --- a/src/settings/navigation/navigationsettingspage.cpp +++ b/src/settings/navigation/navigationsettingspage.cpp @@ -94,7 +94,7 @@ void NavigationSettingsPage::applySettings() settings->setBrowseThroughArchives(m_openArchivesAsFolder->isChecked()); settings->setAutoExpandFolders(m_autoExpandFolders->isChecked()); - settings->writeConfig(); + settings->save(); } void NavigationSettingsPage::restoreDefaults() diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 3bf922dfe..11adb869b 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -148,7 +148,7 @@ void StartupSettingsPage::applySettings() settings->setShowFullPath(m_showFullPath->isChecked()); settings->setFilterBar(m_filterBar->isChecked()); - settings->writeConfig(); + settings->save(); } void StartupSettingsPage::restoreDefaults() diff --git a/src/settings/viewmodes/viewmodesettings.cpp b/src/settings/viewmodes/viewmodesettings.cpp index 01601f711..2191b76fe 100644 --- a/src/settings/viewmodes/viewmodesettings.cpp +++ b/src/settings/viewmodes/viewmodesettings.cpp @@ -132,7 +132,7 @@ void ViewModeSettings::readConfig() } } -void ViewModeSettings::writeConfig() +void ViewModeSettings::save() { switch (m_mode) { case ViewModeSettings::IconsMode: IconsModeSettings::self()->save(); break; diff --git a/src/settings/viewmodes/viewmodesettings.h b/src/settings/viewmodes/viewmodesettings.h index be41ae284..9f0b44e9b 100644 --- a/src/settings/viewmodes/viewmodesettings.h +++ b/src/settings/viewmodes/viewmodesettings.h @@ -61,7 +61,7 @@ public: int fontWeight() const; void readConfig(); - void writeConfig(); + void save(); private: ViewMode m_mode; diff --git a/src/settings/viewmodes/viewsettingstab.cpp b/src/settings/viewmodes/viewsettingstab.cpp index 2169ca955..632ae99da 100644 --- a/src/settings/viewmodes/viewsettingstab.cpp +++ b/src/settings/viewmodes/viewsettingstab.cpp @@ -195,7 +195,7 @@ void ViewSettingsTab::applySettings() settings.setItalicFont(font.italic()); settings.setFontWeight(font.weight()); - settings.writeConfig(); + settings.save(); } void ViewSettingsTab::restoreDefaultSettings() diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 338a14277..2e503bbe1 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -352,7 +352,7 @@ void ViewPropertiesDialog::applyViewProperties() // all existing viewproperties invalid, as they have a smaller time stamp. GeneralSettings* settings = GeneralSettings::self(); settings->setViewPropsTimestamp(QDateTime::currentDateTime()); - settings->writeConfig(); + settings->save(); } m_dolphinView->setMode(m_viewProps->viewMode()); diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 36c6338fe..f52be7478 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -365,7 +365,7 @@ void ViewProperties::save() QDir dir; dir.mkpath(m_filePath); m_node->setVersion(CurrentViewPropertiesVersion); - m_node->writeConfig(); + m_node->save(); m_changedProps = false; } -- cgit v1.3 From 3dbee30c1aecfa4924c587e764a13ae5755c9279 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Fri, 6 Feb 2015 09:37:24 +0100 Subject: Clean up includes --- src/views/draganddrophelper.cpp | 3 --- src/views/draganddrophelper.h | 1 - src/views/viewproperties.cpp | 2 -- 3 files changed, 6 deletions(-) (limited to 'src/views/viewproperties.cpp') diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index f740fd520..c0044c96e 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -26,9 +26,6 @@ #include #include -#include -#include -#include #include #include diff --git a/src/views/draganddrophelper.h b/src/views/draganddrophelper.h index 85268eb4f..0fbe3a128 100644 --- a/src/views/draganddrophelper.h +++ b/src/views/draganddrophelper.h @@ -23,7 +23,6 @@ #include "libdolphin_export.h" -#include class QUrl; class QDropEvent; diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index f52be7478..c8d92be6d 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -25,9 +25,7 @@ #include #include -#include -#include #include #include #include -- cgit v1.3 From 169cca55b9621689712321da8c0425f8002d0008 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Tue, 24 Feb 2015 13:07:35 +0100 Subject: Replace kDebug/kWarning by categorized logging (org.kde.dolphin) --- src/CMakeLists.txt | 1 + src/dolphindebug.cpp | 22 +++++++++++ src/dolphindebug.h | 27 +++++++++++++ src/dolphinpart.cpp | 8 ++-- src/kitemviews/kfileitemmodel.cpp | 44 +++++++++++----------- src/kitemviews/kitemlistview.cpp | 8 ++-- src/kitemviews/private/kitemlistviewlayouter.cpp | 4 +- src/main.cpp | 6 +-- src/panels/folders/folderspanel.cpp | 2 +- src/panels/places/placesitem.cpp | 2 +- src/panels/places/placesitemeditdialog.cpp | 2 +- src/panels/places/placesitemmodel.cpp | 30 +++++++-------- src/panels/places/placespanel.cpp | 2 +- src/settings/serviceitemdelegate.cpp | 2 +- src/tests/kstandarditemmodeltest.cpp | 4 +- src/views/dolphinfileitemlistwidget.cpp | 2 +- src/views/dolphinremoteencoding.cpp | 8 ++-- src/views/dolphinviewactionhandler.cpp | 2 +- .../versioncontrol/versioncontrolobserver.cpp | 4 +- src/views/viewproperties.cpp | 6 +-- 20 files changed, 118 insertions(+), 68 deletions(-) create mode 100644 src/dolphindebug.cpp create mode 100644 src/dolphindebug.h (limited to 'src/views/viewproperties.cpp') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 17ac9cd21..4637e09d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,6 +72,7 @@ set(dolphinprivate_LIB_SRCS views/zoomlevelinfo.cpp dolphinremoveaction.cpp dolphinnewfilemenu.cpp + dolphindebug.cpp ) if(HAVE_BALOO) diff --git a/src/dolphindebug.cpp b/src/dolphindebug.cpp new file mode 100644 index 000000000..17f108427 --- /dev/null +++ b/src/dolphindebug.cpp @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2015 by Emmanuel Pescosta * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "dolphindebug.h" + +Q_LOGGING_CATEGORY(DolphinDebug, "org.kde.dolphin") diff --git a/src/dolphindebug.h b/src/dolphindebug.h new file mode 100644 index 000000000..9b4554b49 --- /dev/null +++ b/src/dolphindebug.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2015 by Emmanuel Pescosta * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef DOLPHIN_DEBUG_H +#define DOLPHIN_DEBUG_H + +#include + +Q_DECLARE_LOGGING_CATEGORY(DolphinDebug) + +#endif // DOLPHIN_DEBUG_H diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index cd1ac52b8..3473218e5 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include "dolphindebug.h" #include #include #include @@ -138,7 +138,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems); connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted); } else { - kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported"; + qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported"; } createActions(); @@ -340,7 +340,7 @@ void DolphinPart::slotMessage(const QString& msg) void DolphinPart::slotErrorMessage(const QString& msg) { - kDebug() << msg; + qCDebug(DolphinDebug) << msg; emit canceled(msg); //KMessageBox::error(m_view, msg); } @@ -471,7 +471,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos, void DolphinPart::slotDirectoryRedirection(const QUrl &oldUrl, const QUrl &newUrl) { - //kDebug() << oldUrl << newUrl << "currentUrl=" << url(); + //qCDebug(DolphinDebug) << oldUrl << newUrl << "currentUrl=" << url(); if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) { KParts::ReadOnlyPart::setUrl(newUrl); const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile); diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 222a940a9..eac3ddf8b 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -24,7 +24,7 @@ #include "dolphin_generalsettings.h" #include -#include +#include "dolphindebug.h" #include "private/kfileitemmodelsortalgorithm.h" #include "private/kfileitemmodeldirlister.h" @@ -339,7 +339,7 @@ QList > KFileItemModel::groups() const } #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed(); #endif } @@ -408,9 +408,9 @@ int KFileItemModel::index(const QUrl& url) const if (m_items.count() != m_itemData.count() && printDebugInfo) { printDebugInfo = false; - kWarning() << "The model is in an inconsistent state."; - kWarning() << "m_items.count() ==" << m_items.count(); - kWarning() << "m_itemData.count() ==" << m_itemData.count(); + qCWarning(DolphinDebug) << "The model is in an inconsistent state."; + qCWarning(DolphinDebug) << "m_items.count() ==" << m_items.count(); + qCWarning(DolphinDebug) << "m_itemData.count() ==" << m_itemData.count(); // Check if there are multiple items with the same URL. QMultiHash indexesForUrl; @@ -420,12 +420,12 @@ int KFileItemModel::index(const QUrl& url) const foreach (const QUrl& url, indexesForUrl.uniqueKeys()) { if (indexesForUrl.count(url) > 1) { - kWarning() << "Multiple items found with the URL" << url; + qCWarning(DolphinDebug) << "Multiple items found with the URL" << url; foreach (int index, indexesForUrl.values(url)) { const ItemData* data = m_itemData.at(index); - kWarning() << "index" << index << ":" << data->item; + qCWarning(DolphinDebug) << "index" << index << ":" << data->item; if (data->parent) { - kWarning() << "parent" << data->parent->item; + qCWarning(DolphinDebug) << "parent" << data->parent->item; } } } @@ -795,8 +795,8 @@ void KFileItemModel::resortAllItems() #ifdef KFILEITEMMODEL_DEBUG QElapsedTimer timer; timer.start(); - kDebug() << "==========================================================="; - kDebug() << "Resorting" << itemCount << "items"; + qCDebug(DolphinDebug) << "==========================================================="; + qCDebug(DolphinDebug) << "Resorting" << itemCount << "items"; #endif // Remember the order of the current URLs so @@ -858,7 +858,7 @@ void KFileItemModel::resortAllItems() } #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed(); #endif } @@ -1013,7 +1013,7 @@ void KFileItemModel::slotRefreshItems(const QList >& { Q_ASSERT(!items.isEmpty()); #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "Refreshing" << items.count() << "items"; + qCDebug(DolphinDebug) << "Refreshing" << items.count() << "items"; #endif // Get the indexes of all items that have been refreshed @@ -1079,7 +1079,7 @@ void KFileItemModel::slotRefreshItems(const QList >& void KFileItemModel::slotClear() { #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "Clearing all items"; + qCDebug(DolphinDebug) << "Clearing all items"; #endif qDeleteAll(m_filteredItems.values()); @@ -1126,8 +1126,8 @@ void KFileItemModel::insertItems(QList& newItems) #ifdef KFILEITEMMODEL_DEBUG QElapsedTimer timer; timer.start(); - kDebug() << "==========================================================="; - kDebug() << "Inserting" << newItems.count() << "items"; + qCDebug(DolphinDebug) << "==========================================================="; + qCDebug(DolphinDebug) << "Inserting" << newItems.count() << "items"; #endif m_groups.clear(); @@ -1144,7 +1144,7 @@ void KFileItemModel::insertItems(QList& newItems) sort(newItems.begin(), newItems.end()); #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "[TIME] Sorting:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] Sorting:" << timer.elapsed(); #endif KItemRangeList itemRanges; @@ -1208,7 +1208,7 @@ void KFileItemModel::insertItems(QList& newItems) emit itemsInserted(itemRanges); #ifdef KFILEITEMMODEL_DEBUG - kDebug() << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed(); #endif } @@ -2213,19 +2213,19 @@ bool KFileItemModel::isConsistent() const // Check if m_items and m_itemData are consistent. const KFileItem item = fileItem(i); if (item.isNull()) { - qWarning() << "Item" << i << "is null"; + qCWarning(DolphinDebug) << "Item" << i << "is null"; return false; } const int itemIndex = index(item); if (itemIndex != i) { - qWarning() << "Item" << i << "has a wrong index:" << itemIndex; + qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex; return false; } // Check if the items are sorted correctly. if (i > 0 && !lessThan(m_itemData.at(i - 1), m_itemData.at(i), m_collator)) { - qWarning() << "The order of items" << i - 1 << "and" << i << "is wrong:" + qCWarning(DolphinDebug) << "The order of items" << i - 1 << "and" << i << "is wrong:" << fileItem(i - 1) << fileItem(i); return false; } @@ -2235,13 +2235,13 @@ bool KFileItemModel::isConsistent() const const ItemData* parent = data->parent; if (parent) { if (expandedParentsCount(data) != expandedParentsCount(parent) + 1) { - qWarning() << "expandedParentsCount is inconsistent for parent" << parent->item << "and child" << data->item; + qCWarning(DolphinDebug) << "expandedParentsCount is inconsistent for parent" << parent->item << "and child" << data->item; return false; } const int parentIndex = index(parent->item); if (parentIndex >= i) { - qWarning() << "Index" << parentIndex << "of parent" << parent->item << "is not smaller than index" << i << "of child" << data->item; + qCWarning(DolphinDebug) << "Index" << parentIndex << "of parent" << parent->item << "is not smaller than index" << i << "of child" << data->item; return false; } } diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 0d0304afc..9416f0dd7 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -22,7 +22,7 @@ #include "kitemlistview.h" -#include +#include "dolphindebug.h" #include "kitemlistcontainer.h" #include "kitemlistcontroller.h" #include "kitemlistheader.h" @@ -543,7 +543,7 @@ void KItemListView::endTransaction() --m_activeTransactions; if (m_activeTransactions < 0) { m_activeTransactions = 0; - qWarning() << "Mismatch between beginTransaction()/endTransaction()"; + qCWarning(DolphinDebug) << "Mismatch between beginTransaction()/endTransaction()"; } if (m_activeTransactions == 0) { @@ -1006,7 +1006,7 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges) const int index = range.index + previouslyInsertedCount; const int count = range.count; if (index < 0 || count <= 0) { - qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")"; + qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")"; continue; } previouslyInsertedCount += count; @@ -1114,7 +1114,7 @@ void KItemListView::slotItemsRemoved(const KItemRangeList& itemRanges) const int index = range.index; const int count = range.count; if (index < 0 || count <= 0) { - qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")"; + qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")"; continue; } diff --git a/src/kitemviews/private/kitemlistviewlayouter.cpp b/src/kitemviews/private/kitemlistviewlayouter.cpp index e2dcc62e7..d54457908 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.cpp +++ b/src/kitemviews/private/kitemlistviewlayouter.cpp @@ -22,7 +22,7 @@ #include #include "kitemlistsizehintresolver.h" -#include +#include "dolphindebug.h" // #define KITEMLISTVIEWLAYOUTER_DEBUG @@ -516,7 +516,7 @@ void KItemListViewLayouter::doLayout() } #ifdef KITEMLISTVIEWLAYOUTER_DEBUG - kDebug() << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed(); #endif m_dirty = false; } diff --git a/src/main.cpp b/src/main.cpp index 14529005f..4291d2fa3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include "dolphindebug.h" #include extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) @@ -109,7 +109,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) if (url.isValid()) { urls.append(url); } else { - qWarning() << "Invalid URL: " << str; + qCWarning(DolphinDebug) << "Invalid URL: " << str; } } @@ -152,7 +152,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) if (className == QLatin1String("DolphinMainWindow")) { m_mainWindow->restore(1); } else { - kWarning() << "Unknown class " << className << " in session saved data!"; + qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!"; } } diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 9169ee9e3..e99c673bc 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -49,7 +49,7 @@ #include -#include +#include "dolphindebug.h" FoldersPanel::FoldersPanel(QWidget* parent) : Panel(parent), diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 59c2ed733..638d59ec0 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -23,7 +23,7 @@ #include "placesitem.h" #include -#include +#include "dolphindebug.h" #include #include #include "placesitemsignalhandler.h" diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index cd04ea3f1..d5ca4bf4f 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -24,7 +24,7 @@ #include "placesitemeditdialog.h" #include -#include +#include "dolphindebug.h" #include #include #include diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 95a913e82..28244c645 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include "dolphindebug.h" #include #include #include @@ -191,7 +191,7 @@ void PlacesItemModel::setHiddenItemsShown(bool show) } #ifdef PLACESITEMMODEL_DEBUG - kDebug() << "Changed visibility of hidden items"; + qCDebug(DolphinDebug) << "Changed visibility of hidden items"; showModelState(); #endif } @@ -496,7 +496,7 @@ void PlacesItemModel::onItemInserted(int index) } #ifdef PLACESITEMMODEL_DEBUG - kDebug() << "Inserted item" << index; + qCDebug(DolphinDebug) << "Inserted item" << index; showModelState(); #endif } @@ -514,7 +514,7 @@ void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem) m_bookmarkedItems.removeAt(boomarkIndex); #ifdef PLACESITEMMODEL_DEBUG - kDebug() << "Removed item" << index; + qCDebug(DolphinDebug) << "Removed item" << index; showModelState(); #endif } @@ -807,7 +807,7 @@ void PlacesItemModel::loadBookmarks() } #ifdef PLACESITEMMODEL_DEBUG - kDebug() << "Loaded bookmarks"; + qCDebug(DolphinDebug) << "Loaded bookmarks"; showModelState(); #endif } @@ -1176,25 +1176,25 @@ QUrl PlacesItemModel::searchUrlForType(const QString& type) #ifdef PLACESITEMMODEL_DEBUG void PlacesItemModel::showModelState() { - kDebug() << "================================="; - kDebug() << "Model:"; - kDebug() << "hidden-index model-index text"; + qCDebug(DolphinDebug) << "================================="; + qCDebug(DolphinDebug) << "Model:"; + qCDebug(DolphinDebug) << "hidden-index model-index text"; int modelIndex = 0; for (int i = 0; i < m_bookmarkedItems.count(); ++i) { if (m_bookmarkedItems[i]) { - kDebug() << i << "(Hidden) " << " " << m_bookmarkedItems[i]->dataValue("text").toString(); + qCDebug(DolphinDebug) << i << "(Hidden) " << " " << m_bookmarkedItems[i]->dataValue("text").toString(); } else { if (item(modelIndex)) { - kDebug() << i << " " << modelIndex << " " << item(modelIndex)->dataValue("text").toString(); + qCDebug(DolphinDebug) << i << " " << modelIndex << " " << item(modelIndex)->dataValue("text").toString(); } else { - kDebug() << i << " " << modelIndex << " " << "(not available yet)"; + qCDebug(DolphinDebug) << i << " " << modelIndex << " " << "(not available yet)"; } ++modelIndex; } } - kDebug(); - kDebug() << "Bookmarks:"; + qCDebug(DolphinDebug); + qCDebug(DolphinDebug) << "Bookmarks:"; int bookmarkIndex = 0; KBookmarkGroup root = m_bookmarkManager->root(); @@ -1203,9 +1203,9 @@ void PlacesItemModel::showModelState() const QString udi = bookmark.metaDataItem("UDI"); const QString text = udi.isEmpty() ? bookmark.text() : udi; if (bookmark.metaDataItem("IsHidden") == QLatin1String("true")) { - kDebug() << bookmarkIndex << "(Hidden)" << text; + qCDebug(DolphinDebug) << bookmarkIndex << "(Hidden)" << text; } else { - kDebug() << bookmarkIndex << " " << text; + qCDebug(DolphinDebug) << bookmarkIndex << " " << text; } bookmark = root.next(bookmark); diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 5618cee21..50ed7e73a 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -26,7 +26,7 @@ #include "dolphin_generalsettings.h" #include -#include +#include "dolphindebug.h" #include #include #include diff --git a/src/settings/serviceitemdelegate.cpp b/src/settings/serviceitemdelegate.cpp index 774ea78ae..a72dd9ec8 100644 --- a/src/settings/serviceitemdelegate.cpp +++ b/src/settings/serviceitemdelegate.cpp @@ -19,7 +19,7 @@ #include "serviceitemdelegate.h" -#include +#include "dolphindebug.h" #include #include diff --git a/src/tests/kstandarditemmodeltest.cpp b/src/tests/kstandarditemmodeltest.cpp index e83e2031d..ea65cc4ce 100644 --- a/src/tests/kstandarditemmodeltest.cpp +++ b/src/tests/kstandarditemmodeltest.cpp @@ -98,13 +98,13 @@ bool KStandardItemModelTest::isModelConsistent() const for (int i = 0; i < m_model->count(); ++i) { const KStandardItem* item = m_model->item(i); if (!item) { - qWarning() << "Item" << i << "is null"; + qCWarning(DolphinDebug) << "Item" << i << "is null"; return false; } const int itemIndex = m_model->index(item); if (itemIndex != i) { - qWarning() << "Item" << i << "has a wrong index:" << itemIndex; + qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex; return false; } } diff --git a/src/views/dolphinfileitemlistwidget.cpp b/src/views/dolphinfileitemlistwidget.cpp index de927d91f..e8345435e 100644 --- a/src/views/dolphinfileitemlistwidget.cpp +++ b/src/views/dolphinfileitemlistwidget.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include "dolphindebug.h" DolphinFileItemListWidget::DolphinFileItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) : diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index fbf21c08f..961a7c800 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -26,7 +26,7 @@ #include "dolphinremoteencoding.h" #include "dolphinviewactionhandler.h" -#include +#include "dolphindebug.h" #include #include #include @@ -141,10 +141,10 @@ void DolphinRemoteEncoding::updateMenu() } } - kDebug() << "URL=" << m_currentURL << " charset=" << charset; + qCDebug(DolphinDebug) << "URL=" << m_currentURL << " charset=" << charset; if (!isFound) { - kWarning() << "could not find entry for charset=" << charset ; + qCWarning(DolphinDebug) << "could not find entry for charset=" << charset ; } else { m_menu->menu()->actions().at(id)->setChecked(true); } @@ -211,7 +211,7 @@ void DolphinRemoteEncoding::slotDefault() } for (QStringList::const_iterator it = domains.constBegin(); it != domains.constEnd();++it) { - kDebug() << "Domain to remove: " << *it; + qCDebug(DolphinDebug) << "Domain to remove: " << *it; if (config.hasGroup(*it)) { config.deleteGroup(*it); } else if (config.group("").hasKey(*it)) { diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 4eec88ff8..ac538a648 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include "dolphindebug.h" #ifdef HAVE_BALOO #include diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index 79ba8dcc4..47e3da357 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include "dolphindebug.h" #include #include #include @@ -94,7 +94,7 @@ QList VersionControlObserver::actions(const KFileItemList& items) cons bool hasNullItems = false; foreach (const KFileItem& item, items) { if (item.isNull()) { - kWarning() << "Requesting version-control-actions for empty items"; + qCWarning(DolphinDebug) << "Requesting version-control-actions for empty items"; hasNullItems = true; break; } diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index c8d92be6d..05c993585 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -24,7 +24,7 @@ #include "dolphin_generalsettings.h" #include -#include +#include "dolphindebug.h" #include #include @@ -359,7 +359,7 @@ void ViewProperties::update() void ViewProperties::save() { - kDebug() << "Saving view-properties to" << m_filePath; + qCDebug(DolphinDebug) << "Saving view-properties to" << m_filePath; QDir dir; dir.mkpath(m_filePath); m_node->setVersion(CurrentViewPropertiesVersion); @@ -388,7 +388,7 @@ QString ViewProperties::viewModePrefix() const case DolphinView::IconsView: prefix = "Icons_"; break; case DolphinView::CompactView: prefix = "Compact_"; break; case DolphinView::DetailsView: prefix = "Details_"; break; - default: kWarning() << "Unknown view-mode of the view properties"; + default: qCWarning(DolphinDebug) << "Unknown view-mode of the view properties"; } return prefix; -- cgit v1.3