Reorganization of the sections in the QGIS configuration file (QSettings).

There may be issues with the implementation -- check to make sure that
the appropriate keys are being used when restoring settings.

Plugins are not affected -- yet.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4269 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2005-11-25 23:31:01 +00:00
parent a25beb4b42
commit f9b3936543
11 changed files with 109 additions and 109 deletions

View File

@ -353,7 +353,7 @@ QgisApp::QgisApp(QWidget * parent, const char *name, Qt::WFlags fl)
//
QSettings settings;
myHideSplashFlag = settings.readBoolEntry("/qgis/hideSplash");
myHideSplashFlag = settings.readBoolEntry("/Splash/hideSplash");
if (!myHideSplashFlag)
{
@ -446,7 +446,7 @@ QgisApp::QgisApp(QWidget * parent, const char *name, Qt::WFlags fl)
Q3WhatsThis::whatsThisButton(helpToolbar);
// Add the recently accessed project file paths to the File menu
mRecentProjectPaths = settings.readListEntry("/qgis/UI/recentProjectsList");
mRecentProjectPaths = settings.readListEntry("/UI/recentProjectsList");
// TODO: Qt4 will have to do this a different way...
#if QT_VERSION < 0x040000
@ -626,7 +626,7 @@ QgisApp::QgisApp(QWidget * parent, const char *name, Qt::WFlags fl)
}
// get the users theme preference from the settings
QString themeName = settings.readEntry("/qgis/theme","default");
QString themeName = settings.readEntry("/Themes","default");
// set the theme
setTheme(themeName);
@ -823,7 +823,7 @@ QDir myPluginDir(thePluginDirString, "*.so*", QDir::Name | QDir::IgnoreCase, QDi
// Windows stores a "true" value as a 1 in the registry so we
// have to use readBoolEntry in this function
if (mySettings.readBoolEntry("/qgis/Plugins/" + myEntryName))
if (mySettings.readBoolEntry("/Plugins/" + myEntryName))
{
#ifdef QGISDEBUG
std::cerr << " -------------------- loading " << myEntryName.toLocal8Bit().data() << std::endl;
@ -1037,7 +1037,7 @@ static void buildSupportedVectorFileFilter_(QString & fileFilters)
@param title the title for the dialog
@note
Stores persistent settings under /qgis/UI/. The sub-keys will be
Stores persistent settings under /UI/. The sub-keys will be
filterName and filterName + "Dir".
Opens dialog on last directory associated with the filter name, or
@ -1055,13 +1055,13 @@ static void openFilesRememberingFilter_(QString const &filterName,
QSettings settings; // where we keep last used filter in
// persistant state
QString lastUsedFilter = settings.readEntry("/qgis/UI/" + filterName,
QString lastUsedFilter = settings.readEntry("/UI/" + filterName,
QString::null,
&haveLastUsedFilter);
QString lastUsedDir = settings.readEntry("/qgis/UI/" + filterName + "Dir",".");
QString lastUsedDir = settings.readEntry("/UI/" + filterName + "Dir",".");
QString lastUsedEncoding = settings.readEntry("/qgis/UI/encoding");
QString lastUsedEncoding = settings.readEntry("/UI/encoding");
#ifdef QGISDEBUG
std::cerr << "Opening file dialog with filters: " << filters.toLocal8Bit().data() << std::endl;
@ -1093,9 +1093,9 @@ static void openFilesRememberingFilter_(QString const &filterName,
qDebug("Writing last used dir: " + myPath);
#endif
settings.writeEntry("/qgis/UI/" + filterName, openFileDialog->selectedFilter());
settings.writeEntry("/qgis/UI/" + filterName + "Dir", myPath);
settings.writeEntry("/qgis/UI/encoding", openFileDialog->encoding());
settings.writeEntry("/UI/" + filterName, openFileDialog->selectedFilter());
settings.writeEntry("/UI/" + filterName + "Dir", myPath);
settings.writeEntry("/UI/encoding", openFileDialog->encoding());
}
delete openFileDialog;
@ -1987,14 +1987,14 @@ void QgisApp::newVectorLayer()
QSettings settings; // where we keep last used filter in
// persistant state
QString lastUsedFilter = settings.readEntry("/qgis/UI/lastVectorFileFilter",
QString lastUsedFilter = settings.readEntry("/UI/lastVectorFileFilter",
QString::null,
&haveLastUsedFilter);
QString lastUsedDir = settings.readEntry("/qgis/UI/lastVectorFileFilterDir",
QString lastUsedDir = settings.readEntry("/UI/lastVectorFileFilterDir",
".");
QString lastUsedEncoding = settings.readEntry("/qgis/UI/encoding");
QString lastUsedEncoding = settings.readEntry("/UI/encoding");
#ifdef QGISDEBUG
@ -2021,10 +2021,10 @@ void QgisApp::newVectorLayer()
filename = openFileDialog->selectedFile();
enc = openFileDialog->encoding();
settings.writeEntry("/qgis/UI//lastVectorFileFilter", openFileDialog->selectedFilter());
settings.writeEntry("/UI//lastVectorFileFilter", openFileDialog->selectedFilter());
settings.writeEntry("/qgis/UI//lastVectorFileFilterDir", openFileDialog->dirPath());
settings.writeEntry("/qgis/UI/encoding", openFileDialog->encoding());
settings.writeEntry("/UI//lastVectorFileFilterDir", openFileDialog->dirPath());
settings.writeEntry("/UI/encoding", openFileDialog->encoding());
delete openFileDialog;
@ -2157,7 +2157,7 @@ void QgisApp::fileOpen()
{
// Retrieve last used project dir from persistent settings
QSettings settings;
QString lastUsedDir = settings.readEntry("/qgis/UI/lastProjectDir", ".");
QString lastUsedDir = settings.readEntry("/UI/lastProjectDir", ".");
Q3FileDialog * openFileDialog = new Q3FileDialog(lastUsedDir, QObject::tr("QGis files (*.qgs)"), 0,
"open project file");
@ -2175,7 +2175,7 @@ void QgisApp::fileOpen()
QFileInfo myFI(fullPath);
QString myPath = myFI.dirPath();
// Persist last used project dir
settings.writeEntry("/qgis/UI/lastProjectDir", myPath);
settings.writeEntry("/UI/lastProjectDir", myPath);
}
else
{
@ -2341,7 +2341,7 @@ void QgisApp::fileSave()
// Retrieve last used project dir from persistent settings
QSettings settings;
QString lastUsedDir = settings.readEntry("/qgis/UI/lastProjectDir", ".");
QString lastUsedDir = settings.readEntry("/UI/lastProjectDir", ".");
std::auto_ptr<Q3FileDialog> saveFileDialog( new Q3FileDialog(lastUsedDir,
QObject::tr("QGis files (*.qgs)"),
@ -2439,7 +2439,7 @@ void QgisApp::fileSaveAs()
{
// Retrieve last used project dir from persistent settings
QSettings settings;
QString lastUsedDir = settings.readEntry("/qgis/UI/lastProjectDir", ".");
QString lastUsedDir = settings.readEntry("/UI/lastProjectDir", ".");
auto_ptr<Q3FileDialog> saveFileDialog( new Q3FileDialog(lastUsedDir,
QObject::tr("QGis files (*.qgs)"),
@ -2461,7 +2461,7 @@ void QgisApp::fileSaveAs()
fullPath.setFile(saveFileDialog->selectedFile());
QString myPath = fullPath.dirPath();
// Persist last used project dir
settings.writeEntry("/qgis/UI/lastProjectDir", myPath);
settings.writeEntry("/UI/lastProjectDir", myPath);
}
else
{
@ -2543,7 +2543,7 @@ void QgisApp::saveRecentProjectPath(QString projectPath, QSettings & settings)
}
// Persist the list
settings.writeEntry("/qgis/UI/recentProjectsList", mRecentProjectPaths);
settings.writeEntry("/UI/recentProjectsList", mRecentProjectPaths);
// TODO: Qt4 will have to do this a different way...
#if QT_VERSION < 0x040000
@ -2724,8 +2724,8 @@ void QgisApp::saveMapAsImage()
//find out the last used filter
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedFilter = myQSettings.readEntry("/qgis/UI/saveAsImageFilter");
QString myLastUsedDir = myQSettings.readEntry("/qgis/UI/lastSaveAsImageDir",".");
QString myLastUsedFilter = myQSettings.readEntry("/UI/saveAsImageFilter");
QString myLastUsedDir = myQSettings.readEntry("/UI/lastSaveAsImageDir",".");
// get a list of supported output image types
@ -2783,8 +2783,8 @@ void QgisApp::saveMapAsImage()
std::cout << "Image type to be passed to mapcanvas: " << (myFilterMap[myFilterString]).toLocal8Bit().data() << std::endl;
#endif
myQSettings.writeEntry("/qgis/UI/lastSaveAsImageFilter" , myFilterString);
myQSettings.writeEntry("/qgis/UI/lastSaveAsImageDir", myQFileDialog->dirPath());
myQSettings.writeEntry("/UI/lastSaveAsImageFilter" , myFilterString);
myQSettings.writeEntry("/UI/lastSaveAsImageDir", myQFileDialog->dirPath());
if ( myOutputFileNameQString !="")
{
@ -3717,14 +3717,14 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
// add it to the plugin registry
pRegistry->addPlugin(myLib->library(), name, pl);
//add it to the qsettings file [ts]
settings.writeEntry("/qgis/Plugins/" + name, true);
settings.writeEntry("/Plugins/" + name, true);
}
else
{
// something went wrong
QMessageBox::warning(this, tr("Error Loading Plugin"), tr("There was an error loading %1."));
//disable it to the qsettings file [ts]
settings.writeEntry("/qgis/Plugins/" + name, false);
settings.writeEntry("/Plugins/" + name, false);
}
}
else
@ -3749,7 +3749,7 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
pl->setQgisMainWindow(this);
pl->initGui();
//add it to the qsettings file [ts]
settings.writeEntry("/qgis/Plugins/" + name, true);
settings.writeEntry("/Plugins/" + name, true);
}
else
@ -3757,7 +3757,7 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
// something went wrong
QMessageBox::warning(this, tr("Error Loading Plugin"), tr("There was an error loading %1."));
//add it to the qsettings file [ts]
settings.writeEntry("/qgis/Plugins/" + name, false);
settings.writeEntry("/Plugins/" + name, false);
}
}
else
@ -4002,15 +4002,15 @@ void QgisApp::saveWindowState()
QString dockStatus;
QTextStream ts(&dockStatus, QIODevice::WriteOnly);
ts << *this;
settings.writeEntry("/qgis/Geometry/ToolBars", dockStatus);
settings.writeEntry("/Geometry/ToolBars", dockStatus);
// store window geometry
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/qgis/Geometry/maximized", this->isMaximized());
settings.writeEntry("/qgis/Geometry/x", p.x());
settings.writeEntry("/qgis/Geometry/y", p.y());
settings.writeEntry("/qgis/Geometry/w", s.width());
settings.writeEntry("/qgis/Geometry/h", s.height());
settings.writeEntry("/Geometry/maximized", this->isMaximized());
settings.writeEntry("/Geometry/x", p.x());
settings.writeEntry("/Geometry/y", p.y());
settings.writeEntry("/Geometry/w", s.width());
settings.writeEntry("/Geometry/h", s.height());
}
@ -4018,7 +4018,7 @@ void QgisApp::restoreWindowState()
{
QSettings settings;
QString dockStatus = settings.readEntry("/qgis/Geometry/ToolBars");
QString dockStatus = settings.readEntry("/Geometry/ToolBars");
QTextStream ts(&dockStatus, QIODevice::ReadOnly);
ts >> *this;
@ -4026,10 +4026,10 @@ void QgisApp::restoreWindowState()
QDesktopWidget *d = QApplication::desktop();
int dw = d->width(); // returns desktop width
int dh = d->height(); // returns desktop height
int w = settings.readNumEntry("/qgis/Geometry/w", 600);
int h = settings.readNumEntry("/qgis/Geometry/h", 400);
int x = settings.readNumEntry("/qgis/Geometry/x", (dw - 600) / 2);
int y = settings.readNumEntry("/qgis/Geometry/y", (dh - 400) / 2);
int w = settings.readNumEntry("/Geometry/w", 600);
int h = settings.readNumEntry("/Geometry/h", 400);
int x = settings.readNumEntry("/Geometry/x", (dw - 600) / 2);
int y = settings.readNumEntry("/Geometry/y", (dh - 400) / 2);
resize(w, h);
move(x, y);
}

View File

@ -524,8 +524,8 @@ void QgsComposer::image(void)
//find out the last used filter
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedFormat = myQSettings.readEntry("/qgis/UI/lastSaveAsImageFormat", "PNG" );
QString myLastUsedFile = myQSettings.readEntry("/qgis/UI/lastSaveAsImageFile","qgis.png");
QString myLastUsedFormat = myQSettings.readEntry("/UI/lastSaveAsImageFormat", "PNG" );
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsImageFile","qgis.png");
// get a list of supported output image types
int myCounterInt=0;
@ -585,8 +585,8 @@ void QgsComposer::image(void)
std::cout << "Image type: " << myFilterMap[myFilterString].toLocal8Bit().data() << std::endl;
#endif
myQSettings.writeEntry("/qgis/UI/lastSaveAsImageFormat" , myFilterMap[myFilterString] );
myQSettings.writeEntry("/qgis/UI/lastSaveAsImageFile", myOutputFileNameQString);
myQSettings.writeEntry("/UI/lastSaveAsImageFormat" , myFilterMap[myFilterString] );
myQSettings.writeEntry("/UI/lastSaveAsImageFile", myOutputFileNameQString);
if ( myOutputFileNameQString == "" ) return;
@ -614,7 +614,7 @@ void QgsComposer::image(void)
void QgsComposer::svg(void)
{
QSettings myQSettings;
QString myLastUsedFile = myQSettings.readEntry("/qgis/UI/lastSaveAsSvgFile","qgis.svg");
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
Q3FileDialog *myQFileDialog = new Q3FileDialog( "", "SVG Format (*.svg *SVG)", 0,
"Save svg file dialog");
@ -632,7 +632,7 @@ void QgsComposer::svg(void)
if ( myOutputFileNameQString == "" ) return;
myQSettings.writeEntry("/qgis/UI/lastSaveAsSvgFile", myOutputFileNameQString);
myQSettings.writeEntry("/UI/lastSaveAsSvgFile", myOutputFileNameQString);
mView->setCanvas(0);
mComposition->setPlotStyle ( QgsComposition::Print );
@ -716,16 +716,16 @@ void QgsComposer::saveWindowState()
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/qgis/Composer/geometry/x", p.x());
settings.writeEntry("/qgis/Composer/geometry/y", p.y());
settings.writeEntry("/qgis/Composer/geometry/w", s.width());
settings.writeEntry("/qgis/Composer/geometry/h", s.height());
settings.writeEntry("/Composer/geometry/x", p.x());
settings.writeEntry("/Composer/geometry/y", p.y());
settings.writeEntry("/Composer/geometry/w", s.width());
settings.writeEntry("/Composer/geometry/h", s.height());
Q3ValueList<int> list = mSplitter->sizes();
Q3ValueList<int>::Iterator it = list.begin();
settings.writeEntry("/qgis/Composer/geometry/wiev", (int)(*it) );
settings.writeEntry("/Composer/geometry/wiev", (int)(*it) );
it++;
settings.writeEntry("/qgis/Composer/geometry/options", (int)(*it) );
settings.writeEntry("/Composer/geometry/options", (int)(*it) );
}
void QgsComposer::restoreWindowState()
@ -735,18 +735,18 @@ void QgsComposer::restoreWindowState()
QDesktopWidget *d = QApplication::desktop();
int dw = d->width();
int dh = d->height();
int w = settings.readNumEntry("/qgis/Composer/geometry/w", 600);
int h = settings.readNumEntry("/qgis/Composer/geometry/h", 400);
int x = settings.readNumEntry("/qgis/Composer/geometry/x", (dw - 600) / 2);
int y = settings.readNumEntry("/qgis/Composer/geometry/y", (dh - 400) / 2);
int w = settings.readNumEntry("/Composer/geometry/w", 600);
int h = settings.readNumEntry("/Composer/geometry/h", 400);
int x = settings.readNumEntry("/Composer/geometry/x", (dw - 600) / 2);
int y = settings.readNumEntry("/Composer/geometry/y", (dh - 400) / 2);
resize(w, h);
move(x, y);
// This doesn't work
Q3ValueList<int> list;
w = settings.readNumEntry("/qgis/Composer/geometry/view", 300);
w = settings.readNumEntry("/Composer/geometry/view", 300);
list.push_back( w );
w = settings.readNumEntry("/qgis/Composer/geometry/options", 300);
w = settings.readNumEntry("/Composer/geometry/options", 300);
list.push_back( w );
mSplitter->setSizes ( list );
}

View File

@ -91,7 +91,7 @@ QgsDbSourceSelect::QgsDbSourceSelect(QgisApp *app, const char *name, bool modal)
//read the last encoding from the settings
//or use local as default
QSettings settings;
QString lastUsedEncoding = settings.readEntry("/qgis/UI/encoding");
QString lastUsedEncoding = settings.readEntry("/UI/encoding");
if(lastUsedEncoding.isNull()||lastUsedEncoding.isEmpty()||lastUsedEncoding=="\0")
{
mEncodingComboBox->setCurrentText(QString(QTextCodec::codecForLocale()->name()));
@ -109,7 +109,7 @@ QgsDbSourceSelect::~QgsDbSourceSelect()
void QgsDbSourceSelect::populateConnectionList()
{
QSettings settings;
QStringList keys = settings.subkeyList("/Qgis/connections");
QStringList keys = settings.subkeyList("/PostgreSQL/connections");
QStringList::Iterator it = keys.begin();
cmbConnections->clear();
while (it != keys.end())
@ -192,7 +192,7 @@ void QgsDbSourceSelect::dbConnect()
// populate the table list
QSettings settings;
QString key = "/Qgis/connections/" + cmbConnections->currentText();
QString key = "/PostgreSQL/connections/" + cmbConnections->currentText();
QString connString = "host=";
QString host = settings.readEntry(key + "/host");
connString += host;
@ -449,14 +449,14 @@ void QgsDbSourceSelect::dbChanged()
{
// Remember which database was selected.
QSettings settings;
settings.writeEntry("/Qgis/connections/selected",
settings.writeEntry("/PostgreSQL/connections/selected",
cmbConnections->currentText());
}
void QgsDbSourceSelect::setConnectionListPosition()
{
QSettings settings;
// If possible, set the item currently displayed database
QString toSelect = settings.readEntry("/Qgis/connections/selected");
QString toSelect = settings.readEntry("/PostgreSQL/connections/selected");
// Does toSelect exist in cmbConnections?
bool set = false;
for (int i = 0; i < cmbConnections->count(); ++i)

View File

@ -136,10 +136,10 @@ void QgsIdentifyResults::restorePosition()
{
QSettings settings;
int ww = settings.readNumEntry("/qgis/Windows/Identify/w", 281);
int wh = settings.readNumEntry("/qgis/Windows/Identify/h", 316);
int wx = settings.readNumEntry("/qgis/Windows/Identify/x", 100);
int wy = settings.readNumEntry("/qgis/Windows/Identify/y", 100);
int ww = settings.readNumEntry("/Windows/Identify/w", 281);
int wh = settings.readNumEntry("/Windows/Identify/h", 316);
int wx = settings.readNumEntry("/Windows/Identify/x", 100);
int wy = settings.readNumEntry("/Windows/Identify/y", 100);
//std::cerr << "Setting geometry: " << wx << ", " << wy << ", " << ww << ", " << wh << std::endl;
resize(ww,wh);
move(wx,wy);
@ -152,10 +152,10 @@ void QgsIdentifyResults::saveWindowLocation()
QSettings settings;
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/qgis/Windows/Identify/x", p.x());
settings.writeEntry("/qgis/Windows/Identify/y", p.y());
settings.writeEntry("/qgis/Windows/Identify/w", s.width());
settings.writeEntry("/qgis/Windows/Identify/h", s.height());
settings.writeEntry("/Windows/Identify/x", p.x());
settings.writeEntry("/Windows/Identify/y", p.y());
settings.writeEntry("/Windows/Identify/w", s.width());
settings.writeEntry("/Windows/Identify/h", s.height());
}
/** add an attribute and its value to the list */
void QgsIdentifyResults::addAttribute(Q3ListViewItem * fnode, QString field, QString value)
@ -178,7 +178,7 @@ void QgsIdentifyResults::addAction(Q3ListViewItem * fnode, int id, QString field
appDir = PREFIX;
#endif
QString img = appDir + "/share/qgis/themes/default/action.png";
QString img = appDir + "/share/themes/default/action.png";
QPixmap pm ( img );
item->setPixmap ( 0, pm );

View File

@ -311,14 +311,14 @@ void QgsMeasure::closeEvent(QCloseEvent *e)
void QgsMeasure::restorePosition()
{
QSettings settings;
int ww = settings.readNumEntry("/qgis/Windows/Measure/w", 150);
int ww = settings.readNumEntry("/Windows/Measure/w", 150);
int wh;
if (mMeasureArea)
wh = settings.readNumEntry("/qgis/Windows/Measure/hNoTable", 70);
wh = settings.readNumEntry("/Windows/Measure/hNoTable", 70);
else
wh = settings.readNumEntry("/qgis/Windows/Measure/h", 200);
int wx = settings.readNumEntry("/qgis/Windows/Measure/x", 100);
int wy = settings.readNumEntry("/qgis/Windows/Measure/y", 100);
wh = settings.readNumEntry("/Windows/Measure/h", 200);
int wx = settings.readNumEntry("/Windows/Measure/x", 100);
int wy = settings.readNumEntry("/Windows/Measure/y", 100);
// setUpdatesEnabled(false);
adjustSize();
resize(ww,wh);
@ -332,13 +332,13 @@ void QgsMeasure::saveWindowLocation()
QSettings settings;
QPoint p = this->pos();
QSize s = this->size();
settings.writeEntry("/qgis/Windows/Measure/x", p.x());
settings.writeEntry("/qgis/Windows/Measure/y", p.y());
settings.writeEntry("/qgis/Windows/Measure/w", s.width());
settings.writeEntry("/Windows/Measure/x", p.x());
settings.writeEntry("/Windows/Measure/y", p.y());
settings.writeEntry("/Windows/Measure/w", s.width());
if (mMeasureArea)
settings.writeEntry("/qgis/Windows/Measure/hNoTable", s.height());
settings.writeEntry("/Windows/Measure/hNoTable", s.height());
else
settings.writeEntry("/qgis/Windows/Measure/h", s.height());
settings.writeEntry("/Windows/Measure/h", s.height());
}
void QgsMeasure::showHelp()

View File

@ -35,7 +35,7 @@ QgsNewConnection::QgsNewConnection(QWidget *parent, const QString& connName, boo
// populate the fields with the stored setting parameters
QSettings settings;
QString key = "/Qgis/connections/" + connName;
QString key = "/PostgreSQL/connections/" + connName;
txtHost->setText(settings.readEntry(key + "/host"));
txtDatabase->setText(settings.readEntry(key + "/database"));
QString port = settings.readEntry(key + "/port");
@ -98,7 +98,7 @@ void QgsNewConnection::testConnection()
void QgsNewConnection::saveConnection()
{
QSettings settings;
QString baseKey = "/Qgis/connections/";
QString baseKey = "/PostgreSQL/connections/";
settings.writeEntry(baseKey + "selected", txtName->text());
baseKey += txtName->text();
settings.writeEntry(baseKey + "/host", txtHost->text());
@ -122,7 +122,7 @@ void QgsNewConnection::helpInfo()
/* void QgsNewConnection::saveConnection()
{
QSettings settings;
QString baseKey = "/Qgis/connections/";
QString baseKey = "/PostgreSQL/connections/";
baseKey += txtName->text();
settings.writeEntry(baseKey + "/host", txtHost->text());
settings.writeEntry(baseKey + "/database", txtDatabase->text());

View File

@ -45,28 +45,28 @@ QgsOptions::QgsOptions(QWidget *parent, const char *name, bool modal) :
cmbBrowser->setCurrentText(browser);
// set the show splash option
std::cout << "Standard Identify radius setting: " << QGis::DEFAULT_IDENTIFY_RADIUS << std::endl;
int identifyValue = settings.readNumEntry("/qgis/map/identifyRadius",QGis::DEFAULT_IDENTIFY_RADIUS);
int identifyValue = settings.readNumEntry("/Map/identifyRadius",QGis::DEFAULT_IDENTIFY_RADIUS);
std::cout << "Standard Identify radius setting read from settings file: " << identifyValue << std::endl;
spinBoxIdentifyValue->setValue(identifyValue);
bool hideSplashFlag = false;
if (settings.readEntry("/qgis/hideSplash")=="true")
if (settings.readEntry("/Splash/hideSplash")=="true")
{
hideSplashFlag =true;
}
cbxHideSplash->setChecked(hideSplashFlag);
// set the current theme
cmbTheme->setCurrentText(settings.readEntry("/qgis/theme"));
cmbTheme->setCurrentText(settings.readEntry("/Themes"));
// set the SVG oversampling factor
spbSVGOversampling->setValue(QgsSVGCache::instance().getOversampling());
// set the display update threshold
spinBoxUpdateThreshold->setValue(settings.readNumEntry("/qgis/map/updateThreshold"));
spinBoxUpdateThreshold->setValue(settings.readNumEntry("/Map/updateThreshold"));
//set the default projection behaviour radio buttongs
if (settings.readEntry("/qgis/projections/defaultBehaviour")=="prompt")
if (settings.readEntry("/Projections/defaultBehaviour")=="prompt")
{
radPromptForProjection->setChecked(true);
}
else if (settings.readEntry("/qgis/projections/defaultBehaviour")=="useProject")
else if (settings.readEntry("/Projections/defaultBehaviour")=="useProject")
{
radUseProjectProjection->setChecked(true);
}
@ -74,7 +74,7 @@ QgsOptions::QgsOptions(QWidget *parent, const char *name, bool modal) :
{
radUseGlobalProjection->setChecked(true);
}
mGlobalSRSID = settings.readNumEntry("/qgis/projections/defaultProjectionSRSID",GEOSRS_ID);
mGlobalSRSID = settings.readNumEntry("/Projections/defaultProjectionSRSID",GEOSRS_ID);
//! @todo changes this control name in gui to txtGlobalProjString
QString myProjString = QgsSpatialRefSys::getProj4FromSrsId(mGlobalSRSID);
txtGlobalWKT->setText(myProjString);
@ -105,16 +105,16 @@ void QgsOptions::saveOptions()
{
QSettings settings;
settings.writeEntry("/qgis/browser", cmbBrowser->currentText());
settings.writeEntry("/qgis/map/identifyRadius", spinBoxIdentifyValue->value());
settings.writeEntry("/Map/identifyRadius", spinBoxIdentifyValue->value());
settings.writeEntry("/qgis/hideSplash",cbxHideSplash->isChecked());
settings.writeEntry("/qgis/new_layers_visible",!chkAddedVisibility->isChecked());
if(cmbTheme->currentText().length() == 0)
{
settings.writeEntry("/qgis/theme", "default");
settings.writeEntry("/Themes", "default");
}else{
settings.writeEntry("/qgis/theme",cmbTheme->currentText());
settings.writeEntry("/Themes",cmbTheme->currentText());
}
settings.writeEntry("/qgis/map/updateThreshold", spinBoxUpdateThreshold->value());
settings.writeEntry("/Map/updateThreshold", spinBoxUpdateThreshold->value());
QgsSVGCache::instance().setOversampling(spbSVGOversampling->value());
settings.writeEntry("/qgis/svgoversampling", spbSVGOversampling->value());
//check behaviour so default projection when new layer is added with no
@ -122,19 +122,19 @@ void QgsOptions::saveOptions()
if (radPromptForProjection->isChecked())
{
//
settings.writeEntry("/qgis/projections/defaultBehaviour", "prompt");
settings.writeEntry("/Projections/defaultBehaviour", "prompt");
}
else if(radUseProjectProjection->isChecked())
{
//
settings.writeEntry("/qgis/projections/defaultBehaviour", "useProject");
settings.writeEntry("/Projections/defaultBehaviour", "useProject");
}
else //assumes radUseGlobalProjection is checked
{
//
settings.writeEntry("/qgis/projections/defaultBehaviour", "useGlobal");
settings.writeEntry("/Projections/defaultBehaviour", "useGlobal");
}
settings.writeEntry("/qgis/projections/defaultProjectionSRSID",(int)mGlobalSRSID);
settings.writeEntry("/Projections/defaultProjectionSRSID",(int)mGlobalSRSID);
settings.writeEntry("/qgis/measure/ellipsoid", getEllipsoidAcronym(cmbEllipsoid->currentText()));
@ -157,7 +157,7 @@ void QgsOptions::addTheme(QString item)
void QgsOptions::setCurrentTheme()
{
QSettings settings;
cmbTheme->setCurrentText(settings.readEntry("/qgis/theme","default"));
cmbTheme->setCurrentText(settings.readEntry("/Themes","default"));
}
void QgsOptions::findBrowser()

View File

@ -206,7 +206,7 @@ void QgsPluginManager::unload()
// remove the plugin from the registry
pRegistry->removePlugin(lvi->text(0));
//disable it to the qsettings file [ts]
settings.writeEntry("/qgis/Plugins/" + lvi->text(0), false);
settings.writeEntry("/Plugins/" + lvi->text(0), false);
}
}
lvi = (Q3CheckListItem *) lvi->nextSibling();

View File

@ -4925,7 +4925,7 @@ QgsRasterLayer::QgsRasterLayer(
// changes the threshold from the preferences dialog, it will
// have no effect on existing layers
// TODO: QSettings settings;
// updateThreshold = settings.readNumEntry("qgis/map/updateThreshold", 1000);
// updateThreshold = settings.readNumEntry("Map/updateThreshold", 1000);
// TODO: Connect signals from the dataprovider to the qgisapp

View File

@ -133,7 +133,7 @@ void QgsSpatialRefSys::validate()
}
QSettings mySettings;
QString myDefaultProjectionOption =
mySettings.readEntry("/qgis/projections/defaultBehaviour");
mySettings.readEntry("/Projections/defaultBehaviour");
if (myDefaultProjectionOption=="prompt")
{
//@note this class is not a descendent of QWidget so we cant pass
@ -158,10 +158,10 @@ void QgsSpatialRefSys::validate()
// XXX TODO: Change project to store selected CS as 'projectSRS' not 'selectedWKT'
mProj4String = QgsProject::instance()->readEntry("SpatialRefSys","//ProjectSRSProj4String",GEOPROJ4);
}
else ///qgis/projections/defaultBehaviour==useDefault
else ///Projections/defaultBehaviour==useDefault
{
// XXX TODO: Change global settings to store default CS as 'defaultSRS' not 'defaultProjectionWKT'
mProj4String = mySettings.readEntry("/qgis/projections/defaultSRS",GEOPROJ4);
mProj4String = mySettings.readEntry("/Projections/defaultSRS",GEOPROJ4);
}
//

View File

@ -146,7 +146,7 @@ QgsVectorLayer::QgsVectorLayer(QString vectorLayerPath,
// changes the threshold from the preferences dialog, it will
// have no effect on existing layers
QSettings settings;
updateThreshold = settings.readNumEntry("qgis/map/updateThreshold", 1000);
updateThreshold = settings.readNumEntry("Map/updateThreshold", 1000);
} // QgsVectorLayer ctor