Navigation Menu

Skip to content

Commit

Permalink
Remove abbreviation of connectionInfo
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9502 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 20, 2008
1 parent b352b85 commit dfca970
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsdatasourceuri.sip
Expand Up @@ -20,7 +20,7 @@ public:
QgsDataSourceURI(QString uri);

//! connection info
QString connInfo() const;
QString connectionInfo() const;

//! complete uri
QString uri() const;
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -2308,17 +2308,17 @@ void QgisApp::addDatabaseLayer()

QApplication::setOverrideCursor( Qt::WaitCursor );

QString connInfo = dbs->connInfo();
QString connectionInfo = dbs->connectionInfo();
// for each selected table, connect to the database, parse the Wkt geometry,
// and build a canvasitem for it
// readWKB(connInfo,tables);
// readWKB(connectionInfo,tables);
QStringList::Iterator it = tables.begin();
while ( it != tables.end() )
{

// create the layer
//qWarning("creating layer");
QgsVectorLayer *layer = new QgsVectorLayer( connInfo + " table=" + *it, *it, "postgres" );
QgsVectorLayer *layer = new QgsVectorLayer( connectionInfo + " table=" + *it, *it, "postgres" );
if ( layer->isValid() )
{
// register this layer with the central layers registry
Expand Down Expand Up @@ -2371,7 +2371,7 @@ void QgisApp::addWmsLayer()
if ( wmss->exec() )
{

addRasterLayer( wmss->connInfo(),
addRasterLayer( wmss->connectionInfo(),
wmss->connName(),
"wms",
wmss->selectedLayers(),
Expand Down
14 changes: 7 additions & 7 deletions src/app/qgsdbsourceselect.cpp
Expand Up @@ -386,17 +386,17 @@ void QgsDbSourceSelect::on_btnConnect_clicked()

// Need to escape the password to allow for single quotes and backslashes

QgsDebugMsg( "Connection info: " + uri.connInfo() );
QgsDebugMsg( "Connection info: " + uri.connectionInfo() );

if ( makeConnection )
{
m_connInfo = uri.connInfo();
//qDebug(m_connInfo);
m_connectionInfo = uri.connectionInfo();
//qDebug(m_connectionInfo);
// Tidy up an existing connection if one exists.
if ( pd != 0 )
PQfinish( pd );

pd = PQconnectdb( m_connInfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
pd = PQconnectdb( m_connectionInfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
if ( PQstatus( pd ) == CONNECTION_OK )
{
//qDebug("Connection succeeded");
Expand Down Expand Up @@ -458,9 +458,9 @@ QStringList QgsDbSourceSelect::selectedTables()
return m_selectedTables;
}

QString QgsDbSourceSelect::connInfo()
QString QgsDbSourceSelect::connectionInfo()
{
return m_connInfo;
return m_connectionInfo;
}

void QgsDbSourceSelect::setSql( const QModelIndex& index )
Expand Down Expand Up @@ -516,7 +516,7 @@ void QgsDbSourceSelect::addSearchGeometryColumn( const QString &schema, const QS
if ( mColumnTypeThread == NULL )
{
mColumnTypeThread = new QgsGeomColumnTypeThread();
mColumnTypeThread->setConnInfo( m_connInfo );
mColumnTypeThread->setConnInfo( m_connectionInfo );
}
mColumnTypeThread->addGeometryColumn( schema, table, column );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsdbsourceselect.h
Expand Up @@ -70,7 +70,7 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
//! String list containing the selected tables
QStringList selectedTables();
//! Connection info (database, host, user, password)
QString connInfo();
QString connectionInfo();
// Store the selected database
void dbChanged();
// Utility function to construct the query for finding out the
Expand Down Expand Up @@ -133,7 +133,7 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
QStringList mColumnLabels;
// Our thread for doing long running queries
QgsGeomColumnTypeThread* mColumnTypeThread;
QString m_connInfo;
QString m_connectionInfo;
QStringList m_selectedTables;
// Storage for the range of layer type icons
QMap<QString, QPair<QString, QIcon> > mLayerIcons;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsnewconnection.cpp
Expand Up @@ -110,9 +110,9 @@ void QgsNewConnection::testConnection()
QgsDataSourceURI uri;
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text() );

QgsLogger::debug( "PQconnectdb(" + uri.connInfo() + ");" );
QgsLogger::debug( "PQconnectdb(" + uri.connectionInfo() + ");" );

PGconn *pd = PQconnectdb( uri.connInfo().toLocal8Bit().data() );
PGconn *pd = PQconnectdb( uri.connectionInfo().toLocal8Bit().data() );
if ( PQstatus( pd ) == CONNECTION_OK )
{
// Database successfully opened; we can now issue SQL commands.
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgspgquerybuilder.cpp
Expand Up @@ -42,11 +42,11 @@ QgsPgQueryBuilder::QgsPgQueryBuilder( QgsDataSourceURI *uri,
setupGuiViews();
// The query builder must make its own connection to the database when
// using this constructor
QString connInfo = mUri->connInfo();
QString connectionInfo = mUri->connectionInfo();

QgsDebugMsg( "Attempting connect using: " + connInfo );
QgsDebugMsg( "Attempting connect using: " + connectionInfo );

mPgConnection = PQconnectdb( connInfo.toLocal8Bit().data() ); // use what is set based on locale; after connecting, use Utf8
mPgConnection = PQconnectdb( connectionInfo.toLocal8Bit().data() ); // use what is set based on locale; after connecting, use Utf8
// check the connection status
if ( PQstatus( mPgConnection ) == CONNECTION_OK )
{
Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsserversourceselect.cpp
Expand Up @@ -319,9 +319,9 @@ void QgsServerSourceSelect::on_btnConnect_clicked()
connStringParts += settings.value( key + "/url" ).toString();

m_connName = cmbConnections->currentText();
m_connInfo = connStringParts.join( " " );
m_connectionInfo = connStringParts.join( " " );

QgsDebugMsg( QString( "Connection info: '%1'." ).arg( m_connInfo ) );
QgsDebugMsg( QString( "Connection info: '%1'." ).arg( m_connectionInfo ) );


// TODO: Create and bind to data provider
Expand All @@ -330,7 +330,7 @@ void QgsServerSourceSelect::on_btnConnect_clicked()
QgsProviderRegistry * pReg = QgsProviderRegistry::instance();

mWmsProvider =
( QgsWmsProvider* ) pReg->getProvider( "wms", m_connInfo );
( QgsWmsProvider* ) pReg->getProvider( "wms", m_connectionInfo );

if ( mWmsProvider )
{
Expand Down Expand Up @@ -528,9 +528,9 @@ QString QgsServerSourceSelect::connName()
return m_connName;
}

QString QgsServerSourceSelect::connInfo()
QString QgsServerSourceSelect::connectionInfo()
{
return m_connInfo;
return m_connectionInfo;
}

QStringList QgsServerSourceSelect::selectedLayers()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsserversourceselect.h
Expand Up @@ -54,7 +54,7 @@ class QgsServerSourceSelect : public QDialog, private Ui::QgsServerSourceSelectB
QString connName();

//! Connection info (uri)
QString connInfo();
QString connectionInfo();

//! Connection Proxy Host
QString connProxyHost();
Expand Down Expand Up @@ -147,7 +147,7 @@ class QgsServerSourceSelect : public QDialog, private Ui::QgsServerSourceSelectB
QString m_connName;

//! URI for selected connection
QString m_connInfo;
QString m_connectionInfo;

//! Proxy Host for selected connection
QString m_connProxyHost;
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsdatasourceuri.cpp
Expand Up @@ -269,36 +269,36 @@ QString QgsDataSourceURI::getValue( const QString &uri, int &i )
return pval;
}

QString QgsDataSourceURI::connInfo() const
QString QgsDataSourceURI::connectionInfo() const
{
QString connInfo = "dbname='" + mDatabase + "'";
QString connectionInfo = "dbname='" + mDatabase + "'";

if ( mHost != "" )
{
connInfo += " host=" + mHost;
connectionInfo += " host=" + mHost;
if ( mPort != "" )
connInfo += " port=" + mPort;
connectionInfo += " port=" + mPort;
}

if ( mUsername != "" )
{
connInfo += " user='" + mUsername + "'"; //needs to be escaped
connectionInfo += " user='" + mUsername + "'"; //needs to be escaped

if ( mPassword != "" )
{
QString p = mPassword;
p.replace( '\\', "\\\\" );
p.replace( '\'', "\\'" );
connInfo += " password='" + p + "'";
connectionInfo += " password='" + p + "'";
}
}

return connInfo;
return connectionInfo;
}

QString QgsDataSourceURI::uri() const
{
return connInfo()
return connectionInfo()
+ QString( " table=%1 (%2) sql=%3" )
.arg( quotedTablename() )
.arg( mGeometryColumn )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdatasourceuri.h
Expand Up @@ -39,7 +39,7 @@ class CORE_EXPORT QgsDataSourceURI
QgsDataSourceURI( QString uri );

//! return connection part of URI
QString connInfo() const;
QString connectionInfo() const;

//! return complete uri
QString uri() const;
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/geoprocessing/qgspggeoprocessing.cpp
Expand Up @@ -100,10 +100,10 @@ void QgsPgGeoprocessing::buffer()

QgsDataSourceURI uri( lyr->source() );

QgsDebugMsg( "data source = " + uri.connInfo() );
QgsDebugMsg( "data source = " + uri.connectionInfo() );

// connect to the database and check the capabilities
PGconn *capTest = PQconnectdb( uri.connInfo().toUtf8() );
PGconn *capTest = PQconnectdb( uri.connectionInfo().toUtf8() );
if ( PQstatus( capTest ) == CONNECTION_OK )
{
postgisVersion( capTest );
Expand Down Expand Up @@ -135,7 +135,7 @@ void QgsPgGeoprocessing::buffer()
}
}
// connect to the database
PGconn *conn = PQconnectdb( uri.connInfo().toUtf8() );
PGconn *conn = PQconnectdb( uri.connectionInfo().toUtf8() );
if ( PQstatus( conn ) == CONNECTION_OK )
{
// populate the schema drop-down
Expand Down Expand Up @@ -305,7 +305,7 @@ void QgsPgGeoprocessing::buffer()
if ( bb->addLayerToMap() )
{
// create the connection string
QString newLayerSource = uri.connInfo();
QString newLayerSource = uri.connectionInfo();
QgsDebugMsg( "newLayerSource: " + newLayerSource );

// add the schema.table and geometry column
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -2688,7 +2688,7 @@ void QgsGrassModuleGdalInput::updateQgisLayers()
{
// Construct OGR DSN
QgsDataSourceURI dsUri( provider->dataSourceUri() );
uri = "PG:" + dsUri.connInfo();
uri = "PG:" + dsUri.connectionInfo();

if ( dsUri.schema() != "" )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spit/qgsspit.cpp
Expand Up @@ -420,7 +420,7 @@ void QgsSpit::dbConnect()
settings.value( key + "/username" ).toString(),
password );

conn = PQconnectdb( uri.connInfo().toUtf8() );
conn = PQconnectdb( uri.connectionInfo().toUtf8() );
}

if ( conn == NULL || PQstatus( conn ) != CONNECTION_OK )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spit/qgsspit.h
Expand Up @@ -48,7 +48,7 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase
//! Return a list of selected tables
QStringList selectedTables();
//! Return the connection info
QString connInfo();
QString connectionInfo();
//! Create a new PostgreSQL connection
void newConnection();
//! Edit a PostgreSQL connection
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgrescountthread.cpp
Expand Up @@ -47,7 +47,7 @@ QgsPostgresCountThread::~QgsPostgresCountThread()

void QgsPostgresCountThread::setConnInfo( QString s )
{
connInfo = s;
connectionInfo = s;
}

void QgsPostgresCountThread::setTableName( QString s )
Expand All @@ -74,12 +74,12 @@ void QgsPostgresCountThread::setGeometryColumn( QString s )
void QgsPostgresCountThread::run()
{
// // placeholders for now.
// QString connInfo;
// QString connectionInfo;

QgsDebugMsg( "QgsPostgresCountThread: Started running." );

// Open another connection to the database
PGconn *connection = PQconnectdb( connInfo.toUtf8() );
PGconn *connection = PQconnectdb( connectionInfo.toUtf8() );

// get the extents

Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgrescountthread.h
Expand Up @@ -92,7 +92,7 @@ class QgsPostgresCountThread : public QThread
/**
*
*/
QString connInfo;
QString connectionInfo;

/**
* Name of the table with no schema
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresextentthread.cpp
Expand Up @@ -50,7 +50,7 @@ QgsPostgresExtentThread::~QgsPostgresExtentThread()

void QgsPostgresExtentThread::setConnInfo( QString s )
{
connInfo = s;
connectionInfo = s;
}

void QgsPostgresExtentThread::setTableName( QString s )
Expand All @@ -77,12 +77,12 @@ void QgsPostgresExtentThread::setGeometryColumn( QString s )
void QgsPostgresExtentThread::run()
{
// // placeholders for now.
// QString connInfo;
// QString connectionInfo;

QgsDebugMsg( "Started running." );

// Open another connection to the database
PGconn *connection = PQconnectdb( connInfo.toUtf8() );
PGconn *connection = PQconnectdb( connectionInfo.toUtf8() );

// get the extents

Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresextentthread.h
Expand Up @@ -111,7 +111,7 @@ class QgsPostgresExtentThread : public QThread
/**
*
*/
QString connInfo;
QString connectionInfo;

/**
* Name of the table with no schema
Expand Down
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -81,14 +81,14 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )

QgsDebugMsg( "Table name is " + mTableName );
QgsDebugMsg( "SQL is " + sqlWhereClause );
QgsDebugMsg( "Connection info is " + mUri.connInfo() );
QgsDebugMsg( "Connection info is " + mUri.connectionInfo() );

QgsDebugMsg( "Geometry column is: " + geometryColumn );
QgsDebugMsg( "Schema is: " + mSchemaName );
QgsDebugMsg( "Table name is: " + mTableName );

connectionRW = NULL;
connectionRO = Conn::connectDb( mUri.connInfo(), true );
connectionRO = Conn::connectDb( mUri.connectionInfo(), true );
if ( connectionRO == NULL )
{
valid = false;
Expand Down Expand Up @@ -205,7 +205,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )

#ifdef POSTGRESQL_THREADS
QgsDebugMsg( "About to touch mExtentThread" );
mExtentThread.setConnInfo( mUri.connInfo );
mExtentThread.setConnInfo( mUri.connectionInfo );
mExtentThread.setTableName( mTableName );
mExtentThread.setSqlWhereClause( sqlWhereClause );
mExtentThread.setGeometryColumn( geometryColumn );
Expand All @@ -215,7 +215,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
QgsDebugMsg( "Main thread just dispatched mExtentThread" );

QgsDebugMsg( "About to touch mCountThread" );
mCountThread.setConnInfo( mUri.connInfo );
mCountThread.setConnInfo( mUri.connectionInfo );
mCountThread.setTableName( mTableName );
mCountThread.setSqlWhereClause( sqlWhereClause );
mCountThread.setGeometryColumn( geometryColumn );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -666,7 +666,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
if ( connectionRW )
return connectionRW;

connectionRW = Conn::connectDb( mUri.connInfo(), false );
connectionRW = Conn::connectDb( mUri.connectionInfo(), false );

return connectionRW;
}
Expand Down

0 comments on commit dfca970

Please sign in to comment.