summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-09-30 15:27:57 +0300
committerKatja Marttila <katja.marttila@qt.io>2020-11-04 10:07:47 +0300
commitd3cae4df15598bf4797cd7fc03aced50bb5a25a1 (patch)
treed5889d6dc6bb99702eeec61337ba0544e94ff071 /src/libs
parent07f4848b5ee0cdc9407d9a0de4d30ca5e03403e0 (diff)
Remove unused code blocks and functions
Results analyzed using cppcheck tools. Also add Q_DECL_OVERRIDE to overwrited functions. Change-Id: Iab5eb43206af0050c1dd84efb7ed860ab9594496 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/aspectratiolabel.h6
-rw-r--r--src/libs/installer/component_p.cpp10
-rw-r--r--src/libs/installer/component_p.h3
-rw-r--r--src/libs/installer/componentselectionpage_p.cpp16
-rw-r--r--src/libs/installer/componentselectionpage_p.h1
-rw-r--r--src/libs/installer/fileutils.cpp24
-rw-r--r--src/libs/installer/fileutils.h7
-rw-r--r--src/libs/installer/metadatajob.cpp2
-rw-r--r--src/libs/installer/packagemanagercore.cpp2
-rw-r--r--src/libs/installer/packagemanagergui.cpp2
-rw-r--r--src/libs/installer/repository.cpp10
-rw-r--r--src/libs/installer/repository.h3
12 files changed, 12 insertions, 74 deletions
diff --git a/src/libs/installer/aspectratiolabel.h b/src/libs/installer/aspectratiolabel.h
index 28fc5aea4..6fbc774a2 100644
--- a/src/libs/installer/aspectratiolabel.h
+++ b/src/libs/installer/aspectratiolabel.h
@@ -44,12 +44,12 @@ class INSTALLER_EXPORT AspectRatioLabel : public QLabel
public:
explicit AspectRatioLabel(QWidget *parent = nullptr);
- int heightForWidth(int w) const;
- QSize sizeHint() const;
+ int heightForWidth(int w) const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
void setPixmap (const QPixmap &pixmap);
- void resizeEvent(QResizeEvent *event);
+ void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
private:
QPixmap scaledPixmap() const;
diff --git a/src/libs/installer/component_p.cpp b/src/libs/installer/component_p.cpp
index 7c107cac2..8533d8e4c 100644
--- a/src/libs/installer/component_p.cpp
+++ b/src/libs/installer/component_p.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -187,14 +187,6 @@ void ComponentModelHelper::setCheckable(bool checkable)
}
/*!
- Returns whether the component is selectable by the user. The default value is \c true.
-*/
-bool ComponentModelHelper::isSelectable() const
-{
- return (flags() & Qt::ItemIsSelectable) != 0;
-}
-
-/*!
Sets whether the component is selectable. If \a selectable is \c true, the component can be selected by the
user; otherwise, the user cannot select the component.
*/
diff --git a/src/libs/installer/component_p.h b/src/libs/installer/component_p.h
index 05b169d4b..c14d53e70 100644
--- a/src/libs/installer/component_p.h
+++ b/src/libs/installer/component_p.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -129,7 +129,6 @@ public:
bool isCheckable() const;
void setCheckable(bool checkable);
- bool isSelectable() const;
void setSelectable(bool selectable);
bool isExpandedByDefault() const;
diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp
index c5117e9cb..e1ca0a3a1 100644
--- a/src/libs/installer/componentselectionpage_p.cpp
+++ b/src/libs/installer/componentselectionpage_p.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -231,8 +231,6 @@ void ComponentSelectionPagePrivate::setupCategoryLayout()
QCheckBox *checkBox = new QCheckBox;
checkBox->setObjectName(repository.displayname());
checkBox->setChecked(repository.isEnabled());
- connect(checkBox, &QCheckBox::stateChanged, this,
- &ComponentSelectionPagePrivate::checkboxStateChanged);
checkBox->setText(repository.displayname());
checkBox->setToolTip(repository.tooltip());
categoryLayout->addWidget(checkBox);
@@ -350,18 +348,6 @@ void ComponentSelectionPagePrivate::deselectAll()
m_currentModel->setCheckedState(ComponentModel::AllUnchecked);
}
-void ComponentSelectionPagePrivate::checkboxStateChanged()
-{
- QList<QCheckBox*> checkboxes = m_categoryGroupBox->findChildren<QCheckBox *>();
- bool enableFetchButton = false;
- foreach (QCheckBox *checkbox, checkboxes) {
- if (checkbox->isChecked()) {
- enableFetchButton = true;
- break;
- }
- }
-}
-
void ComponentSelectionPagePrivate::enableRepositoryCategory(const QString &repositoryName, bool enable)
{
QMap<QString, RepositoryCategory> organizedRepositoryCategories = m_core->settings().organizedRepositoryCategories();
diff --git a/src/libs/installer/componentselectionpage_p.h b/src/libs/installer/componentselectionpage_p.h
index bce13246b..37f808286 100644
--- a/src/libs/installer/componentselectionpage_p.h
+++ b/src/libs/installer/componentselectionpage_p.h
@@ -74,7 +74,6 @@ public slots:
void currentSelectedChanged(const QModelIndex &current);
void selectAll();
void deselectAll();
- void checkboxStateChanged();
void enableRepositoryCategory(const QString &repositoryName, bool enable);
void updateWidgetVisibility(bool show);
void fetchRepositoryCategories();
diff --git a/src/libs/installer/fileutils.cpp b/src/libs/installer/fileutils.cpp
index d0dd342a8..61891832e 100644
--- a/src/libs/installer/fileutils.cpp
+++ b/src/libs/installer/fileutils.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -97,28 +97,6 @@ void TempDirDeleter::add(const QStringList &paths)
m_paths += paths.toSet();
}
-void TempDirDeleter::releaseAll()
-{
- m_paths.clear();
-}
-
-void TempDirDeleter::release(const QString &path)
-{
- m_paths.remove(path);
-}
-
-void TempDirDeleter::passAndReleaseAll(TempDirDeleter &tdd)
-{
- tdd.m_paths = m_paths;
- releaseAll();
-}
-
-void TempDirDeleter::passAndRelease(TempDirDeleter &tdd, const QString &path)
-{
- tdd.add(path);
- release(path);
-}
-
void TempDirDeleter::releaseAndDeleteAll()
{
foreach (const QString &path, m_paths)
diff --git a/src/libs/installer/fileutils.h b/src/libs/installer/fileutils.h
index 24b033e98..78241d3ce 100644
--- a/src/libs/installer/fileutils.h
+++ b/src/libs/installer/fileutils.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -59,11 +59,6 @@ public:
void add(const QString &path);
void add(const QStringList &paths);
- void releaseAll();
- void release(const QString &path);
- void passAndReleaseAll(TempDirDeleter &tdd);
- void passAndRelease(TempDirDeleter &tdd, const QString &path);
-
void releaseAndDeleteAll();
void releaseAndDelete(const QString &path);
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index a15dd8848..bd5fc7f74 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -291,8 +291,6 @@ void MetadataJob::unzipRepositoryTaskFinished()
m_unzipRepositoryitems.append(item);
} else {
//Repository is not valid, remove it
- Repository repository;
- repository.setUrl(QUrl(task->archive()));
Settings &s = m_core->settings();
QSet<Repository> temporaries = s.temporaryRepositories();
foreach (Repository repository, temporaries) {
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 715374f65..eb866e436 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1195,7 +1195,7 @@ class VerboseWriterAdminOutput : public VerboseWriterOutput
public:
VerboseWriterAdminOutput(PackageManagerCore *core) : m_core(core) {}
- virtual bool write(const QString &fileName, QIODevice::OpenMode openMode, const QByteArray &data)
+ virtual bool write(const QString &fileName, QIODevice::OpenMode openMode, const QByteArray &data) Q_DECL_OVERRIDE
{
bool gainedAdminRights = false;
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 52719922a..ffacbb6a2 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -123,7 +123,7 @@ public:
return m_widget;
}
- bool isComplete() const
+ bool isComplete() const Q_DECL_OVERRIDE
{
return m_widget->property("complete").toBool();
}
diff --git a/src/libs/installer/repository.cpp b/src/libs/installer/repository.cpp
index 3957ce5aa..7e7f95354 100644
--- a/src/libs/installer/repository.cpp
+++ b/src/libs/installer/repository.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -225,14 +225,6 @@ bool Repository::isCompressed() const
}
/*!
- Sets this repository to \a compressed state to know weather the repository
- needs to be uncompressed before use.
-*/
-void Repository::setCompressed(bool compressed)
-{
- m_compressed = compressed;
-}
-/*!
Compares the values of this repository to \a other and returns true if they are equal (same server,
default state, enabled state as well as username and password). \sa operator!=()
*/
diff --git a/src/libs/installer/repository.h b/src/libs/installer/repository.h
index 546cddc97..3f28e4d99 100644
--- a/src/libs/installer/repository.h
+++ b/src/libs/installer/repository.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -68,7 +68,6 @@ public:
void setCategoryName(const QString &categoryname);
bool isCompressed() const;
- void setCompressed(bool compressed);
bool operator==(const Repository &other) const;
bool operator!=(const Repository &other) const;