Skip to content

Commit

Permalink
fix oracle provider build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 5, 2017
1 parent 63083ab commit 05d9f92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/providers/oracle/qgsoracleprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,12 @@ QVariant QgsOracleProvider::minimumValue( int index ) const
}

// Returns the list of unique values of an attribute
void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int limit ) const
QSet<QVariant> QgsOracleProvider::uniqueValues( int index, int limit ) const
{
if ( !mConnection )
return;
QSet<QVariant> uniqueValues;

uniqueValues.clear();
if ( !mConnection )
return uniqueValues;

try
{
Expand Down Expand Up @@ -1081,17 +1081,20 @@ void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues,
QgsMessageLog::logMessage( tr( "Unable to execute the query.\nThe error message from the database was:\n%1.\nSQL: %2" )
.arg( qry.lastError().text() )
.arg( qry.lastQuery() ), tr( "Oracle" ) );
return;
return QSet<QVariant>();
}

while ( qry.next() )
{
uniqueValues.append( qry.value( 0 ) );
uniqueValues << qry.value( 0 );
}
}
catch ( OracleFieldNotFound )
{
return QSet<QVariant>();
}

return uniqueValues;
}

// Returns the maximum value of an attribute
Expand Down
2 changes: 1 addition & 1 deletion src/providers/oracle/qgsoracleprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class QgsOracleProvider : public QgsVectorDataProvider

QVariant minimumValue( int index ) const override;
QVariant maximumValue( int index ) const override;
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 ) const override;
virtual QSet<QVariant> uniqueValues( int index, int limit = -1 ) const override;
bool isValid() const override;
QgsAttributeList pkAttributeIndexes() const override { return mPrimaryKeyAttrs; }
QVariant defaultValue( QString fieldName, QString tableName = QString::null, QString schemaName = QString::null );
Expand Down

0 comments on commit 05d9f92

Please sign in to comment.