diff options
| author | Tomaz Canabrava <[email protected]> | 2018-06-22 16:03:48 +0200 |
|---|---|---|
| committer | Tomaz Canabrava <[email protected]> | 2018-06-26 11:06:36 +0200 |
| commit | 9b7ceaa74da3820f43a8743a4824cf5419466791 (patch) | |
| tree | d25b4c583e1bbb68bfdd23a114a40cecc85a7d9d /src/panels | |
| parent | 9b2a9704ee81c63aa13e646f87242087f88d973b (diff) | |
| parent | 088e692007363bb2c8cd98487cc36ad63186b2d4 (diff) | |
don't use temporaries when uneeded
Summary:
Remove unused variable
Compiled, Run. Trash still there.
Use copy ellision
Remove uneeded code
Reviewers: #dolphin, elvisangelaccio
Reviewed By: #dolphin, elvisangelaccio
Subscribers: elvisangelaccio, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13680
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/panel.cpp | 3 | ||||
| -rw-r--r-- | src/panels/places/placesitem.cpp | 3 | ||||
| -rw-r--r-- | src/panels/places/placesitem.h | 1 | ||||
| -rw-r--r-- | src/panels/places/placesitemsignalhandler.cpp | 3 |
4 files changed, 2 insertions, 8 deletions
diff --git a/src/panels/panel.cpp b/src/panels/panel.cpp index 30cff509d..40f816158 100644 --- a/src/panels/panel.cpp +++ b/src/panels/panel.cpp @@ -64,8 +64,7 @@ void Panel::setUrl(const QUrl& url) const QUrl oldUrl = m_url; m_url = url; - const bool accepted = urlChanged(); - if (!accepted) { + if (!urlChanged()) { m_url = oldUrl; } } diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 10b87086c..9f9041bfa 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -38,7 +38,6 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) : m_disc(), m_mtp(), m_signalHandler(nullptr), - m_trashDirLister(nullptr), m_bookmark() { m_signalHandler = new PlacesItemSignalHandler(this); @@ -48,7 +47,6 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) : PlacesItem::~PlacesItem() { delete m_signalHandler; - delete m_trashDirLister; } void PlacesItem::setUrl(const QUrl &url) @@ -59,7 +57,6 @@ void PlacesItem::setUrl(const QUrl &url) // setting an equal URL results in an itemsChanged() // signal. if (dataValue("url").toUrl() != url) { - delete m_trashDirLister; if (url.scheme() == QLatin1String("trash")) { QObject::connect(&Trash::instance(), &Trash::emptinessChanged, m_signalHandler.data(), &PlacesItemSignalHandler::onTrashEmptinessChanged); } diff --git a/src/panels/places/placesitem.h b/src/panels/places/placesitem.h index 3de626983..1677cca19 100644 --- a/src/panels/places/placesitem.h +++ b/src/panels/places/placesitem.h @@ -105,7 +105,6 @@ private: QPointer<Solid::OpticalDisc> m_disc; QPointer<Solid::PortableMediaPlayer> m_mtp; QPointer<PlacesItemSignalHandler> m_signalHandler; - QPointer<KDirLister> m_trashDirLister; KBookmark m_bookmark; friend class PlacesItemSignalHandler; // Calls onAccessibilityChanged() diff --git a/src/panels/places/placesitemsignalhandler.cpp b/src/panels/places/placesitemsignalhandler.cpp index b313f838f..1341b7413 100644 --- a/src/panels/places/placesitemsignalhandler.cpp +++ b/src/panels/places/placesitemsignalhandler.cpp @@ -45,8 +45,7 @@ void PlacesItemSignalHandler::onTearDownRequested(const QString& udi) if (m_item) { Solid::StorageAccess *tmp = m_item->device().as<Solid::StorageAccess>(); if (tmp) { - QString mountPath = tmp->filePath(); - emit tearDownExternallyRequested(mountPath); + emit tearDownExternallyRequested(tmp->filePath()); } } } |
