Skip to content

Commit 1e2e481

Browse files
committedJun 2, 2013
followup 16ba01f for oracle & mssql
1 parent af4a86f commit 1e2e481

9 files changed

+24
-17
lines changed
 

‎src/core/qgsvectorlayerundocommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class QgsVectorLayerUndoCommand : public QUndoCommand
4343
inline QgsGeometryCache *cache() { return mBuffer->L->cache(); }
4444

4545
virtual int id() const { return -1; }
46-
virtual bool mergeWith( QUndoCommand * ) { return -1; }
46+
virtual bool mergeWith( QUndoCommand * ) { return false; }
4747

4848
protected:
4949
QgsVectorLayerEditBuffer* mBuffer;

‎src/providers/mssql/qgsmssqlsourceselect.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,12 @@ void QgsMssqlGeomColumnTypeThread::run()
735735
{
736736
mStopped = false;
737737

738-
foreach ( QgsMssqlLayerProperty layerProperty, layerProperties )
738+
for ( QList<QgsMssqlLayerProperty>::iterator it = layerProperties.begin(),
739+
end = layerProperties.end();
740+
it != end; ++it )
739741
{
742+
QgsMssqlLayerProperty &layerProperty = *it;
743+
740744
if ( !mStopped )
741745
{
742746
QString table;

‎src/providers/mssql/qgsmssqltablemodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ QgsMssqlTableModel::~QgsMssqlTableModel()
4040
{
4141
}
4242

43-
void QgsMssqlTableModel::addTableEntry( QgsMssqlLayerProperty layerProperty )
43+
void QgsMssqlTableModel::addTableEntry( const QgsMssqlLayerProperty &layerProperty )
4444
{
4545
QgsDebugMsg( QString( "%1.%2.%3 type=%4 srid=%5 pk=%6 sql=%7" )
4646
.arg( layerProperty.schemaName )
@@ -346,7 +346,7 @@ bool QgsMssqlTableModel::setData( const QModelIndex &idx, const QVariant &value,
346346
return true;
347347
}
348348

349-
QString QgsMssqlTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
349+
QString QgsMssqlTableModel::layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata )
350350
{
351351
if ( !index.isValid() )
352352
return QString::null;

‎src/providers/mssql/qgsmssqltablemodel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class QgsMssqlTableModel : public QStandardItemModel
4747
~QgsMssqlTableModel();
4848

4949
/**Adds entry for one database table to the model*/
50-
void addTableEntry( QgsMssqlLayerProperty property );
50+
void addTableEntry( const QgsMssqlLayerProperty &property );
5151

5252
/**Sets an sql statement that belongs to a cell specified by a model index*/
5353
void setSql( const QModelIndex& index, const QString& sql );
@@ -74,7 +74,7 @@ class QgsMssqlTableModel : public QStandardItemModel
7474

7575
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
7676

77-
QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
77+
QString layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata );
7878

7979
static QIcon iconForWkbType( QGis::WkbType type );
8080

‎src/providers/oracle/qgsoraclecolumntypethread.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ void QgsOracleColumnTypeThread::run()
5757
return;
5858
}
5959

60-
int i = 0;
61-
foreach ( QgsOracleLayerProperty layerProperty, layerProperties )
60+
int i = 0, n = layerProperties.size();
61+
for ( QVector<QgsOracleLayerProperty>::iterator it = layerProperties.begin(),
62+
end = layerProperties.end();
63+
it != end; ++it )
6264
{
65+
QgsOracleLayerProperty &layerProperty = *it;
6366
if ( !mStopped )
6467
{
65-
emit progress( i++, layerProperties.size() );
68+
emit progress( i++, n );
6669
emit progressMessage( tr( "Scanning column %1.%2.%3..." )
6770
.arg( layerProperty.ownerName )
6871
.arg( layerProperty.tableName )

‎src/providers/oracle/qgsoracleconn.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ struct QgsOracleLayerProperty
4545
QStringList pkCols;
4646
QString sql;
4747

48-
int size() { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
48+
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
4949

50-
QgsOracleLayerProperty at( int i )
50+
QgsOracleLayerProperty at( int i ) const
5151
{
5252
QgsOracleLayerProperty property;
5353

@@ -66,7 +66,7 @@ struct QgsOracleLayerProperty
6666
}
6767

6868
#if QGISDEBUG
69-
QString toString()
69+
QString toString() const
7070
{
7171
QString typeString;
7272
foreach ( QGis::WkbType type, types )

‎src/providers/oracle/qgsoracletablemodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QgsOracleTableModel::~QgsOracleTableModel()
3939
{
4040
}
4141

42-
void QgsOracleTableModel::addTableEntry( QgsOracleLayerProperty layerProperty )
42+
void QgsOracleTableModel::addTableEntry( const QgsOracleLayerProperty &layerProperty )
4343
{
4444
QgsDebugMsg( layerProperty.toString() );
4545

@@ -261,7 +261,7 @@ bool QgsOracleTableModel::setData( const QModelIndex &idx, const QVariant &value
261261
return true;
262262
}
263263

264-
QString QgsOracleTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
264+
QString QgsOracleTableModel::layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata )
265265
{
266266
if ( !index.isValid() )
267267
{

‎src/providers/oracle/qgsoracletablemodel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class QgsOracleTableModel : public QStandardItemModel
3434
~QgsOracleTableModel();
3535

3636
/**Adds entry for one database table to the model*/
37-
void addTableEntry( QgsOracleLayerProperty property );
37+
void addTableEntry( const QgsOracleLayerProperty &property );
3838

3939
/**Sets an sql statement that belongs to a cell specified by a model index*/
4040
void setSql( const QModelIndex& index, const QString& sql );
@@ -57,7 +57,7 @@ class QgsOracleTableModel : public QStandardItemModel
5757

5858
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
5959

60-
QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
60+
QString layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata );
6161

6262
static QIcon iconForWkbType( QGis::WkbType type );
6363

‎src/ui/qgsprojectpropertiesbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@
18651865
</widget>
18661866
</item>
18671867
<item row="3" column="0" colspan="2">
1868-
<layout class="QHBoxLayout" name="horizontalLayout_3">
1868+
<layout class="QHBoxLayout" name="horizontalLayout_8">
18691869
<item>
18701870
<widget class="QLabel" name="mWFSUrlLabel">
18711871
<property name="text">

0 commit comments

Comments
 (0)
Please sign in to comment.