Skip to content

Commit

Permalink
followup 16ba01f for oracle & mssql
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 2, 2013
1 parent af4a86f commit 1e2e481
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerundocommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class QgsVectorLayerUndoCommand : public QUndoCommand
inline QgsGeometryCache *cache() { return mBuffer->L->cache(); }

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

protected:
QgsVectorLayerEditBuffer* mBuffer;
Expand Down
6 changes: 5 additions & 1 deletion src/providers/mssql/qgsmssqlsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,12 @@ void QgsMssqlGeomColumnTypeThread::run()
{
mStopped = false;

foreach ( QgsMssqlLayerProperty layerProperty, layerProperties )
for ( QList<QgsMssqlLayerProperty>::iterator it = layerProperties.begin(),
end = layerProperties.end();
it != end; ++it )
{
QgsMssqlLayerProperty &layerProperty = *it;

if ( !mStopped )
{
QString table;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/mssql/qgsmssqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ QgsMssqlTableModel::~QgsMssqlTableModel()
{
}

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

QString QgsMssqlTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
QString QgsMssqlTableModel::layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata )
{
if ( !index.isValid() )
return QString::null;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/mssql/qgsmssqltablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class QgsMssqlTableModel : public QStandardItemModel
~QgsMssqlTableModel();

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

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

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

QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
QString layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata );

static QIcon iconForWkbType( QGis::WkbType type );

Expand Down
9 changes: 6 additions & 3 deletions src/providers/oracle/qgsoraclecolumntypethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ void QgsOracleColumnTypeThread::run()
return;
}

int i = 0;
foreach ( QgsOracleLayerProperty layerProperty, layerProperties )
int i = 0, n = layerProperties.size();
for ( QVector<QgsOracleLayerProperty>::iterator it = layerProperties.begin(),
end = layerProperties.end();
it != end; ++it )
{
QgsOracleLayerProperty &layerProperty = *it;
if ( !mStopped )
{
emit progress( i++, layerProperties.size() );
emit progress( i++, n );
emit progressMessage( tr( "Scanning column %1.%2.%3..." )
.arg( layerProperty.ownerName )
.arg( layerProperty.tableName )
Expand Down
6 changes: 3 additions & 3 deletions src/providers/oracle/qgsoracleconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ struct QgsOracleLayerProperty
QStringList pkCols;
QString sql;

int size() { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }

QgsOracleLayerProperty at( int i )
QgsOracleLayerProperty at( int i ) const
{
QgsOracleLayerProperty property;

Expand All @@ -66,7 +66,7 @@ struct QgsOracleLayerProperty
}

#if QGISDEBUG
QString toString()
QString toString() const
{
QString typeString;
foreach ( QGis::WkbType type, types )
Expand Down
4 changes: 2 additions & 2 deletions src/providers/oracle/qgsoracletablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QgsOracleTableModel::~QgsOracleTableModel()
{
}

void QgsOracleTableModel::addTableEntry( QgsOracleLayerProperty layerProperty )
void QgsOracleTableModel::addTableEntry( const QgsOracleLayerProperty &layerProperty )
{
QgsDebugMsg( layerProperty.toString() );

Expand Down Expand Up @@ -261,7 +261,7 @@ bool QgsOracleTableModel::setData( const QModelIndex &idx, const QVariant &value
return true;
}

QString QgsOracleTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
QString QgsOracleTableModel::layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata )
{
if ( !index.isValid() )
{
Expand Down
4 changes: 2 additions & 2 deletions src/providers/oracle/qgsoracletablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsOracleTableModel : public QStandardItemModel
~QgsOracleTableModel();

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

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

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

QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
QString layerURI( const QModelIndex &index, const QString &connInfo, bool useEstimatedMetadata );

static QIcon iconForWkbType( QGis::WkbType type );

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsprojectpropertiesbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@
</widget>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="mWFSUrlLabel">
<property name="text">
Expand Down

0 comments on commit 1e2e481

Please sign in to comment.