Clang: warnings--
This commit is contained in:
parent
da4fa6a63a
commit
edb1dbaa6e
@ -64,8 +64,6 @@ ProgressTreeDelegate::paint( QPainter* painter,
|
|||||||
const QStyleOptionViewItem& option,
|
const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index) const
|
const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
bool isFirstLevel = !index.parent().isValid();
|
|
||||||
|
|
||||||
QStyleOptionViewItem opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
@ -96,6 +96,10 @@ ProgressTreeModel::data( const QModelIndex& index, int role ) const
|
|||||||
QVariant
|
QVariant
|
||||||
ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED( section );
|
||||||
|
Q_UNUSED( orientation );
|
||||||
|
Q_UNUSED( role );
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,12 +150,11 @@ ProgressTreeModel::indexFromItem( ProgressTreeItem* item )
|
|||||||
if ( !item || !item->parent() )
|
if ( !item || !item->parent() )
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
|
|
||||||
// Reconstructs a QModelIndex from a ProgressTreeItem that is somewhere in the tree.
|
// 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.
|
// 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
|
* A
|
||||||
* D
|
* D
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
explicit ProgressTreeModel( QObject* parent = nullptr );
|
explicit ProgressTreeModel( QObject* parent = nullptr );
|
||||||
virtual ~ProgressTreeModel();
|
virtual ~ProgressTreeModel() override;
|
||||||
|
|
||||||
// Reimplemented from QAbstractItemModel
|
// Reimplemented from QAbstractItemModel
|
||||||
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
||||||
|
@ -34,8 +34,8 @@ class ProgressTreeView : public QTreeView
|
|||||||
public:
|
public:
|
||||||
static ProgressTreeView* instance();
|
static ProgressTreeView* instance();
|
||||||
|
|
||||||
explicit ProgressTreeView( QWidget* parent = 0 );
|
explicit ProgressTreeView( QWidget* parent = nullptr );
|
||||||
virtual ~ProgressTreeView();
|
virtual ~ProgressTreeView() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief setModel assigns a model to this view.
|
* @brief setModel assigns a model to this view.
|
||||||
|
@ -145,7 +145,7 @@ void QtWaitingSpinner::updateTimer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int QtWaitingSpinner::countTimeout(int lines, qreal speed) {
|
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) {
|
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;
|
return color;
|
||||||
}
|
}
|
||||||
const qreal minAlphaF = qreal(minOpacity) / 100.0;
|
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) {
|
if (distance > distanceThreshold) {
|
||||||
color.setAlphaF(minAlphaF);
|
color.setAlphaF(minAlphaF);
|
||||||
return color;
|
return color;
|
||||||
|
@ -126,6 +126,8 @@ bool
|
|||||||
PackageModel::setHeaderData( int section, Qt::Orientation orientation,
|
PackageModel::setHeaderData( int section, Qt::Orientation orientation,
|
||||||
const QVariant& value, int role )
|
const QVariant& value, int role )
|
||||||
{
|
{
|
||||||
|
Q_UNUSED( role );
|
||||||
|
|
||||||
if ( orientation == Qt::Horizontal )
|
if ( orientation == Qt::Horizontal )
|
||||||
{
|
{
|
||||||
if ( m_columnHeadings.value( section ) != QVariant() )
|
if ( m_columnHeadings.value( section ) != QVariant() )
|
||||||
|
@ -36,13 +36,13 @@ class PackageModel : public QAbstractItemModel
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PackageModel( const YAML::Node& data, QObject* parent = nullptr );
|
explicit PackageModel( const YAML::Node& data, QObject* parent = nullptr );
|
||||||
~PackageModel();
|
~PackageModel() override;
|
||||||
|
|
||||||
QVariant data( const QModelIndex& index, int role ) const override;
|
QVariant data( const QModelIndex& index, int role ) const override;
|
||||||
bool setData( const QModelIndex& index, const QVariant& value,
|
bool setData( const QModelIndex& index, const QVariant& value,
|
||||||
int role = Qt::EditRole ) override;
|
int role = Qt::EditRole ) override;
|
||||||
bool setHeaderData( int section, Qt::Orientation orientation,
|
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;
|
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
||||||
QVariant headerData( int section, Qt::Orientation orientation,
|
QVariant headerData( int section, Qt::Orientation orientation,
|
||||||
int role = Qt::DisplayRole ) const override;
|
int role = Qt::DisplayRole ) const override;
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
#include "PackageTreeItem.h"
|
#include "PackageTreeItem.h"
|
||||||
|
|
||||||
PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent ) :
|
PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent )
|
||||||
m_data( data ),
|
: m_parentItem( parent )
|
||||||
m_parentItem( parent )
|
, m_data( data )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
PackageTreeItem::PackageTreeItem( const QString packageName, PackageTreeItem* parent ) :
|
PackageTreeItem::PackageTreeItem( const QString packageName, PackageTreeItem* parent ) :
|
||||||
|
@ -37,10 +37,10 @@ public:
|
|||||||
bool isHidden = false;
|
bool isHidden = false;
|
||||||
Qt::CheckState selected = Qt::Unchecked;
|
Qt::CheckState selected = Qt::Unchecked;
|
||||||
};
|
};
|
||||||
explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = 0 );
|
explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = nullptr );
|
||||||
explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = 0 );
|
explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = nullptr );
|
||||||
explicit PackageTreeItem( PackageTreeItem* parent = 0 );
|
explicit PackageTreeItem( PackageTreeItem* parent = nullptr );
|
||||||
~PackageTreeItem();
|
~PackageTreeItem() override;
|
||||||
|
|
||||||
void appendChild( PackageTreeItem* child );
|
void appendChild( PackageTreeItem* child );
|
||||||
PackageTreeItem* child( int row );
|
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.
|
/// Returns a modular hashing salt for method 6 (SHA512) with a 16 character random salt.
|
||||||
QString
|
QString
|
||||||
SetPasswordJob::make_salt(size_t length)
|
SetPasswordJob::make_salt(int length)
|
||||||
{
|
{
|
||||||
Q_ASSERT(length >= 8);
|
Q_ASSERT(length >= 8);
|
||||||
Q_ASSERT(length <= 128);
|
Q_ASSERT(length <= 128);
|
||||||
@ -73,7 +73,7 @@ SetPasswordJob::make_salt(size_t length)
|
|||||||
std::mt19937_64 twister(seed);
|
std::mt19937_64 twister(seed);
|
||||||
|
|
||||||
std::uint64_t next;
|
std::uint64_t next;
|
||||||
size_t current_length = 0;
|
int current_length = 0;
|
||||||
|
|
||||||
QString salt_string;
|
QString salt_string;
|
||||||
salt_string.reserve(length + 10);
|
salt_string.reserve(length + 10);
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
QString prettyStatusMessage() const override;
|
QString prettyStatusMessage() const override;
|
||||||
Calamares::JobResult exec() override;
|
Calamares::JobResult exec() override;
|
||||||
|
|
||||||
static QString make_salt(size_t length);
|
static QString make_salt(int length);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_userName;
|
QString m_userName;
|
||||||
|
@ -36,7 +36,7 @@ class PLUGINDLLEXPORT UsersViewStep : public Calamares::ViewStep
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UsersViewStep( QObject* parent = nullptr );
|
explicit UsersViewStep( QObject* parent = nullptr );
|
||||||
virtual ~UsersViewStep();
|
virtual ~UsersViewStep() override;
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WebViewStep( QObject* parent = nullptr );
|
explicit WebViewStep( QObject* parent = nullptr );
|
||||||
virtual ~WebViewStep();
|
virtual ~WebViewStep() override;
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user