[libraries/ksanecore] src: Extend pixma polling naughty list to include USB backends

Roman Vasilev <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 6be7437e64e78dadbe62727647f27c4772bd5b96 by Roman Vasilev, on behalf of Roman Vasilev.
Committed on 27/07/2026 at 09:50.
Pushed by sars into branch 'master'.

Extend pixma polling naughty list to include USB backends

The performance naughty list already blocked option polling for pixma
network backends (matching IP-like device names), but USB pixma
scanners like the CanoScan LiDE 300 suffer from exactly the same issue:
each poll of a SOFT_DETECT option blocks for ~1 second, turning the UI
into a slideshow.

Changed the regex from matching only IP-address patterns to matching
any pixma backend ("^pixma"), which covers both network and USB
devices. The pixma backend family shares a single codebase and the
1-second-per-poll behavior is consistent across all connection types.

Tested with CanoScan LiDE 300 (pixma:04A91913_5463B1) — skanlite UI
is noticeably snappier with polling disabled.

M  +7    -6    src/interface_p.cpp

https://invent.kde.org/libraries/ksanecore/-/commit/6be7437e64e78dadbe62727647f27c4772bd5b96

diff --git a/src/interface_p.cpp b/src/interface_p.cpp
index 9beadc1..a7adc84 100644
--- a/src/interface_p.cpp
+++ b/src/interface_p.cpp
@@ -220,13 +220,14 @@ Interface::OpenStatus InterfacePrivate::loadDeviceOptions()
     m_externalOptionsList.append(new InternalOption(invertOption));
     m_optionsLocation.insert(Interface::InvertColorOption, m_optionsList.size() - 1);
 
-    // NOTICE The Pixma network backend behaves badly. polling a value will result in 1 second
-    // sleeps for every poll. The problem has been reported, but no easy/quick fix was available and
-    // the bug has been there for multiple years. Since this destroys the usability of the backend totally,
-    // we simply put the backend on the naughty list and disable the option polling.
-    static QRegularExpression pixmaNetworkBackend(QStringLiteral("pixma.*\\d+\\.\\d+\\.\\d+\\.\\d+"));
+    // NOTICE The Pixma backend (USB and network) behaves badly. polling a value will
+    // result in 1 second sleeps for every poll. The problem has been reported, but no
+    // easy/quick fix was available and the bug has been there for multiple years. Since
+    // this destroys the usability of the backend totally, we simply put the backend on
+    // the naughty list and disable the option polling.
+    static QRegularExpression pixmaBackend(QStringLiteral("^pixma"));
     m_optionPollingNaughtylisted = false;
-    if (pixmaNetworkBackend.match(m_devName).hasMatch()) {
+    if (pixmaBackend.match(m_devName).hasMatch()) {
         m_optionPollingNaughtylisted = true;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.