Skip to content
Permalink
Browse files

fix oracle provider build (followup c4e26d7)

  • Loading branch information
jef-n committed Jul 19, 2017
1 parent e7700db commit f814ba04c345e402c6b61bf9f2a9aefaaf8deefb
@@ -54,14 +54,14 @@
#include <QNetworkRequest>
#include <QNetworkReply>

QgsOWSSourceSelect::QgsOWSSourceSelect( const QString &service, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsOWSSourceSelect::QgsOWSSourceSelect( const QString &service, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mService( service )
, mCurrentTileset( nullptr )
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
}
@@ -88,7 +88,7 @@ QgsOWSSourceSelect::QgsOWSSourceSelect( const QString &service, QWidget *parent,
// 'Prefer network' is the default noted in the combobox's tool tip
mCacheComboBox->setCurrentIndex( mCacheComboBox->findData( QNetworkRequest::PreferNetwork ) );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
connect( mAddButton, &QAbstractButton::clicked, this, &QgsOWSSourceSelect::addClicked );
//set the current project CRS if available
@@ -116,16 +116,16 @@ void QgsDb2SourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemMod
model->setData( index, le->text() );
}

QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mColumnTypeThread( NULL )
, mUseEstimatedMetadata( false )
{
setupUi( this );

setWindowTitle( tr( "Add Db2 Table(s)" ) );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -138,7 +138,7 @@ QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsDb2SourceSelect::addTables );
@@ -458,7 +458,7 @@ void QgsDb2SourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -34,8 +34,8 @@

const int MAX_SAMPLE_LENGTH = 200;

QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mFile( new QgsDelimitedTextFile() )
, mExampleRowCount( 20 )
, mBadRowCount( 0 )
@@ -48,7 +48,7 @@ QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget *parent, Qt:
QgsSettings settings;
restoreGeometry( settings.value( mPluginKey + "/geometry" ).toByteArray() );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Cancel ) );
buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Add" ) );
@@ -199,7 +199,7 @@ void QgsDelimitedTextSourceSelect::on_buttonBox_accepted()

// add the layer to the map
emit addVectorLayer( QString::fromAscii( url.toEncoded() ), txtLayerName->text(), QStringLiteral( "delimitedtext" ) );
if ( QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -118,20 +118,22 @@ void QgsMssqlSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemM
model->setData( index, le->text() );
}

QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mColumnTypeThread( nullptr )
, mUseEstimatedMetadata( false )
{
setupUi( this );

setWindowTitle( tr( "Add MSSQL Table(s)" ) );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
}
else
{
setWindowTitle( tr( "Add MSSQL Table(s)" ) );
}

mAddButton = new QPushButton( tr( "&Add" ) );
mAddButton->setEnabled( false );
@@ -140,7 +142,7 @@ QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl,
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsMssqlSourceSelect::addTables );
@@ -453,7 +455,7 @@ void QgsMssqlSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -166,14 +166,14 @@ void QgsOracleSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItem
}
}

QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mColumnTypeThread( 0 )
, mIsConnected( false )
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode( ) == QgsProviderRegistry::WidgetMode::Embedded )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -190,7 +190,7 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags f
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( mWidgetMode != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsOracleSourceSelect::addTables );
@@ -357,7 +357,7 @@ void QgsOracleSourceSelect::on_mTablesTreeView_clicked( const QModelIndex &index
void QgsOracleSourceSelect::on_mTablesTreeView_doubleClicked( const QModelIndex &index )
{
QgsSettings settings;
if ( settings.value( "qgis/addOracleDC", false ).toBool() )
if ( settings.value( QStringLiteral( "qgis/addOracleDC" ), false ).toBool() )
{
addTables();
}
@@ -443,12 +443,12 @@ QgsOracleSourceSelect::~QgsOracleSourceSelect()
}

QgsSettings settings;
settings.setValue( "/Windows/OracleSourceSelect/geometry", saveGeometry() );
settings.setValue( "/Windows/OracleSourceSelect/HoldDialogOpen", mHoldDialogOpen->isChecked() );
settings.setValue( QStringLiteral( "/Windows/OracleSourceSelect/geometry" ), saveGeometry() );
settings.setValue( QStringLiteral( "/Windows/OracleSourceSelect/HoldDialogOpen" ), mHoldDialogOpen->isChecked() );

for ( int i = 0; i < mTableModel.columnCount(); i++ )
{
settings.setValue( QString( "/Windows/OracleSourceSelect/columnWidths/%1" ).arg( i ), mTablesTreeView->columnWidth( i ) );
settings.setValue( QStringLiteral( "Windows/OracleSourceSelect/columnWidths/%1" ).arg( i ), mTablesTreeView->columnWidth( i ) );
}
}

@@ -492,8 +492,8 @@ void QgsOracleSourceSelect::addTables()
}
else
{
emit addDatabaseLayers( mSelectedTables, "oracle" );
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "oracle" ) );
if ( !mHoldDialogOpen->isChecked() && widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -541,11 +541,6 @@ void QgsOracleSourceSelect::finishList()
{
QApplication::restoreOverrideCursor();

#if 0
for ( int i = 0; i < QgsOracleTableModel::DbtmColumns; i++ )
mTablesTreeView->resizeColumnToContents( i );
#endif

mTablesTreeView->sortByColumn( QgsOracleTableModel::DbtmTable, Qt::AscendingOrder );
mTablesTreeView->sortByColumn( QgsOracleTableModel::DbtmOwner, Qt::AscendingOrder );
}
@@ -193,14 +193,14 @@ void QgsPgSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemMode
}
}

QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mColumnTypeThread( nullptr )
, mUseEstimatedMetadata( false )
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -217,7 +217,7 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsPr
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsPgSourceSelect::addTables );
@@ -508,7 +508,7 @@ void QgsPgSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "postgres" ) );
if ( ! mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode( ) == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -557,11 +557,6 @@ void QgsPgSourceSelect::finishList()
{
QApplication::restoreOverrideCursor();

#if 0
for ( int i = 0; i < QgsPgTableModel::DbtmColumns; i++ )
mTablesTreeView->resizeColumnToContents( i );
#endif

mTablesTreeView->sortByColumn( QgsPgTableModel::DbtmTable, Qt::AscendingOrder );
mTablesTreeView->sortByColumn( QgsPgTableModel::DbtmSchema, Qt::AscendingOrder );
}
@@ -40,8 +40,8 @@ email : a.furieri@lqt.it
#define strcasecmp(a,b) stricmp(a,b)
#endif

QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ):
QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ):
QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
{
setupUi( this );

@@ -66,7 +66,7 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::Windo
connect( mBuildQueryButton, &QAbstractButton::clicked, this, &QgsSpatiaLiteSourceSelect::buildQuery );
mBuildQueryButton->setEnabled( false );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -417,7 +417,7 @@ void QgsSpatiaLiteSourceSelect::addTables()
else
{
emit addDatabaseLayers( m_selectedTables, QStringLiteral( "spatialite" ) );
if ( QgsAbstractDataSourceWidget::widgetMode( ) == QgsProviderRegistry::WidgetMode::None && ! mHoldDialogOpen->isChecked() )
if ( widgetMode() == QgsProviderRegistry::WidgetMode::None && ! mHoldDialogOpen->isChecked() )
{
accept();
}
@@ -44,7 +44,7 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget *parent, Qt::W
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Cancel ) );
buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Add" ) );
@@ -70,7 +70,7 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget *parent, Qt::W
}
// It needs to find the layertree view without relying on the parent
// being the main window
for ( const QWidget *widget : qApp->allWidgets( ) )
for ( const QWidget *widget : qApp->allWidgets() )
{
if ( ! mTreeView )
{
@@ -137,7 +137,7 @@ void QgsVirtualLayerSourceSelect::onLayerComboChanged( int idx )
}

// Clear embedded layers table
mLayersTable->model()->removeRows( 0, mLayersTable->model()->rowCount( ) );
mLayersTable->model()->removeRows( 0, mLayersTable->model()->rowCount() );
// Add embedded layers
Q_FOREACH ( const QgsVirtualLayerDefinition::SourceLayer &l, def.sourceLayers() )
{
@@ -380,9 +380,9 @@ void QgsVirtualLayerSourceSelect::on_buttonBox_accepted()
{
emit addVectorLayer( def.toString(), layerName, QStringLiteral( "virtual" ) );
}
if ( QgsAbstractDataSourceWidget::widgetMode( ) == QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept( );
accept();
}
}

@@ -48,14 +48,14 @@ enum
MODEL_IDX_SQL
};

QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mCapabilities( nullptr )
, mSQLComposerDialog( nullptr )
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
// For some obscure reason hiding does not work!
// buttonBox->button( QDialogButtonBox::Close )->hide();
@@ -408,7 +408,7 @@ void QgsWFSSourceSelect::addLayer()
emit addVectorLayer( mUri, layerName );
}

if ( ! mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode( ) == QgsProviderRegistry::WidgetMode::None )
if ( ! mHoldDialogOpen->isChecked() && widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -54,14 +54,14 @@
#include <QNetworkRequest>
#include <QNetworkReply>

QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsAbstractDataSourceWidget( parent, fl, theWidgetMode )
, mDefaultCRS( GEO_EPSG_CRS_AUTHID )
, mCurrentTileset( nullptr )
{
setupUi( this );

if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
// For some obscure reason hiding does not work!
// buttonBox->button( QDialogButtonBox::Close )->hide();
@@ -80,7 +80,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs

mImageFormatGroup = new QButtonGroup;

if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( widgetMode() != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsWMSSourceSelect::addClicked );
@@ -155,11 +155,11 @@ QgsWMSSourceSelect::~QgsWMSSourceSelect()
settings.setValue( QStringLiteral( "Windows/WMSSourceSelect/geometry" ), saveGeometry() );
}

void QgsWMSSourceSelect::refresh( )
void QgsWMSSourceSelect::refresh()
{
// Reload WMS connections and update the GUI
QgsDebugMsg( "Refreshing WMS connections ..." );
populateConnectionList( );
populateConnectionList();
}


0 comments on commit f814ba0

Please sign in to comment.
You can’t perform that action at this time.