Opened 9 years ago
Closed 9 years ago
#12369 closed enhancement (fixed)
[patch] default extension for saving files read from preferences
Reported by: | kolesar | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.02 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
Sometimes disk is almost full and I'm unable to save a huge dataset to a compressed .osm file. Of course I have to upgrade my disk to a larger one but that will be full again with uncompressed data. XML data compresses well, gzip does not take noticeable CPU time. Therefore I store my edits and traces compressed by gzip.
I have to type .osm.gz or gpx.gz extension into save dialog every time. This patch allows to set default extension at preferences:
save.extension.osm save.extension.gpx
Default values are "osm" and "gpx", default compression can be set by changing them to "osm.gz" and "gpx.gz".
Note: osm and gpx file filters are different. There are three rows for osm (uncompressed, gzip and bzip2) and a single line for gpx (that has compressed variants). I did not modify this but note that they need unification.
I did not create user interface for these settings because there was no appropriate page for them in the preferences dialog. I have a recent lesson from ticket #12357 to not blow core with functions. These settings are hidden enough.
Attachments (3)
Change History (11)
by , 9 years ago
Attachment: | DefaultExtensionReadFromPreferences.patch added |
---|
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 9 years ago
Thanks! The disadvantage of Einstein preferences is that only few people discover them. So we use it mainly in place of a hardcoded constant (as you did) or to offer continued support for a deprecated feature (i.e. make it hard to find on purpose).
comment:3 by , 9 years ago
Milestone: | → 16.02 |
---|
comment:5 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Moved reading preferences from save action to construct. See #12454 that loads default values to Einstein preferences list before they were read by the action.
by , 9 years ago
Attachment: | SaveExtensionOsmPreferences.patch added |
---|
comment:7 by , 9 years ago
I have added a condition check to SaveActionBase
for a situation that was handled before: create a new layer, draw something, set Swing file chooser, save layer, choose GeoJSON filter at the bottom of file chooser, give a name without extension. Tested version saves as GeoJSON with .geojson extension, versions that set custom extension for OSM layer save this file as OSM with given extension.
This case did not appear on native file chooser or when extension was given. Old versions worked because they did not supply an extension for saving OSM layer.
Attached fix that checks if default extension matches the selected file filter. If not, then uses the default extension of selected file filter. Please commit this patch together with SaveExtensionOsmPreferences.patch submitted a few days ago.
by , 9 years ago
Attachment: | SaveExtensionCheckFileFilter.patch added |
---|
In 9461/josm: