[frameworks/kservice] src: Deprecate KSycoca::setupTestMenu

Nicolas Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 40832fc64c52ab911432f6e3fbe8fda8a8873fe9 by Nicolas Fella, on behalf of Albert Astals Cid.
Committed on 07/08/2026 at 11:42.
Pushed by nicolasfella into branch 'master'.

Deprecate KSycoca::setupTestMenu

It's only used in kio, so we can have the code in kio

M  +1    -1    src/CMakeLists.txt
M  +2    -0    src/sycoca/ksycoca.cpp
M  +5    -0    src/sycoca/ksycoca.h

https://invent.kde.org/frameworks/kservice/-/commit/40832fc64c52ab911432f6e3fbe8fda8a8873fe9

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5820444d..3b3f64fd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -60,7 +60,7 @@ ecm_generate_export_header(KF6Service
     VERSION ${KF_VERSION}
     USE_VERSION_HEADER
     DEPRECATED_BASE_VERSION 0
-    DEPRECATION_VERSIONS 5.90
+    DEPRECATION_VERSIONS 5.90 6.29
     EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
 )
 
diff --git a/src/sycoca/ksycoca.cpp b/src/sycoca/ksycoca.cpp
index 06c5d9b0..44990364 100644
--- a/src/sycoca/ksycoca.cpp
+++ b/src/sycoca/ksycoca.cpp
@@ -801,6 +801,7 @@ void KSycoca::ensureCacheValid()
     d->closeDatabase();
 }
 
+#if KSERVICE_BUILD_DEPRECATED_SINCE(6, 29)
 void KSycoca::setupTestMenu()
 {
     const QByteArray content = R"(<?xml version="1.0"?>
@@ -827,5 +828,6 @@ void KSycoca::setupTestMenu()
     output.open(QIODevice::ReadWrite | QIODevice::Truncate);
     output.write(content);
 }
+#endif
 
 #include "moc_ksycoca.cpp"
diff --git a/src/sycoca/ksycoca.h b/src/sycoca/ksycoca.h
index 67ed4ce4..05565b6b 100644
--- a/src/sycoca/ksycoca.h
+++ b/src/sycoca/ksycoca.h
@@ -152,6 +152,7 @@ public:
      */
     void ensureCacheValid(); // Warning for kservice code: this can delete all the factories.
 
+#if KSERVICE_ENABLE_DEPRECATED_SINCE(6, 29)
     /*!
      * Sets up a minimal applications.menu file in the appropriate location.
      *
@@ -159,9 +160,13 @@ public:
      *
      * You should call QStandardPaths::setTestModeEnabled(true) before calling this.
      *
+     * \deprecated[6.29] Unused
+     *
      * \since 6.0
      */
+    KSERVICE_DEPRECATED_VERSION(6, 29, "Unused")
     static void setupTestMenu();
+#endif
 
     /*!
      * Connect to this to get notified when the database changes.
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.