From 533f050855a50212bba7be57a1590f9ce743e26d Mon Sep 17 00:00:00 2001 From: Roman Inflianskas Date: Sat, 3 Mar 2018 20:39:43 +0300 Subject: [PATCH] Fix some compile warnings Reviewers: #dolphin, markg Reviewed By: markg Subscribers: elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10995 --- src/dolphincontextmenu.cpp | 1 + src/dolphinmainwindow.cpp | 2 ++ src/dolphintabwidget.cpp | 3 +++ src/kitemviews/kfileitemmodel.cpp | 4 ---- src/kitemviews/kitemlistcontroller.cpp | 4 ++-- src/panels/information/phononwidget.cpp | 3 +++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index de40d7eaa0..1f4e8f0100 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -431,6 +431,7 @@ void DolphinContextMenu::addShowMenuBarAction() bool DolphinContextMenu::placeExists(const QUrl& url) const { + Q_UNUSED(url) // Creating up a PlacesItemModel to find out if 'url' is one of the Places // can be expensive because the model asks Solid for the devices which are // available, which can take some time. diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 48e67733d3..abde14cdd9 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -411,6 +411,8 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event) case QDialogButtonBox::No: // Close only the current tab m_tabWidget->closeTab(); + // Do not quit, ignore quit event + // fall through default: event->ignore(); return; diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index d9b7d7e13e..da1ced4b31 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -91,7 +91,10 @@ void DolphinTabWidget::readProperties(const KConfigGroup& group) } else { // Tab state created with Dolphin <= 4.14.x const QByteArray state = group.readEntry("Tab " % QString::number(i), QByteArray()); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" tabPageAt(i)->restoreStateV1(state); +#pragma GCC diagnostic pop } } diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 70014e1a75..ae0ad30b63 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -248,7 +248,6 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const // Copyright (C) 2006 David Faure QList urls; QList mostLocalUrls; - bool canUseMostLocalUrls = true; const ItemData* lastAddedItem = nullptr; for (int index : indexes) { @@ -271,9 +270,6 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const bool isLocal; mostLocalUrls << item.mostLocalUrl(isLocal); - if (!isLocal) { - canUseMostLocalUrls = false; - } } } diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index c8e109a05f..cef58b643f 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -435,8 +435,8 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) } } } - // Fall through to the default case and add the Space to the current search string. - + // fall through + // to the default case and add the Space to the current search string. default: m_keyboardManager->addKeys(event->text()); // Make sure unconsumed events get propagated up the chain. #302329 diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index b8d3d6ef61..94523c40dc 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -23,7 +23,10 @@ #include #include #include +#pragma GCC diagnostic push // Phonon doesn't use C++11 compiler by default, so override +#pragma GCC diagnostic ignored "-Wsuggest-override" // specifier is not available. Remove this pragmas after fixing it. #include +#pragma GCC diagnostic pop #include #include