Clang: warnings--

main
Adriaan de Groot 7 years ago
parent da4fa6a63a
commit edb1dbaa6e

@ -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();

@ -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

@ -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;

@ -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.

@ -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;

@ -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() )

@ -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;

@ -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 ) :

@ -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 );

@ -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);

@ -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;

@ -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;

@ -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;

Loading…
Cancel
Save