Drop themes by name, or keep only the ones named. The counterpart to
rfp_qgs_theme_set(), and what curating a project's theme list needed
before this existed — the alternative was reaching into an unexported
internal, or QGIS Desktop.
Details
Give exactly one of themes or keep. A name in neither is an error rather
than a silent no-op: theme_rm(p, "Low detail") against a project holding
"Low Detail" would otherwise report success and change nothing.
See also
Other qgs:
rfp_qgs_form_add(),
rfp_qgs_layer_rm(),
rfp_qgs_preview_set(),
rfp_qgs_raster_add(),
rfp_qgs_service_add(),
rfp_qgs_service_rm(),
rfp_qgs_services(),
rfp_qgs_style_export(),
rfp_qgs_style_set(),
rfp_qgs_subset_get(),
rfp_qgs_subset_set(),
rfp_qgs_theme_add(),
rfp_qgs_theme_lookup(),
rfp_qgs_theme_names(),
rfp_qgs_theme_set(),
rfp_qgs_theme_unbury(),
rfp_qgs_themes(),
rfp_qgs_vector_add(),
rfp_qwc_config_create(),
rfp_raster_style_path(),
rfp_raster_styles()
Examples
src <- system.file("templates", "bcrestoration_mobile.qgs", package = "rfp")
p <- file.path(tempdir(), "trimmed.qgs")
file.copy(src, p, overwrite = TRUE)
#> [1] TRUE
rfp_qgs_theme_names(p)
#> [1] "High Detail - Crossings" "Land Tenure"
#> [3] "Low Detail - Bull Trout Model" "Low Detail - Salmon Model"
#> [5] "Low Detail - Steelhead Model"
rfp_qgs_theme_rm(p, keep = "Land Tenure", backup = FALSE)
#> ✔ Removed 4 themes from /tmp/RtmpfSNDuG/trimmed.qgs; 1 remains.
