Showing with 9 additions and 23 deletions.
  1. +3 −6 src/providers/gdal/qgsgdalprovider.cpp
  2. +3 −0 src/providers/gdal/qgsgdalprovider.h
  3. +3 −17 src/providers/postgres/qgspostgresprovider.cpp
9 changes: 3 additions & 6 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
}
}
mNoDataValue.append( myNoDataValue );
QgsDebugMsg( QString( "mNoDataValue[%1] = %1" ).arg( i - 1 ).arg( mNoDataValue[i-1] ) );
QgsDebugMsg( QString( "mNoDataValue[%1] = %2" ).arg( i - 1 ).arg( mNoDataValue[i-1] ) );
}

mValid = true;
Expand Down Expand Up @@ -1512,11 +1512,8 @@ QList<QgsRasterPyramid> QgsGdalProvider::buildPyramidList()
myRasterPyramid.xDim = ( int )( 0.5 + ( myWidth / ( double )myDivisor ) );
myRasterPyramid.yDim = ( int )( 0.5 + ( myHeight / ( double )myDivisor ) );
myRasterPyramid.exists = false;
#ifdef QGISDEBUG
QgsLogger::debug( "Pyramid", myRasterPyramid.level, 1, __FILE__, __FUNCTION__, __LINE__ );
QgsLogger::debug( "xDim", myRasterPyramid.xDim, 1, __FILE__, __FUNCTION__, __LINE__ );
QgsLogger::debug( "yDim", myRasterPyramid.yDim, 1, __FILE__, __FUNCTION__, __LINE__ );
#endif

QgsDebugMsg( QString( "Pyramid %1 xDim %2 yDim %3" ).arg( myRasterPyramid.level ).arg( myRasterPyramid.xDim ).arg( myRasterPyramid.yDim ) );

//
// Now we check if it actually exists in the raster layer
Expand Down
3 changes: 3 additions & 0 deletions src/providers/gdal/qgsgdalprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ class QgsGdalProvider : public QgsRasterDataProvider
/** Emit a signal to notify of the progress event. */
void emitProgress( int theType, double theProgress, QString theMessage );

signals:
void statusChanged( QString );

private:
// initialize CRS from wkt
bool crsFromWkt( const char *wkt );
Expand Down
20 changes: 3 additions & 17 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2029,25 +2029,11 @@ QString QgsPostgresProvider::getPrimaryKey()
.arg( quotedValue( mQuery ) );

Result ctidCheck = connectionRO->PQexec( sql );

if ( PQntuples( ctidCheck ) == 1 )
{
sql = QString( "SELECT max(substring(ctid::text from E'\\\\((\\\\d+),\\\\d+\\\\)')::integer) from %1" )
.arg( mQuery );

Result ctidCheck = connectionRO->PQexec( sql );
if ( PQntuples( ctidCheck ) == 1 )
{
int id = QString( PQgetvalue( ctidCheck, 0, 0 ) ).toInt();

if ( id < 0x10000 )
{
// fallback to ctid
primaryKey = "ctid";
primaryKeyType = "tid";
mIsDbPrimaryKey = true;
}
}
primaryKey = "ctid";
primaryKeyType = "tid";
mIsDbPrimaryKey = true;
}
}

Expand Down