Repository navigation
feat(mobile): a phone's build runs no other programs, and says so where GDAL, DuckDB and GeoLibre would appear (#1902) #2018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,10 +107,18 @@ pub fn usable() -> bool { | |
| } | ||
|
|
||
| fn missing() -> DataError { | ||
| DataError::Unsupported( | ||
| DataError::Unsupported(missing_text(crate::no_programs_here())) | ||
| } | ||
|
|
||
| /// Why a format read through GDAL can't be read: GDAL isn't installed, or (`here` names it) this | ||
| /// build runs no programs, where installing it wouldn't help. | ||
| fn missing_text(here: &str) -> String { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, grouped with the other quality points: Left for the release quality pass.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Left for the release quality pass. |
||
| if here.is_empty() { | ||
| "this format needs GDAL: install it (ogr2ogr and ogrinfo on the PATH, or RUSTGIS_GDAL_BIN naming their folder) and add the file again" | ||
| .into(), | ||
| ) | ||
| .into() | ||
| } else { | ||
| format!("this format is read through GDAL, a program {here} can't run: convert the file to a GeoPackage on a computer and add that") | ||
| } | ||
| } | ||
|
|
||
| /// Where converted layers are kept: the platform's cache folder, or `RUSTGIS_GDAL_CACHE`. | ||
|
|
@@ -606,6 +614,15 @@ mod tests { | |
| use super::*; | ||
| use crate::GeometryType; | ||
|
|
||
| #[test] | ||
| fn where_programs_cant_run_the_message_says_so_instead_of_asking_for_an_install() { | ||
| assert!(missing_text("").contains("install it")); | ||
| let phone = missing_text("a phone"); | ||
| assert!(phone.contains("a phone can't run") && !phone.contains("install"), "{phone}"); | ||
| // Where programs run, the build reports none missing for that reason. | ||
| assert_eq!(crate::RUNS_PROGRAMS, crate::no_programs_here().is_empty()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn names() { | ||
| assert!( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.