mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +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);
|
setFeatures(DefaultDockWidgetFeatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinDockWidget::DolphinDockWidget(QWidget* parent, Qt::WindowFlags flags) :
|
|
||||||
QDockWidget(parent, flags),
|
|
||||||
m_locked(false),
|
|
||||||
m_dockTitleBar(nullptr)
|
|
||||||
{
|
|
||||||
setFeatures(DefaultDockWidgetFeatures);
|
|
||||||
}
|
|
||||||
|
|
||||||
DolphinDockWidget::~DolphinDockWidget()
|
DolphinDockWidget::~DolphinDockWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,7 @@ class DolphinDockWidget : public QDockWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DolphinDockWidget(const QString& title, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
explicit DolphinDockWidget(const QString& title = QString(), QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
||||||
explicit DolphinDockWidget(QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
|
|
||||||
~DolphinDockWidget() override;
|
~DolphinDockWidget() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,8 +64,7 @@ void Panel::setUrl(const QUrl& url)
|
||||||
|
|
||||||
const QUrl oldUrl = m_url;
|
const QUrl oldUrl = m_url;
|
||||||
m_url = url;
|
m_url = url;
|
||||||
const bool accepted = urlChanged();
|
if (!urlChanged()) {
|
||||||
if (!accepted) {
|
|
||||||
m_url = oldUrl;
|
m_url = oldUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) :
|
||||||
m_disc(),
|
m_disc(),
|
||||||
m_mtp(),
|
m_mtp(),
|
||||||
m_signalHandler(nullptr),
|
m_signalHandler(nullptr),
|
||||||
m_trashDirLister(nullptr),
|
|
||||||
m_bookmark()
|
m_bookmark()
|
||||||
{
|
{
|
||||||
m_signalHandler = new PlacesItemSignalHandler(this);
|
m_signalHandler = new PlacesItemSignalHandler(this);
|
||||||
|
@ -48,7 +47,6 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) :
|
||||||
PlacesItem::~PlacesItem()
|
PlacesItem::~PlacesItem()
|
||||||
{
|
{
|
||||||
delete m_signalHandler;
|
delete m_signalHandler;
|
||||||
delete m_trashDirLister;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlacesItem::setUrl(const QUrl &url)
|
void PlacesItem::setUrl(const QUrl &url)
|
||||||
|
@ -59,7 +57,6 @@ void PlacesItem::setUrl(const QUrl &url)
|
||||||
// setting an equal URL results in an itemsChanged()
|
// setting an equal URL results in an itemsChanged()
|
||||||
// signal.
|
// signal.
|
||||||
if (dataValue("url").toUrl() != url) {
|
if (dataValue("url").toUrl() != url) {
|
||||||
delete m_trashDirLister;
|
|
||||||
if (url.scheme() == QLatin1String("trash")) {
|
if (url.scheme() == QLatin1String("trash")) {
|
||||||
QObject::connect(&Trash::instance(), &Trash::emptinessChanged, m_signalHandler.data(), &PlacesItemSignalHandler::onTrashEmptinessChanged);
|
QObject::connect(&Trash::instance(), &Trash::emptinessChanged, m_signalHandler.data(), &PlacesItemSignalHandler::onTrashEmptinessChanged);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,6 @@ private:
|
||||||
QPointer<Solid::OpticalDisc> m_disc;
|
QPointer<Solid::OpticalDisc> m_disc;
|
||||||
QPointer<Solid::PortableMediaPlayer> m_mtp;
|
QPointer<Solid::PortableMediaPlayer> m_mtp;
|
||||||
QPointer<PlacesItemSignalHandler> m_signalHandler;
|
QPointer<PlacesItemSignalHandler> m_signalHandler;
|
||||||
QPointer<KDirLister> m_trashDirLister;
|
|
||||||
KBookmark m_bookmark;
|
KBookmark m_bookmark;
|
||||||
|
|
||||||
friend class PlacesItemSignalHandler; // Calls onAccessibilityChanged()
|
friend class PlacesItemSignalHandler; // Calls onAccessibilityChanged()
|
||||||
|
|
|
@ -45,8 +45,7 @@ void PlacesItemSignalHandler::onTearDownRequested(const QString& udi)
|
||||||
if (m_item) {
|
if (m_item) {
|
||||||
Solid::StorageAccess *tmp = m_item->device().as<Solid::StorageAccess>();
|
Solid::StorageAccess *tmp = m_item->device().as<Solid::StorageAccess>();
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
QString mountPath = tmp->filePath();
|
emit tearDownExternallyRequested(tmp->filePath());
|
||||||
emit tearDownExternallyRequested(mountPath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue