From 0ba41238c2b959dd2219fc00ef2636c5be762dc9 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Sat, 7 Mar 2026 23:01:09 +0900
Subject: Remove use of KDE_IS_VERSION

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 kmag/kmag.cpp     |  16 -------
 kmouth/speech.cpp | 130 +-----------------------------------------------------
 2 files changed, 1 insertion(+), 145 deletions(-)

diff --git a/kmag/kmag.cpp b/kmag/kmag.cpp
index 1abc1c1..20eca71 100644
--- a/kmag/kmag.cpp
+++ b/kmag/kmag.cpp
@@ -63,12 +63,6 @@
 #include "kmagselrect.h"
 
 
-#ifdef KDE_IS_VERSION
-#if KDE_IS_VERSION(3,2,90)
-   #define havesetCheckedState
-#endif
-#endif
-
 KmagApp::KmagApp(TQWidget* , const char* name)
   : TDEMainWindow(0, name, WStyle_MinMax | WType_TopLevel | WStyle_StaysOnTop | WDestructiveClose | WStyle_ContextHelp),
     m_defaultMouseCursorType(2)
@@ -150,24 +144,16 @@ void KmagApp::initActions()
 
   m_pShowMenu = new TDEToggleAction(i18n("Show &Menu"), "showmenu", CTRL+Key_M, this,
                             TQ_SLOT(slotShowMenu()), actionCollection(),"show_menu");
-  #ifdef havesetCheckedState
   m_pShowMenu->setCheckedState(i18n("Hide &Menu"));
-  #endif
   m_pShowMainToolBar = new TDEToggleAction(i18n("Show Main &Toolbar"), 0, 0, this,
                             TQ_SLOT(slotShowMainToolBar()), actionCollection(),"show_mainToolBar");
-  #ifdef havesetCheckedState
   m_pShowMainToolBar->setCheckedState(i18n("Hide Main &Toolbar"));
-  #endif
   m_pShowViewToolBar = new TDEToggleAction(i18n("Show &View Toolbar"), 0, 0, this,
                             TQ_SLOT(slotShowViewToolBar()), actionCollection(),"show_viewToolBar");
-  #ifdef havesetCheckedState
   m_pShowViewToolBar->setCheckedState(i18n("Hide &View Toolbar"));
-  #endif
   m_pShowSettingsToolBar = new TDEToggleAction(i18n("Show &Settings Toolbar"), 0, 0, this,
                             TQ_SLOT(slotShowSettingsToolBar()), actionCollection(),"show_settingsToolBar");
-  #ifdef havesetCheckedState
   m_pShowSettingsToolBar->setCheckedState(i18n("Hide &Settings Toolbar"));
-  #endif
 
   m_modeFollowMouse = new TDERadioAction(i18n("&Follow Mouse Mode"), "followmouse", Key_F1, this,
                             TQ_SLOT(slotModeFollowMouse()), actionCollection(), "mode_followmouse");
@@ -201,9 +187,7 @@ void KmagApp::initActions()
 
   m_hideCursor = new TDEToggleAction(i18n("Hide Mouse &Cursor"), "hidemouse", Key_F4, this,
                             TQ_SLOT(slotToggleHideCursor()), actionCollection(), "hidecursor");
-  #ifdef havesetCheckedState
   m_hideCursor->setCheckedState(i18n("Show Mouse &Cursor"));
-  #endif
   m_hideCursor->setToolTip(i18n("Hide the mouse cursor"));
 
   m_pZoomIn = KStdAction::zoomIn(this, TQ_SLOT(zoomIn()), actionCollection(), "zoom_in");
diff --git a/kmouth/speech.cpp b/kmouth/speech.cpp
index ad80946..95b4db7 100644
--- a/kmouth/speech.cpp
+++ b/kmouth/speech.cpp
@@ -24,14 +24,7 @@
 #include <tqtextcodec.h>
 #include <tqfile.h>
 #include <kdebug.h>
-
-#include <tdeversion.h>
-#ifdef KDE_IS_VERSION
-#if KDE_IS_VERSION(3,2,0)
-   #define macroExpander
-   #include <kmacroexpander.h>
-#endif
-#endif
+#include <kmacroexpander.h>
 
 Speech::Speech() {
 }
@@ -41,132 +34,11 @@ Speech::~Speech() {
 
 TQString Speech::prepareCommand (TQString command, const TQString &text,
                           const TQString &filename, const TQString &language) {
-#ifdef macroExpander
    TQMap<TQChar,TQString> map;
    map['t'] = text;
    map['f'] = filename;
    map['l'] = language;
    return KMacroExpander::expandMacrosShellQuote (command, map);
-#else
-   TQValueStack<bool> stack;  // saved isdoublequote values during parsing of braces
-   bool issinglequote=false; // inside '...' ?
-   bool isdoublequote=false; // inside "..." ?
-   int noreplace=0; // nested braces when within ${...}
-   TQString escText = KShellProcess::quote(text);
-
-   // character sequences that change the state or need to be otherwise processed
-   TQRegExp re_singlequote("('|%%|%t|%f|%l)");
-   TQRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l)");
-   TQRegExp re_noquote  ("('|\"|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l)");
-
-   // parse the command:
-   for (int i = re_noquote.search(command);
-        i != -1;
-        i = (issinglequote?re_singlequote.search(command,i)
-            :isdoublequote?re_doublequote.search(command,i)
-            :re_noquote.search(command,i))
-       )
-      // while there are character sequences that need to be processed
-   {
-      if ((command[i]=='(') || (command[i]=='{')) { // (...) or {...}
-         // assert(isdoublequote == false)
-         stack.push(isdoublequote);
-         if (noreplace > 0)
-            // count nested braces when within ${...}
-            noreplace++;
-         i++;
-      }
-      else if (command[i]=='$') { // $(...) or ${...}
-         stack.push(isdoublequote);
-         isdoublequote = false;
-         if ((noreplace > 0) || (command[i+1]=='{'))
-            // count nested braces when within ${...}
-            noreplace++;
-         i+=2;
-      }
-      else if ((command[i]==')') || (command[i]=='}')) {
-         // $(...) or (...) or ${...} or {...}
-         if (!stack.isEmpty())
-            isdoublequote = stack.pop();
-         else
-            tqWarning("Parse error.");
-         if (noreplace > 0)
-            // count nested braces when within ${...}
-            noreplace--;
-         i++;
-      }
-      else if (command[i]=='\'') {
-         issinglequote=!issinglequote;
-         i++;
-      }
-      else if (command[i]=='"') {
-         isdoublequote=!isdoublequote;
-         i++;
-      }
-      else if (command[i]=='\\')
-         i+=2;
-      else if (command[i]=='`') {
-         // Replace all `...` with safer $(...)
-         command.replace (i, 1, "$(");
-         TQRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)");
-         for (int i2=re_backticks.search(command,i+2);
-              i2!=-1;
-              i2=re_backticks.search(command,i2)
-             )
-         {
-            if (command[i2] == '`') {
-               command.replace (i2, 1, ")");
-               i2=command.length(); // leave loop
-            }
-            else {
-               // remove backslash and ignore following character
-               command.remove (i2, 1);
-               i2++;
-            }
-         }
-         // Leave i unchanged! We need to process "$("
-      }
-      else if (noreplace > 0) { // do not replace macros within ${...}
-         if (issinglequote)
-            i+=re_singlequote.matchedLength();
-         else if (isdoublequote)
-            i+=re_doublequote.matchedLength();
-         else
-            i+=re_noquote.matchedLength();
-      }
-      else { // replace macro
-         TQString match, v;
-
-         // get match
-         if (issinglequote)
-            match=re_singlequote.cap();
-         else if (isdoublequote)
-            match=re_doublequote.cap();
-         else
-            match=re_noquote.cap();
-
-         // substitute %variables
-         if (match=="%t")
-            v = escText;
-         else if (match=="%f")
-            v = filename;
-         else if (match=="%%")
-            v = "%";
-         else if (match=="%l")
-            v = language;
-
-         // %variable inside of a quote?
-         if (isdoublequote)
-            v='"'+v+'"';
-         else if (issinglequote)
-            v="'"+v+"'";
-
-         command.replace (i, match.length(), v);
-         i+=v.length();
-      }
-   }
-   return command;
-#endif
 }
 
 void Speech::speak(TQString command, bool stdIn, const TQString &text, const TQString &language, int encoding, TQTextCodec *codec) {
-- 
cgit v1.2.3

