Bug 513047

Summary: Skanpage doesn't remember scanner options due to unstable naming
Product: [Applications] Skanpage Reporter: Jonas Ryssel <burner+kde>
Component: generalAssignee: Alexander Stippich <a.stippich>
Status: REPORTED ---    
Severity: normal CC: nerumo
Priority: NOR    
Version First Reported In: 25.08.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jonas Ryssel 2025-12-07 14:32:11 UTC
SUMMARY
Skanpage forgets scanner configuration upon power cycling a scanner.

STEPS TO REPRODUCE
1. Plug in a scanner
2. Configure the scanner options in Skanpage
3. Power cycle/unplug and replug the scanner
4. Reselect scanner in Skanpage (or close and reopen Skanpage)

OBSERVED RESULT
The scanner options have been reset.

EXPECTED RESULT
The scanner options should be preserved.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1

ADDITIONAL INFORMATION
By looking in `~/.local/state/skanpagestaterc` I've noticed that ID the settings are saved under is based on the USB device id. In my case that is `avision:libusb:005:011`.
Every time I power cycle/replug the scanner, its USB device ID increments by one, why I currently have a lot of configured devices named
[Options For avision:libusb:005:007]
[Options For avision:libusb:005:008]
[Options For avision:libusb:005:010]
[Options For avision:libusb:005:011]
[Options For avision:libusb:005:051]
all for the same scanner.

Looking at
https://invent.kde.org/utilities/skanpage/-/blob/master/src/Skanpage.cpp
i found that `void Skanpage::saveScannerOptions()` and `void Skanpage::loadScannerOptions()` uses `d->m_ksaneInterface.deviceName()` to determine the device name, but it should probably use `d->m_deviceVendor()` and `d->m_deviceModel()` instead.