Skip to content

Commit dfca970

Browse files
author
timlinux
committed
Remove abbreviation of connectionInfo
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9502 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b352b85 commit dfca970

20 files changed

+55
-55
lines changed

python/core/qgsdatasourceuri.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public:
2020
QgsDataSourceURI(QString uri);
2121

2222
//! connection info
23-
QString connInfo() const;
23+
QString connectionInfo() const;
2424

2525
//! complete uri
2626
QString uri() const;

src/app/qgisapp.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2308,17 +2308,17 @@ void QgisApp::addDatabaseLayer()
23082308

23092309
QApplication::setOverrideCursor( Qt::WaitCursor );
23102310

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

23192319
// create the layer
23202320
//qWarning("creating layer");
2321-
QgsVectorLayer *layer = new QgsVectorLayer( connInfo + " table=" + *it, *it, "postgres" );
2321+
QgsVectorLayer *layer = new QgsVectorLayer( connectionInfo + " table=" + *it, *it, "postgres" );
23222322
if ( layer->isValid() )
23232323
{
23242324
// register this layer with the central layers registry
@@ -2371,7 +2371,7 @@ void QgisApp::addWmsLayer()
23712371
if ( wmss->exec() )
23722372
{
23732373

2374-
addRasterLayer( wmss->connInfo(),
2374+
addRasterLayer( wmss->connectionInfo(),
23752375
wmss->connName(),
23762376
"wms",
23772377
wmss->selectedLayers(),

src/app/qgsdbsourceselect.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,17 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
386386

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

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

391391
if ( makeConnection )
392392
{
393-
m_connInfo = uri.connInfo();
394-
//qDebug(m_connInfo);
393+
m_connectionInfo = uri.connectionInfo();
394+
//qDebug(m_connectionInfo);
395395
// Tidy up an existing connection if one exists.
396396
if ( pd != 0 )
397397
PQfinish( pd );
398398

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

461-
QString QgsDbSourceSelect::connInfo()
461+
QString QgsDbSourceSelect::connectionInfo()
462462
{
463-
return m_connInfo;
463+
return m_connectionInfo;
464464
}
465465

466466
void QgsDbSourceSelect::setSql( const QModelIndex& index )
@@ -516,7 +516,7 @@ void QgsDbSourceSelect::addSearchGeometryColumn( const QString &schema, const QS
516516
if ( mColumnTypeThread == NULL )
517517
{
518518
mColumnTypeThread = new QgsGeomColumnTypeThread();
519-
mColumnTypeThread->setConnInfo( m_connInfo );
519+
mColumnTypeThread->setConnInfo( m_connectionInfo );
520520
}
521521
mColumnTypeThread->addGeometryColumn( schema, table, column );
522522
}

src/app/qgsdbsourceselect.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
7070
//! String list containing the selected tables
7171
QStringList selectedTables();
7272
//! Connection info (database, host, user, password)
73-
QString connInfo();
73+
QString connectionInfo();
7474
// Store the selected database
7575
void dbChanged();
7676
// Utility function to construct the query for finding out the
@@ -133,7 +133,7 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
133133
QStringList mColumnLabels;
134134
// Our thread for doing long running queries
135135
QgsGeomColumnTypeThread* mColumnTypeThread;
136-
QString m_connInfo;
136+
QString m_connectionInfo;
137137
QStringList m_selectedTables;
138138
// Storage for the range of layer type icons
139139
QMap<QString, QPair<QString, QIcon> > mLayerIcons;

src/app/qgsnewconnection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ void QgsNewConnection::testConnection()
110110
QgsDataSourceURI uri;
111111
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text() );
112112

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

115-
PGconn *pd = PQconnectdb( uri.connInfo().toLocal8Bit().data() );
115+
PGconn *pd = PQconnectdb( uri.connectionInfo().toLocal8Bit().data() );
116116
if ( PQstatus( pd ) == CONNECTION_OK )
117117
{
118118
// Database successfully opened; we can now issue SQL commands.

src/app/qgspgquerybuilder.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ QgsPgQueryBuilder::QgsPgQueryBuilder( QgsDataSourceURI *uri,
4242
setupGuiViews();
4343
// The query builder must make its own connection to the database when
4444
// using this constructor
45-
QString connInfo = mUri->connInfo();
45+
QString connectionInfo = mUri->connectionInfo();
4646

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

49-
mPgConnection = PQconnectdb( connInfo.toLocal8Bit().data() ); // use what is set based on locale; after connecting, use Utf8
49+
mPgConnection = PQconnectdb( connectionInfo.toLocal8Bit().data() ); // use what is set based on locale; after connecting, use Utf8
5050
// check the connection status
5151
if ( PQstatus( mPgConnection ) == CONNECTION_OK )
5252
{

src/app/qgsserversourceselect.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ void QgsServerSourceSelect::on_btnConnect_clicked()
319319
connStringParts += settings.value( key + "/url" ).toString();
320320

321321
m_connName = cmbConnections->currentText();
322-
m_connInfo = connStringParts.join( " " );
322+
m_connectionInfo = connStringParts.join( " " );
323323

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

326326

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

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

335335
if ( mWmsProvider )
336336
{
@@ -528,9 +528,9 @@ QString QgsServerSourceSelect::connName()
528528
return m_connName;
529529
}
530530

531-
QString QgsServerSourceSelect::connInfo()
531+
QString QgsServerSourceSelect::connectionInfo()
532532
{
533-
return m_connInfo;
533+
return m_connectionInfo;
534534
}
535535

536536
QStringList QgsServerSourceSelect::selectedLayers()

src/app/qgsserversourceselect.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class QgsServerSourceSelect : public QDialog, private Ui::QgsServerSourceSelectB
5454
QString connName();
5555

5656
//! Connection info (uri)
57-
QString connInfo();
57+
QString connectionInfo();
5858

5959
//! Connection Proxy Host
6060
QString connProxyHost();
@@ -147,7 +147,7 @@ class QgsServerSourceSelect : public QDialog, private Ui::QgsServerSourceSelectB
147147
QString m_connName;
148148

149149
//! URI for selected connection
150-
QString m_connInfo;
150+
QString m_connectionInfo;
151151

152152
//! Proxy Host for selected connection
153153
QString m_connProxyHost;

src/core/qgsdatasourceuri.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -269,36 +269,36 @@ QString QgsDataSourceURI::getValue( const QString &uri, int &i )
269269
return pval;
270270
}
271271

272-
QString QgsDataSourceURI::connInfo() const
272+
QString QgsDataSourceURI::connectionInfo() const
273273
{
274-
QString connInfo = "dbname='" + mDatabase + "'";
274+
QString connectionInfo = "dbname='" + mDatabase + "'";
275275

276276
if ( mHost != "" )
277277
{
278-
connInfo += " host=" + mHost;
278+
connectionInfo += " host=" + mHost;
279279
if ( mPort != "" )
280-
connInfo += " port=" + mPort;
280+
connectionInfo += " port=" + mPort;
281281
}
282282

283283
if ( mUsername != "" )
284284
{
285-
connInfo += " user='" + mUsername + "'"; //needs to be escaped
285+
connectionInfo += " user='" + mUsername + "'"; //needs to be escaped
286286

287287
if ( mPassword != "" )
288288
{
289289
QString p = mPassword;
290290
p.replace( '\\', "\\\\" );
291291
p.replace( '\'', "\\'" );
292-
connInfo += " password='" + p + "'";
292+
connectionInfo += " password='" + p + "'";
293293
}
294294
}
295295

296-
return connInfo;
296+
return connectionInfo;
297297
}
298298

299299
QString QgsDataSourceURI::uri() const
300300
{
301-
return connInfo()
301+
return connectionInfo()
302302
+ QString( " table=%1 (%2) sql=%3" )
303303
.arg( quotedTablename() )
304304
.arg( mGeometryColumn )

src/core/qgsdatasourceuri.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CORE_EXPORT QgsDataSourceURI
3939
QgsDataSourceURI( QString uri );
4040

4141
//! return connection part of URI
42-
QString connInfo() const;
42+
QString connectionInfo() const;
4343

4444
//! return complete uri
4545
QString uri() const;

src/plugins/geoprocessing/qgspggeoprocessing.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ void QgsPgGeoprocessing::buffer()
100100

101101
QgsDataSourceURI uri( lyr->source() );
102102

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

105105
// connect to the database and check the capabilities
106-
PGconn *capTest = PQconnectdb( uri.connInfo().toUtf8() );
106+
PGconn *capTest = PQconnectdb( uri.connectionInfo().toUtf8() );
107107
if ( PQstatus( capTest ) == CONNECTION_OK )
108108
{
109109
postgisVersion( capTest );
@@ -135,7 +135,7 @@ void QgsPgGeoprocessing::buffer()
135135
}
136136
}
137137
// connect to the database
138-
PGconn *conn = PQconnectdb( uri.connInfo().toUtf8() );
138+
PGconn *conn = PQconnectdb( uri.connectionInfo().toUtf8() );
139139
if ( PQstatus( conn ) == CONNECTION_OK )
140140
{
141141
// populate the schema drop-down
@@ -305,7 +305,7 @@ void QgsPgGeoprocessing::buffer()
305305
if ( bb->addLayerToMap() )
306306
{
307307
// create the connection string
308-
QString newLayerSource = uri.connInfo();
308+
QString newLayerSource = uri.connectionInfo();
309309
QgsDebugMsg( "newLayerSource: " + newLayerSource );
310310

311311
// add the schema.table and geometry column

src/plugins/grass/qgsgrassmodule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2688,7 +2688,7 @@ void QgsGrassModuleGdalInput::updateQgisLayers()
26882688
{
26892689
// Construct OGR DSN
26902690
QgsDataSourceURI dsUri( provider->dataSourceUri() );
2691-
uri = "PG:" + dsUri.connInfo();
2691+
uri = "PG:" + dsUri.connectionInfo();
26922692

26932693
if ( dsUri.schema() != "" )
26942694
{

src/plugins/spit/qgsspit.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void QgsSpit::dbConnect()
420420
settings.value( key + "/username" ).toString(),
421421
password );
422422

423-
conn = PQconnectdb( uri.connInfo().toUtf8() );
423+
conn = PQconnectdb( uri.connectionInfo().toUtf8() );
424424
}
425425

426426
if ( conn == NULL || PQstatus( conn ) != CONNECTION_OK )

src/plugins/spit/qgsspit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase
4848
//! Return a list of selected tables
4949
QStringList selectedTables();
5050
//! Return the connection info
51-
QString connInfo();
51+
QString connectionInfo();
5252
//! Create a new PostgreSQL connection
5353
void newConnection();
5454
//! Edit a PostgreSQL connection

src/providers/postgres/qgspostgrescountthread.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ QgsPostgresCountThread::~QgsPostgresCountThread()
4747

4848
void QgsPostgresCountThread::setConnInfo( QString s )
4949
{
50-
connInfo = s;
50+
connectionInfo = s;
5151
}
5252

5353
void QgsPostgresCountThread::setTableName( QString s )
@@ -74,12 +74,12 @@ void QgsPostgresCountThread::setGeometryColumn( QString s )
7474
void QgsPostgresCountThread::run()
7575
{
7676
// // placeholders for now.
77-
// QString connInfo;
77+
// QString connectionInfo;
7878

7979
QgsDebugMsg( "QgsPostgresCountThread: Started running." );
8080

8181
// Open another connection to the database
82-
PGconn *connection = PQconnectdb( connInfo.toUtf8() );
82+
PGconn *connection = PQconnectdb( connectionInfo.toUtf8() );
8383

8484
// get the extents
8585

src/providers/postgres/qgspostgrescountthread.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class QgsPostgresCountThread : public QThread
9292
/**
9393
*
9494
*/
95-
QString connInfo;
95+
QString connectionInfo;
9696

9797
/**
9898
* Name of the table with no schema

src/providers/postgres/qgspostgresextentthread.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ QgsPostgresExtentThread::~QgsPostgresExtentThread()
5050

5151
void QgsPostgresExtentThread::setConnInfo( QString s )
5252
{
53-
connInfo = s;
53+
connectionInfo = s;
5454
}
5555

5656
void QgsPostgresExtentThread::setTableName( QString s )
@@ -77,12 +77,12 @@ void QgsPostgresExtentThread::setGeometryColumn( QString s )
7777
void QgsPostgresExtentThread::run()
7878
{
7979
// // placeholders for now.
80-
// QString connInfo;
80+
// QString connectionInfo;
8181

8282
QgsDebugMsg( "Started running." );
8383

8484
// Open another connection to the database
85-
PGconn *connection = PQconnectdb( connInfo.toUtf8() );
85+
PGconn *connection = PQconnectdb( connectionInfo.toUtf8() );
8686

8787
// get the extents
8888

src/providers/postgres/qgspostgresextentthread.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class QgsPostgresExtentThread : public QThread
111111
/**
112112
*
113113
*/
114-
QString connInfo;
114+
QString connectionInfo;
115115

116116
/**
117117
* Name of the table with no schema

src/providers/postgres/qgspostgresprovider.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
8181

8282
QgsDebugMsg( "Table name is " + mTableName );
8383
QgsDebugMsg( "SQL is " + sqlWhereClause );
84-
QgsDebugMsg( "Connection info is " + mUri.connInfo() );
84+
QgsDebugMsg( "Connection info is " + mUri.connectionInfo() );
8585

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

9090
connectionRW = NULL;
91-
connectionRO = Conn::connectDb( mUri.connInfo(), true );
91+
connectionRO = Conn::connectDb( mUri.connectionInfo(), true );
9292
if ( connectionRO == NULL )
9393
{
9494
valid = false;
@@ -205,7 +205,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
205205

206206
#ifdef POSTGRESQL_THREADS
207207
QgsDebugMsg( "About to touch mExtentThread" );
208-
mExtentThread.setConnInfo( mUri.connInfo );
208+
mExtentThread.setConnInfo( mUri.connectionInfo );
209209
mExtentThread.setTableName( mTableName );
210210
mExtentThread.setSqlWhereClause( sqlWhereClause );
211211
mExtentThread.setGeometryColumn( geometryColumn );
@@ -215,7 +215,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
215215
QgsDebugMsg( "Main thread just dispatched mExtentThread" );
216216

217217
QgsDebugMsg( "About to touch mCountThread" );
218-
mCountThread.setConnInfo( mUri.connInfo );
218+
mCountThread.setConnInfo( mUri.connectionInfo );
219219
mCountThread.setTableName( mTableName );
220220
mCountThread.setSqlWhereClause( sqlWhereClause );
221221
mCountThread.setGeometryColumn( geometryColumn );

src/providers/postgres/qgspostgresprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
666666
if ( connectionRW )
667667
return connectionRW;
668668

669-
connectionRW = Conn::connectDb( mUri.connInfo(), false );
669+
connectionRW = Conn::connectDb( mUri.connectionInfo(), false );
670670

671671
return connectionRW;
672672
}

0 commit comments

Comments
 (0)