summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/kselectdatabasedlg.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/dialogs/kselectdatabasedlg.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/kselectdatabasedlg.cpp')
-rw-r--r--kmymoney2/dialogs/kselectdatabasedlg.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/kmymoney2/dialogs/kselectdatabasedlg.cpp b/kmymoney2/dialogs/kselectdatabasedlg.cpp
index 941712c..47d092d 100644
--- a/kmymoney2/dialogs/kselectdatabasedlg.cpp
+++ b/kmymoney2/dialogs/kselectdatabasedlg.cpp
@@ -22,14 +22,14 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qapplication.h>
-#include <qsqldatabase.h>
-#include <qfiledialog.h>
-#include <qstatusbar.h>
-#include <qcheckbox.h>
-#include <qcolor.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include <tqfiledialog.h>
+#include <tqstatusbar.h>
+#include <tqcheckbox.h>
+#include <tqcolor.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -45,24 +45,24 @@
#include "kselectdatabasedlg.h"
-KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name)
- : KSelectDatabaseDlgDecl(parent, name) {
+KSelectDatabaseDlg::KSelectDatabaseDlg(TQWidget *tqparent, const char *name)
+ : KSelectDatabaseDlgDecl(tqparent, name) {
listDrivers->clear();
// list drivers supported by KMM
- QMap<QString, QString> map = m_map.driverMap();
+ TQMap<TQString, TQString> map = m_map.driverMap();
// list drivers installed on system
- QStringList list = QSqlDatabase::drivers();
+ TQStringList list = TQSqlDatabase::drivers();
if (list.count() == 0) {
- KMessageBox::error (0, i18n("There are no Qt SQL drivers installed in your system.\n"
- "Please consult documentation for your distro, or visit the Qt web site (www.trolltech.com)"
+ KMessageBox::error (0, i18n("There are no TQt SQL drivers installed in your system.\n"
+ "Please consult documentation for your distro, or visit the TQt web site (www.trolltech.com)"
" and search for SQL drivers."),
"");
setError();
} else {
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
while(it != list.end()) {
- QString dname = *it;
- if (map.keys().contains(dname)) { // only display if driver is supported
+ TQString dname = *it;
+ if (map.keys().tqcontains(dname)) { // only display if driver is supported
dname = dname + " - " + map[dname];
listDrivers->insertItem (dname);
}
@@ -73,20 +73,20 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name)
textUserName->setText("");
struct passwd * pwd = getpwuid(geteuid());
if (pwd != 0)
- textUserName->setText (QString(pwd->pw_name));
+ textUserName->setText (TQString(pwd->pw_name));
textPassword->setText ("");
- m_requiredFields = new kMandatoryFieldGroup(this);
+ m_requiredFields = new kMandatoryFieldGroup(TQT_TQOBJECT(this));
m_requiredFields->setOkButton(buttonOK);
m_requiredFields->add(listDrivers);
m_requiredFields->add(textDbName);
- connect (listDrivers, SIGNAL(clicked(QListBoxItem *)),
- this, SLOT(slotDriverSelected(QListBoxItem *)));
- connect (buttonSQL, SIGNAL(clicked()), this, SLOT(slotGenerateSQL()));
- connect (buttonOK, SIGNAL(clicked()), this, SLOT(accept()));
+ connect (listDrivers, TQT_SIGNAL(clicked(TQListBoxItem *)),
+ this, TQT_SLOT(slotDriverSelected(TQListBoxItem *)));
+ connect (buttonSQL, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGenerateSQL()));
+ connect (buttonOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()));
checkPreLoad->setChecked(false);
buttonSQL->setEnabled(true);
}
- connect (buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp()));
+ connect (buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp()));
// ensure a driver gets selected; pre-select if only one
listDrivers->clearSelection();
if (listDrivers->count() == 1) {
@@ -95,30 +95,30 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name)
}
}
-KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, QWidget *parent, const char *name)
- : KSelectDatabaseDlgDecl(parent, name) {
+KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, TQWidget *tqparent, const char *name)
+ : KSelectDatabaseDlgDecl(tqparent, name) {
// here we are re-opening a database from a URL
// probably taken from the last-used or recent file list
listDrivers->clear();
// check that the SQL driver is still available
- QString driverName = openURL.queryItem("driver");
+ TQString driverName = openURL.queryItem("driver");
// list drivers installed on system
- QStringList list = QSqlDatabase::drivers();
+ TQStringList list = TQSqlDatabase::drivers();
// list drivers supported by KMM
- QMap<QString, QString> map = m_map.driverMap();
- if (!list.contains(driverName)) {
- KMessageBox::error (0, i18n("Qt SQL driver %1 is no longer installed on your system").arg(driverName),
+ TQMap<TQString, TQString> map = m_map.driverMap();
+ if (!list.tqcontains(driverName)) {
+ KMessageBox::error (0, i18n("TQt SQL driver %1 is no longer installed on your system").tqarg(driverName),
"");
setError();
- } else if (!map.contains(driverName)) {
- KMessageBox::error (0, i18n("Qt SQL driver %1 is not suported").arg(driverName),
+ } else if (!map.tqcontains(driverName)) {
+ KMessageBox::error (0, i18n("TQt SQL driver %1 is not suported").tqarg(driverName),
"");
setError();
} else {
// fill in the fixed data from the URL
- listDrivers->insertItem (QString(driverName + " - " + map[driverName]));
+ listDrivers->insertItem (TQString(driverName + " - " + map[driverName]));
listDrivers->setSelected(0,true);
- QString dbName = openURL.path().right(openURL.path().length() - 1); // remove separator slash
+ TQString dbName = openURL.path().right(openURL.path().length() - 1); // remove separator slash
textDbName->setText (dbName);
textHostName->setText (openURL.host());
textUserName->setText(openURL.user());
@@ -131,14 +131,14 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, QWidget *parent, const char
textPassword->setFocus();
buttonSQL->setEnabled(false);
// set password as required
- m_requiredFields = new kMandatoryFieldGroup(this);
+ m_requiredFields = new kMandatoryFieldGroup(TQT_TQOBJECT(this));
m_requiredFields->add(textPassword);
m_requiredFields->setOkButton(buttonOK);
- connect (buttonOK, SIGNAL(clicked()), this, SLOT(accept()));
+ connect (buttonOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()));
checkPreLoad->setChecked(false);
}
- connect (buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp()));
+ connect (buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp()));
}
@@ -158,20 +158,20 @@ const KURL KSelectDatabaseDlg::selectedURL() {
url.setPass(textPassword->text());
url.setHost(textHostName->text());
url.setPath("/" + textDbName->text());
- QString qs = QString("driver=%1")
- .arg(listDrivers->currentText().section (' ', 0, 0));
+ TQString qs = TQString("driver=%1")
+ .tqarg(listDrivers->currentText().section (' ', 0, 0));
if (checkPreLoad->isChecked()) qs.append("&options=loadAll");
if (!textPassword->text().isEmpty()) qs.append("&secure=yes");
url.setQuery(qs);
return (url);
}
-void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) {
+void KSelectDatabaseDlg::slotDriverSelected (TQListBoxItem *driver) {
databaseTypeE dbType = m_map.driverToType(driver->text().section(' ', 0, 0));
if (!m_map.isTested(dbType)) {
int rc = KMessageBox::warningContinueCancel (0,
- i18n("Qt SQL driver %1 has not been fully tested in a KMyMoney environment. Please make sure you have adequate backups of your data. Please report any problems to the developer mailing list at kmymoney2-developer@lists.sourceforge.net")
- .arg(driver->text()),
+ i18n("TQt SQL driver %1 has not been fully tested in a KMyMoney environment. Please make sure you have adequate backups of your data. Please report any problems to the developer mailing list at kmymoney2-developer@lists.sourceforge.net")
+ .tqarg(driver->text()),
"");
if (rc == KMessageBox::Cancel) {
listDrivers->clearSelection();
@@ -180,12 +180,12 @@ void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) {
}
if (dbType == Sqlite3){
- QString dbName = QFileDialog::getOpenFileName(
+ TQString dbName = TQFileDialog::getOpenFileName(
"",
- i18n("SQLite files (*.sql);; All files (*.*)"),
+ i18n("STQLite files (*.sql);; All files (*.*)"),
this,
"",
- i18n("Select SQLite file"));
+ i18n("Select STQLite file"));
if (dbName.isNull()) {
listDrivers->setSelected(driver, false);
return;
@@ -204,16 +204,16 @@ void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) {
}
void KSelectDatabaseDlg::slotGenerateSQL () {
- QString fileName = QFileDialog::getSaveFileName(
+ TQString fileName = TQFileDialog::getSaveFileName(
"",
i18n("All files (*.*)"),
this,
"",
i18n("Select output file"));
if (fileName == "") return;
- QFile out(fileName);
+ TQFile out(fileName);
if (!out.open(IO_WriteOnly)) return;
- QTextStream s(&out);
+ TQTextStream s(&out);
MyMoneyDbDef db;
s << db.generateSQL(listDrivers->currentText().section (' ', 0, 0));
out.close();