summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4524ce3..b7f36e7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -30,13 +30,13 @@
#include <kcmdlineargs.h>
#include <klocale.h>
#include <unistd.h>
-#include <qtextcodec.h>
-#include <qobject.h>
+#include <tqtextcodec.h>
+#include <tqobject.h>
#include <kmessagebox.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <klineedit.h>
-#include <qtooltip.h>
-#include <qclipboard.h>
+#include <tqtooltip.h>
+#include <tqclipboard.h>
#include "qalculateexpressionedit.h"
#include "qalculateresultdisplay.h"
@@ -55,9 +55,9 @@ static KCmdLineOptions options[] = {
extern KnownVariable *vans[5];
extern MathStructure *mstruct, *matrix_mstruct, *parsed_mstruct, *parsed_tostruct;
-extern QString result_text, result_history_text, parsed_text;
-extern QWidget *expressionWidget, *resultWidget, *statusWidget_l;
-extern QWidget *topWidget;
+extern TQString result_text, result_history_text, parsed_text;
+extern TQWidget *expressionWidget, *resultWidget, *statusWidget_l;
+extern TQWidget *topWidget;
extern KQalculate *mainWin;
extern bool load_global_defs, fetch_exchange_rates_at_startup, first_time, first_qalculate_run;
@@ -70,15 +70,15 @@ extern pthread_t view_thread, command_thread;
extern pthread_attr_t view_thread_attr, command_thread_attr;
extern bool command_thread_started;
-extern QValueVector<QString> recent_functions_pre;
-extern QValueVector<QString> recent_variables_pre;
-extern QValueVector<QString> recent_units_pre;
+extern TQValueVector<TQString> recent_functions_pre;
+extern TQValueVector<TQString> recent_variables_pre;
+extern TQValueVector<TQString> recent_units_pre;
-QTimer *error_timer;
+TQTimer *error_timer;
void create_qalculate_window(KUniqueApplication *parent) {
- QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
+ TQTextCodec::setCodecForCStrings(TQTextCodec::codecForName("utf8"));
b_busy = false;
@@ -99,18 +99,18 @@ void create_qalculate_window(KUniqueApplication *parent) {
mainWin = new KQalculate(parent);
topWidget = mainWin;
- expressionWidget = (QWidget*) mainWin->expressionEdit;
- resultWidget = (QWidget*) mainWin->resultLabel;
- statusWidget_l = (QWidget*) mainWin->statusLabel_l;
+ expressionWidget = (TQWidget*) mainWin->expressionEdit;
+ resultWidget = (TQWidget*) mainWin->resultLabel;
+ statusWidget_l = (TQWidget*) mainWin->statusLabel_l;
}
-QString parse_expression_arguments(KCmdLineArgs *args) {
- QString calc_arg;
+TQString parse_expression_arguments(KCmdLineArgs *args) {
+ TQString calc_arg;
if(args->isSet("clipboard")) {
- calc_arg = qApp->clipboard()->text(QClipboard::Selection);
+ calc_arg = tqApp->clipboard()->text(TQClipboard::Selection);
if(calc_arg.isEmpty()) {
- calc_arg = qApp->clipboard()->text(QClipboard::Clipboard);
+ calc_arg = tqApp->clipboard()->text(TQClipboard::Clipboard);
}
} else {
for(int i = 0; i < args->count(); i++) {
@@ -126,7 +126,7 @@ QString parse_expression_arguments(KCmdLineArgs *args) {
void start_qalculate() {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
- QString calc_arg = parse_expression_arguments(args);
+ TQString calc_arg = parse_expression_arguments(args);
args->clear();
if(!calc_arg.isEmpty()) {
mainWin->expressionEdit->setText(calc_arg);
@@ -136,18 +136,18 @@ void start_qalculate() {
mainWin->resultLabel->setText("<div align=\"right\"><font size=2>&nbsp;<br></font><font size=6>= 0</font></div>");
}
- qApp->processEvents();
+ tqApp->processEvents();
//exchange rates
if(first_qalculate_run) {
if(KMessageBox::questionYesNo(mainWin, i18n("You need to download exchange rates to be able to convert between different currencies. You can later get current exchange rates by selecting \"Update Exchange Rates\" under the File menu.\n\nDo you want to fetch exchange rates now from the Internet?"), i18n("Update exchange rates?")) == KMessageBox::Yes) {
- qApp->processEvents();
+ tqApp->processEvents();
mainWin->fetch_exchange_rates(5);
}
- qApp->processEvents();
+ tqApp->processEvents();
} else if(fetch_exchange_rates_at_startup) {
mainWin->fetch_exchange_rates(5);
- qApp->processEvents();
+ tqApp->processEvents();
}
CALCULATOR->loadExchangeRates();
@@ -164,15 +164,15 @@ void start_qalculate() {
//load global definitions
if(load_global_defs && !CALCULATOR->loadGlobalDefinitions()) {
KMessageBox::error(mainWin, i18n("Failed to load global definitions!"), i18n("Error"));
- qApp->processEvents();
+ tqApp->processEvents();
}
//load local definitions
CALCULATOR->loadLocalDefinitions();
//check for calculation errros regularly
- error_timer = new QTimer(mainWin);
- QObject::connect(error_timer, SIGNAL(timeout()), mainWin, SLOT(onErrorTimeout()));
+ error_timer = new TQTimer(mainWin);
+ TQObject::connect(error_timer, SIGNAL(timeout()), mainWin, SLOT(onErrorTimeout()));
generate_units_tree_struct();
generate_functions_tree_struct();
@@ -211,8 +211,8 @@ void start_qalculate() {
pthread_attr_init(&command_thread_attr);
command_thread_started = false;
- QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));
- QObject::connect(qApp, SIGNAL(aboutToQuit()), mainWin, SLOT(aboutToQuit()));
+ TQObject::connect(tqApp, SIGNAL(lastWindowClosed()), tqApp, SLOT(quit()));
+ TQObject::connect(tqApp, SIGNAL(aboutToQuit()), mainWin, SLOT(aboutToQuit()));
error_timer->start(100);
@@ -235,7 +235,7 @@ public:
if(mainWin && started) {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
- QString calc_arg = parse_expression_arguments(args);
+ TQString calc_arg = parse_expression_arguments(args);
args->clear();
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2