Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:qgis/QGIS
  • Loading branch information
rouault committed Jun 12, 2016
2 parents 7ed1a7f + 1d6dfc5 commit 571ee34
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 27 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -612,7 +612,9 @@ ENDIF (ANDROID)
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0063 NEW)
IF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
cmake_policy(SET CMP0063 NEW)
ENDIF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
ENDIF(COMMAND cmake_policy)

IF (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/oracle/plugin.py
Expand Up @@ -527,7 +527,7 @@ def type2String(self):

def update(self, new_name, new_type_str=None, new_not_null=None,
new_default_str=None):
self.table().aboutToChange()
self.table().aboutToChange.emit()
if self.name == new_name:
new_name = None
if self.type2String() == new_type_str:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/plugin.py
Expand Up @@ -1091,7 +1091,7 @@ def rename(self, new_name):
return self.update(new_name)

def update(self, new_name, new_type_str=None, new_not_null=None, new_default_str=None):
self.table().aboutToChange()
self.table().aboutToChange.emit()
if self.name == new_name:
new_name = None
if self.type2String() == new_type_str:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/postgis/plugin.py
Expand Up @@ -184,7 +184,7 @@ def runVacuumAnalyze(self):
self.schema().refresh() if self.schema() else self.database().refresh()

def runRefreshMaterializedView(self):
self.aboutToChange()
self.aboutToChange.emit()
self.database().connector.runRefreshMaterializedView((self.schemaName(), self.name))
# TODO: change only this item, not re-create all the tables in the schema/database
self.schema().refresh() if self.schema() else self.database().refresh()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -148,7 +148,7 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( vlayer )
{
const QgsSingleSymbolRendererV2* singleRenderer = dynamic_cast< const QgsSingleSymbolRendererV2* >( vlayer->rendererV2() );
if ( !singleRenderer && vlayer->rendererV2()->embeddedRenderer() )
if ( !singleRenderer && vlayer->rendererV2() && vlayer->rendererV2()->embeddedRenderer() )
{
singleRenderer = dynamic_cast< const QgsSingleSymbolRendererV2* >( vlayer->rendererV2()->embeddedRenderer() );
}
Expand Down
12 changes: 3 additions & 9 deletions src/providers/oracle/ocispatial/qsql_ocispatial.cpp
Expand Up @@ -3163,9 +3163,7 @@ bool QOCISpatialResult::exec()
qOraWarning( "Unable to get statement type:", d->err );
setLastError( qMakeError( QCoreApplication::translate( "QOCISpatialResult",
"Unable to get statement type" ), QSqlError::StatementError, d->err ) );
#ifdef QOCISPATIAL_DEBUG
qDebug() << "lastQuery()" << lastQuery();
#endif
qWarning( "type retrieval failed with statement:%s", lastQuery().toLocal8Bit().constData() );
return false;
}

Expand All @@ -3189,9 +3187,7 @@ bool QOCISpatialResult::exec()
qOraWarning( "unable to bind value: ", d->err );
setLastError( qMakeError( QCoreApplication::translate( "QOCISpatialResult", "Unable to bind value" ),
QSqlError::StatementError, d->err ) );
#ifdef QOCISPATIAL_DEBUG
qDebug() << "lastQuery()" << lastQuery();
#endif
qWarning( "bind failed with statement:%s", lastQuery().toLocal8Bit().constData() );
return false;
}

Expand All @@ -3202,9 +3198,7 @@ bool QOCISpatialResult::exec()
qOraWarning( "unable to execute statement:", d->err );
setLastError( qMakeError( QCoreApplication::translate( "QOCISpatialResult",
"Unable to execute statement" ), QSqlError::StatementError, d->err ) );
#ifdef QOCISPATIAL_DEBUG
qDebug() << "lastQuery()" << lastQuery();
#endif
qWarning( "execution failed with statement:%s", lastQuery().toLocal8Bit().constData() );
return false;
}

Expand Down
32 changes: 19 additions & 13 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -3402,19 +3402,25 @@ QGISEXTERN QString loadStyle( const QString &uri, QString &errCause )
QSqlQuery qry( *conn );

QString style;
if ( !qry.exec( QString( "SELECT styleQML FROM ("
"SELECT styleQML"
" FROM layer_styles"
" WHERE f_table_catalog=%1"
" AND f_table_schema=%2"
" AND f_table_name=%3"
" AND f_geometry_column=%4"
" ORDER BY useAsDefault DESC"
") WHERE rownum=1" )
.arg( QgsOracleConn::quotedValue( dsUri.database() ) )
.arg( QgsOracleConn::quotedValue( dsUri.schema() ) )
.arg( QgsOracleConn::quotedValue( dsUri.table() ) )
.arg( QgsOracleConn::quotedValue( dsUri.geometryColumn() ) ) ) )
if ( !qry.exec( "SELECT COUNT(*) FROM user_tables WHERE table_name='LAYER_STYLES'" ) || !qry.next() || qry.value( 0 ).toInt() == 0 )
{
errCause = QObject::tr( "Unable layer style table not found [%1]" ).arg( qry.lastError().text() );
conn->disconnect();
return QString::null;
}
else if ( !qry.exec( QString( "SELECT styleQML FROM ("
"SELECT styleQML"
" FROM layer_styles"
" WHERE f_table_catalog=%1"
" AND f_table_schema=%2"
" AND f_table_name=%3"
" AND f_geometry_column=%4"
" ORDER BY useAsDefault DESC"
") WHERE rownum=1" )
.arg( QgsOracleConn::quotedValue( dsUri.database() ) )
.arg( QgsOracleConn::quotedValue( dsUri.schema() ) )
.arg( QgsOracleConn::quotedValue( dsUri.table() ) )
.arg( QgsOracleConn::quotedValue( dsUri.geometryColumn() ) ) ) )
{
errCause = QObject::tr( "Could not retrieve style [%1]" ).arg( qry.lastError().text() );
}
Expand Down

0 comments on commit 571ee34

Please sign in to comment.