Skip to content

Commit 571ee34

Browse files
committed
Merge branch 'master' of github.com:qgis/QGIS
2 parents 7ed1a7f + 1d6dfc5 commit 571ee34

File tree

7 files changed

+29
-27
lines changed

7 files changed

+29
-27
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ ENDIF (ANDROID)
612612
IF(COMMAND cmake_policy)
613613
cmake_policy(SET CMP0003 NEW)
614614
cmake_policy(SET CMP0005 OLD)
615-
cmake_policy(SET CMP0063 NEW)
615+
IF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
616+
cmake_policy(SET CMP0063 NEW)
617+
ENDIF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
616618
ENDIF(COMMAND cmake_policy)
617619

618620
IF (WIN32)

python/plugins/db_manager/db_plugins/oracle/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def type2String(self):
527527

528528
def update(self, new_name, new_type_str=None, new_not_null=None,
529529
new_default_str=None):
530-
self.table().aboutToChange()
530+
self.table().aboutToChange.emit()
531531
if self.name == new_name:
532532
new_name = None
533533
if self.type2String() == new_type_str:

python/plugins/db_manager/db_plugins/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ def rename(self, new_name):
10911091
return self.update(new_name)
10921092

10931093
def update(self, new_name, new_type_str=None, new_not_null=None, new_default_str=None):
1094-
self.table().aboutToChange()
1094+
self.table().aboutToChange.emit()
10951095
if self.name == new_name:
10961096
new_name = None
10971097
if self.type2String() == new_type_str:

python/plugins/db_manager/db_plugins/postgis/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def runVacuumAnalyze(self):
184184
self.schema().refresh() if self.schema() else self.database().refresh()
185185

186186
def runRefreshMaterializedView(self):
187-
self.aboutToChange()
187+
self.aboutToChange.emit()
188188
self.database().connector.runRefreshMaterializedView((self.schemaName(), self.name))
189189
# TODO: change only this item, not re-create all the tables in the schema/database
190190
self.schema().refresh() if self.schema() else self.database().refresh()

src/app/qgsapplayertreeviewmenuprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()
148148
if ( vlayer )
149149
{
150150
const QgsSingleSymbolRendererV2* singleRenderer = dynamic_cast< const QgsSingleSymbolRendererV2* >( vlayer->rendererV2() );
151-
if ( !singleRenderer && vlayer->rendererV2()->embeddedRenderer() )
151+
if ( !singleRenderer && vlayer->rendererV2() && vlayer->rendererV2()->embeddedRenderer() )
152152
{
153153
singleRenderer = dynamic_cast< const QgsSingleSymbolRendererV2* >( vlayer->rendererV2()->embeddedRenderer() );
154154
}

src/providers/oracle/ocispatial/qsql_ocispatial.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,9 +3163,7 @@ bool QOCISpatialResult::exec()
31633163
qOraWarning( "Unable to get statement type:", d->err );
31643164
setLastError( qMakeError( QCoreApplication::translate( "QOCISpatialResult",
31653165
"Unable to get statement type" ), QSqlError::StatementError, d->err ) );
3166-
#ifdef QOCISPATIAL_DEBUG
3167-
qDebug() << "lastQuery()" << lastQuery();
3168-
#endif
3166+
qWarning( "type retrieval failed with statement:%s", lastQuery().toLocal8Bit().constData() );
31693167
return false;
31703168
}
31713169

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

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

src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3402,19 +3402,25 @@ QGISEXTERN QString loadStyle( const QString &uri, QString &errCause )
34023402
QSqlQuery qry( *conn );
34033403

34043404
QString style;
3405-
if ( !qry.exec( QString( "SELECT styleQML FROM ("
3406-
"SELECT styleQML"
3407-
" FROM layer_styles"
3408-
" WHERE f_table_catalog=%1"
3409-
" AND f_table_schema=%2"
3410-
" AND f_table_name=%3"
3411-
" AND f_geometry_column=%4"
3412-
" ORDER BY useAsDefault DESC"
3413-
") WHERE rownum=1" )
3414-
.arg( QgsOracleConn::quotedValue( dsUri.database() ) )
3415-
.arg( QgsOracleConn::quotedValue( dsUri.schema() ) )
3416-
.arg( QgsOracleConn::quotedValue( dsUri.table() ) )
3417-
.arg( QgsOracleConn::quotedValue( dsUri.geometryColumn() ) ) ) )
3405+
if ( !qry.exec( "SELECT COUNT(*) FROM user_tables WHERE table_name='LAYER_STYLES'" ) || !qry.next() || qry.value( 0 ).toInt() == 0 )
3406+
{
3407+
errCause = QObject::tr( "Unable layer style table not found [%1]" ).arg( qry.lastError().text() );
3408+
conn->disconnect();
3409+
return QString::null;
3410+
}
3411+
else if ( !qry.exec( QString( "SELECT styleQML FROM ("
3412+
"SELECT styleQML"
3413+
" FROM layer_styles"
3414+
" WHERE f_table_catalog=%1"
3415+
" AND f_table_schema=%2"
3416+
" AND f_table_name=%3"
3417+
" AND f_geometry_column=%4"
3418+
" ORDER BY useAsDefault DESC"
3419+
") WHERE rownum=1" )
3420+
.arg( QgsOracleConn::quotedValue( dsUri.database() ) )
3421+
.arg( QgsOracleConn::quotedValue( dsUri.schema() ) )
3422+
.arg( QgsOracleConn::quotedValue( dsUri.table() ) )
3423+
.arg( QgsOracleConn::quotedValue( dsUri.geometryColumn() ) ) ) )
34183424
{
34193425
errCause = QObject::tr( "Could not retrieve style [%1]" ).arg( qry.lastError().text() );
34203426
}

0 commit comments

Comments
 (0)