Skip to content
Permalink
Browse files

followup 16ba01f for oracle & mssql

  • Loading branch information
jef-n committed Jun 2, 2013
1 parent af4a86f commit 1e2e4816a6393e7fb47a2e18fa372a8ff0b17775
@@ -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;
@@ -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;
@@ -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 )
@@ -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;
@@ -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 );
@@ -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 );

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

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

#if QGISDEBUG
QString toString()
QString toString() const
{
QString typeString;
foreach ( QGis::WkbType type, types )
@@ -39,7 +39,7 @@ QgsOracleTableModel::~QgsOracleTableModel()
{
}

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

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

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

0 comments on commit 1e2e481

Please sign in to comment.
You can’t perform that action at this time.