Skip to content

Commit 9183115

Browse files
author
jef
committed
rename some postgres app classes and move a ogr class
git-svn-id: http://svn.osgeo.org/qgis/trunk@12702 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9024bac commit 9183115

13 files changed

+77
-93
lines changed

src/app/CMakeLists.txt

+7-18
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ SET(QGIS_APP_SRCS
5353
qgsmergeattributesdialog.cpp
5454
qgsnewhttpconnection.cpp
5555
qgsnumericsortlistviewitem.cpp
56-
qgsogrsublayersdialog.cpp
5756
qgsoptions.cpp
5857
qgspastetransformations.cpp
5958
qgspointrotationitem.cpp
@@ -103,6 +102,7 @@ SET(QGIS_APP_SRCS
103102
ogr/qgsogrhelperfunctions.cpp
104103
ogr/qgsopenvectorlayerdialog.cpp
105104
ogr/qgsnewogrconnection.cpp
105+
ogr/qgsogrsublayersdialog.cpp
106106

107107
attributetable/qgsattributetabledialog.cpp
108108
attributetable/qgsattributetablemodel.cpp
@@ -175,7 +175,6 @@ SET (QGIS_APP_MOC_HDRS
175175
qgsmergeattributesdialog.h
176176
qgsnewhttpconnection.h
177177
qgsoptions.h
178-
qgsogrsublayersdialog.h
179178
qgspastetransformations.h
180179
qgspluginmanager.h
181180
qgspythondialog.h
@@ -212,6 +211,7 @@ SET (QGIS_APP_MOC_HDRS
212211

213212
ogr/qgsopenvectorlayerdialog.h
214213
ogr/qgsnewogrconnection.h
214+
ogr/qgsogrsublayersdialog.h
215215

216216
attributetable/qgsattributetableview.h
217217
attributetable/qgsattributetablemodel.h
@@ -220,22 +220,10 @@ SET (QGIS_APP_MOC_HDRS
220220
attributetable/qgsattributetabledelegate.h
221221

222222
gps/qgsgpsinformationwidget.h
223-
gps/qgsgpsmarker.h
224223
gps/qwtpolar/qwt_polar_canvas.h
225-
gps/qwtpolar/qwt_polar_curve.h
226-
gps/qwtpolar/qwt_polar_fitter.h
227-
gps/qwtpolar/qwt_polar_global.h
228-
gps/qwtpolar/qwt_polar_grid.h
229-
gps/qwtpolar/qwt_polar.h
230-
gps/qwtpolar/qwt_polar_itemdict.h
231-
gps/qwtpolar/qwt_polar_item.h
232-
gps/qwtpolar/qwt_polar_layout.h
233224
gps/qwtpolar/qwt_polar_magnifier.h
234-
gps/qwtpolar/qwt_polar_marker.h
235225
gps/qwtpolar/qwt_polar_panner.h
236226
gps/qwtpolar/qwt_polar_plot.h
237-
gps/qwtpolar/qwt_polar_point.h
238-
gps/qwtpolar/qwt_polar_spectrogram.h
239227
)
240228

241229
IF (POSTGRES_FOUND)
@@ -244,12 +232,12 @@ IF (POSTGRES_FOUND)
244232
ENDIF(HAVE_PGCONFIG)
245233

246234
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
247-
qgspgsourceselect.cpp
248-
qgsnewconnection.cpp
235+
postgres/qgspgsourceselect.cpp
236+
postgres/qgspgnewconnection.cpp
249237
)
250238
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
251-
qgspgsourceselect.h
252-
qgsnewconnection.h
239+
postgres/qgspgsourceselect.h
240+
postgres/qgspgnewconnection.h
253241
)
254242
ENDIF (POSTGRES_FOUND)
255243

@@ -275,6 +263,7 @@ IF (WIN32)
275263

276264
IF (MSVC)
277265
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
266+
ADD_DEFINITIONS(-DQWT_DLL)
278267
ELSE(MSVC)
279268

280269
# Icon for windows MINGW
File renamed without changes.

src/app/qgsnewconnection.cpp renamed to src/app/postgres/qgspgnewconnection.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsnewconnection.cpp - description
2+
qgspgnewconnection.cpp - description
33
-------------------
44
begin : Sat Jun 22 2002
55
copyright : (C) 2002 by Gary E.Sherman
@@ -20,7 +20,7 @@
2020
#include <QMessageBox>
2121
#include <QInputDialog>
2222

23-
#include "qgsnewconnection.h"
23+
#include "qgspgnewconnection.h"
2424
#include "qgscontexthelp.h"
2525
#include "qgsdatasourceuri.h"
2626
#include "qgslogger.h"
@@ -30,7 +30,7 @@ extern "C"
3030
#include <libpq-fe.h>
3131
}
3232

33-
QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt::WFlags fl )
33+
QgsPgNewConnection::QgsPgNewConnection( QWidget *parent, const QString& connName, Qt::WFlags fl )
3434
: QDialog( parent, fl ), mOriginalConnName( connName )
3535
{
3636
setupUi( this );
@@ -78,7 +78,7 @@ QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt
7878
}
7979
}
8080
/** Autoconnected SLOTS **/
81-
void QgsNewConnection::accept()
81+
void QgsPgNewConnection::accept()
8282
{
8383
QSettings settings;
8484
QString baseKey = "/PostgreSQL/connections/";
@@ -116,12 +116,12 @@ void QgsNewConnection::accept()
116116
QDialog::accept();
117117
}
118118

119-
void QgsNewConnection::on_btnConnect_clicked()
119+
void QgsPgNewConnection::on_btnConnect_clicked()
120120
{
121121
testConnection();
122122
}
123123

124-
void QgsNewConnection::on_cb_geometryColumnsOnly_clicked()
124+
void QgsPgNewConnection::on_cb_geometryColumnsOnly_clicked()
125125
{
126126
if ( cb_geometryColumnsOnly->checkState() == Qt::Checked )
127127
cb_publicSchemaOnly->setEnabled( false );
@@ -131,11 +131,11 @@ void QgsNewConnection::on_cb_geometryColumnsOnly_clicked()
131131

132132
/** end Autoconnected SLOTS **/
133133

134-
QgsNewConnection::~QgsNewConnection()
134+
QgsPgNewConnection::~QgsPgNewConnection()
135135
{
136136
}
137137

138-
void QgsNewConnection::testConnection()
138+
void QgsPgNewConnection::testConnection()
139139
{
140140
QgsDataSourceURI uri;
141141
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text(), ( QgsDataSourceURI::SSLmode ) cbxSSLmode->itemData( cbxSSLmode->currentIndex() ).toInt() );
@@ -148,28 +148,28 @@ void QgsNewConnection::testConnection()
148148
{
149149
QString password = QString::null;
150150

151-
while( PQstatus( pd ) != CONNECTION_OK )
151+
while ( PQstatus( pd ) != CONNECTION_OK )
152152
{
153153
bool ok = true;
154154
password = QInputDialog::getText( this,
155155
tr( "Enter password" ),
156-
tr( "Error: %1Enter password for %2")
157-
.arg( QString::fromUtf8( PQerrorMessage( pd ) ) )
158-
.arg( uri.connectionInfo() ),
156+
tr( "Error: %1Enter password for %2" )
157+
.arg( QString::fromUtf8( PQerrorMessage( pd ) ) )
158+
.arg( uri.connectionInfo() ),
159159
QLineEdit::Password,
160160
password,
161161
&ok );
162162

163163
::PQfinish( pd );
164164

165-
if( !ok )
165+
if ( !ok )
166166
break;
167167

168168
pd = PQconnectdb( QString( "%1 password='%2'" ).arg( uri.connectionInfo() ).arg( password ).toLocal8Bit() );
169169
}
170170
}
171171

172-
if ( PQstatus( pd ) == CONNECTION_OK )
172+
if ( PQstatus( pd ) == CONNECTION_OK )
173173
{
174174
// Database successfully opened; we can now issue SQL commands.
175175
QMessageBox::information( this, tr( "Test connection" ), tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ) );

src/app/qgsnewconnection.h renamed to src/app/postgres/qgspgnewconnection.h

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsnewconnection.h - description
2+
qgspgnewconnection.h - description
33
-------------------
44
begin : Sat Jun 22 2002
55
copyright : (C) 2002 by Gary E.Sherman
@@ -15,23 +15,24 @@
1515
* *
1616
***************************************************************************/
1717
/* $Id$ */
18-
#ifndef QGSNEWCONNECTION_H
19-
#define QGSNEWCONNECTION_H
20-
#include "ui_qgsnewconnectionbase.h"
18+
#ifndef QGSPGNEWCONNECTION_H
19+
#define QGSPGNEWCONNECTION_H
20+
#include "ui_qgspgnewconnectionbase.h"
2121
#include "qgisgui.h"
2222
#include "qgscontexthelp.h"
23-
/*! \class QgsNewConnection
23+
24+
/*! \class QgsPgNewConnection
2425
* \brief Dialog to allow the user to configure and save connection
25-
* information for a PostgresQl database
26+
* information for a PostgreSQL database
2627
*/
27-
class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
28+
class QgsPgNewConnection : public QDialog, private Ui::QgsPgNewConnectionBase
2829
{
2930
Q_OBJECT
3031
public:
3132
//! Constructor
32-
QgsNewConnection( QWidget *parent = 0, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags );
33+
QgsPgNewConnection( QWidget *parent = 0, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags );
3334
//! Destructor
34-
~QgsNewConnection();
35+
~QgsPgNewConnection();
3536
//! Tests the connection using the parameters supplied
3637
void testConnection();
3738
public slots:
@@ -43,4 +44,4 @@ class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
4344
QString mOriginalConnName; //store initial name to delete entry in case of rename
4445
};
4546

46-
#endif // QGSNEWCONNECTIONBASE_H
47+
#endif // QGSPGNEWCONNECTIONBASE_H

src/app/qgspgsourceselect.cpp renamed to src/app/postgres/qgspgsourceselect.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ email : sherman at mrcc.com
2323
#include "qgslogger.h"
2424
#include "qgsapplication.h"
2525
#include "qgscontexthelp.h"
26-
#include "qgsnewconnection.h"
26+
#include "qgspgnewconnection.h"
2727
#include "qgsquerybuilder.h"
2828
#include "qgsdatasourceuri.h"
2929
#include "qgsvectorlayer.h"
@@ -96,7 +96,7 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
9696
// Slot for adding a new connection
9797
void QgsPgSourceSelect::on_btnNew_clicked()
9898
{
99-
QgsNewConnection *nc = new QgsNewConnection( this );
99+
QgsPgNewConnection *nc = new QgsPgNewConnection( this );
100100
nc->exec();
101101
delete nc;
102102

@@ -129,7 +129,7 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
129129
// Slot for editing a connection
130130
void QgsPgSourceSelect::on_btnEdit_clicked()
131131
{
132-
QgsNewConnection *nc = new QgsNewConnection( this, cmbConnections->currentText() );
132+
QgsPgNewConnection *nc = new QgsPgNewConnection( this, cmbConnections->currentText() );
133133
nc->exec();
134134
delete nc;
135135

@@ -412,21 +412,21 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
412412
{
413413
QString password = QString::null;
414414

415-
while( PQstatus( pd ) != CONNECTION_OK )
415+
while ( PQstatus( pd ) != CONNECTION_OK )
416416
{
417417
bool ok = true;
418418
password = QInputDialog::getText( this,
419419
tr( "Enter password" ),
420-
tr( "Error: %1Enter password for %2")
421-
.arg( QString::fromUtf8( PQerrorMessage( pd ) ) )
422-
.arg( uri.connectionInfo() ),
420+
tr( "Error: %1Enter password for %2" )
421+
.arg( QString::fromUtf8( PQerrorMessage( pd ) ) )
422+
.arg( uri.connectionInfo() ),
423423
QLineEdit::Password,
424424
password,
425425
&ok );
426426

427427
::PQfinish( pd );
428428

429-
if( !ok )
429+
if ( !ok )
430430
break;
431431

432432
pd = PQconnectdb( QString( "%1 password='%2'" ).arg( uri.connectionInfo() ).arg( password ).toLocal8Bit() );
File renamed without changes.

src/app/qgisapp.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
#include "qgscursors.h"
101101
#include "qgscustomprojectiondialog.h"
102102
#include "qgsencodingfiledialog.h"
103-
#include "qgsogrsublayersdialog.h"
104103
#include "qgsexception.h"
105104
#include "qgsfeature.h"
106105
#include "qgsnewvectorlayerdialog.h"
@@ -137,6 +136,7 @@
137136
#include "qgsundowidget.h"
138137
#include "qgsvectordataprovider.h"
139138
#include "qgsvectorlayer.h"
139+
#include "ogr/qgsogrsublayersdialog.h"
140140
#include "ogr/qgsopenvectorlayerdialog.h"
141141
#include "qgsattributetabledialog.h"
142142
#include "qgsvectorfilewriter.h"
@@ -188,7 +188,7 @@
188188
// Conditional Includes
189189
//
190190
#ifdef HAVE_POSTGRESQL
191-
#include "qgspgsourceselect.h"
191+
#include "postgres/qgspgsourceselect.h"
192192
#endif
193193
#ifdef HAVE_SPATIALITE
194194
#include "qgsspatialitesourceselect.h"
@@ -328,7 +328,7 @@ QgisApp::QgisApp( QSplashScreen *splash, QWidget * parent, Qt::WFlags fl )
328328
mSplash( splash ),
329329
mPythonConsole( NULL ),
330330
mPythonUtils( NULL ),
331-
mpGpsWidget(NULL)
331+
mpGpsWidget( NULL )
332332
{
333333
if ( smInstance )
334334
{
@@ -559,7 +559,7 @@ void QgisApp::readSettings()
559559
// Restore state of GPS Tracker
560560
if ( settings.value( "/gps/widgetEnabled", false ).toBool() )
561561
{
562-
showGpsTool();
562+
showGpsTool();
563563
}
564564
}
565565

@@ -957,7 +957,7 @@ void QgisApp::createActions()
957957
mActionGpsTool->setStatusTip( tr( "Show GPS tool" ) );
958958
connect( mActionGpsTool, SIGNAL( triggered() ), this, SLOT( showGpsTool() ) );
959959
mActionGpsTool->setEnabled( true );
960-
960+
961961

962962
mActionLayerProperties = new QAction( tr( "Properties..." ), this );
963963
shortcuts->registerAction( mActionLayerProperties );
@@ -2074,11 +2074,11 @@ void QgisApp::saveRecentProjectPath( QString projectPath, QSettings & settings )
20742074
// Persist state of GPS Tracker
20752075
if ( mpGpsWidget )
20762076
{
2077-
settings.setValue( "/gps/widgetEnabled", true );
2077+
settings.setValue( "/gps/widgetEnabled", true );
20782078
}
20792079
else
20802080
{
2081-
settings.setValue( "/gps/widgetEnabled", false );
2081+
settings.setValue( "/gps/widgetEnabled", false );
20822082
}
20832083
// Update menu list of paths
20842084
updateRecentProjectPaths();
@@ -2127,12 +2127,12 @@ void QgisApp::restoreWindowState()
21272127
// Persist state of GPS Tracker
21282128
if ( mpGpsWidget )
21292129
{
2130-
settings.setValue( "/gps/widgetEnabled", true );
2131-
delete mpGpsWidget;
2130+
settings.setValue( "/gps/widgetEnabled", true );
2131+
delete mpGpsWidget;
21322132
}
21332133
else
21342134
{
2135-
settings.setValue( "/gps/widgetEnabled", false );
2135+
settings.setValue( "/gps/widgetEnabled", false );
21362136
}
21372137
}
21382138
///////////// END OF GUI SETUP ROUTINES ///////////////
@@ -4401,7 +4401,7 @@ void QgisApp::removeAllLayers()
44014401

44024402
void QgisApp::showGpsTool()
44034403
{
4404-
if(!mpGpsWidget)
4404+
if ( !mpGpsWidget )
44054405
{
44064406
mpGpsWidget = new QgsGPSInformationWidget( mMapCanvas );
44074407
//create the dock widget

0 commit comments

Comments
 (0)