Skip to content

Commit

Permalink
fix interface since rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
troopa81 authored and nyalldawson committed Jan 29, 2021
1 parent 33db399 commit 2a94f09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/providers/oracle/qgsoracleproviderconnection.cpp
Expand Up @@ -213,7 +213,6 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsOracleProviderConnection::
const int numCols { rec.count() };
auto iterator = std::make_shared<QgsOracleProviderResultIterator>( numCols, qry );
QgsAbstractDatabaseProviderConnection::QueryResult results( iterator );
results.setRowCount( qry.size() );
for ( int idx = 0; idx < numCols; ++idx )
{
results.appendColumn( rec.field( idx ).name() );
Expand All @@ -225,19 +224,19 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsOracleProviderConnection::
return QgsAbstractDatabaseProviderConnection::QueryResult();
}

QVariantList QgsOracleProviderResultIterator::nextRow()
QVariantList QgsOracleProviderResultIterator::nextRowPrivate()
{
const QVariantList currentRow( mNextRow );
mNextRow = nextRowPrivate();
mNextRow = nextRowInternal();
return currentRow;
}

bool QgsOracleProviderResultIterator::hasNextRow() const
bool QgsOracleProviderResultIterator::hasNextRowPrivate() const
{
return ! mNextRow.isEmpty();
}

QVariantList QgsOracleProviderResultIterator::nextRowPrivate()
QVariantList QgsOracleProviderResultIterator::nextRowInternal()
{
QVariantList row;
if ( mQuery.next() )
Expand All @@ -247,6 +246,10 @@ QVariantList QgsOracleProviderResultIterator::nextRowPrivate()
row.push_back( mQuery.value( col ) );
}
}
else
{
mQuery.finish();
}
return row;
}

Expand Down
6 changes: 3 additions & 3 deletions src/providers/oracle/qgsoracleproviderconnection.h
Expand Up @@ -27,16 +27,16 @@ struct QgsOracleProviderResultIterator: public QgsAbstractDatabaseProviderConnec
, mQuery( query )
{}

QVariantList nextRow() override;
bool hasNextRow() const override;
QVariantList nextRowPrivate() override;
bool hasNextRowPrivate() const override;

private:

int mColumnCount = 0;
QSqlQuery mQuery;
QVariantList mNextRow;

QVariantList nextRowPrivate();
QVariantList nextRowInternal();

};

Expand Down

0 comments on commit 2a94f09

Please sign in to comment.