Skip to content

Commit c44bfb3

Browse files
committed
Shutdown 'unchanged files' code warnings that show up in PRs
1 parent 2cfbb93 commit c44bfb3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/core/valuemapmodelbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void ValueMapModelBase::setMap( const QVariant &map )
3737
const QVariantList list = map.toList();
3838
if ( !list.empty() ) // QGIS 3
3939
{
40-
beginInsertRows( QModelIndex(), 0, list.size() - 1 );
40+
beginInsertRows( QModelIndex(), 0, static_cast<int>( list.size() ) - 1 );
4141

4242
for ( const QVariant &item : list )
4343
{

src/core/vertexmodel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void VertexModel::undoHistory()
144144
{
145145
setCurrentVertexIndex( -1 );
146146
beginResetModel();
147-
mVertices.insert( std::max( 0, change.index - 1 ), change.vertex );
147+
mVertices.insert( std::max<long long int>( change.index - 1, 0 ), change.vertex );
148148
createCandidates();
149149
endResetModel();
150150
setCurrentVertexIndex( change.index );
@@ -246,7 +246,7 @@ void VertexModel::createCandidates()
246246
[]( const Vertex &vertex ) { return vertex.type != ExistingVertex; } ),
247247
mVertices.end() );
248248

249-
int r = 0;
249+
qsizetype r = 0;
250250

251251
while ( r < mVertices.count() )
252252
{
@@ -382,7 +382,7 @@ QModelIndex VertexModel::parent( const QModelIndex &child ) const
382382
int VertexModel::rowCount( const QModelIndex &parent ) const
383383
{
384384
Q_UNUSED( parent )
385-
return mVertices.count();
385+
return static_cast<int>( mVertices.count() );
386386
}
387387

388388
int VertexModel::columnCount( const QModelIndex &parent ) const
@@ -732,7 +732,7 @@ void VertexModel::setCurrentPoint( const QgsPoint &point )
732732
emit geometryChanged();
733733
}
734734

735-
void VertexModel::setCurrentVertex( int newVertex, bool forceUpdate )
735+
void VertexModel::setCurrentVertex( qsizetype newVertex, bool forceUpdate )
736736
{
737737
if ( mCurrentIndex >= 0 && mCurrentIndex < mVertices.count() )
738738
{
@@ -768,7 +768,7 @@ void VertexModel::setCurrentVertex( int newVertex, bool forceUpdate )
768768
emit currentVertexIndexChanged();
769769
}
770770

771-
void VertexModel::setCurrentVertexIndex( int currentIndex )
771+
void VertexModel::setCurrentVertexIndex( qsizetype currentIndex )
772772
{
773773
if ( currentIndex == mCurrentIndex )
774774
return;
@@ -786,7 +786,7 @@ int VertexModel::currentVertexIndex() const
786786

787787
int VertexModel::vertexCount() const
788788
{
789-
return mVertices.count();
789+
return static_cast<int>( mVertices.count() );
790790
}
791791

792792
int VertexModel::ringCount() const

src/core/vertexmodel.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ class QFIELD_CORE_EXPORT VertexModel : public QAbstractListModel
127127

128128
struct VertexChange
129129
{
130-
VertexChange( VertexChangeType type, int &index, const Vertex &vertex )
130+
VertexChange( VertexChangeType type, qsizetype &index, const Vertex &vertex )
131131
: type( type )
132132
, index( index )
133133
, vertex( vertex )
134134
{}
135135

136136
VertexChangeType type = NoChange;
137-
int index = -1;
137+
qsizetype index = -1;
138138
Vertex vertex;
139139
};
140140

@@ -253,7 +253,7 @@ class QFIELD_CORE_EXPORT VertexModel : public QAbstractListModel
253253

254254
int currentVertexIndex() const;
255255

256-
void setCurrentVertexIndex( int currentIndex );
256+
void setCurrentVertexIndex( qsizetype currentIndex );
257257

258258
Vertex vertex( int row ) const;
259259

@@ -330,11 +330,11 @@ class QFIELD_CORE_EXPORT VertexModel : public QAbstractListModel
330330
* @param newVertex the new vertex index
331331
* @param forceUpdate if true, it will force to update all vertices and emit signal
332332
*/
333-
void setCurrentVertex( int newVertex, bool forceUpdate = false );
333+
void setCurrentVertex( qsizetype newVertex, bool forceUpdate = false );
334334

335335
EditingMode mMode = NoEditing;
336336
//!
337-
int mCurrentIndex = -1;
337+
qsizetype mCurrentIndex = -1;
338338
int mRingCount = 0;
339339
Qgis::GeometryType mGeometryType = Qgis::GeometryType::Line;
340340
Qgis::WkbType mGeometryWkbType = Qgis::WkbType::Unknown;
@@ -346,7 +346,7 @@ class QFIELD_CORE_EXPORT VertexModel : public QAbstractListModel
346346
bool mIsHovering = false;
347347

348348
QList<VertexChange> mHistory;
349-
int mHistoryIndex = -1;
349+
qsizetype mHistoryIndex = -1;
350350
bool mHistoryTraversing = false;
351351

352352
friend class VertexModelTest;

0 commit comments

Comments
 (0)