Skip to content

Commit

Permalink
Don't specify organization name on QSettings constructors. It overrid…
Browse files Browse the repository at this point in the history
…es the organization domain set in QApplicaton. This results in Mac settings being written to different files depending upon whether the argument is or isn't present on constructors.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6290 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Dec 20, 2006
1 parent 77714ce commit 94acb0a
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 45 deletions.
6 changes: 3 additions & 3 deletions src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -39,7 +39,7 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui(QgisIface * _qI, QWidget *
setupUi(this); setupUi(this);
// at startup, fetch the last used delimiter and directory from // at startup, fetch the last used delimiter and directory from
// settings // settings
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString key = "/Plugin-DelimitedText"; QString key = "/Plugin-DelimitedText";
txtDelimiter->setText(settings.readEntry(key + "/delimiter")); txtDelimiter->setText(settings.readEntry(key + "/delimiter"));


Expand Down Expand Up @@ -75,7 +75,7 @@ void QgsDelimitedTextPluginGui::on_pbnOK_clicked()
emit drawVectorLayer(uri,txtLayerName->text(),"delimitedtext"); emit drawVectorLayer(uri,txtLayerName->text(),"delimitedtext");
// store the settings // store the settings


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString key = "/Plugin-DelimitedText"; QString key = "/Plugin-DelimitedText";
settings.writeEntry(key + "/delimiter", txtDelimiter->text()); settings.writeEntry(key + "/delimiter", txtDelimiter->text());
QFileInfo fi(txtFilePath->text()); QFileInfo fi(txtFilePath->text());
Expand Down Expand Up @@ -185,7 +185,7 @@ void QgsDelimitedTextPluginGui::getOpenFileName()
{ {
// Get a file to process, starting at the current directory // Get a file to process, starting at the current directory
// Set inital dir to last used // Set inital dir to last used
QSettings settings("QuantumGIS", "qgis"); QSettings settings;


QString s = QFileDialog::getOpenFileName( QString s = QFileDialog::getOpenFileName(
this, this,
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/georeferencer/plugingui.cpp
Expand Up @@ -50,7 +50,7 @@ void QgsGeorefPluginGui::on_pbnClose_clicked()




void QgsGeorefPluginGui::on_pbnSelectRaster_clicked() { void QgsGeorefPluginGui::on_pbnSelectRaster_clicked() {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString dir = settings.readEntry("/Plugin-GeoReferencer/rasterdirectory"); QString dir = settings.readEntry("/Plugin-GeoReferencer/rasterdirectory");
if (dir.isEmpty()) if (dir.isEmpty())
dir = "."; dir = ".";
Expand Down Expand Up @@ -82,7 +82,7 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {


// remember the directory // remember the directory
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QFileInfo fileInfo(leSelectRaster->text()); QFileInfo fileInfo(leSelectRaster->text());
settings.writeEntry("/Plugin-GeoReferencer/rasterdirectory", settings.writeEntry("/Plugin-GeoReferencer/rasterdirectory",
fileInfo.dirPath()); fileInfo.dirPath());
Expand Down Expand Up @@ -117,7 +117,7 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {


// XXX This is horrible, but it works and I'm tired / ll // XXX This is horrible, but it works and I'm tired / ll
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QgsProject* prj = QgsProject::instance(); QgsProject* prj = QgsProject::instance();
mProjBehaviour = settings.readEntry("/Projections/defaultBehaviour"); mProjBehaviour = settings.readEntry("/Projections/defaultBehaviour");
mProjectSRS = prj->readEntry("SpatialRefSys", "/ProjectSRSProj4String"); mProjectSRS = prj->readEntry("SpatialRefSys", "/ProjectSRSProj4String");
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/gps_importer/qgsgpsdevicedialog.cpp
Expand Up @@ -149,7 +149,7 @@ void QgsGPSDeviceDialog::slotSelectionChanged() {


void QgsGPSDeviceDialog::writeDeviceSettings() { void QgsGPSDeviceDialog::writeDeviceSettings() {
QStringList deviceNames; QStringList deviceNames;
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString devPath = "/Plugin-GPS/devices/%1"; QString devPath = "/Plugin-GPS/devices/%1";
settings.remove("/Plugin-GPS/devices"); settings.remove("/Plugin-GPS/devices");


Expand Down
6 changes: 3 additions & 3 deletions src/plugins/gps_importer/qgsgpsplugingui.cpp
Expand Up @@ -206,7 +206,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
QgsLogger::debug(" Gps File Importer::pbnGPXSelectFile_clicked() "); QgsLogger::debug(" Gps File Importer::pbnGPXSelectFile_clicked() ");
QString myFileTypeQString; QString myFileTypeQString;
QString myFilterString=tr("GPS eXchange format (*.gpx)"); QString myFilterString=tr("GPS eXchange format (*.gpx)");
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString dir = settings.readEntry("/Plugin-GPS/gpxdirectory"); QString dir = settings.readEntry("/Plugin-GPS/gpxdirectory");
if (dir.isEmpty()) if (dir.isEmpty())
dir = "."; dir = ".";
Expand Down Expand Up @@ -337,7 +337,7 @@ void QgsGPSPluginGui::populatePortComboBoxes() {
// OSX, OpenBSD, NetBSD etc? Anyone? // OSX, OpenBSD, NetBSD etc? Anyone?


// remember the last ports used // remember the last ports used
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString lastDLPort = settings.readEntry("/Plugin-GPS/lastdlport", ""); QString lastDLPort = settings.readEntry("/Plugin-GPS/lastdlport", "");
QString lastULPort = settings.readEntry("/Plugin-GPS/lastulport", ""); QString lastULPort = settings.readEntry("/Plugin-GPS/lastulport", "");
for (int i = 0; i < cmbDLPort->count(); ++i) { for (int i = 0; i < cmbDLPort->count(); ++i) {
Expand Down Expand Up @@ -365,7 +365,7 @@ void QgsGPSPluginGui::populateIMPBabelFormats() {
mBabelFilter = ""; mBabelFilter = "";
cmbULDevice->clear(); cmbULDevice->clear();
cmbDLDevice->clear(); cmbDLDevice->clear();
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString lastDLDevice = settings.readEntry("/Plugin-GPS/lastdldevice", ""); QString lastDLDevice = settings.readEntry("/Plugin-GPS/lastdldevice", "");
QString lastULDevice = settings.readEntry("/Plugin-GPS/lastuldevice", ""); QString lastULDevice = settings.readEntry("/Plugin-GPS/lastuldevice", "");
BabelMap::const_iterator iter; BabelMap::const_iterator iter;
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassattributes.cpp
Expand Up @@ -125,7 +125,7 @@ void QgsGrassAttributes::restorePosition()
#ifdef QGISDEBUG #ifdef QGISDEBUG
std::cerr << "QgsGrassAttributes::restorePosition()" << std::endl; std::cerr << "QgsGrassAttributes::restorePosition()" << std::endl;
#endif #endif
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
int ww = settings.readNumEntry("/GRASS/windows/attributes/w", 250); int ww = settings.readNumEntry("/GRASS/windows/attributes/w", 250);
int wh = settings.readNumEntry("/GRASS/windows/attributes/h", 350); int wh = settings.readNumEntry("/GRASS/windows/attributes/h", 350);
int wx = settings.readNumEntry("/GRASS/windows/attributes/x", 100); int wx = settings.readNumEntry("/GRASS/windows/attributes/x", 100);
Expand All @@ -142,7 +142,7 @@ void QgsGrassAttributes::saveWindowLocation()
#ifdef QGISDEBUG #ifdef QGISDEBUG
std::cerr << "QgsGrassAttributes::saveWindowLocation()" << std::endl; std::cerr << "QgsGrassAttributes::saveWindowLocation()" << std::endl;
#endif #endif
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QPoint p = this->pos(); QPoint p = this->pos();
QSize s = this->size(); QSize s = this->size();
settings.writeEntry("/GRASS/windows/attributes/x", p.x()); settings.writeEntry("/GRASS/windows/attributes/x", p.x());
Expand Down Expand Up @@ -181,7 +181,7 @@ int QgsGrassAttributes::addTab ( const QString & label )


resetButtons(); resetButtons();


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString path = "/GRASS/windows/attributes/columnWidth/"; QString path = "/GRASS/windows/attributes/columnWidth/";
for ( int i = 0; i < 2; i++ ) for ( int i = 0; i < 2; i++ )
{ {
Expand Down Expand Up @@ -401,7 +401,7 @@ void QgsGrassAttributes::resetButtons ( )


void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize ) void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize )
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString path = "/GRASS/windows/attributes/columnWidth/" QString path = "/GRASS/windows/attributes/columnWidth/"
+ QString::number(section); + QString::number(section);
std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl; std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl;
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -402,7 +402,7 @@ void QgsGrassEdit::init()


// Restore symbology // Restore symbology
QString spath = "/GRASS/edit/symb/"; QString spath = "/GRASS/edit/symb/";
QSettings settings("QuantumGIS", "qgis"); QSettings settings;


mLineWidth = settings.readNumEntry ( mLineWidth = settings.readNumEntry (
spath + "lineWidth", 1 ); spath + "lineWidth", 1 );
Expand Down Expand Up @@ -731,7 +731,7 @@ void QgsGrassEdit::changeSymbology(Q3ListViewItem * item, const QPoint & pnt, in
std::cerr << "QgsGrassEdit::changeSymbology() col = " << col << std::endl; std::cerr << "QgsGrassEdit::changeSymbology() col = " << col << std::endl;
#endif #endif


QSettings settings("QuantumGIS", "qgis"); QSettings settings;


if ( !item ) return; if ( !item ) return;


Expand Down Expand Up @@ -768,7 +768,7 @@ void QgsGrassEdit::lineWidthChanged()
#ifdef QGISDEBUG #ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::lineWidthChanged()" << std::endl; std::cerr << "QgsGrassEdit::lineWidthChanged()" << std::endl;
#endif #endif
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
mLineWidth = mLineWidthSpinBox->value(); mLineWidth = mLineWidthSpinBox->value();


for ( int i = 0; i < SYMB_COUNT; i++ ) { for ( int i = 0; i < SYMB_COUNT; i++ ) {
Expand All @@ -784,15 +784,15 @@ void QgsGrassEdit::markerSizeChanged()
#ifdef QGISDEBUG #ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::markerSizeChanged()" << std::endl; std::cerr << "QgsGrassEdit::markerSizeChanged()" << std::endl;
#endif #endif
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
mSize = mMarkerSizeSpinBox->value(); mSize = mMarkerSizeSpinBox->value();
QString spath = "/GRASS/edit/symb/"; QString spath = "/GRASS/edit/symb/";
settings.writeEntry ( spath + "markerSize", mSize ); settings.writeEntry ( spath + "markerSize", mSize );
} }


void QgsGrassEdit::restorePosition() void QgsGrassEdit::restorePosition()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
int ww = settings.readNumEntry("/GRASS/windows/edit/w", 420); int ww = settings.readNumEntry("/GRASS/windows/edit/w", 420);
int wh = settings.readNumEntry("/GRASS/windows/edit/h", 150); int wh = settings.readNumEntry("/GRASS/windows/edit/h", 150);
int wx = settings.readNumEntry("/GRASS/windows/edit/x", 100); int wx = settings.readNumEntry("/GRASS/windows/edit/x", 100);
Expand All @@ -803,7 +803,7 @@ void QgsGrassEdit::restorePosition()


void QgsGrassEdit::saveWindowLocation() void QgsGrassEdit::saveWindowLocation()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QPoint p = this->pos(); QPoint p = this->pos();
QSize s = this->size(); QSize s = this->size();
settings.writeEntry("/GRASS/windows/edit/x", p.x()); settings.writeEntry("/GRASS/windows/edit/x", p.x());
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Expand Up @@ -120,7 +120,7 @@ QgsGrassNewMapset::QgsGrassNewMapset ( QgisApp *qgisApp, QgisIface *iface,
mMapsetText->setPaletteBackgroundColor ( paletteBackgroundColor() ); mMapsetText->setPaletteBackgroundColor ( paletteBackgroundColor() );


// DATABASE // DATABASE
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString db = settings.readEntry("/GRASS/lastGisdbase"); QString db = settings.readEntry("/GRASS/lastGisdbase");
if ( !db.isNull() ) if ( !db.isNull() )
{ {
Expand Down Expand Up @@ -201,7 +201,7 @@ void QgsGrassNewMapset::databaseChanged()
#endif #endif
// TODO: reset next tabs // TODO: reset next tabs
// //
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
settings.writeEntry("/GRASS/lastGisdbase", mDatabaseLineEdit->text() ); settings.writeEntry("/GRASS/lastGisdbase", mDatabaseLineEdit->text() );


setNextEnabled ( page(DATABASE), false ); setNextEnabled ( page(DATABASE), false );
Expand Down Expand Up @@ -271,7 +271,7 @@ void QgsGrassNewMapset::setLocations ( )


mLocationComboBox->clear(); mLocationComboBox->clear();


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString lastLocation = settings.readEntry("/GRASS/lastLocation"); QString lastLocation = settings.readEntry("/GRASS/lastLocation");


// Get available locations with write permissions // Get available locations with write permissions
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -138,7 +138,7 @@ void QgsGrassPlugin::initGui()
mNewMapset = 0; mNewMapset = 0;
mRegion = 0; mRegion = 0;


QSettings settings("QuantumGIS", "qgis"); QSettings settings;


QgsGrass::init(); QgsGrass::init();


Expand Down Expand Up @@ -257,7 +257,7 @@ void QgsGrassPlugin::mapsetChanged ()
mCloseMapsetAction->setEnabled(true); mCloseMapsetAction->setEnabled(true);
mNewVectorAction->setEnabled(true); mNewVectorAction->setEnabled(true);


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
bool on = settings.readBoolEntry ("/GRASS/region/on", true ); bool on = settings.readBoolEntry ("/GRASS/region/on", true );
mRegionAction->setOn(on); mRegionAction->setOn(on);
switchRegion(on); switchRegion(on);
Expand Down Expand Up @@ -605,7 +605,7 @@ void QgsGrassPlugin::switchRegion(bool on)
std::cout << "QgsGrassPlugin::switchRegion()" << std::endl; std::cout << "QgsGrassPlugin::switchRegion()" << std::endl;
#endif #endif


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
settings.writeEntry ("/GRASS/region/on", on ); settings.writeEntry ("/GRASS/region/on", on );


if ( on ) { if ( on ) {
Expand Down Expand Up @@ -663,7 +663,7 @@ void QgsGrassPlugin::setRegionPen(QPen & pen)
mRegionBand->setColor ( mRegionPen.color() ); mRegionBand->setColor ( mRegionPen.color() );
mRegionBand->setWidth ( mRegionPen.width() ); mRegionBand->setWidth ( mRegionPen.width() );


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
settings.writeEntry ("/GRASS/region/color", mRegionPen.color().name() ); settings.writeEntry ("/GRASS/region/color", mRegionPen.color().name() );
settings.writeEntry ("/GRASS/region/width", (int) mRegionPen.width() ); settings.writeEntry ("/GRASS/region/width", (int) mRegionPen.width() );
} }
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/grass/qgsgrassregion.cpp
Expand Up @@ -449,7 +449,7 @@ void QgsGrassRegion::postRender(QPainter *painter)
void QgsGrassRegion::accept() void QgsGrassRegion::accept()
{ {
// TODO: better repaint region // TODO: better repaint region
QSettings settings("QuantumGIS", "qgis"); QSettings settings;


bool on = settings.readBoolEntry ("/GRASS/region/on", true ); bool on = settings.readBoolEntry ("/GRASS/region/on", true );


Expand Down Expand Up @@ -483,7 +483,7 @@ void QgsGrassRegion::reject()


void QgsGrassRegion::restorePosition() void QgsGrassRegion::restorePosition()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
int ww = settings.readNumEntry("/GRASS/windows/region/w", 250); int ww = settings.readNumEntry("/GRASS/windows/region/w", 250);
int wh = settings.readNumEntry("/GRASS/windows/region/h", 350); int wh = settings.readNumEntry("/GRASS/windows/region/h", 350);
int wx = settings.readNumEntry("/GRASS/windows/region/x", 100); int wx = settings.readNumEntry("/GRASS/windows/region/x", 100);
Expand All @@ -494,7 +494,7 @@ void QgsGrassRegion::restorePosition()


void QgsGrassRegion::saveWindowLocation() void QgsGrassRegion::saveWindowLocation()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QPoint p = this->pos(); QPoint p = this->pos();
QSize s = this->size(); QSize s = this->size();
settings.writeEntry("/GRASS/windows/region/x", p.x()); settings.writeEntry("/GRASS/windows/region/x", p.x());
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassselect.cpp
Expand Up @@ -49,7 +49,7 @@ QgsGrassSelect::QgsGrassSelect(int type):QgsGrassSelectBase()
lastLocation = QgsGrass::getDefaultLocation(); lastLocation = QgsGrass::getDefaultLocation();
lastMapset = QgsGrass::getDefaultMapset(); lastMapset = QgsGrass::getDefaultMapset();
} else { } else {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
lastGisdbase = settings.readEntry("/GRASS/lastGisdbase"); lastGisdbase = settings.readEntry("/GRASS/lastGisdbase");
//check we got something from qsettings otherwise default to users home dir //check we got something from qsettings otherwise default to users home dir
if (lastGisdbase.isEmpty()) if (lastGisdbase.isEmpty())
Expand Down Expand Up @@ -108,7 +108,7 @@ void QgsGrassSelect::restorePosition()
optionsFrame->adjustSize (); optionsFrame->adjustSize ();
adjustSize (); adjustSize ();


QSettings settings("QuantumGIS", "qgis"); QSettings settings;
int ww = settings.readNumEntry("/GRASS/windows/select/w", 500); int ww = settings.readNumEntry("/GRASS/windows/select/w", 500);
int wh = settings.readNumEntry("/GRASS/windows/select/h", 100); int wh = settings.readNumEntry("/GRASS/windows/select/h", 100);
int wx = settings.readNumEntry("/GRASS/windows/select/x", 100); int wx = settings.readNumEntry("/GRASS/windows/select/x", 100);
Expand All @@ -119,7 +119,7 @@ void QgsGrassSelect::restorePosition()


void QgsGrassSelect::saveWindowLocation() void QgsGrassSelect::saveWindowLocation()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QPoint p = this->pos(); QPoint p = this->pos();
QSize s = this->size(); QSize s = this->size();
settings.writeEntry("/GRASS/windows/select/x", p.x()); settings.writeEntry("/GRASS/windows/select/x", p.x());
Expand Down Expand Up @@ -484,7 +484,7 @@ void QgsGrassSelect::on_ok_clicked()
} }


//write to qgsettings as gisdbase seems to be valid //write to qgsettings as gisdbase seems to be valid
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
settings.writeEntry("/GRASS/lastGisdbase",lastGisdbase ); settings.writeEntry("/GRASS/lastGisdbase",lastGisdbase );


location = elocation->currentText(); location = elocation->currentText();
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -420,7 +420,7 @@ void QgsGrassTools::closeEvent(QCloseEvent *e)


void QgsGrassTools::restorePosition() void QgsGrassTools::restorePosition()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
int ww = settings.readNumEntry("/GRASS/windows/tools/w", 250); int ww = settings.readNumEntry("/GRASS/windows/tools/w", 250);
int wh = settings.readNumEntry("/GRASS/windows/tools/h", 300); int wh = settings.readNumEntry("/GRASS/windows/tools/h", 300);
int wx = settings.readNumEntry("/GRASS/windows/tools/x", 100); int wx = settings.readNumEntry("/GRASS/windows/tools/x", 100);
Expand All @@ -432,7 +432,7 @@ void QgsGrassTools::restorePosition()


void QgsGrassTools::saveWindowLocation() void QgsGrassTools::saveWindowLocation()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QPoint p = this->pos(); QPoint p = this->pos();
QSize s = this->size(); QSize s = this->size();
settings.writeEntry("/GRASS/windows/tools/x", p.x()); settings.writeEntry("/GRASS/windows/tools/x", p.x());
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/spit/main.cpp
Expand Up @@ -4,6 +4,11 @@
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
QApplication a( argc, argv ); QApplication a( argc, argv );
// Set up the QSettings environment must be done after qapp is created
QCoreApplication::setOrganizationName("QuantumGIS");
QCoreApplication::setOrganizationDomain("qgis.org");
QCoreApplication::setApplicationName("qgis");

QgsSpit w(0, Qt::Window); QgsSpit w(0, Qt::Window);
w.show(); w.show();


Expand Down
4 changes: 2 additions & 2 deletions src/plugins/spit/qgsconnectiondialog.cpp
Expand Up @@ -35,7 +35,7 @@ QgsConnectionDialog::QgsConnectionDialog(QWidget *parent, const QString& connNam
{ {
setupUi(this); setupUi(this);
if (!connName.isEmpty()) { if (!connName.isEmpty()) {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString key = "/PostgreSQL/connections/" + connName; QString key = "/PostgreSQL/connections/" + connName;
txtHost->setText(settings.readEntry(key + "/host")); txtHost->setText(settings.readEntry(key + "/host"));
txtDatabase->setText(settings.readEntry(key + "/database")); txtDatabase->setText(settings.readEntry(key + "/database"));
Expand Down Expand Up @@ -90,7 +90,7 @@ void QgsConnectionDialog::testConnection()


void QgsConnectionDialog::saveConnection() void QgsConnectionDialog::saveConnection()
{ {
QSettings settings("QuantumGIS", "qgis"); QSettings settings;
QString baseKey = "/PostgreSQL/connections/"; QString baseKey = "/PostgreSQL/connections/";
baseKey += txtName->text(); baseKey += txtName->text();
settings.writeEntry(baseKey + "/host", txtHost->text()); settings.writeEntry(baseKey + "/host", txtHost->text());
Expand Down

0 comments on commit 94acb0a

Please sign in to comment.