mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-15 18:01:11 +00:00
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
This commit is contained in:
commit
9b7ceaa74d
|
@ -58,14 +58,6 @@ DolphinDockWidget::DolphinDockWidget(const QString& title, QWidget* parent, Qt::
|
|||
setFeatures(DefaultDockWidgetFeatures);
|
||||
}
|
||||
|
||||
DolphinDockWidget::DolphinDockWidget(QWidget* parent, Qt::WindowFlags flags) :
|
||||
QDockWidget(parent, flags),
|
||||
m_locked(false),
|
||||
m_dockTitleBar(nullptr)
|
||||
{
|
||||
setFeatures(DefaultDockWidgetFeatures);
|
||||
}
|
||||
|
||||
DolphinDockWidget::~DolphinDockWidget()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -30,8 +30,7 @@ class DolphinDockWidget : public QDockWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DolphinDockWidget(const QString& title, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
||||
explicit DolphinDockWidget(QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
||||
explicit DolphinDockWidget(const QString& title = QString(), QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
||||
~DolphinDockWidget() override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue