Re: [Qgis-developer] Housekeeping in the (Qgs)Settings
On Tue, Mar 7, 2017 at 9:37 AM, Richard Duivenvoordewrote: > > Hi Ale, > > yep agreed! And now (while most users do not have real 3.0 > configs/settings) is the only time to do this... > as people will loose all connections etc etc > > I would even be ok, to use python style names, so no capitals and use of > underscores: > > /BetterAttributeTable/geometry > becomes > better_attribute_table/geometry > > etc etc > > Let's clean up :-) > > Regards, > > Richard > > Hi Richard, thanks for the feed-back, the original plan was to have all setting keys case-insensitive (lowercase) but that was reverted yesterday, because some setting keys have been used to store values (i.e. strings) as a part of the key, like for example the name of a WMS/WFS or plugin site description. I'm afraid we are forced to live with that. BTW, the new QgsSettings class supports namespaced settings, we have "gui", "core", "server", "plugins", "misc", so we should be able to organize the setting keys in a more logical manner. > > On 2017-03-06 11:05, Alessandro Pasotti wrote: > >> Hi, >> >> the current keys naming for the settings is not very consistent, what >> do you guys think about cleaning it a bit? >> >> I was thinking at: >> >> 1. adding an 'app' section to QgsSettings::Section enum, to store >> namespaced settings for the application >> 2. remove the '/' at the beginning of the keys (it's completely >> unuseful) >> 3. enforce namespacing with the use of Sections on all keys used in >> the '/src/*' folders >> >> This is a quick grep|sort|uniq of the setting keys: >> >> allowGeometrylessTables >> /BetterAttributeTable/geometry >> /browser/favourites >> /browser/hiddenPaths >> cache/directory >> cache/size >> /colors/palettecolors >> /colors/palettelabels >> /colors/recent >> /ColorWidgets/textWidgetFormat >> /Composer/defaultFont >> /Composer/defaultSnapGridOffsetX >> /Composer/defaultSnapGridOffsetY >> /Composer/defaultSnapGridResolution >> /Composer/defaultSnapTolerancePixels >> /Composer/geometry >> composer/searchPathsForTemplates >> /ComposerUI/state >> CptCity/archiveName >> CptCity/baseDir >> crs >> database >> /dataitem/directoryHiddenColumns >> /Db2/connections/selected >> dboptions >> dbworkspace >> Digitizing >> /digitizing/simplify_tolerance >> /digitizing/simplify_tolerance_units >> dpiMode >> /Error/dialog/detail >> estimatedMetadata >> /eVis/browser-geometry >> /eVis/db-geometry >> fontFamily >> /fontFamily >> fontPointSize >> /fontPointSize >> geometryColumnsOnly >> /gps/lastPort >> /GradientEditor/plotAlpha >> /GradientEditor/plotHue >> /GradientEditor/plotLightness >> /GradientEditor/plotSaturation >> /GRASS/browser/import/crsTransform >> /GRASS/browser/import/external >> /GRASS/gidbase/custom >> /GRASS/gidbase/customDir >> /GRASS/lastDirectOutputDir >> /GRASS/lastGisdbase >> /GRASS/lastLocation >> /GRASS/lastMapset >> /GRASS/modules/config/custom >> /GRASS/modules/config/customDir >> /GRASS/modules/debug >> /GRASS/newMapsetWizard/openMapset >> /GRASS/region/color >> /GRASS/region/on >> /GRASS/region/width >> /GRASS/showTopoLayers >> /GRASS/windows/tools/geometry >> groupBoxCustom >> help/helpSearchPath >> /HelpViewer/geometry >> /HistogramWidget/showMean >> /HistogramWidget/showStdev >> host >> iconSize >> /IconSize >> ignoreAxisOrientation >> ignoreGetFeatureInfoURI >> ignoreGetMapURI >> invertAxisOrientation >> lastColorMapDir >> locale >> locale/overrideFlag >> locale/userLocale >> /Map/highlight/buffer >> /Map/highlight/color >> /Map/highlight/colorAlpha >> /Map/highlight/minWidth >> /Map/identifyMode >> /Map/logCanvasRefreshEvent >> Map/scales >> /Map/searchRadiusMM >> /MSSQL/connections/selected >> /ogr/connections/selectedtype >> /osm/lastDir >> password >> path >> /Plugin-GeoReferencer/lastcompression >> /Plugin-GeoReferencer/lastPDFReportDir >> /Plugin-GeoReferencer/lastresampling >> /Plugin-GeoReferencer/lasttransformation >> /Plugin-GeoReferencer/loadinqgis >> /Plugin-GeoReferencer/targetsrs >> /Plugin-GeoReferencer/TransformSettingsWindow/geometry >> /Plugin-Georeferencer/user_specified_resolution >> /Plugin-GeoReferencer/user_specified_resx >> /Plugin-GeoReferencer/user_specified_resy >> /Plugin-Georeferencer/word_file_checkbox >> /Plugin-GeoReferencer/zeroastrans >> /Plugin-GPS/devicelist >> /Plugin-GPS/geometry >> /Plugin-GPS/gpsbabelpath >> /Plugin-GPS/gpxdirectory >> /Plugin-GPS/importdirectory >> /Plugin-GPS/lastdldevice >> /Plugin-GPS/lastdlport >> /Plugin-GPS/lastImportFilter >> /Plugin-GPS/lastTab >> /Plugin-GPS/lastuldevice >> /Plugin-GPS/lastulport >> Plugin-OfflineEditing/geometry >> Plugin-OfflineEditing/offline_data_path >> plugins/searchPathsForPlugins >> port >> /PostgreSQL/connections/selected >> previewImage >> /Projections/defaultBehavior >> /Projections/layerDefaultCrs >> /Projections/otfTransformEnabled >> /Projections/projectDefaultCrs >> /Projections/showDatumTransformDialog >> proxy/proxyEnabled >> proxy/proxyExcludedUrls >> proxy/proxyHost >>
Re: [Qgis-developer] Housekeeping in the (Qgs)Settings
Hi Ale, yep agreed! And now (while most users do not have real 3.0 configs/settings) is the only time to do this... as people will loose all connections etc etc I would even be ok, to use python style names, so no capitals and use of underscores: /BetterAttributeTable/geometry becomes better_attribute_table/geometry etc etc Let's clean up :-) Regards, Richard On 2017-03-06 11:05, Alessandro Pasotti wrote: Hi, the current keys naming for the settings is not very consistent, what do you guys think about cleaning it a bit? I was thinking at: 1. adding an 'app' section to QgsSettings::Section enum, to store namespaced settings for the application 2. remove the '/' at the beginning of the keys (it's completely unuseful) 3. enforce namespacing with the use of Sections on all keys used in the '/src/*' folders This is a quick grep|sort|uniq of the setting keys: allowGeometrylessTables /BetterAttributeTable/geometry /browser/favourites /browser/hiddenPaths cache/directory cache/size /colors/palettecolors /colors/palettelabels /colors/recent /ColorWidgets/textWidgetFormat /Composer/defaultFont /Composer/defaultSnapGridOffsetX /Composer/defaultSnapGridOffsetY /Composer/defaultSnapGridResolution /Composer/defaultSnapTolerancePixels /Composer/geometry composer/searchPathsForTemplates /ComposerUI/state CptCity/archiveName CptCity/baseDir crs database /dataitem/directoryHiddenColumns /Db2/connections/selected dboptions dbworkspace Digitizing /digitizing/simplify_tolerance /digitizing/simplify_tolerance_units dpiMode /Error/dialog/detail estimatedMetadata /eVis/browser-geometry /eVis/db-geometry fontFamily /fontFamily fontPointSize /fontPointSize geometryColumnsOnly /gps/lastPort /GradientEditor/plotAlpha /GradientEditor/plotHue /GradientEditor/plotLightness /GradientEditor/plotSaturation /GRASS/browser/import/crsTransform /GRASS/browser/import/external /GRASS/gidbase/custom /GRASS/gidbase/customDir /GRASS/lastDirectOutputDir /GRASS/lastGisdbase /GRASS/lastLocation /GRASS/lastMapset /GRASS/modules/config/custom /GRASS/modules/config/customDir /GRASS/modules/debug /GRASS/newMapsetWizard/openMapset /GRASS/region/color /GRASS/region/on /GRASS/region/width /GRASS/showTopoLayers /GRASS/windows/tools/geometry groupBoxCustom help/helpSearchPath /HelpViewer/geometry /HistogramWidget/showMean /HistogramWidget/showStdev host iconSize /IconSize ignoreAxisOrientation ignoreGetFeatureInfoURI ignoreGetMapURI invertAxisOrientation lastColorMapDir locale locale/overrideFlag locale/userLocale /Map/highlight/buffer /Map/highlight/color /Map/highlight/colorAlpha /Map/highlight/minWidth /Map/identifyMode /Map/logCanvasRefreshEvent Map/scales /Map/searchRadiusMM /MSSQL/connections/selected /ogr/connections/selectedtype /osm/lastDir password path /Plugin-GeoReferencer/lastcompression /Plugin-GeoReferencer/lastPDFReportDir /Plugin-GeoReferencer/lastresampling /Plugin-GeoReferencer/lasttransformation /Plugin-GeoReferencer/loadinqgis /Plugin-GeoReferencer/targetsrs /Plugin-GeoReferencer/TransformSettingsWindow/geometry /Plugin-Georeferencer/user_specified_resolution /Plugin-GeoReferencer/user_specified_resx /Plugin-GeoReferencer/user_specified_resy /Plugin-Georeferencer/word_file_checkbox /Plugin-GeoReferencer/zeroastrans /Plugin-GPS/devicelist /Plugin-GPS/geometry /Plugin-GPS/gpsbabelpath /Plugin-GPS/gpxdirectory /Plugin-GPS/importdirectory /Plugin-GPS/lastdldevice /Plugin-GPS/lastdlport /Plugin-GPS/lastImportFilter /Plugin-GPS/lastTab /Plugin-GPS/lastuldevice /Plugin-GPS/lastulport Plugin-OfflineEditing/geometry Plugin-OfflineEditing/offline_data_path plugins/searchPathsForPlugins port /PostgreSQL/connections/selected previewImage /Projections/defaultBehavior /Projections/layerDefaultCrs /Projections/otfTransformEnabled /Projections/projectDefaultCrs /Projections/showDatumTransformDialog proxy/proxyEnabled proxy/proxyExcludedUrls proxy/proxyHost proxy/proxyPassword proxy/proxyPort proxy/proxyType proxy/proxyUser pythonConsole/fontfamilytextEditor pythonConsole/fontsizeEditor /qgis/addDb2DC /qgis/addMSSQLDC /qgis/addPostgisDC qgis/askToSaveProjectChanges /qgis/attributeTableBehavior /qgis/attributeTableLastView /qgis/attributeTableRowCache /qgis/attributeTableView /qgis/capitalizeLayerName /qgis/checkVersion /Qgis/connections-wms/selected /qgis/copyFeatureFormat /qgis/copyGeometryAsWKT /qgis/default_canvas_color_blue /qgis/default_canvas_color_green /qgis/default_canvas_color_red /qgis/default_measure_color_blue /qgis/default_measure_color_green /qgis/default_measure_color_red /qgis/default_selection_color_alpha /qgis/default_selection_color_blue /qgis/default_selection_color_green /qgis/default_selection_color_red /qgis/digitizing/default_snap_enabled /qgis/digitizing/default_snap_mode /qgis/digitizing/default_snapping_tolerance /qgis/digitizing/default_snapping_tolerance_unit /qgis/digitizing/disable_enter_attribute_values_dialog /qgis/digitizing/fill_color_alpha /qgis/digitizing/fill_color_blue
[Qgis-developer] Housekeeping in the (Qgs)Settings
Hi, the current keys naming for the settings is not very consistent, what do you guys think about cleaning it a bit? I was thinking at: 1. adding an 'app' section to QgsSettings::Section enum, to store namespaced settings for the application 2. remove the '/' at the beginning of the keys (it's completely unuseful) 3. enforce namespacing with the use of Sections on all keys used in the '/src/*' folders This is a quick grep|sort|uniq of the setting keys: allowGeometrylessTables /BetterAttributeTable/geometry /browser/favourites /browser/hiddenPaths cache/directory cache/size /colors/palettecolors /colors/palettelabels /colors/recent /ColorWidgets/textWidgetFormat /Composer/defaultFont /Composer/defaultSnapGridOffsetX /Composer/defaultSnapGridOffsetY /Composer/defaultSnapGridResolution /Composer/defaultSnapTolerancePixels /Composer/geometry composer/searchPathsForTemplates /ComposerUI/state CptCity/archiveName CptCity/baseDir crs database /dataitem/directoryHiddenColumns /Db2/connections/selected dboptions dbworkspace Digitizing /digitizing/simplify_tolerance /digitizing/simplify_tolerance_units dpiMode /Error/dialog/detail estimatedMetadata /eVis/browser-geometry /eVis/db-geometry fontFamily /fontFamily fontPointSize /fontPointSize geometryColumnsOnly /gps/lastPort /GradientEditor/plotAlpha /GradientEditor/plotHue /GradientEditor/plotLightness /GradientEditor/plotSaturation /GRASS/browser/import/crsTransform /GRASS/browser/import/external /GRASS/gidbase/custom /GRASS/gidbase/customDir /GRASS/lastDirectOutputDir /GRASS/lastGisdbase /GRASS/lastLocation /GRASS/lastMapset /GRASS/modules/config/custom /GRASS/modules/config/customDir /GRASS/modules/debug /GRASS/newMapsetWizard/openMapset /GRASS/region/color /GRASS/region/on /GRASS/region/width /GRASS/showTopoLayers /GRASS/windows/tools/geometry groupBoxCustom help/helpSearchPath /HelpViewer/geometry /HistogramWidget/showMean /HistogramWidget/showStdev host iconSize /IconSize ignoreAxisOrientation ignoreGetFeatureInfoURI ignoreGetMapURI invertAxisOrientation lastColorMapDir locale locale/overrideFlag locale/userLocale /Map/highlight/buffer /Map/highlight/color /Map/highlight/colorAlpha /Map/highlight/minWidth /Map/identifyMode /Map/logCanvasRefreshEvent Map/scales /Map/searchRadiusMM /MSSQL/connections/selected /ogr/connections/selectedtype /osm/lastDir password path /Plugin-GeoReferencer/lastcompression /Plugin-GeoReferencer/lastPDFReportDir /Plugin-GeoReferencer/lastresampling /Plugin-GeoReferencer/lasttransformation /Plugin-GeoReferencer/loadinqgis /Plugin-GeoReferencer/targetsrs /Plugin-GeoReferencer/TransformSettingsWindow/geometry /Plugin-Georeferencer/user_specified_resolution /Plugin-GeoReferencer/user_specified_resx /Plugin-GeoReferencer/user_specified_resy /Plugin-Georeferencer/word_file_checkbox /Plugin-GeoReferencer/zeroastrans /Plugin-GPS/devicelist /Plugin-GPS/geometry /Plugin-GPS/gpsbabelpath /Plugin-GPS/gpxdirectory /Plugin-GPS/importdirectory /Plugin-GPS/lastdldevice /Plugin-GPS/lastdlport /Plugin-GPS/lastImportFilter /Plugin-GPS/lastTab /Plugin-GPS/lastuldevice /Plugin-GPS/lastulport Plugin-OfflineEditing/geometry Plugin-OfflineEditing/offline_data_path plugins/searchPathsForPlugins port /PostgreSQL/connections/selected previewImage /Projections/defaultBehavior /Projections/layerDefaultCrs /Projections/otfTransformEnabled /Projections/projectDefaultCrs /Projections/showDatumTransformDialog proxy/proxyEnabled proxy/proxyExcludedUrls proxy/proxyHost proxy/proxyPassword proxy/proxyPort proxy/proxyType proxy/proxyUser pythonConsole/fontfamilytextEditor pythonConsole/fontsizeEditor /qgis/addDb2DC /qgis/addMSSQLDC /qgis/addPostgisDC qgis/askToSaveProjectChanges /qgis/attributeTableBehavior /qgis/attributeTableLastView /qgis/attributeTableRowCache /qgis/attributeTableView /qgis/capitalizeLayerName /qgis/checkVersion /Qgis/connections-wms/selected /qgis/copyFeatureFormat /qgis/copyGeometryAsWKT /qgis/default_canvas_color_blue /qgis/default_canvas_color_green /qgis/default_canvas_color_red /qgis/default_measure_color_blue /qgis/default_measure_color_green /qgis/default_measure_color_red /qgis/default_selection_color_alpha /qgis/default_selection_color_blue /qgis/default_selection_color_green /qgis/default_selection_color_red /qgis/digitizing/default_snap_enabled /qgis/digitizing/default_snap_mode /qgis/digitizing/default_snapping_tolerance /qgis/digitizing/default_snapping_tolerance_unit /qgis/digitizing/disable_enter_attribute_values_dialog /qgis/digitizing/fill_color_alpha /qgis/digitizing/fill_color_blue /qgis/digitizing/fill_color_green /qgis/digitizing/fill_color_red /qgis/digitizing/line_color_alpha /qgis/digitizing/line_color_alpha_scale /qgis/digitizing/line_color_blue /qgis/digitizing/line_color_green /qgis/digitizing/line_color_red /qgis/digitizing/line_ghost /qgis/digitizing/line_width /qgis/digitizing/marker_only_for_selected /qgis/digitizing/marker_size /qgis/digitizing/marker_style /qgis/digitizing/reuseLastValues