From 61a0a06deae49bb08a672f31596434fa3324bf28 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Tue, 17 Mar 2026 17:34:11 +0900
Subject: Remove use of TDE_VERSION

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 src/kqalculate.cpp                        |  86 +++++-------------------
 src/main.cpp                              |  10 ---
 src/qalculateeditdatasetdialog.cpp        |  25 -------
 src/qalculateeditfunctiondialog.cpp       |  21 ------
 src/qalculateexpressionedit.cpp           |  48 --------------
 src/qalculateinsertfunctiondialog.cpp     |  10 ---
 src/qalculateinsertmatrixvectordialog.cpp |  15 -----
 src/qalculateplotdialog.cpp               |   9 ---
 src/qalculateprecisiondialog.cpp          |   5 --
 src/qalculatepreferencesdialog.cpp        | 107 ------------------------------
 10 files changed, 16 insertions(+), 320 deletions(-)

diff --git a/src/kqalculate.cpp b/src/kqalculate.cpp
index 87dbc6e..2df06ab 100644
--- a/src/kqalculate.cpp
+++ b/src/kqalculate.cpp
@@ -103,12 +103,8 @@
 #include <tqstringlist.h>
 #include <tqcombobox.h>
 #include <ksystemtray.h>
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR > 1
 #include <tdeactionclasses.h>
-#endif
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 4
 #include <tdeaccelmanager.h>
-#endif
 #include <tqbuttongroup.h>
 #include <tqvbuttongroup.h>
 #include <tqradiobutton.h>
@@ -117,10 +113,7 @@
 #include <tqimage.h>
 #include <tdeaccel.h>
 #include <tdeio/netaccess.h>
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 2
 #include <kinputdialog.h>
-#endif
-#include <tdeversion.h>
 #include <tqstyle.h>
 #include <tdeglobalaccel.h>
 #include <kkeydialog.h>
@@ -190,23 +183,6 @@ const MathStructure *KQalculate::getResultPart(int i) {
 	return &result_parts[(size_t) i - 1];
 }
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <kiconloader.h>
-#include <tdeconfig.h>
-TQPixmap loadSystrayIcon(const TQString &icon) {
-	TDEConfig *appCfg = tdeApp->config();
-	TDEConfigGroupSaver configSaver(appCfg, "System Tray");
-	int iconWidth = appCfg->readNumEntry("systrayIconWidth", 22);
-	return TDEGlobal::instance()->iconLoader()->loadIcon(icon, TDEIcon::Panel, iconWidth);
-}
-#endif
-
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 3
-#define ICON_SIZE_SMALL_MEDIUM		TDEIcon::SizeSmallMedium
-#else
-#define ICON_SIZE_SMALL_MEDIUM		22
-#endif
-
 ModeObject::ModeObject(int mode) : i_mode(mode) {}
 void ModeObject::loadMode() {
 	mainWin->loadMode(i_mode);
@@ -285,7 +261,7 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 
 	if(use_button_pixmaps) leftButtonsLayout = new TQVBoxLayout(0, 0, 3);
 	else leftButtonsLayout = new TQVBoxLayout(0, 0, 6);
-	if(use_button_pixmaps) executeButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("application-x-executable", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", centralWidget());
+	if(use_button_pixmaps) executeButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("application-x-executable", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", centralWidget());
 	else if(rpn_mode) executeButton = new QalculateButton(i18n("Enter"), centralWidget());
 	else executeButton = new QalculateButton(i18n("="), centralWidget());
 	executeButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
@@ -295,12 +271,12 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 	leftButtonsSeparator = new KSeparator(TQt::Horizontal, centralWidget());
 	leftButtonsLayout->addWidget(leftButtonsSeparator);
 	if(use_button_pixmaps) leftButtonsSeparator->hide();
-	if(use_button_pixmaps) storeButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("document-save-as", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", centralWidget());
+	if(use_button_pixmaps) storeButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("document-save-as", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", centralWidget());
 	else storeButton = new QalculateButton(i18n("Store"), centralWidget());
 	storeButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	TQToolTip::add(storeButton, i18n("Store result as variable"));
 	leftButtonsLayout->addWidget(storeButton);
-	if(use_button_pixmaps) convertButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("qalculate_convert", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", centralWidget());
+	if(use_button_pixmaps) convertButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("qalculate_convert", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", centralWidget());
 	else convertButton = new QalculateButton(i18n("Convert"), centralWidget());
 	convertButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	TQToolTip::add(convertButton, i18n("Convert units in result"));
@@ -454,12 +430,10 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 	keypadAngleLayout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
 	keypadFunctionsLayout->addMultiCellLayout(keypadAngleLayout, 4, 4, 0, 2);
 	
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 4	
 	TDEAcceleratorManager::setNoAccel(kpDegreesButton);
 	TDEAcceleratorManager::setNoAccel(kpRadiansButton);
 	TDEAcceleratorManager::setNoAccel(kpGradiansButton);
 	TDEAcceleratorManager::setNoAccel(kpNoAngleUnitButton);
-#endif		
 	
 	keypadBottomLayout->addLayout(keypadFunctionsLayout);
 	
@@ -554,27 +528,27 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 	stackPageLayout->addWidget(stackList);
 	if(use_button_pixmaps) stackPageButtonsLayout = new TQVBoxLayout(stackPageLayout, 3);
 	else stackPageButtonsLayout = new TQVBoxLayout(stackPageLayout, 6);
-	if(use_button_pixmaps) registerUpButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("go-up", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", stackPage);
+	if(use_button_pixmaps) registerUpButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("go-up", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", stackPage);
 	else registerUpButton = new QalculateButton(i18n("Up"), stackPage);
 	TQToolTip::add(registerUpButton, i18n("Move selected register up"));
 	registerUpButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	stackPageButtonsLayout->addWidget(registerUpButton);
-	if(use_button_pixmaps) registerDownButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("go-down", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", stackPage);
+	if(use_button_pixmaps) registerDownButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("go-down", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", stackPage);
 	else registerDownButton = new QalculateButton(i18n("Down"), stackPage);
 	TQToolTip::add(registerDownButton, i18n("Move selected register down"));
 	registerDownButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	stackPageButtonsLayout->addWidget(registerDownButton);
-	if(use_button_pixmaps) editRegisterButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("edit", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", stackPage);
+	if(use_button_pixmaps) editRegisterButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("edit", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", stackPage);
 	else editRegisterButton = new QalculateButton(i18n("Edit"), stackPage);
 	TQToolTip::add(editRegisterButton, i18n("Edit value of selected register"));
 	editRegisterButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	stackPageButtonsLayout->addWidget(editRegisterButton);
-	if(use_button_pixmaps) deleteRegisterButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("edit-delete", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", stackPage);
+	if(use_button_pixmaps) deleteRegisterButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("edit-delete", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", stackPage);
 	else deleteRegisterButton = new QalculateButton(i18n("Delete"), stackPage);
 	TQToolTip::add(deleteRegisterButton, i18n("Delete selected register"));
 	deleteRegisterButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
 	stackPageButtonsLayout->addWidget(deleteRegisterButton);
-	if(use_button_pixmaps) clearStackButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("view_remove", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM), "", stackPage);
+	if(use_button_pixmaps) clearStackButton = new QalculateButton(tdeApp->iconLoader()->loadIconSet("view_remove", TDEIcon::Small, TDEIcon::SizeSmallMedium), "", stackPage);
 	else clearStackButton = new QalculateButton(i18n("Clear"), stackPage);
 	TQToolTip::add(clearStackButton, i18n("Clear the RPN stack"));
 	clearStackButton->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed, false);
@@ -957,15 +931,9 @@ void KQalculate::showSystemTrayIcon(bool do_show) {
 	if(do_show && !trayicon) {
 		trayicon = new KSystemTray(this);
 		TQObject::connect(trayicon, TQ_SIGNAL(quitSelected()), tqApp, TQ_SLOT(quit()));
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2	
-		trayicon->setPixmap(loadSystrayIcon(PACKAGE));
-#else
 		trayicon->setPixmap(trayicon->loadIcon(PACKAGE));
-#endif
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 2
 		TDEPopupMenu* traypop = trayicon->contextMenu();
 		ActionHideSystemTrayIcon->plug(traypop, 1);
-#endif
 		TQToolTip::add(trayicon, i18n("Qalculate! - Scientific Calculator"));
 	}
 	if(do_show) {
@@ -3898,11 +3866,7 @@ void KQalculate::execute() {
 bool KQalculate::fetch_exchange_rates(int) {
 	KURL url(CALCULATOR->getExchangeRatesUrl().c_str());
 	TQString filename(CALCULATOR->getExchangeRatesFileName().c_str());
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	if(TDEIO::NetAccess::download(url, filename)) {
-#else
 	if(TDEIO::NetAccess::download(url, filename, this)) {
-#endif
 		return true;
 	} else {
 		TQString errorstr = i18n("Failed to download exchange rates from ECB.");
@@ -4022,23 +3986,13 @@ void KQalculate::showHide() {
 	if(isVisible()) {
 		hide();
 	} else {
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2			
-			KWin::Info info = KWin::info(winId());
-			KWin::setOnDesktop(winId(), KWin::currentDesktop());
-			move(info.geometry.topLeft());
-#else
 			KWin::WindowInfo info = KWin::windowInfo(winId(), (unsigned long) NET::WMGeometry);
 			KWin::setOnDesktop(winId(), KWin::currentDesktop());
 			move(info.geometry().topLeft());
-#endif						
 			setShown(true);
 			show();
 			raise();
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-			KWin::setActiveWindow(winId());
-#else
 			KWin::activateWindow(winId());
-#endif
 	}
 }
 void KQalculate::configureGlobalShortcuts() {
@@ -4821,7 +4775,6 @@ void KQalculate::saveModeAs() {
 	delete dialog;
 }
 void KQalculate::deleteMode() {
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 2
 	bool b_ok = false;
 	TQStringList mode_names;
 	for(size_t i = 2; i < modes.size(); i++) {
@@ -4845,7 +4798,6 @@ void KQalculate::deleteMode() {
 			}
 		}
 	}
-#endif
 }
 void KQalculate::saveMode() {
 	save_mode();
@@ -5896,23 +5848,23 @@ void KQalculate::applyPreferences() {
 		if(use_button_pixmaps) {
 			leftButtonsLayout->setSpacing(3);
 			executeButton->setText("");	
-			executeButton->setIconSet(tdeApp->iconLoader()->loadIconSet("application-x-executable", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			executeButton->setIconSet(tdeApp->iconLoader()->loadIconSet("application-x-executable", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			storeButton->setText("");	
-			storeButton->setIconSet(tdeApp->iconLoader()->loadIconSet("document-save-as", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			storeButton->setIconSet(tdeApp->iconLoader()->loadIconSet("document-save-as", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			convertButton->setText("");	
-			convertButton->setIconSet(tdeApp->iconLoader()->loadIconSet("qalculate_convert", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			convertButton->setIconSet(tdeApp->iconLoader()->loadIconSet("qalculate_convert", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			leftButtonsSeparator->hide();
 			stackPageButtonsLayout->setSpacing(3);
 			registerUpButton->setText("");
-			registerUpButton->setIconSet(tdeApp->iconLoader()->loadIconSet("go-up", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			registerUpButton->setIconSet(tdeApp->iconLoader()->loadIconSet("go-up", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			registerDownButton->setText("");
-			registerDownButton->setIconSet(tdeApp->iconLoader()->loadIconSet("go-down", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			registerDownButton->setIconSet(tdeApp->iconLoader()->loadIconSet("go-down", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			editRegisterButton->setText("");
-			editRegisterButton->setIconSet(tdeApp->iconLoader()->loadIconSet("edit", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			editRegisterButton->setIconSet(tdeApp->iconLoader()->loadIconSet("edit", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			deleteRegisterButton->setText("");
-			deleteRegisterButton->setIconSet(tdeApp->iconLoader()->loadIconSet("edit-delete", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			deleteRegisterButton->setIconSet(tdeApp->iconLoader()->loadIconSet("edit-delete", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 			clearStackButton->setText("");
-			clearStackButton->setIconSet(tdeApp->iconLoader()->loadIconSet("view_remove", TDEIcon::Small, ICON_SIZE_SMALL_MEDIUM));
+			clearStackButton->setIconSet(tdeApp->iconLoader()->loadIconSet("view_remove", TDEIcon::Small, TDEIcon::SizeSmallMedium));
 		} else {
 			leftButtonsLayout->setSpacing(6);
 			if(rpn_mode) executeButton->setText(i18n("Enter"));
@@ -6521,24 +6473,18 @@ void QalculateParseLabel::drawContents(TQPainter *p) {
 QalculateButton::QalculateButton(TQWidget *parent, const char *name) : TQPushButton(parent, name) {
 	setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum));
 	umtcw = true;
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 4	
 	TDEAcceleratorManager::setNoAccel(this);
-#endif
 
 }
 QalculateButton::QalculateButton(const TQString &text, TQWidget *parent, const char *name) : TQPushButton(text, parent, name) {
 	setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum));
 	umtcw = true;
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 4	
 	TDEAcceleratorManager::setNoAccel(this);
-#endif	
 }
 QalculateButton::QalculateButton(const TQIconSet &icon, const TQString &text, TQWidget *parent, const char *name) : TQPushButton(icon, text, parent, name) {
 	setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum));
 	umtcw = true;
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR >= 4	
 	TDEAcceleratorManager::setNoAccel(this);
-#endif	
 }
 QalculateButton::~QalculateButton() {}
 
diff --git a/src/main.cpp b/src/main.cpp
index 9ebaa7d..d844088 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -239,23 +239,13 @@ public:
 			TQString calc_arg = parse_expression_arguments(args);
 			args->clear();
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2			
-			KWin::Info info = KWin::info(mainWin->winId());
-			KWin::setOnDesktop(mainWin->winId(), KWin::currentDesktop());
-			mainWin->move(info.geometry.topLeft());
-#else
 			KWin::WindowInfo info = KWin::windowInfo(mainWin->winId(), (unsigned long) NET::WMGeometry);
 			KWin::setOnDesktop(mainWin->winId(), KWin::currentDesktop());
 			mainWin->move(info.geometry().topLeft());			
-#endif						
 			mainWin->setShown(true);
 			mainWin->show();
 			mainWin->raise();
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-			KWin::setActiveWindow(mainWin->winId());
-#else
 			KWin::activateWindow(mainWin->winId());
-#endif
 
 			if(!calc_arg.isEmpty()) {
 				mainWin->expressionEdit->setText(calc_arg);
diff --git a/src/qalculateeditdatasetdialog.cpp b/src/qalculateeditdatasetdialog.cpp
index aa98420..2b19c8d 100644
--- a/src/qalculateeditdatasetdialog.cpp
+++ b/src/qalculateeditdatasetdialog.cpp
@@ -32,19 +32,10 @@
 #include <tqhbox.h>
 #include <tqcheckbox.h>
 #include <tdemessagebox.h>
-#include <tdeversion.h>
 #include <tqlayout.h>
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-#include <tqtextedit.h>
-#else
 #include <ktextedit.h>
-#endif
 #include <tdelistview.h>
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <tqtabwidget.h>
-#else
 #include <ktabwidget.h>
-#endif
 #include <tqapplication.h>
 #include <kstdguiitem.h>
 
@@ -57,11 +48,7 @@ QalculateEditDataSetDialog::QalculateEditDataSetDialog(TQWidget *parent, const c
 	edited_dataset = NULL;
 	property_edit_dialog = NULL;
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	tabs = new TQTabWidget(this);
-#else
 	tabs = new KTabWidget(this);
-#endif
 	setMainWidget(tabs);
 	TQWidget *page1 = new TQWidget(this);
 	TQWidget *page2 = new TQWidget(this);
@@ -78,19 +65,11 @@ QalculateEditDataSetDialog::QalculateEditDataSetDialog(TQWidget *parent, const c
 	fileEdit = new KLineEdit(page1);
 	grid->addWidget(fileEdit, 1, 1);
 	grid->addWidget(new TQLabel(i18n("Description:"), page1), 2, 0);
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-	descriptionEdit = new TQTextEdit(page1);
-#else	
 	descriptionEdit = new KTextEdit(page1);
-#endif
 	descriptionEdit->setTextFormat(TQTextEdit::PlainText);
 	grid->addMultiCellWidget(descriptionEdit, 3, 3, 0, 1);
 	grid->addWidget(new TQLabel(i18n("Copyright:"), page1), 4, 0);
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-	copyrightEdit = new TQTextEdit(page1);
-#else	
 	copyrightEdit = new KTextEdit(page1);
-#endif
 	copyrightEdit->setTextFormat(TQTextEdit::PlainText);
 	grid->addMultiCellWidget(copyrightEdit, 5, 5, 0, 1);
 
@@ -455,11 +434,7 @@ QalculateEditDataPropertyDialog::QalculateEditDataPropertyDialog(TQWidget *paren
 	titleEdit = new KLineEdit(mainWidget());
 	grid->addWidget(titleEdit, 2, 1);
 	grid->addWidget(new TQLabel(i18n("Description:"), mainWidget()), 3, 0);
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-	descriptionEdit = new TQTextEdit(mainWidget());
-#else	
 	descriptionEdit = new KTextEdit(mainWidget());
-#endif
 	descriptionEdit->setTextFormat(TQTextEdit::PlainText);
 	grid->addMultiCellWidget(descriptionEdit, 4, 4, 0, 1);
 	grid->addWidget(new TQLabel(i18n("Value type:"), mainWidget()), 5, 0);
diff --git a/src/qalculateeditfunctiondialog.cpp b/src/qalculateeditfunctiondialog.cpp
index 81bc9ca..4975656 100644
--- a/src/qalculateeditfunctiondialog.cpp
+++ b/src/qalculateeditfunctiondialog.cpp
@@ -33,18 +33,9 @@
 #include <tqcheckbox.h>
 #include <tdemessagebox.h>
 #include <tqlayout.h>
-#include <tdeversion.h>
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-#include <tqtextedit.h>
-#else
 #include <ktextedit.h>
-#endif
 #include <tdelistview.h>
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <tqtabwidget.h>
-#else
 #include <ktabwidget.h>
-#endif
 #include <tqheader.h>
 #include <tdeapplication.h>
 #include <kstdguiitem.h>
@@ -60,11 +51,7 @@ QalculateEditFunctionDialog::QalculateEditFunctionDialog(TQWidget *parent, const
 	edited_function = NULL;
 	argument_edit_dialog = NULL;
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	tabs = new TQTabWidget(this);
-#else
 	tabs = new KTabWidget(this);
-#endif
 	setMainWidget(tabs);
 	TQWidget *page1 = new TQWidget(this);
 	TQWidget *page2 = new TQWidget(this);
@@ -97,19 +84,11 @@ QalculateEditFunctionDialog::QalculateEditFunctionDialog(TQWidget *parent, const
 	hideButton = new TQCheckBox(i18n("Hide function"), page1);
 	hbox->addWidget(hideButton);
 	grid->addWidget(new TQLabel(i18n("Description:"), page1), 5, 0);	
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-	descriptionEdit = new TQTextEdit(page1);
-#else
 	descriptionEdit = new KTextEdit(page1);
-#endif
 	descriptionEdit->setTextFormat(TQTextEdit::PlainText);
 	grid->addMultiCellWidget(descriptionEdit, 6, 6, 0, 1);
 	vbox->addWidget(new TQLabel(i18n("Expression:"), page2));
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 1
-	expressionEdit = new TQTextEdit(page2);
-#else	
 	expressionEdit = new KTextEdit(page2);
-#endif
 	expressionEdit->setTextFormat(TQTextEdit::PlainText);
 	vbox->addWidget(expressionEdit);
 	hbox = new TQHBoxLayout(vbox, spacingHint());
diff --git a/src/qalculateexpressionedit.cpp b/src/qalculateexpressionedit.cpp
index c834f6e..f5ae71a 100644
--- a/src/qalculateexpressionedit.cpp
+++ b/src/qalculateexpressionedit.cpp
@@ -23,7 +23,6 @@
 #include "kqalculate.h"
 #include <vector>
 #include <string>
-#include <tdeversion.h>
 #include <kcursor.h>
 #include <tqstyle.h>
 #include <tqpainter.h>
@@ -794,36 +793,6 @@ QalculateExpressionEditListBoxItem::QalculateExpressionEditListBoxItem(Expressio
 QalculateExpressionEditListBoxItem::~QalculateExpressionEditListBoxItem() {
 }
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-TQString rPixelSqueeze(const TQString& name, const TQFontMetrics& fontMetrics, uint maxPixels)
-{
-  uint nameWidth = fontMetrics.width(name);
-
-  if (maxPixels < nameWidth)
-  {
-    TQString tmp = name;
-    const uint em = fontMetrics.maxWidth();
-    maxPixels -= fontMetrics.width("...");
-
-    while (maxPixels < nameWidth && !tmp.isEmpty())
-    {
-      int length = tmp.length();
-      int delta = em ? (nameWidth - maxPixels) / em : length;
-
-      if(delta < 1) delta = 1;
-      else if(length < delta) delta = length;
-
-      tmp.remove(length - delta, delta);
-      nameWidth = fontMetrics.width(tmp);
-    }
-
-    return (tmp + "...");
-  }
-
-  return name;
-}
-#endif
-
 void QalculateExpressionEditListBoxItem::paint(TQPainter *painter) {
 
 	int itemHeight = height(listBox());
@@ -840,11 +809,7 @@ void QalculateExpressionEditListBoxItem::paint(TQPainter *painter) {
 			if(rt.widthUsed() > nameWidth - 1) {
 				squeezedText = text();			
 				if(italic_index > 0) squeezedText.truncate(italic_index);
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2	
-				squeezedText = rPixelSqueeze(squeezedText, listBox()->fontMetrics(), nameWidth);
-#else
 				squeezedText = KStringHandler::rPixelSqueeze(squeezedText, listBox()->fontMetrics(), nameWidth);
-#endif
 				painter->drawText(0, 0, nameWidth, itemHeight, TQt::AlignLeft | TQt::AlignVCenter, squeezedText);
 			} else {
 				TQColorGroup cg = listBox()->colorGroup();
@@ -852,18 +817,10 @@ void QalculateExpressionEditListBoxItem::paint(TQPainter *painter) {
 				rt.draw(painter, 1, 0, TQRect(0, 0, nameWidth - 1, itemHeight), cg, &painter->brush());
 			}
 		} else {
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2	
-			squeezedText = rPixelSqueeze(text(), listBox()->fontMetrics(), nameWidth);
-#else
 			squeezedText = KStringHandler::rPixelSqueeze(text(), listBox()->fontMetrics(), nameWidth);
-#endif
 			painter->drawText(0, 0, nameWidth, itemHeight, TQt::AlignLeft | TQt::AlignVCenter, squeezedText);
 		}
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2	
-		squeezedText = rPixelSqueeze(title, listBox()->fontMetrics(), titleWidth);
-#else
 		squeezedText = KStringHandler::rPixelSqueeze(title, listBox()->fontMetrics(), titleWidth);
-#endif		
 		TQFont font = painter->font();
 		font.setItalic(true);
 		painter->setFont(font);
@@ -943,12 +900,7 @@ void QalculateExpressionEditCompletionBox::setItems(const TQValueVector<Expressi
 	sort();
 
 	if(isVisible() && size().height() != sizeHint().height()) {
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-		hide();
-		popup();
-#else
 		sizeAndPosition();
-#endif
 	}
 
 	blockSignals(block);
diff --git a/src/qalculateinsertfunctiondialog.cpp b/src/qalculateinsertfunctiondialog.cpp
index b6be78d..489ec5e 100644
--- a/src/qalculateinsertfunctiondialog.cpp
+++ b/src/qalculateinsertfunctiondialog.cpp
@@ -34,7 +34,6 @@
 #include <tqpushbutton.h>
 #include <kdatepicker.h>
 #include <tdefiledialog.h>
-#include <tdeversion.h>
 #include <kstdguiitem.h>
 #include "buttonwithindexsignal.h"
 #include "qalculateinsertmatrixvectordialog.h"
@@ -45,17 +44,8 @@ extern EvaluationOptions evalops;
 
 QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent, const TQString &selected_text, const char *name) : KDialogBase(parent, name, true, f->title(true).c_str(), Ok|Apply|Cancel, Ok) {
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	setButtonOKText(i18n("Insert"));
-	setButtonApplyText(i18n("Execute"));
-#else
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 3
-	setButtonOK(KGuiItem(i18n("Insert")));
-#else
 	setButtonOK(KStdGuiItem::insert());	
-#endif
 	setButtonApply(KGuiItem(i18n("Execute")));
-#endif	
 	mathFunction = f;
 	TQVBox *box = makeVBoxMainWidget();
 	box->setSpacing(12);
diff --git a/src/qalculateinsertmatrixvectordialog.cpp b/src/qalculateinsertmatrixvectordialog.cpp
index 81d09ef..33bbb14 100644
--- a/src/qalculateinsertmatrixvectordialog.cpp
+++ b/src/qalculateinsertmatrixvectordialog.cpp
@@ -36,7 +36,6 @@
 #include <tqbuttongroup.h>
 #include <tqradiobutton.h>
 #include <tdeapplication.h>
-#include <tdeversion.h>
 #include <kstdguiitem.h>
 
 extern PrintOptions printops;
@@ -276,17 +275,8 @@ TQString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure
 	}
 
 	if(is_result) {
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-		setButtonOKText(i18n("Insert"));
-		setButtonCancelText(KStdGuiItem::close().text());
-#else
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 3
-		setButtonOK(KGuiItem(i18n("Insert")));
-#else
 		setButtonOK(KStdGuiItem::insert());	
-#endif
 		setButtonCancel(KStdGuiItem::close());
-#endif		
 		actionButton(Cancel)->setDefault(true);
 		actionButton(Cancel)->setFocus();
 		if(create_vector) {
@@ -295,13 +285,8 @@ TQString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure
 			setCaption(i18n("Matrix Result"));
 		}
 	} else {
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-		setButtonOKText(KStdGuiItem::ok().text());
-		setButtonCancelText(KStdGuiItem::cancel().text());
-#else
 		setButtonOK(KStdGuiItem::ok());
 		setButtonCancel(KStdGuiItem::cancel());
-#endif	
 		actionButton(Ok)->setDefault(true);
 		elementsTable->setFocus();
 		if(create_vector) {
diff --git a/src/qalculateplotdialog.cpp b/src/qalculateplotdialog.cpp
index 9ef7031..2ca3d51 100644
--- a/src/qalculateplotdialog.cpp
+++ b/src/qalculateplotdialog.cpp
@@ -35,12 +35,7 @@
 #include <tqlayout.h>
 #include <ktextedit.h>
 #include <tdelistview.h>
-#include <tdeversion.h>
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <tqtabwidget.h>
-#else
 #include <ktabwidget.h>
-#endif
 #include <tdefiledialog.h>
 #include <tdeapplication.h>
 #include <kstdguiitem.h>
@@ -72,11 +67,7 @@ QalculatePlotDialog::QalculatePlotDialog(TQWidget *parent, const char *name) : K
 	
 	actionButton(User1)->setEnabled(false);
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	tabs = new TQTabWidget(this);
-#else
 	tabs = new KTabWidget(this);
-#endif
 	setMainWidget(tabs);
 	TQWidget *page1 = new TQWidget(this);
 	TQWidget *page2 = new TQWidget(this);
diff --git a/src/qalculateprecisiondialog.cpp b/src/qalculateprecisiondialog.cpp
index c11634f..a5c5a81 100644
--- a/src/qalculateprecisiondialog.cpp
+++ b/src/qalculateprecisiondialog.cpp
@@ -26,15 +26,10 @@
 #include <kguiitem.h>
 #include <tqlayout.h>
 #include <kpushbutton.h>
-#include <tdeversion.h>
 
 QalculatePrecisionDialog::QalculatePrecisionDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Precision"), Apply | Close, Close, true) {
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	setButtonApplyText(i18n("Recalculate"));
-#else
 	setButtonApply(KGuiItem(i18n("Recalculate")));
-#endif	
 	setMainWidget(new TQWidget(this));
 	TQHBoxLayout *box = new TQHBoxLayout(mainWidget());
 	box->setSpacing(spacingHint());
diff --git a/src/qalculatepreferencesdialog.cpp b/src/qalculatepreferencesdialog.cpp
index e23be93..e6c4f70 100644
--- a/src/qalculatepreferencesdialog.cpp
+++ b/src/qalculatepreferencesdialog.cpp
@@ -26,15 +26,8 @@
 #include <tqlabel.h>
 #include <tqradiobutton.h>
 #include <tqtooltip.h>
-#include <tdeversion.h>
-#if TDE_VERSION_MAJOR > 3 || TDE_VERSION_MINOR > 1
 #include <tdefontrequester.h>
-#endif
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <tqtabwidget.h>
-#else
 #include <ktabwidget.h>
-#endif
 #include <tqpushbutton.h>
 #include <tqfont.h>
 #include <tqpushbutton.h>
@@ -56,101 +49,9 @@ extern TQColor status_warning_color;
 extern int use_icon_buttons;
 extern bool rpn_keypad_only;
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-#include <tdefontdialog.h>
-
-class TDEFontRequester : public TQWidget
-{
-  TQ_OBJECT
-
-  public:
-
-    TDEFontRequester( TQWidget *parent=0L, const char *name=0L,
-        bool onlyFixed=false );
-
-    TQFont font() const { return m_selFont; }
-    virtual void setFont( const TQFont &font, bool onlyFixed=false );
-
-  protected:
-
-    void displaySampleText();
-
-  protected slots:
-
-    virtual void buttonClicked();
-
-  protected:
-
-    bool m_onlyFixed;
-    TQString m_sampleText, m_title;
-    TQLabel *m_sampleLabel;
-    TQPushButton *m_button;
-    TQFont m_selFont;
-
-};
-
-
-TDEFontRequester::TDEFontRequester( TQWidget *parent, const char *name,
-    bool onlyFixed ) : TQWidget( parent, name ),
-    m_onlyFixed( onlyFixed )
-{
-  TQHBoxLayout *layout = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
-
-  m_sampleLabel = new TQLabel( this, "m_sampleLabel" );
-  m_button = new TQPushButton( i18n( "Choose..." ), this, "m_button" );
-
-  m_sampleLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
-  setFocusProxy( m_button );
-
-  layout->addWidget( m_sampleLabel, 1 );
-  layout->addWidget( m_button );
-
-  connect( m_button, TQ_SIGNAL( clicked() ), TQ_SLOT( buttonClicked() ) );
-
-  displaySampleText();
-
-}
-
-void TDEFontRequester::setFont( const TQFont &font, bool onlyFixed )
-{
-  m_selFont = font;
-  m_onlyFixed = onlyFixed;
-
-  displaySampleText();
-}
-void TDEFontRequester::buttonClicked()
-{
-  int result = TDEFontDialog::getFont( m_selFont, m_onlyFixed, parentWidget() );
-
-  if ( result == KDialog::Accepted )
-  {
-    displaySampleText();
-  }
-}
-
-void TDEFontRequester::displaySampleText()
-{
-  m_sampleLabel->setFont( m_selFont );
-
-  int size = m_selFont.pointSize();
-  if(size == -1)
-    size = m_selFont.pixelSize();
-
-  if ( m_sampleText.isEmpty() )
-    m_sampleLabel->setText( TQString( "%1 %2" ).arg( m_selFont.family() )
-      .arg( size ) );
-  else
-    m_sampleLabel->setText( m_sampleText );
-}
-#endif
-
 QalculatePreferencesDialog::QalculatePreferencesDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Preferences"), Ok | Apply | Cancel, Ok, false) {
 
-#if TDE_VERSION_MAJOR < 4 && TDE_VERSION_MINOR < 2
-	TQTabWidget *tabs = new TQTabWidget(this);
-#else
 	TQTabWidget *tabs = new KTabWidget(this);
-#endif
 	setMainWidget(tabs);
 	TQWidget *page1 = new TQWidget(this);
 	TQWidget *page2 = new TQWidget(this);
@@ -241,18 +142,10 @@ QalculatePreferencesDialog::QalculatePreferencesDialog(TQWidget *parent, const c
 	vbox->addWidget(statusFontEdit);
 	grid = new TQGridLayout(vbox);
 	grid->addWidget(new TQLabel(i18n("Status error color:"), page2), 0, 0);
-#if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1	
-	statusErrorColorButton = new KColorButton(page2);
-#else
 	statusErrorColorButton = new KColorButton("red", "red", page2);
-#endif
 	grid->addWidget(statusErrorColorButton, 0, 1);
 	grid->addWidget(new TQLabel(i18n("Status warning color:"), page2), 1, 0);
-#if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1	
-	statusWarningColorButton = new KColorButton(page2);
-#else
 	statusWarningColorButton = new KColorButton("blue", "blue", page2);
-#endif	
 	grid->addWidget(statusWarningColorButton, 1, 1);
 	vbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
 	
-- 
cgit v1.2.3

