Skip to content
Permalink
Browse files

Don't specify organization name on QSettings constructors. It overrid…

…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
telwertowski committed Dec 20, 2006
1 parent 77714ce commit 94acb0add32b7d987eb7c6bc5733e1ee6c844394
@@ -39,7 +39,7 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui(QgisIface * _qI, QWidget *
setupUi(this);
// at startup, fetch the last used delimiter and directory from
// settings
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QString key = "/Plugin-DelimitedText";
txtDelimiter->setText(settings.readEntry(key + "/delimiter"));

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

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

QString s = QFileDialog::getOpenFileName(
this,
@@ -50,7 +50,7 @@ void QgsGeorefPluginGui::on_pbnClose_clicked()


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

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

// XXX This is horrible, but it works and I'm tired / ll
{
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QgsProject* prj = QgsProject::instance();
mProjBehaviour = settings.readEntry("/Projections/defaultBehaviour");
mProjectSRS = prj->readEntry("SpatialRefSys", "/ProjectSRSProj4String");
@@ -149,7 +149,7 @@ void QgsGPSDeviceDialog::slotSelectionChanged() {

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

@@ -206,7 +206,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
QgsLogger::debug(" Gps File Importer::pbnGPXSelectFile_clicked() ");
QString myFileTypeQString;
QString myFilterString=tr("GPS eXchange format (*.gpx)");
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QString dir = settings.readEntry("/Plugin-GPS/gpxdirectory");
if (dir.isEmpty())
dir = ".";
@@ -337,7 +337,7 @@ void QgsGPSPluginGui::populatePortComboBoxes() {
// OSX, OpenBSD, NetBSD etc? Anyone?

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

resetButtons();

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

void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize )
{
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QString path = "/GRASS/windows/attributes/columnWidth/"
+ QString::number(section);
std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl;
@@ -402,7 +402,7 @@ void QgsGrassEdit::init()

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

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

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

if ( !item ) return;

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

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

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

void QgsGrassEdit::saveWindowLocation()
{
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/GRASS/windows/edit/x", p.x());
@@ -120,7 +120,7 @@ QgsGrassNewMapset::QgsGrassNewMapset ( QgisApp *qgisApp, QgisIface *iface,
mMapsetText->setPaletteBackgroundColor ( paletteBackgroundColor() );

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

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

mLocationComboBox->clear();

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

// Get available locations with write permissions
@@ -138,7 +138,7 @@ void QgsGrassPlugin::initGui()
mNewMapset = 0;
mRegion = 0;

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

QgsGrass::init();

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

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

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

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

QSettings settings("QuantumGIS", "qgis");
QSettings settings;
settings.writeEntry ("/GRASS/region/color", mRegionPen.color().name() );
settings.writeEntry ("/GRASS/region/width", (int) mRegionPen.width() );
}
@@ -449,7 +449,7 @@ void QgsGrassRegion::postRender(QPainter *painter)
void QgsGrassRegion::accept()
{
// TODO: better repaint region
QSettings settings("QuantumGIS", "qgis");
QSettings settings;

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

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

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

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

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

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

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

location = elocation->currentText();
@@ -420,7 +420,7 @@ void QgsGrassTools::closeEvent(QCloseEvent *e)

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

void QgsGrassTools::saveWindowLocation()
{
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/GRASS/windows/tools/x", p.x());
@@ -4,6 +4,11 @@
int main( int argc, char ** 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);
w.show();

@@ -35,7 +35,7 @@ QgsConnectionDialog::QgsConnectionDialog(QWidget *parent, const QString& connNam
{
setupUi(this);
if (!connName.isEmpty()) {
QSettings settings("QuantumGIS", "qgis");
QSettings settings;
QString key = "/PostgreSQL/connections/" + connName;
txtHost->setText(settings.readEntry(key + "/host"));
txtDatabase->setText(settings.readEntry(key + "/database"));
@@ -90,7 +90,7 @@ void QgsConnectionDialog::testConnection()

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

0 comments on commit 94acb0a

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