[office/tellico/4.2] src: Don't expose Raw queries to user

Robby Stephenson <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 6bb7173c634b6c2f583440c2a7a0981a084f0a1d by Robby Stephenson.
Committed on 01/08/2026 at 15:44.
Pushed by rstephenson into branch '4.2'.

Don't expose Raw queries to user

Raw queries are meant to be used for updates when a more complex query
can be built from existing data

M  +1    -1    src/fetch/amazonfetcher.h
M  +1    -1    src/fetch/bedethequefetcher.cpp
M  +1    -1    src/fetch/entrezfetcher.cpp
M  +1    -1    src/fetch/ibsfetcher.cpp
M  +1    -2    src/fetch/imdbfetcher.cpp
M  +1    -1    src/fetch/springerfetcher.cpp
M  +0    -1    src/fetch/srufetcher.cpp
M  +1    -1    src/fetch/z3950fetcher.cpp
M  +1    -0    src/tests/fetchertest.cpp

https://invent.kde.org/office/tellico/-/commit/6bb7173c634b6c2f583440c2a7a0981a084f0a1d

diff --git a/src/fetch/amazonfetcher.h b/src/fetch/amazonfetcher.h
index 4e52e88b0..41c950bca 100644
--- a/src/fetch/amazonfetcher.h
+++ b/src/fetch/amazonfetcher.h
@@ -70,7 +70,7 @@ public:
   virtual QString attribution() const override;
   virtual bool isSearching() const override { return m_started; }
   virtual void continueSearch() override;
-  // amazon can search title, person, isbn, or keyword. No Raw for now.
+  // amazon can search title, person, isbn, or keyword
   virtual bool canSearch(FetchKey k) const override;
   virtual void stop() override;
   virtual Data::EntryPtr fetchEntryHook(uint uid) override;
diff --git a/src/fetch/bedethequefetcher.cpp b/src/fetch/bedethequefetcher.cpp
index 6e94619d5..709f976be 100644
--- a/src/fetch/bedethequefetcher.cpp
+++ b/src/fetch/bedethequefetcher.cpp
@@ -71,7 +71,7 @@ bool BedethequeFetcher::canFetch(int type) const {
   return type == Data::Collection::ComicBook;
 }
 
-// No UPC or Raw for now.
+// No UPC for now
 bool BedethequeFetcher::canSearch(Fetch::FetchKey k) const {
   return k == Title || k == Keyword || k == ISBN;
 }
diff --git a/src/fetch/entrezfetcher.cpp b/src/fetch/entrezfetcher.cpp
index b4bf9484a..88d17d02e 100644
--- a/src/fetch/entrezfetcher.cpp
+++ b/src/fetch/entrezfetcher.cpp
@@ -77,7 +77,7 @@ QString EntrezFetcher::source() const {
 }
 
 bool EntrezFetcher::canSearch(Fetch::FetchKey k) const {
-  return k == Title || k == Person || k == Keyword || k == Raw || k == PubmedID || k == DOI;
+  return k == Title || k == Person || k == Keyword || k == PubmedID || k == DOI;
 }
 
 bool EntrezFetcher::canFetch(int type) const {
diff --git a/src/fetch/ibsfetcher.cpp b/src/fetch/ibsfetcher.cpp
index 4034bcaa6..20c5da63a 100644
--- a/src/fetch/ibsfetcher.cpp
+++ b/src/fetch/ibsfetcher.cpp
@@ -70,7 +70,7 @@ bool IBSFetcher::canFetch(int type) const {
   return type == Data::Collection::Book || type == Data::Collection::Bibtex;
 }
 
-// No UPC or Raw for now.
+// No UPC for now
 bool IBSFetcher::canSearch(Fetch::FetchKey k) const {
   return k == Title || k == Person || k == ISBN;
 }
diff --git a/src/fetch/imdbfetcher.cpp b/src/fetch/imdbfetcher.cpp
index 570783d2d..cb1254d59 100644
--- a/src/fetch/imdbfetcher.cpp
+++ b/src/fetch/imdbfetcher.cpp
@@ -79,8 +79,7 @@ bool IMDBFetcher::canFetch(int type) const {
 
 // imdb can search title only
 bool IMDBFetcher::canSearch(Fetch::FetchKey k) const {
-  // Raw searches are intended to be the imdb url
-  return k == Title || k == Raw;
+  return k == Title;
 }
 
 void IMDBFetcher::readConfigHook(const KConfigGroup& config_) {
diff --git a/src/fetch/springerfetcher.cpp b/src/fetch/springerfetcher.cpp
index f6e4db4d8..aafbb1990 100644
--- a/src/fetch/springerfetcher.cpp
+++ b/src/fetch/springerfetcher.cpp
@@ -64,7 +64,7 @@ QString SpringerFetcher::attribution() const {
 }
 
 bool SpringerFetcher::canSearch(Fetch::FetchKey k) const  {
-  return k == Title || k == Person || k == Keyword || k == ISBN || k == DOI || k == Raw;
+  return k == Title || k == Person || k == Keyword || k == ISBN || k == DOI;
 }
 
 bool SpringerFetcher::canFetch(int type) const {
diff --git a/src/fetch/srufetcher.cpp b/src/fetch/srufetcher.cpp
index 17d6824e0..f53072fac 100644
--- a/src/fetch/srufetcher.cpp
+++ b/src/fetch/srufetcher.cpp
@@ -88,7 +88,6 @@ QString SRUFetcher::source() const {
   return m_name.isEmpty() ? defaultName() : m_name;
 }
 
-// No Raw for now.
 bool SRUFetcher::canSearch(Fetch::FetchKey k) const {
   return k == Title || k == Person || k == ISBN || k == Keyword || k == LCCN;
 }
diff --git a/src/fetch/z3950fetcher.cpp b/src/fetch/z3950fetcher.cpp
index 568813919..d92b7ad9d 100644
--- a/src/fetch/z3950fetcher.cpp
+++ b/src/fetch/z3950fetcher.cpp
@@ -131,7 +131,7 @@ QString Z3950Fetcher::source() const {
   return m_name.isEmpty() ? defaultName() : m_name;
 }
 
-// No UPC or Raw for now.
+// No UPC for now
 bool Z3950Fetcher::canSearch(Fetch::FetchKey k) const {
   return k == Title || k == Person || k == ISBN || k == Keyword || k == LCCN;
 }
diff --git a/src/tests/fetchertest.cpp b/src/tests/fetchertest.cpp
index 7bf65dd20..1866138d7 100644
--- a/src/tests/fetchertest.cpp
+++ b/src/tests/fetchertest.cpp
@@ -59,6 +59,7 @@ void FetcherTest::testType() {
     QVERIFY(!f->isSearching());
     QVERIFY(!f->hasMoreResults());
     QVERIFY(!f->canFetch(Tellico::Fetch::FetchLast)); // invalid
+    QVERIFY(!f->canSearch(Tellico::Fetch::Raw)); // don't expose Raw to user
 
     Tellico::Data::Collection::Type cType = Tellico::Data::Collection::Base;
     // BoardGame is the last collection type (currently)
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.