13 changes: 6 additions & 7 deletions src/providers/oracle/qgsoraclesourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ email : jef at norbit dot de
***************************************************************************/

#include "qgsoraclesourceselect.h"
#include "qgsoraclecolumntypethread.h"

#include "qgslogger.h"
#include "qgsapplication.h"
Expand All @@ -28,6 +27,7 @@ email : jef at norbit dot de
#include "qgsquerybuilder.h"
#include "qgsdatasourceuri.h"
#include "qgsvectorlayer.h"
#include "qgsoraclecolumntypethread.h"

#include <QFileDialog>
#include <QInputDialog>
Expand Down Expand Up @@ -139,7 +139,6 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WFlags fl, bo
{
setupUi( this );


if ( mEmbeddedMode )
{
buttonBox->button( QDialogButtonBox::Close )->hide();
Expand All @@ -152,8 +151,8 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WFlags fl, bo
mAddButton = new QPushButton( tr( "&Add" ) );
mAddButton->setEnabled( false );

mBuildQueryButton = new QPushButton( tr( "&Build query" ) );
mBuildQueryButton->setToolTip( tr( "Build query" ) );
mBuildQueryButton = new QPushButton( tr( "&Set Filter" ) );
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( !mManagerMode )
Expand Down Expand Up @@ -191,7 +190,6 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WFlags fl, bo
mTablesTreeView->setEditTriggers( QAbstractItemView::CurrentChanged );
mTablesTreeView->setItemDelegate( mTablesTreeDelegate );


QSettings settings;
mTablesTreeView->setSelectionMode( settings.value( "/qgis/addOracleDC", false ).toBool() ?
QAbstractItemView::ExtendedSelection :
Expand Down Expand Up @@ -466,7 +464,9 @@ void QgsOracleSourceSelect::on_btnConnect_clicked()
mIsConnected = true;
mTablesTreeDelegate->setConn( QgsOracleConn::connectDb( uri.connectionInfo() ) );

mColumnTypeThread = new QgsOracleColumnTypeThread( cmbConnections->currentText(), mUseEstimatedMetadata );
mColumnTypeThread = new QgsOracleColumnTypeThread( cmbConnections->currentText(),
mUseEstimatedMetadata,
cbxAllowGeometrylessTables->isChecked() );

connect( mColumnTypeThread, SIGNAL( setLayerType( QgsOracleLayerProperty ) ),
this, SLOT( setLayerType( QgsOracleLayerProperty ) ) );
Expand Down Expand Up @@ -495,7 +495,6 @@ void QgsOracleSourceSelect::finishList()

mTablesTreeView->sortByColumn( QgsOracleTableModel::dbtmTable, Qt::AscendingOrder );
mTablesTreeView->sortByColumn( QgsOracleTableModel::dbtmOwner, Qt::AscendingOrder );

}

void QgsOracleSourceSelect::columnThreadFinished()
Expand Down
20 changes: 2 additions & 18 deletions src/providers/oracle/qgsoracletablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,7 @@ QgsOracleTableModel::~QgsOracleTableModel()

void QgsOracleTableModel::addTableEntry( QgsOracleLayerProperty layerProperty )
{
#ifdef QGISDEBUG
QString typeString;
foreach ( QGis::WkbType type, layerProperty.types )
{
if ( !typeString.isEmpty() )
typeString += "|";
typeString += QString::number( type );
}
QString sridString;
foreach ( int srid, layerProperty.srids )
{
if ( !sridString.isEmpty() )
sridString += "|";
sridString += QString::number( srid );
}
QgsDebugMsg( layerProperty.toString() );
#endif

if ( layerProperty.isView && layerProperty.pkCols.isEmpty() )
{
Expand All @@ -70,8 +54,8 @@ void QgsOracleTableModel::addTableEntry( QgsOracleLayerProperty layerProperty )

for ( int i = 0; i < layerProperty.size(); i++ )
{
QGis::WkbType wkbType = layerProperty.at( i ).types[0];
int srid = layerProperty.at( i ).srids[0];
QGis::WkbType wkbType = layerProperty.types[ i ];
int srid = layerProperty.srids[ i ];

QStandardItem *ownerNameItem = new QStandardItem( layerProperty.ownerName );

Expand Down
26 changes: 20 additions & 6 deletions src/ui/qgsoraclenewconnectionbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
<string>Connection Information</string>
</property>
<layout class="QGridLayout" name="gridLayout_1">
<item row="11" column="0" colspan="3">
<widget class="QCheckBox" name="cb_useEstimatedMetadata">
<property name="toolTip">
<string>Use estimated table statistics for the layer metadata.</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When the layer is setup various metadata is required for the Oracle table. This includes information such as the table row count, geometry type and spatial extents of the data in the geometry column. If the table contains a large number of rows determining this metadata is time consuming.&lt;/p&gt;&lt;p&gt;By activating this option the following fast table metadata operations are done:&lt;/p&gt;&lt;p&gt;1) Row count is determined from all_tables.num_rows.&lt;/p&gt;&lt;p&gt;2) Table extents are always determined with the SDO_TUNE.EXTENTS_OF function even if a layer filter is applied.&lt;/p&gt;&lt;p&gt;3) The table geometry is determined from the first 100 non-null geometry rows in the table.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use estimated table metadata</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="txtUsername"/>
</item>
Expand Down Expand Up @@ -162,6 +175,9 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="txtDatabase"/>
</item>
<item row="6" column="2" rowspan="2">
<widget class="QPushButton" name="btnConnect">
<property name="text">
Expand All @@ -176,9 +192,6 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="txtDatabase"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TextLabel1">
<property name="text">
Expand All @@ -192,16 +205,16 @@
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="txtHost"/>
</item>
<item row="11" column="0" colspan="3">
<widget class="QCheckBox" name="cb_useEstimatedMetadata">
<item row="12" column="0" colspan="3">
<widget class="QCheckBox" name="cb_onlyExistingTypes">
<property name="toolTip">
<string>Use estimated table statistics for the layer metadata.</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When the layer is setup various metadata is required for the Oracle table. This includes information such as the table row count, geometry type and spatial extents of the data in the geometry column. If the table contains a large number of rows determining this metadata is time consuming.&lt;/p&gt;&lt;p&gt;By activating this option the following fast table metadata operations are done:&lt;/p&gt;&lt;p&gt;1) Row count is determined from all_tables.num_rows.&lt;/p&gt;&lt;p&gt;2) Table extents are always determined with the SDO_TUNE.EXTENTS_OF function even if a layer filter is applied.&lt;/p&gt;&lt;p&gt;3) The table geometry is determined from the first 100 non-null geometry rows in the table.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use estimated table metadata</string>
<string>Only existing geometry types</string>
</property>
</widget>
</item>
Expand All @@ -225,6 +238,7 @@
<tabstop>cb_userTablesOnly</tabstop>
<tabstop>cb_allowGeometrylessTables</tabstop>
<tabstop>cb_useEstimatedMetadata</tabstop>
<tabstop>cb_onlyExistingTypes</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
Expand Down