Import a QGIS style with its reads made on a thread

Open
#2,620 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
desktop

Research direction

Start in cmd/reads.rs: read reads::prepare and reads::ahead and follow one existing arm (e.g. Add Data or Reload Data) end to end to see how pre-read data is handed to the command. Then find the style.importQgis command and its .qml and image-marker reads, and mirror that pattern with a new arm; leave project.importQgis alone since it runs other commands. Done means the import reads happen off the command thread, so the import offers Cancel and progress like the other commands, with existing import tests still passing.

Written by the indexing model from the issue text.

Description

style.importQgis reads its .qml file on the command's thread, and since #2612 it also reads its raster image markers' images there: up to 64 MiB, each file decoded once to check it. The work is bounded, but a slow disk or network share can hold the window, with no Cancel.

cmd/reads.rs already makes the reads of Add Data, Reload Data, Convert To Annotation and others on a thread before the command lands (reads::ahead). Proposal: a style.importQgis arm in reads::prepare that reads the style and its images there and hands them to the command, so the import gets Cancel and progress like those commands. project.importQgis is a separate case, because it runs other commands as it goes. Raised in review of #2612.

Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
11h 1m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.