diff --git a/src/calamares/progresstree/ProgressTreeDelegate.cpp b/src/calamares/progresstree/ProgressTreeDelegate.cpp index f6b52b978..34835c8fa 100644 --- a/src/calamares/progresstree/ProgressTreeDelegate.cpp +++ b/src/calamares/progresstree/ProgressTreeDelegate.cpp @@ -64,8 +64,6 @@ ProgressTreeDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { - bool isFirstLevel = !index.parent().isValid(); - QStyleOptionViewItem opt = option; painter->save(); diff --git a/src/calamares/progresstree/ProgressTreeModel.cpp b/src/calamares/progresstree/ProgressTreeModel.cpp index dbe8315eb..33e985809 100644 --- a/src/calamares/progresstree/ProgressTreeModel.cpp +++ b/src/calamares/progresstree/ProgressTreeModel.cpp @@ -96,6 +96,10 @@ ProgressTreeModel::data( const QModelIndex& index, int role ) const QVariant ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const { + Q_UNUSED( section ); + Q_UNUSED( orientation ); + Q_UNUSED( role ); + return QVariant(); } @@ -146,12 +150,11 @@ ProgressTreeModel::indexFromItem( ProgressTreeItem* item ) if ( !item || !item->parent() ) return QModelIndex(); - // Reconstructs a QModelIndex from a ProgressTreeItem that is somewhere in the tree. - // Traverses the item to the root node, then rebuilds the qmodeindices from there + // Traverses the item to the root node, then rebuilds the qmodelindices from there // back down; each int is the row of that item in the parent. /** - * In this diagram, if the \param item is G, childIndexList will contain [0, 2, 0] + * In this diagram, if the item is G, childIndexList will contain [0, 2, 0] * * A * D diff --git a/src/calamares/progresstree/ProgressTreeModel.h b/src/calamares/progresstree/ProgressTreeModel.h index 60db77939..0311a28a0 100644 --- a/src/calamares/progresstree/ProgressTreeModel.h +++ b/src/calamares/progresstree/ProgressTreeModel.h @@ -39,7 +39,7 @@ public: }; explicit ProgressTreeModel( QObject* parent = nullptr ); - virtual ~ProgressTreeModel(); + virtual ~ProgressTreeModel() override; // Reimplemented from QAbstractItemModel Qt::ItemFlags flags( const QModelIndex& index ) const override; diff --git a/src/calamares/progresstree/ProgressTreeView.h b/src/calamares/progresstree/ProgressTreeView.h index fae75d0dc..9e735ef2d 100644 --- a/src/calamares/progresstree/ProgressTreeView.h +++ b/src/calamares/progresstree/ProgressTreeView.h @@ -34,8 +34,8 @@ class ProgressTreeView : public QTreeView public: static ProgressTreeView* instance(); - explicit ProgressTreeView( QWidget* parent = 0 ); - virtual ~ProgressTreeView(); + explicit ProgressTreeView( QWidget* parent = nullptr ); + virtual ~ProgressTreeView() override; /** * @brief setModel assigns a model to this view. diff --git a/src/libcalamaresui/widgets/QtWaitingSpinner.cpp b/src/libcalamaresui/widgets/QtWaitingSpinner.cpp index 93ad6f9ee..18c6264bd 100644 --- a/src/libcalamaresui/widgets/QtWaitingSpinner.cpp +++ b/src/libcalamaresui/widgets/QtWaitingSpinner.cpp @@ -145,7 +145,7 @@ void QtWaitingSpinner::updateTimer() { } int QtWaitingSpinner::countTimeout(int lines, qreal speed) { - return 1000 / (lines * speed); + return int( 1000.0 / (lines * speed) ); } int QtWaitingSpinner::lineDistance(int from, int to, int lines) { @@ -161,7 +161,7 @@ QColor QtWaitingSpinner::countTrailColor(int distance, int lines, int trail, int return color; } const qreal minAlphaF = qreal(minOpacity) / 100.0; - int distanceThreshold = ceil( (lines - 1) * qreal(trail) / 100.0); + int distanceThreshold = int( ceil( (lines - 1) * qreal(trail) / 100.0) ); if (distance > distanceThreshold) { color.setAlphaF(minAlphaF); return color; diff --git a/src/modules/netinstall/PackageModel.cpp b/src/modules/netinstall/PackageModel.cpp index 629133c86..8a2025b0e 100644 --- a/src/modules/netinstall/PackageModel.cpp +++ b/src/modules/netinstall/PackageModel.cpp @@ -126,6 +126,8 @@ bool PackageModel::setHeaderData( int section, Qt::Orientation orientation, const QVariant& value, int role ) { + Q_UNUSED( role ); + if ( orientation == Qt::Horizontal ) { if ( m_columnHeadings.value( section ) != QVariant() ) diff --git a/src/modules/netinstall/PackageModel.h b/src/modules/netinstall/PackageModel.h index 4a41f1879..ef2bc1794 100644 --- a/src/modules/netinstall/PackageModel.h +++ b/src/modules/netinstall/PackageModel.h @@ -36,13 +36,13 @@ class PackageModel : public QAbstractItemModel public: explicit PackageModel( const YAML::Node& data, QObject* parent = nullptr ); - ~PackageModel(); + ~PackageModel() override; QVariant data( const QModelIndex& index, int role ) const override; bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole ) override; bool setHeaderData( int section, Qt::Orientation orientation, - const QVariant& value, int role = Qt::EditRole ); + const QVariant& value, int role = Qt::EditRole ) override; Qt::ItemFlags flags( const QModelIndex& index ) const override; QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override; diff --git a/src/modules/netinstall/PackageTreeItem.cpp b/src/modules/netinstall/PackageTreeItem.cpp index 0cbc52223..bbd7f792f 100644 --- a/src/modules/netinstall/PackageTreeItem.cpp +++ b/src/modules/netinstall/PackageTreeItem.cpp @@ -18,9 +18,9 @@ #include "PackageTreeItem.h" -PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent ) : - m_data( data ), - m_parentItem( parent ) +PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent ) + : m_parentItem( parent ) + , m_data( data ) { } PackageTreeItem::PackageTreeItem( const QString packageName, PackageTreeItem* parent ) : diff --git a/src/modules/netinstall/PackageTreeItem.h b/src/modules/netinstall/PackageTreeItem.h index 291def37d..a95a4fe31 100644 --- a/src/modules/netinstall/PackageTreeItem.h +++ b/src/modules/netinstall/PackageTreeItem.h @@ -37,10 +37,10 @@ public: bool isHidden = false; Qt::CheckState selected = Qt::Unchecked; }; - explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = 0 ); - explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = 0 ); - explicit PackageTreeItem( PackageTreeItem* parent = 0 ); - ~PackageTreeItem(); + explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = nullptr ); + explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = nullptr ); + explicit PackageTreeItem( PackageTreeItem* parent = nullptr ); + ~PackageTreeItem() override; void appendChild( PackageTreeItem* child ); PackageTreeItem* child( int row ); diff --git a/src/modules/users/SetPasswordJob.cpp b/src/modules/users/SetPasswordJob.cpp index bf3423347..a077d8cb5 100644 --- a/src/modules/users/SetPasswordJob.cpp +++ b/src/modules/users/SetPasswordJob.cpp @@ -54,7 +54,7 @@ SetPasswordJob::prettyStatusMessage() const /// Returns a modular hashing salt for method 6 (SHA512) with a 16 character random salt. QString -SetPasswordJob::make_salt(size_t length) +SetPasswordJob::make_salt(int length) { Q_ASSERT(length >= 8); Q_ASSERT(length <= 128); @@ -73,7 +73,7 @@ SetPasswordJob::make_salt(size_t length) std::mt19937_64 twister(seed); std::uint64_t next; - size_t current_length = 0; + int current_length = 0; QString salt_string; salt_string.reserve(length + 10); diff --git a/src/modules/users/SetPasswordJob.h b/src/modules/users/SetPasswordJob.h index 45e99a57a..8a53d4941 100644 --- a/src/modules/users/SetPasswordJob.h +++ b/src/modules/users/SetPasswordJob.h @@ -33,7 +33,7 @@ public: QString prettyStatusMessage() const override; Calamares::JobResult exec() override; - static QString make_salt(size_t length); + static QString make_salt(int length); private: QString m_userName; diff --git a/src/modules/users/UsersViewStep.h b/src/modules/users/UsersViewStep.h index ea5d9101b..c7e0f447d 100644 --- a/src/modules/users/UsersViewStep.h +++ b/src/modules/users/UsersViewStep.h @@ -36,7 +36,7 @@ class PLUGINDLLEXPORT UsersViewStep : public Calamares::ViewStep public: explicit UsersViewStep( QObject* parent = nullptr ); - virtual ~UsersViewStep(); + virtual ~UsersViewStep() override; QString prettyName() const override; diff --git a/src/modules/webview/WebViewStep.h b/src/modules/webview/WebViewStep.h index 9d8405a97..5b8a85049 100644 --- a/src/modules/webview/WebViewStep.h +++ b/src/modules/webview/WebViewStep.h @@ -43,7 +43,7 @@ class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep public: explicit WebViewStep( QObject* parent = nullptr ); - virtual ~WebViewStep(); + virtual ~WebViewStep() override; QString prettyName() const override;