summaryrefslogtreecommitdiffstats
path: root/kexi/migration
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/migration')
-rw-r--r--kexi/migration/importoptionsdlg.cpp36
-rw-r--r--kexi/migration/importoptionsdlg.h7
-rw-r--r--kexi/migration/importwizard.cpp204
-rw-r--r--kexi/migration/importwizard.h43
-rw-r--r--kexi/migration/keximigrate.cpp162
-rw-r--r--kexi/migration/keximigrate.h73
-rw-r--r--kexi/migration/keximigratedata.h4
-rw-r--r--kexi/migration/migratemanager.cpp96
-rw-r--r--kexi/migration/migratemanager.h24
-rw-r--r--kexi/migration/migratemanager_p.h23
-rw-r--r--kexi/migration/mysql/mysqlmigrate.cpp94
-rw-r--r--kexi/migration/mysql/mysqlmigrate.h27
-rw-r--r--kexi/migration/pqxx/pg_type.h4
-rw-r--r--kexi/migration/pqxx/pqxxmigrate.cpp66
-rw-r--r--kexi/migration/pqxx/pqxxmigrate.h23
15 files changed, 446 insertions, 440 deletions
diff --git a/kexi/migration/importoptionsdlg.cpp b/kexi/migration/importoptionsdlg.cpp
index 24ff3259..4741bf5c 100644
--- a/kexi/migration/importoptionsdlg.cpp
+++ b/kexi/migration/importoptionsdlg.cpp
@@ -20,11 +20,11 @@
#include "importoptionsdlg.h"
#include <widget/kexicharencodingcombobox.h>
-#include <qdir.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtextcodec.h>
-#include <qcheckbox.h>
+#include <tqdir.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtextcodec.h>
+#include <tqcheckbox.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -36,48 +36,48 @@
using namespace KexiMigration;
-OptionsDialog::OptionsDialog( const QString& databaseFile, const QString& selectedEncoding, QWidget* parent )
+OptionsDialog::OptionsDialog( const TQString& databaseFile, const TQString& selectedEncoding, TQWidget* tqparent )
: KDialogBase(
KDialogBase::Plain,
i18n( "Advanced Import Options" ),
Ok|Cancel,
Ok,
- parent,
+ tqparent,
"KexiMigration::OptionsDialog",
true,
false
)
{
setIcon(DesktopIcon("configure"));
- QGridLayout *lyr = new QGridLayout( plainPage(), 4, 3, KDialogBase::marginHint(),
+ TQGridLayout *lyr = new TQGridLayout( plainPage(), 4, 3, KDialogBase::marginHint(),
KDialogBase::spacingHint());
m_encodingComboBox = new KexiCharacterEncodingComboBox(plainPage(), selectedEncoding);
- m_encodingComboBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ m_encodingComboBox->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
lyr->addWidget( m_encodingComboBox, 1, 1 );
- QLabel* lbl = new QLabel(
+ TQLabel* lbl = new TQLabel(
i18n("<h3>Text encoding for Microsoft Access database</h3>\n"
"<p>Database file \"%1\" appears to be created by a version of Microsoft Access older than 2000.</p>"
"<p>In order to properly import national characters, you may need to choose a proper text encoding "
"if the database was created on a computer with a different character set.</p>")
- .arg(QDir::convertSeparators(databaseFile)), plainPage());
- lbl->setAlignment( Qt::AlignAuto | Qt::WordBreak );
- lbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ .tqarg(TQDir::convertSeparators(databaseFile)), plainPage());
+ lbl->tqsetAlignment( TQt::AlignAuto | TQt::WordBreak );
+ lbl->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
lyr->addMultiCellWidget( lbl, 0, 0, 0, 2 );
- QLabel* lbl2 = new QLabel( m_encodingComboBox, i18n("Text encoding:"), plainPage());
+ TQLabel* lbl2 = new TQLabel( m_encodingComboBox, i18n("Text encoding:"), plainPage());
lyr->addWidget( lbl2, 1, 0 );
- m_chkAlwaysUseThisEncoding = new QCheckBox(
+ m_chkAlwaysUseThisEncoding = new TQCheckBox(
i18n("Always use this encoding in similar situations"), plainPage());
lyr->addMultiCellWidget( m_chkAlwaysUseThisEncoding, 2, 2, 1,2 );
- lyr->addItem( new QSpacerItem( 20, 111, QSizePolicy::Minimum, QSizePolicy::Expanding ), 3, 1 );
- lyr->addItem( new QSpacerItem( 121, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 2 );
+ lyr->addItem( new TQSpacerItem( 20, 111, TQSizePolicy::Minimum, TQSizePolicy::Expanding ), 3, 1 );
+ lyr->addItem( new TQSpacerItem( 121, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ), 1, 2 );
//read config
kapp->config()->setGroup("ImportExport");
- QString defaultEncodingForMSAccessFiles = kapp->config()->readEntry("DefaultEncodingForMSAccessFiles");
+ TQString defaultEncodingForMSAccessFiles = kapp->config()->readEntry("DefaultEncodingForMSAccessFiles");
if (!defaultEncodingForMSAccessFiles.isEmpty()) {
m_encodingComboBox->setSelectedEncoding(defaultEncodingForMSAccessFiles);
m_chkAlwaysUseThisEncoding->setChecked(true);
diff --git a/kexi/migration/importoptionsdlg.h b/kexi/migration/importoptionsdlg.h
index 736cb174..f40e8230 100644
--- a/kexi/migration/importoptionsdlg.h
+++ b/kexi/migration/importoptionsdlg.h
@@ -22,7 +22,7 @@
#include <kdialogbase.h>
-class QCheckBox;
+class TQCheckBox;
class KexiCharacterEncodingComboBox;
namespace KexiMigration {
@@ -33,8 +33,9 @@ namespace KexiMigration {
class OptionsDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- OptionsDialog( const QString& databaseFile, const QString& selectedEncoding, QWidget* parent = 0 );
+ OptionsDialog( const TQString& databaseFile, const TQString& selectedEncoding, TQWidget* tqparent = 0 );
virtual ~OptionsDialog();
KexiCharacterEncodingComboBox* encodingComboBox() const;
@@ -44,7 +45,7 @@ class OptionsDialog : public KDialogBase
protected:
KexiCharacterEncodingComboBox *m_encodingComboBox;
- QCheckBox *m_chkAlwaysUseThisEncoding;
+ TQCheckBox *m_chkAlwaysUseThisEncoding;
};
}
diff --git a/kexi/migration/importwizard.cpp b/kexi/migration/importwizard.cpp
index dda3d200..4fd7497b 100644
--- a/kexi/migration/importwizard.cpp
+++ b/kexi/migration/importwizard.cpp
@@ -23,11 +23,11 @@
#include "keximigrate.h"
#include "importoptionsdlg.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvbuttongroup.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqvbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
#include <kcombobox.h>
#include <kmessagebox.h>
@@ -58,8 +58,8 @@ using namespace KexiMigration;
//===========================================================
//
-ImportWizard::ImportWizard(QWidget *parent, QMap<QString,QString>* args)
- : KWizard(parent)
+ImportWizard::ImportWizard(TQWidget *tqparent, TQMap<TQString,TQString>* args)
+ : KWizard(tqparent)
, m_args(args)
{
setCaption(i18n("Import Database"));
@@ -83,8 +83,8 @@ ImportWizard::ImportWizard(QWidget *parent, QMap<QString,QString>* args)
setupImporting();
setupFinish();
- connect(this, SIGNAL(selected(const QString &)), this, SLOT(pageSelected(const QString &)));
- connect(this, SIGNAL(helpClicked()), this, SLOT(helpClicked()));
+ connect(this, TQT_SIGNAL(selected(const TQString &)), this, TQT_SLOT(pageSelected(const TQString &)));
+ connect(this, TQT_SIGNAL(helpClicked()), this, TQT_SLOT(helpClicked()));
if (m_predefinedConnectionData) {
// setup wizard for predefined server source
@@ -96,7 +96,7 @@ ImportWizard::ImportWizard(QWidget *parent, QMap<QString,QString>* args)
// setup wizard for predefined source
// (used when external project type was opened in Kexi, e.g. mdb file)
// MigrateManager manager;
-// QString driverName = manager.driverForMimeType( m_predefinedMimeType );
+// TQString driverName = manager.driverForMimeType( m_predefinedMimeType );
// m_srcTypeCombo->setCurrentText( driverName );
// showPage( m_srcConnPage );
@@ -110,7 +110,7 @@ ImportWizard::ImportWizard(QWidget *parent, QMap<QString,QString>* args)
}
}
- m_sourceDBEncoding = QString::fromLatin1(KGlobal::locale()->encoding()); //default
+ m_sourceDBEncoding = TQString::tqfromLatin1(KGlobal::locale()->encoding()); //default
}
//===========================================================
@@ -130,7 +130,7 @@ void ImportWizard::parseArguments()
if (!(*m_args)["databaseName"].isEmpty() && !(*m_args)["mimeType"].isEmpty()) {
m_predefinedDatabaseName = (*m_args)["databaseName"];
m_predefinedMimeType = (*m_args)["mimeType"];
- if (m_args->contains("connectionData")) {
+ if (m_args->tqcontains("connectionData")) {
m_predefinedConnectionData = new KexiDB::ConnectionData();
KexiDB::fromMap(
KexiUtils::deserializeMap((*m_args)["connectionData"]), *m_predefinedConnectionData
@@ -144,23 +144,23 @@ void ImportWizard::parseArguments()
//
void ImportWizard::setupIntro()
{
- m_introPage = new QWidget(this);
- QVBoxLayout *vbox = new QVBoxLayout(m_introPage, KDialog::marginHint());
+ m_introPage = new TQWidget(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_introPage, KDialog::marginHint());
- QLabel *lblIntro = new QLabel(m_introPage);
- lblIntro->setAlignment( Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak );
- QString msg;
+ TQLabel *lblIntro = new TQLabel(m_introPage);
+ lblIntro->tqsetAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak );
+ TQString msg;
if (m_predefinedConnectionData) { //predefined import: server source
msg = i18n("<qt>Database Importing wizard is about to import \"%1\" database "
"<nobr>(connection %2)</nobr> into a Kexi database.</qt>")
- .arg(m_predefinedDatabaseName).arg(m_predefinedConnectionData->serverInfoString());
+ .tqarg(m_predefinedDatabaseName).tqarg(m_predefinedConnectionData->serverInfoString());
}
else if (!m_predefinedDatabaseName.isEmpty()) { //predefined import: file source
//! @todo this message is currently ok for files only
KMimeType::Ptr mimeTypePtr = KMimeType::mimeType(m_predefinedMimeType);
msg = i18n("<qt>Database Importing wizard is about to import <nobr>\"%1\"</nobr> file "
"of type \"%2\" into a Kexi database.</qt>")
- .arg(QDir::convertSeparators(m_predefinedDatabaseName)).arg(mimeTypePtr->comment());
+ .tqarg(TQDir::convertSeparators(m_predefinedDatabaseName)).tqarg(mimeTypePtr->comment());
}
else {
msg = i18n("Database Importing wizard allows you to import an existing database "
@@ -177,13 +177,13 @@ void ImportWizard::setupIntro()
/*
void ImportWizard::setupSrcType()
{
- m_srcTypePage = new QWidget(this);
+ m_srcTypePage = new TQWidget(this);
//! @todo Would be good if KexiDBDriverComboBox worked for migration drivers
- QVBoxLayout *vbox = new QVBoxLayout(m_srcTypePage, KDialog::marginHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_srcTypePage, KDialog::marginHint());
- QHBoxLayout *hbox = new QHBoxLayout(vbox);
- QLabel *lbl = new QLabel(i18n("Source database type:")+" ", m_srcTypePage);
+ TQHBoxLayout *hbox = new TQHBoxLayout(vbox);
+ TQLabel *lbl = new TQLabel(i18n("Source database type:")+" ", m_srcTypePage);
hbox->addWidget(lbl);
m_srcTypeCombo = new KComboBox(m_srcTypePage);
@@ -193,7 +193,7 @@ void ImportWizard::setupSrcType()
lbl->setBuddy(m_srcTypeCombo);
MigrateManager manager;
- QStringList names = manager.driverNames();
+ TQStringList names = manager.driverNames();
m_srcTypeCombo->insertStringList(names);
addPage(m_srcTypePage, i18n("Select Source Database Type"));
@@ -203,8 +203,8 @@ void ImportWizard::setupSrcType()
//
void ImportWizard::setupSrcConn()
{
- m_srcConnPage = new QWidget(this);
- QVBoxLayout *vbox = new QVBoxLayout(m_srcConnPage, KDialog::marginHint());
+ m_srcConnPage = new TQWidget(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_srcConnPage, KDialog::marginHint());
m_srcConn = new KexiConnSelectorWidget(Kexi::connset(),
":ProjectMigrationSourceDir", m_srcConnPage, "m_srcConnSelector");
@@ -212,7 +212,7 @@ void ImportWizard::setupSrcConn()
m_srcConn->hideConnectonIcon();
m_srcConn->showSimpleConn();
- QStringList excludedFilters;
+ TQStringList excludedFilters;
//! @todo remove when support for kexi files as source prj is added in migration
excludedFilters += KexiDB::Driver::defaultFileBasedDriverMimeType();
excludedFilters += "application/x-kexiproject-shortcut";
@@ -229,7 +229,7 @@ void ImportWizard::setupSrcConn()
void ImportWizard::setupSrcDB()
{
// arrivesrcdbPage creates widgets on that page
- m_srcDBPage = new QWidget(this);
+ m_srcDBPage = new TQWidget(this);
m_srcDBName = NULL;
addPage(m_srcDBPage, i18n("Select Source Database"));
}
@@ -238,16 +238,16 @@ void ImportWizard::setupSrcDB()
//
void ImportWizard::setupDstType()
{
- m_dstTypePage = new QWidget(this);
+ m_dstTypePage = new TQWidget(this);
KexiDB::DriverManager manager;
KexiDB::Driver::InfoMap drvs = manager.driversInfo();
- QVBoxLayout *vbox = new QVBoxLayout(m_dstTypePage, KDialog::marginHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_dstTypePage, KDialog::marginHint());
- QHBoxLayout *hbox = new QHBoxLayout(vbox);
- QLabel *lbl = new QLabel(i18n("Destination database type:")+" ", m_dstTypePage);
- lbl->setAlignment(Qt::AlignAuto|Qt::AlignTop);
+ TQHBoxLayout *hbox = new TQHBoxLayout(vbox);
+ TQLabel *lbl = new TQLabel(i18n("Destination database type:")+" ", m_dstTypePage);
+ lbl->tqsetAlignment(TQt::AlignAuto|TQt::AlignTop);
hbox->addWidget(lbl);
m_dstPrjTypeSelector = new KexiPrjTypeSelector(m_dstTypePage);
@@ -255,7 +255,7 @@ void ImportWizard::setupDstType()
m_dstPrjTypeSelector->option_file->setText(i18n("Database project stored in a file"));
m_dstPrjTypeSelector->option_server->setText(i18n("Database project stored on a server"));
- QVBoxLayout *frame_server_vbox = new QVBoxLayout(m_dstPrjTypeSelector->frame_server, KDialog::spacingHint());
+ TQVBoxLayout *frame_server_vbox = new TQVBoxLayout(m_dstPrjTypeSelector->frame_server, KDialog::spacingHint());
m_dstServerTypeCombo = new KexiDBDriverComboBox(m_dstPrjTypeSelector->frame_server, drvs,
KexiDBDriverComboBox::ShowServerDrivers);
frame_server_vbox->addWidget(m_dstServerTypeCombo);
@@ -274,7 +274,7 @@ void ImportWizard::setupDstTitle()
{
m_dstTitlePage = new KexiDBTitlePage(i18n("Destination project's caption:"),
this, "KexiDBTitlePage");
- m_dstTitlePage->layout()->setMargin( KDialog::marginHint() );
+ m_dstTitlePage->tqlayout()->setMargin( KDialog::marginHint() );
m_dstTitlePage->updateGeometry();
m_dstNewDBNameLineEdit = m_dstTitlePage->le_caption;
addPage(m_dstTitlePage, i18n("Select Destination Database Project's Caption"));
@@ -284,18 +284,18 @@ void ImportWizard::setupDstTitle()
//
void ImportWizard::setupDst()
{
- m_dstPage = new QWidget(this);
- QVBoxLayout *vbox = new QVBoxLayout(m_dstPage, KDialog::marginHint());
+ m_dstPage = new TQWidget(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_dstPage, KDialog::marginHint());
m_dstConn = new KexiConnSelectorWidget(Kexi::connset(),
":ProjectMigrationDestinationDir", m_dstPage, "m_dstConnSelector");
m_dstConn->hideHelpers();
//me: Can't connect m_dstConn->m_fileDlg here, it doesn't exist yet
- //connect(this, SLOT(next()), m_dstConn->m_fileDlg, SIGNAL(accepted()));
+ //connect(this, TQT_SLOT(next()), m_dstConn->m_fileDlg, TQT_SIGNAL(accepted()));
vbox->addWidget( m_dstConn );
- connect(m_dstConn,SIGNAL(connectionItemExecuted(ConnectionDataLVItem*)),
- this,SLOT(next()));
+ connect(m_dstConn,TQT_SIGNAL(connectionItemExecuted(ConnectionDataLVItem*)),
+ this,TQT_SLOT(next()));
// m_dstConn->hideHelpers();
m_dstConn->showSimpleConn();
@@ -317,14 +317,14 @@ void ImportWizard::setupDst()
//
void ImportWizard::setupImportType()
{
- m_importTypePage = new QWidget(this);
- QVBoxLayout *vbox = new QVBoxLayout(m_importTypePage, KDialog::marginHint());
- m_importTypeButtonGroup = new QVButtonGroup(m_importTypePage);
+ m_importTypePage = new TQWidget(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_importTypePage, KDialog::marginHint());
+ m_importTypeButtonGroup = new TQVButtonGroup(m_importTypePage);
m_importTypeButtonGroup->setLineWidth(0);
vbox->addWidget( m_importTypeButtonGroup );
- (void)new QRadioButton(i18n("Structure and data"), m_importTypeButtonGroup);
- (void)new QRadioButton(i18n("Structure only"), m_importTypeButtonGroup);
+ (void)new TQRadioButton(i18n("Structure and data"), m_importTypeButtonGroup);
+ (void)new TQRadioButton(i18n("Structure only"), m_importTypeButtonGroup);
m_importTypeButtonGroup->setExclusive( true );
m_importTypeButtonGroup->setButton( 0 );
@@ -335,14 +335,14 @@ void ImportWizard::setupImportType()
//
void ImportWizard::setupImporting()
{
- m_importingPage = new QWidget(this);
+ m_importingPage = new TQWidget(this);
m_importingPage->hide();
- QVBoxLayout *vbox = new QVBoxLayout(m_importingPage, KDialog::marginHint());
- m_lblImportingTxt = new QLabel(m_importingPage);
- m_lblImportingTxt->setAlignment( Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak );
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_importingPage, KDialog::marginHint());
+ m_lblImportingTxt = new TQLabel(m_importingPage);
+ m_lblImportingTxt->tqsetAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak );
- m_lblImportingErrTxt = new QLabel(m_importingPage);
- m_lblImportingErrTxt->setAlignment( Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak );
+ m_lblImportingErrTxt = new TQLabel(m_importingPage);
+ m_lblImportingErrTxt->tqsetAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak );
m_progressBar = new KProgress(100, m_importingPage);
m_progressBar->hide();
@@ -353,7 +353,7 @@ void ImportWizard::setupImporting()
KButtonBox *optionsBox = new KButtonBox(m_importingPage);
vbox->addWidget( optionsBox );
- m_importOptionsButton = optionsBox->addButton(i18n("Advanced Options"), this, SLOT(slotOptionsButtonClicked()));
+ m_importOptionsButton = optionsBox->addButton(i18n("Advanced Options"), TQT_TQOBJECT(this), TQT_SLOT(slotOptionsButtonClicked()));
m_importOptionsButton->setIconSet(SmallIconSet("configure"));
optionsBox->addStretch(1);
@@ -370,14 +370,14 @@ void ImportWizard::setupImporting()
//
void ImportWizard::setupFinish()
{
- m_finishPage = new QWidget(this);
+ m_finishPage = new TQWidget(this);
m_finishPage->hide();
- QVBoxLayout *vbox = new QVBoxLayout(m_finishPage, KDialog::marginHint());
- m_finishLbl = new QLabel(m_finishPage);
- m_finishLbl->setAlignment( Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak );
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_finishPage, KDialog::marginHint());
+ m_finishLbl = new TQLabel(m_finishPage);
+ m_finishLbl->tqsetAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak );
vbox->addWidget( m_finishLbl );
- m_openImportedProjectCheckBox = new QCheckBox(i18n("Open imported project"),
+ m_openImportedProjectCheckBox = new TQCheckBox(i18n("Open imported project"),
m_finishPage, "openImportedProjectCheckBox");
m_openImportedProjectCheckBox->setChecked(true);
vbox->addSpacing( KDialog::spacingHint() );
@@ -391,14 +391,14 @@ void ImportWizard::setupFinish()
//
bool ImportWizard::checkUserInput()
{
- QString finishtxt;
+ TQString finishtxt;
if (m_dstNewDBNameLineEdit->text().isEmpty())
{
finishtxt = finishtxt + "<br>" + i18n("No new database name was entered.");
}
- Kexi::ObjectStatus result;
+ Kexi::ObjecttqStatus result;
KexiMigrate* sourceDriver = prepareImport(result);
if (sourceDriver && sourceDriver->isSourceAndDestinationDataSourceTheSame())
{
@@ -427,17 +427,17 @@ void ImportWizard::arriveSrcConnPage()
in addition to just "open" */
if (m_setupFileBasedSrcNeeded) {
m_setupFileBasedSrcNeeded = false;
- QStringList additionalMimeTypes;
+ TQStringList additionalMimeTypes;
/* moved
- if (m_srcTypeCombo->currentText().contains("Access")) {
+ if (m_srcTypeCombo->currentText().tqcontains("Access")) {
//! @todo tmp: hardcoded!
additionalMimeTypes << "application/x-msaccess";
}*/
m_srcConn->m_fileDlg->setMode(KexiStartupFileDialog::Opening);
m_srcConn->m_fileDlg->setAdditionalFilters(additionalMimeTypes);
-/*moved if (m_srcTypeCombo->currentText().contains("Access")) {
+/*moved if (m_srcTypeCombo->currentText().tqcontains("Access")) {
//! @todo tmp: hardcoded!
- #ifdef Q_WS_WIN
+ #ifdef TQ_WS_WIN
m_srcConn->m_fileDlg->setSelectedFilter("*.mdb");
#else
m_srcConn->m_fileDlg->setFilter("*.mdb");
@@ -445,7 +445,7 @@ void ImportWizard::arriveSrcConnPage()
}*/
//m_srcConn->m_file->label->hide();
//m_srcConn->m_file->btn_advanced->hide();
- //m_srcConn->m_file->label->parentWidget()->hide();
+ //m_srcConn->m_file->label->tqparentWidget()->hide();
}
// } else {
// m_srcConn->showAdvancedConn();
@@ -467,7 +467,7 @@ void ImportWizard::arriveSrcDBPage()
KexiDB::ConnectionData* condata = m_srcConn->selectedConnectionData();
if(condata) {
m_prjSet = new KexiProjectSet(*condata);
- QVBoxLayout *vbox = new QVBoxLayout(m_srcDBPage, KDialog::marginHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(m_srcDBPage, KDialog::marginHint());
m_srcDBName = new KexiProjectSelectorWidget(m_srcDBPage,
"KexiMigrationProjectSelector", m_prjSet);
vbox->addWidget( m_srcDBName );
@@ -480,8 +480,8 @@ void ImportWizard::arriveSrcDBPage()
void ImportWizard::arriveDstTitlePage()
{
if(fileBasedSrcSelected()) {
- QString suggestedDBName( QFileInfo(m_srcConn->selectedFileName()).fileName() );
- const QFileInfo fi( suggestedDBName );
+ TQString suggestedDBName( TQFileInfo(m_srcConn->selectedFileName()).fileName() );
+ const TQFileInfo fi( suggestedDBName );
suggestedDBName = suggestedDBName.left(suggestedDBName.length()
- (fi.extension().length() ? (fi.extension().length()+1) : 0));
m_dstNewDBNameLineEdit->setText( suggestedDBName );
@@ -551,11 +551,11 @@ void ImportWizard::arriveImportingPage() {
//! and KexiMigration::Driver classes
bool showOptions = false;
if (fileBasedSrcSelected()) {
- Kexi::ObjectStatus result;
+ Kexi::ObjecttqStatus result;
KexiMigrate* sourceDriver = prepareImport(result);
if (sourceDriver) {
showOptions = !result.error()
- && sourceDriver->propertyValue( "source_database_has_nonunicode_encoding" ).toBool();
+ && sourceDriver->propertyValue( "source_database_has_nontqunicode_encoding" ).toBool();
KexiMigration::Data *data = sourceDriver->data();
sourceDriver->setData( 0 );
delete data;
@@ -572,7 +572,7 @@ void ImportWizard::arriveImportingPage() {
void ImportWizard::arriveFinishPage() {
// backButton()->hide();
// cancelButton()->setEnabled(false);
-// m_finishLbl->setText( m_successText.arg(m_dstNewDBNameLineEdit->text()) );
+// m_finishLbl->setText( m_successText.tqarg(m_dstNewDBNameLineEdit->text()) );
}
bool ImportWizard::fileBasedSrcSelected() const
@@ -586,7 +586,7 @@ bool ImportWizard::fileBasedSrcSelected() const
bool ImportWizard::fileBasedDstSelected() const
{
-// QString dstType(m_dstServerTypeCombo->currentText());
+// TQString dstType(m_dstServerTypeCombo->currentText());
return m_dstPrjTypeSelector->buttonGroup->selectedId() == 1;
@@ -605,7 +605,7 @@ void ImportWizard::progressUpdated(int percent) {
//===========================================================
//
-QString ImportWizard::driverNameForSelectedSource()
+TQString ImportWizard::driverNameForSelectedSource()
{
if (fileBasedSrcSelected()) {
KMimeType::Ptr ptr = KMimeType::findByFileContent( m_srcConn->selectedFileName() );
@@ -613,7 +613,7 @@ QString ImportWizard::driverNameForSelectedSource()
//try by URL:
ptr = KMimeType::findByURL( m_srcConn->selectedFileName() );
}
- return ptr ? m_migrateManager.driverForMimeType( ptr.data()->name() ) : QString::null;
+ return ptr ? m_migrateManager.driverForMimeType( ptr.data()->name() ) : TQString();
}
//server-based
@@ -622,7 +622,7 @@ QString ImportWizard::driverNameForSelectedSource()
}
return m_srcConn->selectedConnectionData()
- ? m_srcConn->selectedConnectionData()->driverName : QString::null;
+ ? m_srcConn->selectedConnectionData()->driverName : TQString();
}
//===========================================================
@@ -639,7 +639,7 @@ void ImportWizard::accept()
// cancelButton()->setEnabled(true);
*/
if (m_args) {
- if ((!fileBasedDstSelected() && !m_args->contains("destinationConnectionShortcut"))
+ if ((!fileBasedDstSelected() && !m_args->tqcontains("destinationConnectionShortcut"))
|| !m_openImportedProjectCheckBox->isChecked())
{
//do not open dest db if used didn't want it
@@ -650,7 +650,7 @@ void ImportWizard::accept()
KWizard::accept();
}
-KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result)
+KexiMigrate* ImportWizard::prepareImport(Kexi::ObjecttqStatus& result)
{
KexiUtils::WaitCursor wait;
@@ -667,16 +667,16 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result)
);
if (!destDriver || manager.error())
{
- result.setStatus(&manager);
+ result.settqStatus(&manager);
kdDebug() << "Manager error..." << endl;
manager.debugError();
-// result.setStatus(&manager);
+// result.settqStatus(&manager);
}
// Set up destination connection data
KexiDB::ConnectionData *cdata;
bool cdataOwned = false;
- QString dbname;
+ TQString dbname;
if (!result.error())
{
if (m_dstConn->selectedConnectionData())
@@ -702,18 +702,18 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result)
{
//TODO This needs a better message
//KMessageBox::error(this,
- result.setStatus(i18n("No connection data is available. You did not select a destination filename."),"");
+ result.settqStatus(i18n("No connection data is available. You did not select a destination filename."),"");
//return false;
} */
}
// Find a source (migration) driver name
- QString sourceDriverName;
+ TQString sourceDriverName;
if (!result.error())
{
sourceDriverName = driverNameForSelectedSource();
if (sourceDriverName.isEmpty())
- result.setStatus(i18n("No appropriate migration driver found."),
+ result.settqStatus(i18n("No appropriate migration driver found."),
m_migrateManager.possibleProblemsInfoMsg());
}
@@ -724,7 +724,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result)
sourceDriver = m_migrateManager.driver( sourceDriverName );
if(!sourceDriver || m_migrateManager.error()) {
kdDebug() << "Import migrate driver error..." << endl;
- result.setStatus(&m_migrateManager);
+ result.settqStatus(&m_migrateManager);
}
}
@@ -736,10 +736,10 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result)
// Setup progress feedback for the GUI
if(sourceDriver->progressSupported()) {
m_progressBar->updateGeometry();
- disconnect(sourceDriver, SIGNAL(progressPercent(int)),
- this, SLOT(progressUpdated(int)));
- connect(sourceDriver, SIGNAL(progressPercent(int)),
- this, SLOT(progressUpdated(int)));
+ disconnect(sourceDriver, TQT_SIGNAL(progressPercent(int)),
+ this, TQT_SLOT(progressUpdated(int)));
+ connect(sourceDriver, TQT_SIGNAL(progressPercent(int)),
+ this, TQT_SLOT(progressUpdated(int)));
progressUpdated(0);
}
@@ -793,7 +793,7 @@ tristate ImportWizard::import()
{
m_importExecuted = true;
- Kexi::ObjectStatus result;
+ Kexi::ObjecttqStatus result;
KexiMigrate* sourceDriver = prepareImport(result);
bool acceptingNeeded = false;
@@ -802,8 +802,8 @@ tristate ImportWizard::import()
if (sourceDriver && !result.error())
{
if (!m_sourceDBEncoding.isEmpty()) {
- sourceDriver->setPropertyValue( "source_database_nonunicode_encoding",
- QVariant(m_sourceDBEncoding.upper().replace(' ',"")) // "CP1250", not "cp 1250"
+ sourceDriver->setPropertyValue( "source_database_nontqunicode_encoding",
+ TQVariant(m_sourceDBEncoding.upper().tqreplace(' ',"")) // "CP1250", not "cp 1250"
);
}
@@ -820,7 +820,7 @@ tristate ImportWizard::import()
if (KMessageBox::Yes != KMessageBox::warningYesNo(this,
"<qt>"+i18n("Database %1 already exists."
"<p>Do you want to replace it with a new one?")
- .arg(sourceDriver->data()->destination->infoString()),
+ .tqarg(sourceDriver->data()->destination->infoString()),
0, KGuiItem(i18n("&Replace")), KGuiItem(i18n("No"))))
{
return cancelled;
@@ -838,7 +838,7 @@ tristate ImportWizard::import()
m_args->insert("destinationDatabaseName",
sourceDriver->data()->destination->databaseName());
// }
- QString destinationConnectionShortcut(
+ TQString destinationConnectionShortcut(
Kexi::connset().fileNameForConnectionData( m_dstConn->selectedConnectionData() ) );
if (!destinationConnectionShortcut.isEmpty()) {
m_args->insert("destinationConnectionShortcut", destinationConnectionShortcut);
@@ -853,7 +853,7 @@ tristate ImportWizard::import()
m_progressBar->setProgress(0);
m_progressBar->hide();
- QString msg, details;
+ TQString msg, details;
KexiTextMessageHandler handler(msg, details);
handler.showErrorMessage(&result);
@@ -861,7 +861,7 @@ tristate ImportWizard::import()
setTitle(m_finishPage, i18n("Failure"));
m_finishLbl->setText(
i18n("<p>Import failed.</p>%1<p>%2</p><p>You can click \"Back\" button and try again.</p>")
- .arg(msg).arg(details));
+ .tqarg(msg).tqarg(details));
return false;
}
// delete kexi_conn;
@@ -879,7 +879,7 @@ void ImportWizard::next()
{
if (currentPage() == m_srcConnPage) {
if (fileBasedSrcSelected()
- && /*! @todo use KURL? */!QFileInfo(m_srcConn->selectedFileName()).isFile()) {
+ && /*! @todo use KURL? */!TQFileInfo(m_srcConn->selectedFileName()).isFile()) {
KMessageBox::sorry(this,i18n("Select source database filename."));
return;
@@ -892,16 +892,16 @@ void ImportWizard::next()
KexiMigrate* import = m_migrateManager.driver( driverNameForSelectedSource() );
if(!import || m_migrateManager.error()) {
- QString dbname;
+ TQString dbname;
if (fileBasedSrcSelected())
dbname = m_srcConn->selectedFileName();
else
dbname = m_srcConn->selectedConnectionData()
- ? m_srcConn->selectedConnectionData()->serverInfoString() : QString::null;
+ ? m_srcConn->selectedConnectionData()->serverInfoString() : TQString();
if (!dbname.isEmpty())
- dbname = QString(" \"%1\"").arg(dbname);
+ dbname = TQString(" \"%1\"").tqarg(dbname);
KMessageBox::error(this, i18n("Could not import database%1. This type is not supported.")
- .arg(dbname));
+ .tqarg(dbname));
return;
}
}
@@ -922,7 +922,7 @@ void ImportWizard::next()
if (true == res) {
m_finishLbl->setText(
i18n("Database has been imported into Kexi database project \"%1\".")
- .arg(m_dstNewDBNameLineEdit->text()) );
+ .tqarg(m_dstNewDBNameLineEdit->text()) );
cancelButton()->setEnabled(false);
setBackEnabled(m_finishPage, false);
setFinishEnabled(m_finishPage, true);
@@ -957,7 +957,7 @@ void ImportWizard::back()
KWizard::back();
}
-void ImportWizard::pageSelected(const QString &)
+void ImportWizard::pageSelected(const TQString &)
{
if (currentPage() == m_introPage) {
}
@@ -1020,7 +1020,7 @@ void ImportWizard::helpClicked()
void ImportWizard::slotOptionsButtonClicked()
{
OptionsDialog dlg(m_srcConn->selectedFileName(), m_sourceDBEncoding, this);
- if (QDialog::Accepted != dlg.exec())
+ if (TQDialog::Accepted != dlg.exec())
return;
if (m_sourceDBEncoding != dlg.encodingComboBox()->selectedEncoding()) {
diff --git a/kexi/migration/importwizard.h b/kexi/migration/importwizard.h
index 7d51a934..95da22cd 100644
--- a/kexi/migration/importwizard.h
+++ b/kexi/migration/importwizard.h
@@ -29,12 +29,12 @@
#include <kexiutils/tristate.h>
#include "migratemanager.h"
-class QLabel;
-class QCheckBox;
-class QPushButton;
-class QHBoxLayout;
-class QVBoxLayout;
-class QVButtonGroup;
+class TQLabel;
+class TQCheckBox;
+class TQPushButton;
+class TQHBoxLayout;
+class TQVBoxLayout;
+class TQVButtonGroup;
class KComboBox;
class KListView;
class KLineEdit;
@@ -47,7 +47,7 @@ class KexiPrjTypeSelector;
namespace Kexi
{
- class ObjectStatus;
+ class ObjecttqStatus;
}
namespace KexiDB
@@ -63,12 +63,13 @@ class KexiMigrate;
class KEXIMIGR_EXPORT ImportWizard : public KWizard
{
Q_OBJECT
+ TQ_OBJECT
public:
/*! Creates wizard's instance.
\a args contains arguments that can be parsed by parseArguments().
\a *arg will be also set to imported project's filename on success
and to null value on failure or cancellation. */
- ImportWizard(QWidget *parent = 0, QMap<QString,QString>* args = 0);
+ ImportWizard(TQWidget *tqparent = 0, TQMap<TQString,TQString>* args = 0);
virtual ~ImportWizard();
public slots:
@@ -77,7 +78,7 @@ public slots:
protected slots:
virtual void next();
virtual void back();
- void pageSelected(const QString &);
+ void pageSelected(const TQString &);
virtual void accept();
virtual void reject();
void helpClicked();
@@ -97,7 +98,7 @@ private:
void setupImporting();
bool checkUserInput();
- KexiMigrate* prepareImport(Kexi::ObjectStatus& result);
+ KexiMigrate* prepareImport(Kexi::ObjecttqStatus& result);
/*! Performs import. \return true/false on success/faulure
or cancelled when user cancelled importing (mainly
@@ -106,9 +107,9 @@ private:
bool fileBasedSrcSelected() const;
bool fileBasedDstSelected() const;
- QString driverNameForSelectedSource();
-// void checkIfSrcTypeFileBased(const QString& srcType);
-// void checkIfDstTypeFileBased(const QString& dstType);
+ TQString driverNameForSelectedSource();
+// void checkIfSrcTypeFileBased(const TQString& srcType);
+// void checkIfDstTypeFileBased(const TQString& dstType);
void arriveSrcConnPage();
void arriveSrcDBPage();
@@ -117,10 +118,10 @@ private:
void arriveFinishPage();
void arriveImportingPage();
- QWidget *m_introPage, /* *m_srcTypePage,*/ *m_srcConnPage, *m_srcDBPage,
+ TQWidget *m_introPage, /* *m_srcTypePage,*/ *m_srcConnPage, *m_srcDBPage,
*m_dstTypePage, *m_dstPage, *m_importTypePage, *m_importingPage, *m_finishPage;
- QVButtonGroup *m_importTypeButtonGroup;
+ TQVButtonGroup *m_importTypeButtonGroup;
KexiDBTitlePage* m_dstTitlePage;
KComboBox *m_srcTypeCombo;
@@ -131,21 +132,21 @@ private:
KLineEdit *m_dstNewDBNameLineEdit;
KexiProjectSelectorWidget *m_srcDBName;
- QLabel *m_lblImportingTxt, *m_lblImportingErrTxt, *m_finishLbl;
- QCheckBox *m_openImportedProjectCheckBox;
+ TQLabel *m_lblImportingTxt, *m_lblImportingErrTxt, *m_finishLbl;
+ TQCheckBox *m_openImportedProjectCheckBox;
bool m_fileBasedDstWasPresented, m_setupFileBasedSrcNeeded,
m_importExecuted; //!< used in import()
KexiProjectSet* m_prjSet;
KProgress *m_progressBar;
- QPushButton* m_importOptionsButton;
- QMap<QString,QString> *m_args;
- QString m_predefinedDatabaseName, m_predefinedMimeType;
+ TQPushButton* m_importOptionsButton;
+ TQMap<TQString,TQString> *m_args;
+ TQString m_predefinedDatabaseName, m_predefinedMimeType;
KexiDB::ConnectionData *m_predefinedConnectionData;
MigrateManager m_migrateManager; //!< object lives here, so status messages can be globally preserved
//! Encoding for source db. Currently only used for MDB driver.
//! @todo Hardcoded. Move to KexiMigrate driver's impl.
- QString m_sourceDBEncoding;
+ TQString m_sourceDBEncoding;
};
}
diff --git a/kexi/migration/keximigrate.cpp b/kexi/migration/keximigrate.cpp
index 26229323..989a002a 100644
--- a/kexi/migration/keximigrate.cpp
+++ b/kexi/migration/keximigrate.cpp
@@ -33,9 +33,9 @@
using namespace KexiDB;
using namespace KexiMigration;
-KexiMigrate::KexiMigrate(QObject *parent, const char *name,
- const QStringList&)
- : QObject( parent, name )
+KexiMigrate::KexiMigrate(TQObject *tqparent, const char *name,
+ const TQStringList&)
+ : TQObject( tqparent, name )
, m_migrateData(0)
, m_destPrj(0)
{
@@ -61,20 +61,20 @@ KexiMigrate::~KexiMigrate()
delete m_destPrj;
}
-bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjectStatus* result,
+bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjecttqStatus* result,
bool& acceptingNeeded)
{
acceptingNeeded = false;
if (result)
- result->clearStatus();
+ result->cleartqStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->setStatus(&drvManager,
+ result->settqStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
return false;
}
@@ -113,30 +113,30 @@ bool KexiMigrate::isSourceAndDestinationDataSourceTheSame() const
//=============================================================================
// Perform Import operation
-bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
+bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
{
if (result)
- result->clearStatus();
+ result->cleartqStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->setStatus(&drvManager,
+ result->settqStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
return false;
}
- QStringList tables;
+ TQStringList tables;
// Step 1 - connect
kdDebug() << "KexiMigrate::performImport() CONNECTING..." << endl;
if (!drv_connect()) {
kdDebug() << "Couldnt connect to database server" << endl;
if (result)
- result->setStatus(i18n("Could not connect to data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ result->settqStatus(i18n("Could not connect to data source \"%1\".")
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -145,9 +145,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (!tableNames(tables)) {
kdDebug() << "Couldnt get list of tables" << endl;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("Could not get a list of table names for data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -155,9 +155,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (tables.isEmpty()) {
kdDebug() << "There were no tables to import" << endl;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("No tables to import found in data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -165,20 +165,20 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
tables.sort();
m_tableSchemas.clear();
if (!destDriver) {
- result->setStatus(&drvManager);
+ result->settqStatus(&drvManager);
return false;
}
- const bool kexi__objects_exists = tables.find("kexi__objects")!=tables.end();
- QStringList kexiDBTables;
+ const bool kexi__objects_exists = tables.tqfind("kexi__objects")!=tables.end();
+ TQStringList kexiDBTables;
if (kexi__objects_exists) {
tristate res = drv_queryStringListFromSQL(
- QString::fromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
- .arg((int)KexiDB::TableObjectType), 0, kexiDBTables, -1);
+ TQString::tqfromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
+ .tqarg((int)KexiDB::TableObjectType), 0, kexiDBTables, -1);
if (res == true) {
// prepend KexiDB-compatible tables to 'tables' list, so we'll copy KexiDB-compatible tables first,
// to make sure existing IDs will not be in conflict with IDs newly generated for non-KexiDB tables
kexiDBTables.sort();
- foreach(QStringList::ConstIterator, it, kexiDBTables)
+ foreach(TQStringList::ConstIterator, it, kexiDBTables)
tables.remove( *it );
//kdDebug() << "KexiDB-compat tables: " << kexiDBTables << endl;
//kdDebug() << "non-KexiDB tables: " << tables << endl;
@@ -187,21 +187,21 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
// uint i=0;
// -- read table schemas and create them in memory (only for non-KexiDB-compat tables)
- foreach (QStringList::ConstIterator, it, tables) {
+ foreach (TQStringList::ConstIterator, it, tables) {
if (destDriver->isSystemObjectName( *it ) //"kexi__objects", etc.
|| (*it).lower().startsWith("kexi__")) //tables at KexiProject level, e.g. "kexi__blobs"
continue;
// this is a non-KexiDB table: generate schema from native data source
- const QString tableName( KexiUtils::string2Identifier(*it) );
+ const TQString tableName( KexiUtils::string2Identifier(*it) );
KexiDB::TableSchema *tableSchema = new KexiDB::TableSchema(tableName);
tableSchema->setCaption( *it ); //caption is equal to the original name
if (!drv_readTableSchema(*it, *tableSchema)) {
delete tableSchema;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("Could not import project from data source \"%1\". Error reading table \"%2\".")
- .arg(m_migrateData->source->serverInfoString()).arg(tableName), "");
+ .tqarg(m_migrateData->source->serverInfoString()).tqarg(tableName), "");
return false;
}
//yeah, got a table
@@ -228,9 +228,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (trans.isNull()) {
ok = false;
if (result)
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
//later destConn->dropDatabase(m_migrateData->destination->databaseName());
//don't delete prj, otherwise eror message will be deleted delete prj;
//later return m_destPrj;
@@ -243,24 +243,24 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
// Step 5 - Create the copies of KexiDB-compat tables in memory (to maintain the same IDs)
m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport.clear();
- foreach (QStringList::ConstIterator, it, kexiDBTables) {
+ foreach (TQStringList::ConstIterator, it, kexiDBTables) {
//load the schema from kexi__objects and kexi__fields
TableSchema *t = new TableSchema();
RowData data;
bool firstRecord = true;
if (true == drv_fetchRecordFromSQL(
- QString("SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects "
- "WHERE o_name='%1' AND o_type=%1").arg(*it).arg((int)KexiDB::TableObjectType),
+ TQString("SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects "
+ "WHERE o_name='%1' AND o_type=%1").tqarg(*it).tqarg((int)KexiDB::TableObjectType),
data, firstRecord)
&& destConn->setupObjectSchemaData( data, *t ))
{
//! @todo to reuse Connection::setupTableSchema()'s statement somehow...
//load schema for every field and add it
firstRecord = true;
- QString sql(
- QString::fromLatin1("SELECT t_id, f_type, f_name, f_length, f_precision, f_constraints, "
+ TQString sql(
+ TQString::tqfromLatin1("SELECT t_id, f_type, f_name, f_length, f_precision, f_constraints, "
"f_options, f_default, f_order, f_caption, f_help"
- " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").arg(t->id()) );
+ " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").tqarg(t->id()) );
while (ok) {
tristate res = drv_fetchRecordFromSQL(sql, data, firstRecord);
if (res != true) {
@@ -293,19 +293,19 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
// Step 7 - Create the non-KexiDB-compatible tables: new IDs will be assigned to them
if (ok) {
KexiDB::TableSchema *ts;
- for (QPtrListIterator<TableSchema> it (m_tableSchemas); (ts = it.current()); ++it) {
+ for (TQPtrListIterator<TableSchema> it (m_tableSchemas); (ts = it.current()); ++it) {
ok = destConn->createTable( ts );
if (!ok) {
kdDebug() << "Failed to create a table " << ts->name() << endl;
destConn->debugError();
if (result)
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
m_tableSchemas.remove(ts);
break;
}
- updateProgress((Q_ULLONG)NUM_OF_ROWS_PER_CREATE_TABLE);
+ updateProgress((TQ_ULLONG)NUM_OF_ROWS_PER_CREATE_TABLE);
}
}
@@ -315,7 +315,7 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (ok) {
//add compatible tables to the list, so data will be copied, if needed
if (m_migrateData->keepData) {
- for(QPtrListIterator<TableSchema> it (m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport);
+ for(TQPtrListIterator<TableSchema> it (m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport);
it.current(); ++it)
{
m_tableSchemas.append(it.current());
@@ -329,9 +329,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (m_destPrj->error()) {
ok = false;
if (result)
- result->setStatus(m_destPrj,
+ result->settqStatus(m_destPrj,
i18n("Could not import project from data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()));
+ .tqarg(m_migrateData->source->serverInfoString()));
}
}
@@ -344,19 +344,19 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (m_migrateData->keepData) {
//! @todo check detailed "copy forms/blobs/tables" flags here when we add them
// Copy data for "kexi__objectdata" as well, if available in the source db
- if (tables.find("kexi__objectdata")!=tables.end())
+ if (tables.tqfind("kexi__objectdata")!=tables.end())
m_tableSchemas.append(destConn->tableSchema("kexi__objectdata"));
// Copy data for "kexi__blobs" as well, if available in the source db
- if (tables.find("kexi__blobs")!=tables.end())
+ if (tables.tqfind("kexi__blobs")!=tables.end())
m_tableSchemas.append(destConn->tableSchema("kexi__blobs"));
// Copy data for "kexi__fields" as well, if available in the source db
- if (tables.find("kexi__fields")!=tables.end())
+ if (tables.tqfind("kexi__fields")!=tables.end())
m_tableSchemas.append(destConn->tableSchema("kexi__fields"));
}
- for(QPtrListIterator<TableSchema> ts(m_tableSchemas); ok && ts.current() != 0 ; ++ts)
+ for(TQPtrListIterator<TableSchema> ts(m_tableSchemas); ok && ts.current() != 0 ; ++ts)
{
- const QString tname( ts.current()->name().lower() );
+ const TQString tname( ts.current()->name().lower() );
if (destConn->driver()->isSystemObjectName( tname )
//! @todo what if these two tables are not compatible with tables created in destination db
//! because newer db format was used?
@@ -370,8 +370,8 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
continue;
}
kdDebug() << "Copying data for table: " << tname << endl;
- QString originalTableName;
- if (kexiDBTables.find(tname)==kexiDBTables.end())
+ TQString originalTableName;
+ if (kexiDBTables.tqfind(tname)==kexiDBTables.end())
//caption is equal to the original name
originalTableName = ts.current()->caption().isEmpty() ? tname : ts.current()->caption();
else
@@ -380,8 +380,8 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (!ok) {
kdDebug() << "Failed to copy table " << tname << endl;
if (result)
- result->setStatus(destConn,
- i18n("Could not copy table \"%1\" to destination database.").arg(tname));
+ result->settqStatus(destConn,
+ i18n("Could not copy table \"%1\" to destination database.").tqarg(tname));
break;
}
}//for
@@ -404,9 +404,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
// Finally: error handling
if (result && result->error())
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not import data from data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()));
+ .tqarg(m_migrateData->source->serverInfoString()));
if (destConn) {
destConn->debugError();
destConn->rollbackTransaction(trans);
@@ -420,10 +420,10 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
}
//=============================================================================
-bool KexiMigrate::performExport(Kexi::ObjectStatus* result)
+bool KexiMigrate::performExport(Kexi::ObjecttqStatus* result)
{
if (result)
- result->clearStatus();
+ result->cleartqStatus();
//! @todo performExport
@@ -432,7 +432,7 @@ bool KexiMigrate::performExport(Kexi::ObjectStatus* result)
//=============================================================================
// Functions for getting table data
-bool KexiMigrate::tableNames(QStringList & tn)
+bool KexiMigrate::tableNames(TQStringList & tn)
{
//! @todo Cache list of table names
kdDebug() << "Reading list of tables..." << endl;
@@ -442,17 +442,17 @@ bool KexiMigrate::tableNames(QStringList & tn)
//=============================================================================
// Progress functions
bool KexiMigrate::progressInitialise() {
- Q_ULLONG sum = 0, size;
+ TQ_ULLONG sum = 0, size;
emit progressPercent(0);
//! @todo Don't copy table names here
- QStringList tables;
+ TQStringList tables;
if(!tableNames(tables))
return false;
// 1) Get the number of rows/bytes to import
int tableNumber = 1;
- for(QStringList::Iterator it = tables.begin();
+ for(TQStringList::Iterator it = tables.begin();
it != tables.end(); ++it, tableNumber++)
{
if(drv_getTableSize(*it, size)) {
@@ -475,7 +475,7 @@ bool KexiMigrate::progressInitialise() {
}
-void KexiMigrate::updateProgress(Q_ULLONG step) {
+void KexiMigrate::updateProgress(TQ_ULLONG step) {
m_progressDone += step;
if (m_progressDone >= m_progressNextReport) {
int percent = (m_progressDone+1) * 100 / m_progressTotal;
@@ -489,11 +489,11 @@ void KexiMigrate::updateProgress(Q_ULLONG step) {
//=============================================================================
// Prompt the user to choose a field type
-KexiDB::Field::Type KexiMigrate::userType(const QString& fname)
+KexiDB::Field::Type KexiMigrate::userType(const TQString& fname)
{
KInputDialog *dlg;
- QStringList types;
- QString res;
+ TQStringList types;
+ TQString res;
types << "Byte";
types << "Short Integer";
@@ -512,10 +512,10 @@ KexiDB::Field::Type KexiMigrate::userType(const QString& fname)
res = dlg->getItem( i18n("Field Type"),
i18n("The data type for %1 could not be determined. "
"Please select one of the following data "
- "types").arg(fname),
+ "types").tqarg(fname),
types, 0, false);
-//! @todo use QMap<QCString, KexiDB::Field::Type> here!
+//! @todo use TQMap<TQCString, KexiDB::Field::Type> here!
if (res == *types.at(0))
return KexiDB::Field::Byte;
else if (res == *types.at(1))
@@ -546,24 +546,24 @@ KexiDB::Field::Type KexiMigrate::userType(const QString& fname)
return KexiDB::Field::Text;
}
-QVariant KexiMigrate::propertyValue( const QCString& propName )
+TQVariant KexiMigrate::propertyValue( const TQCString& propName )
{
return m_properties[propName.lower()];
}
-QString KexiMigrate::propertyCaption( const QCString& propName ) const
+TQString KexiMigrate::propertyCaption( const TQCString& propName ) const
{
return m_propertyCaptions[propName.lower()];
}
-void KexiMigrate::setPropertyValue( const QCString& propName, const QVariant& value )
+void KexiMigrate::setPropertyValue( const TQCString& propName, const TQVariant& value )
{
m_properties[propName.lower()] = value;
}
-QValueList<QCString> KexiMigrate::propertyNames() const
+TQValueList<TQCString> KexiMigrate::propertyNames() const
{
- QValueList<QCString> names = m_properties.keys();
+ TQValueList<TQCString> names = m_properties.keys();
qHeapSort(names);
return names;
}
@@ -575,21 +575,21 @@ bool KexiMigrate::isValid()
{
setError(ERR_INCOMPAT_DRIVER_VERSION,
i18n("Incompatible migration driver's \"%1\" version: found version %2, expected version %3.")
- .arg(name())
- .arg(QString("%1.%2").arg(versionMajor()).arg(versionMinor()))
- .arg(QString("%1.%2").arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor())));
+ .tqarg(name())
+ .tqarg(TQString("%1.%2").tqarg(versionMajor()).tqarg(versionMinor()))
+ .tqarg(TQString("%1.%2").tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor())));
return false;
}
return true;
}
-bool KexiMigrate::drv_queryMaxNumber(const QString& tableName,
- const QString& columnName, int& result)
+bool KexiMigrate::drv_queryMaxNumber(const TQString& tableName,
+ const TQString& columnName, int& result)
{
- QString string;
+ TQString string;
tristate r = drv_querySingleStringFromSQL(
- QString::fromLatin1("SELECT MAX(%1) FROM %2").arg(drv_escapeIdentifier(columnName))
- .arg(drv_escapeIdentifier(tableName)), 0, string);
+ TQString::tqfromLatin1("SELECT MAX(%1) FROM %2").tqarg(drv_escapeIdentifier(columnName))
+ .tqarg(drv_escapeIdentifier(tableName)), 0, string);
if (r == false)
return false;
if (~r) {
@@ -604,9 +604,9 @@ bool KexiMigrate::drv_queryMaxNumber(const QString& tableName,
}
tristate KexiMigrate::drv_querySingleStringFromSQL(
- const QString& sqlStatement, uint columnNumber, QString& string)
+ const TQString& sqlStatement, uint columnNumber, TQString& string)
{
- QStringList stringList;
+ TQStringList stringList;
const tristate res = drv_queryStringListFromSQL(sqlStatement, columnNumber, stringList, 1);
if (true == res)
string = stringList.first();
diff --git a/kexi/migration/keximigrate.h b/kexi/migration/keximigrate.h
index 3d5ed65f..e618ed72 100644
--- a/kexi/migration/keximigrate.h
+++ b/kexi/migration/keximigrate.h
@@ -28,13 +28,13 @@
#include "keximigratedata.h"
#include <kgenericfactory.h>
-#include <qstringlist.h>
-#include <qguardedptr.h>
+#include <tqstringlist.h>
+#include <tqguardedptr.h>
class KexiProject;
namespace Kexi
{
- class ObjectStatus;
+ class ObjecttqStatus;
}
/*! KexiMigration implementation version.
@@ -75,9 +75,10 @@ Basic idea is this:
See kexi/doc/dev/kexi_import.txt for more info.
*/
-class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
+class KEXIMIGR_EXPORT KexiMigrate : public TQObject, public KexiDB::Object
{
Q_OBJECT
+ TQ_OBJECT
public:
virtual ~KexiMigrate();
@@ -98,7 +99,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
\a acceptingNeeded is set to true if destination database exists.
In this case you should ask about accepting database overwriting.
Used in ImportWizard::import(). */
- bool checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjectStatus* result,
+ bool checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjecttqStatus* result,
bool& acceptingNeeded);
/*! Checks if the source- and the destination databases are identical.
@@ -106,10 +107,10 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
bool isSourceAndDestinationDataSourceTheSame() const;
//! Perform an import operation
- bool performImport(Kexi::ObjectStatus* result = 0);
+ bool performImport(Kexi::ObjecttqStatus* result = 0);
//! Perform an export operation
- bool performExport(Kexi::ObjectStatus* result = 0);
+ bool performExport(Kexi::ObjecttqStatus* result = 0);
//! Returns true if the migration driver supports progress updates.
inline bool progressSupported() { return drv_progressSupported(); }
@@ -119,20 +120,20 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
//! @todo This is copied from KexiDB::Driver. One day it will be merged with KexiDB.
//! \return property value for \a propeName available for this driver.
- //! If there's no such property defined for driver, Null QVariant value is returned.
- virtual QVariant propertyValue( const QCString& propName );
+ //! If there's no such property defined for driver, Null TQVariant value is returned.
+ virtual TQVariant propertyValue( const TQCString& propName );
//! @todo This is copied from KexiDB::Driver. One day it will be merged with KexiDB.
- void setPropertyValue( const QCString& propName, const QVariant& value );
+ void setPropertyValue( const TQCString& propName, const TQVariant& value );
//! @todo This is copied from KexiDB::Driver. One day it will be merged with KexiDB.
//! \return translated property caption for \a propeName.
//! If there's no such property defined for driver, empty string value is returned.
- QString propertyCaption( const QCString& propName ) const;
+ TQString propertyCaption( const TQCString& propName ) const;
//! @todo This is copied from KexiDB::Driver. One day it will be merged with KexiDB.
//! \return a list of property names available for this driver.
- QValueList<QCString> propertyNames() const;
+ TQValueList<TQCString> propertyNames() const;
/*! \return true is driver is valid. Checks if KexiMigrate::versionMajor()
and KexiMigrate::versionMinor() are matching.
@@ -144,7 +145,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
protected:
//! Used by MigrateManager.
- KexiMigrate(QObject *parent, const char *name, const QStringList &args = QStringList());
+ KexiMigrate(TQObject *tqparent, const char *name, const TQStringList &args = TQStringList());
//! Connect to source database (driver specific)
virtual bool drv_connect() = 0;
@@ -152,11 +153,11 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
virtual bool drv_disconnect() = 0;
//! Get table names in source database (driver specific)
- virtual bool drv_tableNames(QStringList& tablenames) = 0;
+ virtual bool drv_tableNames(TQStringList& tablenames) = 0;
//! Read schema for a given table (driver specific)
virtual bool drv_readTableSchema(
- const QString& originalName, KexiDB::TableSchema& tableSchema) = 0;
+ const TQString& originalName, KexiDB::TableSchema& tableSchema) = 0;
/*! Fetches maximum number from table \a tableName, column \a columnName
into \a result. On success true is returned. If there is no records in the table,
@@ -167,8 +168,8 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
with "SELECT MAX(columName) FROM tableName" statement, assuming SQL-compliant
backend.
*/
- virtual bool drv_queryMaxNumber(const QString& tableName,
- const QString& columnName, int& result);
+ virtual bool drv_queryMaxNumber(const TQString& tableName,
+ const TQString& columnName, int& result);
/*! Fetches single string at column \a columnNumber for each record from result obtained
by running \a sqlStatement. \a numRecords can be specified to limit number of records read.
@@ -179,7 +180,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
(so e.g. keximdb driver does not need this). */
//! @todo SQL-dependent!
virtual tristate drv_queryStringListFromSQL(
- const QString& sqlStatement, uint columnNumber, QStringList& stringList,
+ const TQString& sqlStatement, uint columnNumber, TQStringList& stringList,
int numRecords = -1)
{ Q_UNUSED(sqlStatement); Q_UNUSED(columnNumber); Q_UNUSED(stringList);
Q_UNUSED(numRecords);
@@ -191,8 +192,8 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
\return cancelled if there are no records available.
This implementation uses drv_queryStringListFromSQL() with numRecords == 1. */
//! @todo SQL-dependent!
- virtual tristate drv_querySingleStringFromSQL(const QString& sqlStatement,
- uint columnNumber, QString& string);
+ virtual tristate drv_querySingleStringFromSQL(const TQString& sqlStatement,
+ uint columnNumber, TQString& string);
/*! Fetches single record from result obtained
by running \a sqlStatement.
@@ -202,7 +203,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
On success the result is stored in \a data and true is returned,
\a data is resized to appropriate size. cancelled is returned on EOF. */
//! @todo SQL-dependent!
- virtual tristate drv_fetchRecordFromSQL(const QString& sqlStatement,
+ virtual tristate drv_fetchRecordFromSQL(const TQString& sqlStatement,
KexiDB::RowData& data, bool &firstRecord)
{ Q_UNUSED(sqlStatement); Q_UNUSED(data); Q_UNUSED(firstRecord);
return cancelled; }
@@ -210,7 +211,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
//! Copy a table from source DB to target DB (driver specific)
//! - create copies of KexiDB tables
//! - create copies of non-KexiDB tables
- virtual bool drv_copyTable(const QString& srcTable, KexiDB::Connection *destConn,
+ virtual bool drv_copyTable(const TQString& srcTable, KexiDB::Connection *destConn,
KexiDB::TableSchema* dstTable) = 0;
virtual bool drv_progressSupported() { return false; }
@@ -232,16 +233,16 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
\return size of the specified table
*/
- virtual bool drv_getTableSize(const QString&, Q_ULLONG&)
+ virtual bool drv_getTableSize(const TQString&, TQ_ULLONG&)
{ return false; }
- void updateProgress(Q_ULLONG step = 1ULL);
+ void updateProgress(TQ_ULLONG step = 1ULL);
//! @todo user should be asked ONCE using a convenient wizard's page, not a popup dialog
//! Prompt user to select a field type for unrecognized fields
- KexiDB::Field::Type userType(const QString& fname);
+ KexiDB::Field::Type userType(const TQString& fname);
- virtual QString drv_escapeIdentifier( const QString& str ) const {
+ virtual TQString drv_escapeIdentifier( const TQString& str ) const {
return m_kexiDBDriver ? m_kexiDBDriver->escapeIdentifier(str) : str; }
//! @todo Remove this! KexiMigrate should be usable for multiple concurrent migrations!
@@ -254,24 +255,24 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
/*! Driver properties dictionary (indexed by name),
useful for presenting properties to the user.
Set available properties here in driver implementation. */
- QMap<QCString,QVariant> m_properties;
+ TQMap<TQCString,TQVariant> m_properties;
/*! i18n'd captions for properties. You do not need
to set predefined properties' caption in driver implementation
-it's done automatically. */
- QMap<QCString,QString> m_propertyCaptions;
+ TQMap<TQCString,TQString> m_propertyCaptions;
//! KexiDB driver. For instance, it is used for escaping identifiers
- QGuardedPtr<KexiDB::Driver> m_kexiDBDriver;
+ TQGuardedPtr<KexiDB::Driver> m_kexiDBDriver;
private:
//! Get the list of tables
- bool tableNames(QStringList& tablenames);
+ bool tableNames(TQStringList& tablenames);
//! Table schemas from source DB
- QPtrList<KexiDB::TableSchema> m_tableSchemas;
+ TQPtrList<KexiDB::TableSchema> m_tableSchemas;
- QPtrList<KexiDB::TableSchema> m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport;
+ TQPtrList<KexiDB::TableSchema> m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport;
/*! Estimate size of migration job
Calls drv_getTableSize for each table to be copied.
@@ -282,13 +283,13 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
KexiProject *m_destPrj;
//! Size of migration job
- Q_ULLONG m_progressTotal;
+ TQ_ULLONG m_progressTotal;
//! Amount of migration job complete
- Q_ULLONG m_progressDone;
+ TQ_ULLONG m_progressDone;
//! Don't recalculate progress done until this value is reached.
- Q_ULLONG m_progressNextReport;
+ TQ_ULLONG m_progressNextReport;
friend class MigrateManager;
};
@@ -304,7 +305,7 @@ class KEXIMIGR_EXPORT KexiMigrate : public QObject, public KexiDB::Object
KGenericFactory<KexiMigration::class_name>( "keximigrate_" #internal_name ))
/*! Driver's static version information, automatically implemented for KexiDB drivers.
- Put this into migration driver class declaration just like Q_OBJECT macro. */
+ Put this into migration driver class declaration just like TQ_OBJECT macro. */
#define KEXIMIGRATION_DRIVER \
public: \
virtual int versionMajor() const; \
diff --git a/kexi/migration/keximigratedata.h b/kexi/migration/keximigratedata.h
index 81e8c0f5..075240bc 100644
--- a/kexi/migration/keximigratedata.h
+++ b/kexi/migration/keximigratedata.h
@@ -41,7 +41,7 @@ namespace KexiMigration
KexiDB::ConnectionData* source;
//! Name of the source database
- QString sourceName;
+ TQString sourceName;
//! Destination project data
KexiProjectData* destination;
@@ -50,7 +50,7 @@ namespace KexiMigration
// KexiDB::Connection* dest;
// //! New database name
-// QString destName;
+// TQString destName;
//! Flag to determine structure copy, or structure + data
bool keepData;
diff --git a/kexi/migration/migratemanager.cpp b/kexi/migration/migratemanager.cpp
index 320ad718..8cd26c3c 100644
--- a/kexi/migration/migratemanager.cpp
+++ b/kexi/migration/migratemanager.cpp
@@ -32,7 +32,7 @@
#include <assert.h>
-#include <qapplication.h>
+#include <tqapplication.h>
//remove debug
#undef KexiDBDbg
@@ -50,7 +50,7 @@ MigrateManagerInternal* MigrateManagerInternal::s_self = 0L;
MigrateManager __manager;
MigrateManagerInternal::MigrateManagerInternal() /* protected */
- : QObject( 0, "KexiMigrate::MigrateManagerInternal" )
+ : TQObject( 0, "KexiMigrate::MigrateManagerInternal" )
, Object()
, m_drivers(17, false)
, m_refCount(0)
@@ -72,7 +72,7 @@ MigrateManagerInternal::~MigrateManagerInternal()
void MigrateManagerInternal::slotAppQuits()
{
- if (qApp->mainWidget() && qApp->mainWidget()->isVisible())
+ if (tqApp->mainWidget() && tqApp->mainWidget()->isVisible())
return; //what a hack! - we give up when app is still there
KexiDBDbg << "MigrateManagerInternal::slotAppQuits(): let's clear drivers..." << endl;
m_drivers.clear();
@@ -91,8 +91,8 @@ bool MigrateManagerInternal::lookupDrivers()
if (!lookupDriversNeeded)
return true;
- if (qApp) {
- connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(slotAppQuits()));
+ if (tqApp) {
+ connect(tqApp,TQT_SIGNAL(aboutToQuit()),this,TQT_SLOT(slotAppQuits()));
}
//TODO: for QT-only version check for KInstance wrapper
// KexiDBWarn << "DriverManagerInternal::lookupDrivers(): cannot work without KInstance (KGlobal::instance()==0)!" << endl;
@@ -105,21 +105,21 @@ bool MigrateManagerInternal::lookupDrivers()
for(; it != tlist.constEnd(); ++it)
{
KService::Ptr ptr = (*it);
- QString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString();
+ TQString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString();
if (srv_name.isEmpty()) {
KexiDBWarn << "MigrateManagerInternal::lookupDrivers(): "
"X-Kexi-MigrationDriverName must be set for migration driver \""
<< ptr->property("Name").toString() << "\" service!\n -- skipped!" << endl;
continue;
}
- if (m_services_lcase.contains(srv_name.lower())) {
+ if (m_services_lcase.tqcontains(srv_name.lower())) {
continue;
}
//! @todo could be merged. Copied from KexiDB::DriverManager.
//<COPIED>
- QString srv_ver_str = ptr->property("X-Kexi-KexiMigrationVersion").toString();
- QStringList lst( QStringList::split(".", srv_ver_str) );
+ TQString srv_ver_str = ptr->property("X-Kexi-KexiMigrationVersion").toString();
+ TQStringList lst( TQStringList::split(".", srv_ver_str) );
int minor_ver, major_ver;
bool ok = (lst.count() == 2);
if (ok)
@@ -129,30 +129,30 @@ bool MigrateManagerInternal::lookupDrivers()
if (!ok) {
KexiDBWarn << "MigrateManagerInternal::lookupDrivers(): problem with detecting '"
<< srv_name.lower() << "' driver's version -- skipping it!" << endl;
- possibleProblems += QString("\"%1\" migration driver has unrecognized version; "
+ possibleProblems += TQString("\"%1\" migration driver has unrecognized version; "
"required driver version is \"%2.%3\"")
- .arg(srv_name.lower())
- .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor());
+ .tqarg(srv_name.lower())
+ .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor());
continue;
}
if (major_ver != KexiMigration::versionMajor() || minor_ver != KexiMigration::versionMinor()) {
- KexiDBWarn << QString("MigrateManagerInternal::lookupDrivers(): '%1' driver"
+ KexiDBWarn << TQString("MigrateManagerInternal::lookupDrivers(): '%1' driver"
" has version '%2' but required migration driver version is '%3.%4'\n"
- " -- skipping this driver!").arg(srv_name.lower()).arg(srv_ver_str)
- .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor()) << endl;
- possibleProblems += QString("\"%1\" migration driver has version \"%2\" "
+ " -- skipping this driver!").tqarg(srv_name.lower()).tqarg(srv_ver_str)
+ .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor()) << endl;
+ possibleProblems += TQString("\"%1\" migration driver has version \"%2\" "
"but required driver version is \"%3.%4\"")
- .arg(srv_name.lower()).arg(srv_ver_str)
- .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor());
+ .tqarg(srv_name.lower()).tqarg(srv_ver_str)
+ .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor());
continue;
}
//</COPIED>
- QString mime = ptr->property("X-Kexi-FileDBDriverMime").toString().lower();
- QString drvType = ptr->property("X-Kexi-MigrationDriverType").toString().lower();
+ TQString mime = ptr->property("X-Kexi-FileDBDriverMime").toString().lower();
+ TQString drvType = ptr->property("X-Kexi-MigrationDriverType").toString().lower();
if (drvType=="file") {
if (!mime.isEmpty()) {
- if (!m_services_by_mimetype.contains(mime)) {
+ if (!m_services_by_mimetype.tqcontains(mime)) {
m_services_by_mimetype.insert(mime, ptr);
}
else {
@@ -175,7 +175,7 @@ bool MigrateManagerInternal::lookupDrivers()
return true;
}
-KexiMigrate* MigrateManagerInternal::driver(const QString& name)
+KexiMigrate* MigrateManagerInternal::driver(const TQString& name)
{
if (!lookupDrivers())
return 0;
@@ -183,25 +183,25 @@ KexiMigrate* MigrateManagerInternal::driver(const QString& name)
clearError();
KexiDBDbg << "MigrationrManagerInternal::migrationDriver(): loading " << name << endl;
- KexiMigrate *drv = name.isEmpty() ? 0 : m_drivers.find(name.latin1());
+ KexiMigrate *drv = name.isEmpty() ? 0 : m_drivers.tqfind(name.latin1());
if (drv)
return drv; //cached
- if (!m_services_lcase.contains(name.lower())) {
- setError(ERR_DRIVERMANAGER, i18n("Could not find import/export database driver \"%1\".").arg(name) );
+ if (!m_services_lcase.tqcontains(name.lower())) {
+ setError(ERR_DRIVERMANAGER, i18n("Could not find import/export database driver \"%1\".").tqarg(name) );
return 0;
}
- KService::Ptr ptr= *(m_services_lcase.find(name.lower()));
- QString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString();
+ KService::Ptr ptr= *(m_services_lcase.tqfind(name.lower()));
+ TQString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString();
KexiDBDbg << "MigrateManagerInternal::driver(): library: "<<ptr->library()<<endl;
drv = KParts::ComponentFactory::createInstanceFromService<KexiMigrate>(ptr,
- this, srv_name.latin1(), QStringList(),&m_serverResultNum);
+ this, srv_name.latin1(), TQStringList(),&m_serverResultNum);
if (!drv) {
setError(ERR_DRIVERMANAGER, i18n("Could not load import/export database driver \"%1\".")
- .arg(name) );
+ .tqarg(name) );
if (m_componentLoadingErrors.isEmpty()) {//fill errtable on demand
m_componentLoadingErrors[KParts::ComponentFactory::ErrNoServiceFound]="ErrNoServiceFound";
m_componentLoadingErrors[KParts::ComponentFactory::ErrServiceProvidesNoLibrary]="ErrServiceProvidesNoLibrary";
@@ -252,7 +252,7 @@ void MigrateManagerInternal::decRefCount()
// ---------------------------
MigrateManager::MigrateManager()
- : QObject( 0, "KexiMigrate::MigrateManager" )
+ : TQObject( 0, "KexiMigrate::MigrateManager" )
, Object()
, d_int( MigrateManagerInternal::self() )
{
@@ -284,27 +284,27 @@ MigrateManager::~MigrateManager()
}
-const QStringList MigrateManager::driverNames()
+const TQStringList MigrateManager::driverNames()
{
if (!d_int->lookupDrivers()) {
kdDebug() << "MigrateManager::driverNames() lookupDrivers failed" << endl;
- return QStringList();
+ return TQStringList();
}
if (d_int->m_services.isEmpty()) {
kdDebug() << "MigrateManager::driverNames() MigrateManager::ServicesMap is empty" << endl;
- return QStringList();
+ return TQStringList();
}
if (d_int->error()) {
kdDebug() << "MigrateManager::driverNames() Error: " << d_int->errorMsg() << endl;
- return QStringList();
+ return TQStringList();
}
return d_int->m_services.keys();
}
-QString MigrateManager::driverForMimeType(const QString &mimeType)
+TQString MigrateManager::driverForMimeType(const TQString &mimeType)
{
if (!d_int->lookupDrivers()) {
kdDebug() << "MigrateManager::driverForMimeType() lookupDrivers() failed" << endl;
@@ -314,24 +314,24 @@ QString MigrateManager::driverForMimeType(const QString &mimeType)
KService::Ptr ptr = d_int->m_services_by_mimetype[mimeType.lower()];
if (!ptr) {
- kdDebug() << QString("MigrateManager::driverForMimeType(%1) No such mimetype").arg(mimeType) << endl;
- return QString::null;
+ kdDebug() << TQString("MigrateManager::driverForMimeType(%1) No such mimetype").tqarg(mimeType) << endl;
+ return TQString();
}
return ptr->property("X-Kexi-MigrationDriverName").toString();
}
-KexiMigrate* MigrateManager::driver(const QString& name)
+KexiMigrate* MigrateManager::driver(const TQString& name)
{
KexiMigrate *drv = d_int->driver(name);
if (d_int->error()) {
- kdDebug() << QString("MigrateManager::driver(%1) Error: %2").arg(name).arg(d_int->errorMsg()) << endl;
+ kdDebug() << TQString("MigrateManager::driver(%1) Error: %2").tqarg(name).tqarg(d_int->errorMsg()) << endl;
setError(d_int);
}
return drv;
}
-QString MigrateManager::serverErrorMsg()
+TQString MigrateManager::serverErrorMsg()
{
return d_int->m_serverErrMsg;
}
@@ -341,29 +341,29 @@ int MigrateManager::serverResult()
return d_int->m_serverResultNum;
}
-QString MigrateManager::serverResultName()
+TQString MigrateManager::serverResultName()
{
return d_int->m_serverResultName;
}
void MigrateManager::drv_clearServerResult()
{
- d_int->m_serverErrMsg=QString::null;
+ d_int->m_serverErrMsg=TQString();
d_int->m_serverResultNum=0;
- d_int->m_serverResultName=QString::null;
+ d_int->m_serverResultName=TQString();
}
-QString MigrateManager::possibleProblemsInfoMsg() const
+TQString MigrateManager::possibleProblemsInfoMsg() const
{
if (d_int->possibleProblems.isEmpty())
- return QString::null;
- QString str;
+ return TQString();
+ TQString str;
str.reserve(1024);
str = "<ul>";
- for (QStringList::ConstIterator it = d_int->possibleProblems.constBegin();
+ for (TQStringList::ConstIterator it = d_int->possibleProblems.constBegin();
it!=d_int->possibleProblems.constEnd(); ++it)
{
- str += (QString::fromLatin1("<li>") + *it + QString::fromLatin1("</li>"));
+ str += (TQString::tqfromLatin1("<li>") + *it + TQString::tqfromLatin1("</li>"));
}
str += "</ul>";
return str;
diff --git a/kexi/migration/migratemanager.h b/kexi/migration/migratemanager.h
index c876ab91..593a931b 100644
--- a/kexi/migration/migratemanager.h
+++ b/kexi/migration/migratemanager.h
@@ -20,10 +20,10 @@
#ifndef KEXI_MIGRATION_MNGR_H
#define KEXI_MIGRATION_MNGR_H
-#include <qobject.h>
-#include <qcstring.h>
-#include <qmap.h>
-#include <qdict.h>
+#include <tqobject.h>
+#include <tqcstring.h>
+#include <tqmap.h>
+#include <tqdict.h>
#include <klibloader.h>
#include <kservice.h>
@@ -35,10 +35,10 @@ namespace KexiMigration {
class MigrateManagerInternal;
//! @short Migration library management, for finding and loading mogration drivers.
-class KEXIMIGR_EXPORT MigrateManager : public QObject, public KexiDB::Object
+class KEXIMIGR_EXPORT MigrateManager : public TQObject, public KexiDB::Object
{
public:
- typedef QMap<QString, KService::Ptr> ServicesMap;
+ typedef TQMap<TQString, KService::Ptr> ServicesMap;
MigrateManager();
virtual ~MigrateManager();
@@ -46,29 +46,29 @@ class KEXIMIGR_EXPORT MigrateManager : public QObject, public KexiDB::Object
/*! Tries to load db driver with named name \a name.
The name is case insensitive.
\return db driver, or 0 if error (then error message is also set) */
- KexiMigrate* driver(const QString& name);
+ KexiMigrate* driver(const TQString& name);
/*! returns list of available drivers names.
That drivers can be loaded by first use of driver() method. */
- const QStringList driverNames();
+ const TQStringList driverNames();
/*! Looks up a drivers list by MIME type of database file.
Only file-based database drivers are checked.
The lookup is case insensitive.
\return driver name or null string if no driver found.
*/
- QString driverForMimeType(const QString &mimeType);
+ TQString driverForMimeType(const TQString &mimeType);
//! server error is set if there is error at KService level (useful for debugging)
- virtual QString serverErrorMsg();
+ virtual TQString serverErrorMsg();
virtual int serverResult();
- virtual QString serverResultName();
+ virtual TQString serverResultName();
//! @todo copied from KexiDB::DriverManager, merge it.
/*! HTML information about possible problems encountered.
It's displayed in 'details' section, if an error encountered.
Currently it contains a list of incompatible migration drivers. */
- QString possibleProblemsInfoMsg() const;
+ TQString possibleProblemsInfoMsg() const;
protected:
virtual void drv_clearServerResult();
diff --git a/kexi/migration/migratemanager_p.h b/kexi/migration/migratemanager_p.h
index 0d90acfe..59824573 100644
--- a/kexi/migration/migratemanager_p.h
+++ b/kexi/migration/migratemanager_p.h
@@ -20,22 +20,23 @@
#ifndef KEXI_MIGRATE_MNGR_P_H
#define KEXI_MIGRATE_MNGR_P_H
-#include <qobject.h>
-#include <qasciidict.h>
+#include <tqobject.h>
+#include <tqasciidict.h>
namespace KexiMigration {
/*! Internal class of driver manager.
*/
-class MigrateManagerInternal : public QObject, public KexiDB::Object
+class MigrateManagerInternal : public TQObject, public KexiDB::Object
{
Q_OBJECT
+ TQ_OBJECT
public:
~MigrateManagerInternal();
/*! Tries to load db driver \a name.
\return db driver, or 0 if error (then error message is also set) */
- KexiMigrate* driver(const QString& name);
+ KexiMigrate* driver(const TQString& name);
static MigrateManagerInternal *self();
@@ -47,9 +48,9 @@ class MigrateManagerInternal : public QObject, public KexiDB::Object
void decRefCount();
protected slots:
- /*! Used to destroy all drivers on QApplication quit, so even if there are
+ /*! Used to destroy all drivers on TQApplication quit, so even if there are
DriverManager's static instances that are destroyed on program
- "static destruction", drivers are not kept after QApplication death.
+ "static destruction", drivers are not kept after TQApplication death.
*/
void slotAppQuits();
@@ -65,18 +66,18 @@ class MigrateManagerInternal : public QObject, public KexiDB::Object
MigrateManager::ServicesMap m_services_lcase; //! as above but service names in lowercase
MigrateManager::ServicesMap m_services_by_mimetype;
- QAsciiDict<KexiMigrate> m_drivers;
+ TQAsciiDict<KexiMigrate> m_drivers;
ulong m_refCount;
- QString m_serverErrMsg;
+ TQString m_serverErrMsg;
int m_serverResultNum;
- QString m_serverResultName;
+ TQString m_serverResultName;
//! result names for KParts::ComponentFactory::ComponentLoadingError
- QMap<int,QString> m_componentLoadingErrors;
+ TQMap<int,TQString> m_componentLoadingErrors;
bool lookupDriversNeeded : 1;
- QStringList possibleProblems;
+ TQStringList possibleProblems;
friend class MigrateManager;
};
diff --git a/kexi/migration/mysql/mysqlmigrate.cpp b/kexi/migration/mysql/mysqlmigrate.cpp
index a2c62dd5..013613ea 100644
--- a/kexi/migration/mysql/mysqlmigrate.cpp
+++ b/kexi/migration/mysql/mysqlmigrate.cpp
@@ -20,11 +20,11 @@
#include "mysqlmigrate.h"
-#include <qstring.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qvariant.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqfile.h>
+#include <tqvariant.h>
+#include <tqvaluelist.h>
#include <kdebug.h>
#include <mysql_version.h>
@@ -52,9 +52,9 @@ KEXIMIGRATE_DRIVER_INFO( MySQLMigrate, mysql )
}*/
//! Constructor (needed for trading interface)
-MySQLMigrate::MySQLMigrate(QObject *parent, const char *name,
- const QStringList &args) :
- KexiMigrate(parent, name, args)
+MySQLMigrate::MySQLMigrate(TQObject *tqparent, const char *name,
+ const TQStringList &args) :
+ KexiMigrate(tqparent, name, args)
,d(new MySqlConnectionInternal(0))
,m_mysqlres(0)
{
@@ -92,7 +92,7 @@ bool MySQLMigrate::drv_disconnect()
/* ************************************************************************** */
/*! Get the types and properties for each column. */
bool MySQLMigrate::drv_readTableSchema(
- const QString& originalName, KexiDB::TableSchema& tableSchema)
+ const TQString& originalName, KexiDB::TableSchema& tableSchema)
{
// m_table = new KexiDB::TableSchema(table);
@@ -100,7 +100,7 @@ bool MySQLMigrate::drv_readTableSchema(
// tableSchema.setCaption(table + " table");
//Perform a query on the table to get some data
- QString query = QString("SELECT * FROM `") + drv_escapeIdentifier(originalName) + "` LIMIT 0";
+ TQString query = TQString("SELECT * FROM `") + drv_escapeIdentifier(originalName) + "` LIMIT 0";
if(d->executeSQL(query)) {
MYSQL_RES *res = mysql_store_result(d->mysql);
if (res != NULL) {
@@ -109,14 +109,14 @@ bool MySQLMigrate::drv_readTableSchema(
MYSQL_FIELD *fields = mysql_fetch_fields(res);
for(unsigned int i = 0; i < numFlds; i++) {
- QString fldName(fields[i].name);
- QString fldID( KexiUtils::string2Identifier(fldName) );
+ TQString fldName(fields[i].name);
+ TQString fldID( KexiUtils::string2Identifier(fldName) );
KexiDB::Field *fld =
new KexiDB::Field(fldID, type(originalName, &fields[i]));
if(fld->type() == KexiDB::Field::Enum) {
- QStringList values = examineEnumField(originalName, &fields[i]);
+ TQStringList values = examineEnumField(originalName, &fields[i]);
}
fld->setCaption(fldName);
@@ -136,14 +136,14 @@ bool MySQLMigrate::drv_readTableSchema(
/*! Get a list of tables and put into the supplied string list */
-bool MySQLMigrate::drv_tableNames(QStringList& tableNames)
+bool MySQLMigrate::drv_tableNames(TQStringList& tableNames)
{
if(d->executeSQL("SHOW TABLES")) {
MYSQL_RES *res = mysql_store_result(d->mysql);
if (res != NULL) {
MYSQL_ROW row;
while ((row = mysql_fetch_row(res)) != NULL) {
- tableNames << QString::fromUtf8(row[0]); //utf8.. ok?
+ tableNames << TQString::fromUtf8(row[0]); //utf8.. ok?
}
mysql_free_result(res);
} else {
@@ -160,7 +160,7 @@ bool MySQLMigrate::drv_tableNames(QStringList& tableNames)
On success the result is stored in \a stringList and true is returned.
\return cancelled if there are no records available. */
tristate MySQLMigrate::drv_queryStringListFromSQL(
- const QString& sqlStatement, uint columnNumber, QStringList& stringList, int numRecords)
+ const TQString& sqlStatement, uint columnNumber, TQStringList& stringList, int numRecords)
{
stringList.clear();
if (d->executeSQL(sqlStatement)) {
@@ -190,7 +190,7 @@ tristate MySQLMigrate::drv_queryStringListFromSQL(
mysql_free_result(res);
return false;
}
- stringList.append( QString::fromUtf8(row[columnNumber], lengths[columnNumber]) ); //ok? utf8?
+ stringList.append( TQString::fromUtf8(row[columnNumber], lengths[columnNumber]) ); //ok? utf8?
}
mysql_free_result(res);
} else {
@@ -204,7 +204,7 @@ tristate MySQLMigrate::drv_queryStringListFromSQL(
/*! Fetches single record from result obtained
by running \a sqlStatement. */
-tristate MySQLMigrate::drv_fetchRecordFromSQL(const QString& sqlStatement,
+tristate MySQLMigrate::drv_fetchRecordFromSQL(const TQString& sqlStatement,
KexiDB::RowData& data, bool &firstRecord)
{
if (firstRecord || !m_mysqlres) {
@@ -235,12 +235,12 @@ tristate MySQLMigrate::drv_fetchRecordFromSQL(const QString& sqlStatement,
}
data.resize(numFields);
for (int i=0; i < numFields; i++)
- data[i] = QString::fromUtf8(row[i], lengths[i] ); //ok? utf8?
+ data[i] = TQString::fromUtf8(row[i], lengths[i] ); //ok? utf8?
return true;
}
/*! Copy MySQL table to KexiDB database */
-bool MySQLMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *destConn,
+bool MySQLMigrate::drv_copyTable(const TQString& srcTable, KexiDB::Connection *destConn,
KexiDB::TableSchema* dstTable)
{
if(d->executeSQL("SELECT * FROM `" + drv_escapeIdentifier(srcTable)) + "`") {
@@ -249,8 +249,8 @@ bool MySQLMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *de
MYSQL_ROW row;
const KexiDB::QueryColumnInfo::Vector fieldsExpanded( dstTable->query()->fieldsExpanded() );
while ((row = mysql_fetch_row(res)) != NULL) {
- const int numFields = QMIN((int)fieldsExpanded.count(), (int)mysql_num_fields(res));
- QValueList<QVariant> vals;
+ const int numFields = TQMIN((int)fieldsExpanded.count(), (int)mysql_num_fields(res));
+ TQValueList<TQVariant> vals;
unsigned long *lengths = mysql_fetch_lengths(res);
if (!lengths) {
mysql_free_result(res);
@@ -280,14 +280,14 @@ bool MySQLMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *de
}
-bool MySQLMigrate::drv_getTableSize(const QString& table, Q_ULLONG& size) {
+bool MySQLMigrate::drv_getTableSize(const TQString& table, TQ_ULLONG& size) {
if(d->executeSQL("SELECT COUNT(*) FROM `" + drv_escapeIdentifier(table)) + "`") {
MYSQL_RES *res = mysql_store_result(d->mysql);
if (res != NULL) {
MYSQL_ROW row;
while ((row = mysql_fetch_row(res)) != NULL) {
//! @todo check result valid
- size = QString(row[0]).toULongLong();
+ size = TQString(row[0]).toULongLong();
}
mysql_free_result(res);
} else {
@@ -300,7 +300,7 @@ bool MySQLMigrate::drv_getTableSize(const QString& table, Q_ULLONG& size) {
}
//! Convert a MySQL type to a KexiDB type, prompting user if necessary.
-KexiDB::Field::Type MySQLMigrate::type(const QString& table,
+KexiDB::Field::Type MySQLMigrate::type(const TQString& table,
const MYSQL_FIELD *fld)
{
// Field type
@@ -391,12 +391,12 @@ KexiDB::Field::Type MySQLMigrate::type(const QString& table,
Assumes fld is a CHAR, VARCHAR, one of the BLOBs or TEXTs.
\return KexiDB::Field::Text, KexiDB::Field::LongText or KexiDB::Field::BLOB
*/
-KexiDB::Field::Type MySQLMigrate::examineBlobField(const QString& table,
+KexiDB::Field::Type MySQLMigrate::examineBlobField(const TQString& table,
const MYSQL_FIELD* fld) {
- QString mysqlType;
+ TQString mysqlType;
KexiDB::Field::Type kexiType;
- QString query = "SHOW COLUMNS FROM `" + drv_escapeIdentifier(table) +
- "` LIKE '" + QString::fromLatin1(fld->name) + "'";
+ TQString query = "SHOW COLUMNS FROM `" + drv_escapeIdentifier(table) +
+ "` LIKE '" + TQString::tqfromLatin1(fld->name) + "'";
if(d->executeSQL(query)) {
MYSQL_RES *res = mysql_store_result(d->mysql);
@@ -404,7 +404,7 @@ KexiDB::Field::Type MySQLMigrate::examineBlobField(const QString& table,
if (res != NULL) {
MYSQL_ROW row;
while ((row = mysql_fetch_row(res)) != NULL) {
- mysqlType = QString(row[1]);
+ mysqlType = TQString(row[1]);
}
mysql_free_result(res);
} else {
@@ -417,10 +417,10 @@ KexiDB::Field::Type MySQLMigrate::examineBlobField(const QString& table,
kdDebug() << "MySQLMigrate::examineBlobField: considering "
<< mysqlType << endl;
- if(mysqlType.contains("blob", false) != 0) {
+ if(mysqlType.tqcontains("blob", false) != 0) {
// Doesn't matter how big it is, it's binary
kexiType = KexiDB::Field::BLOB;
- } else if(mysqlType.contains("text", false) != 0) {
+ } else if(mysqlType.tqcontains("text", false) != 0) {
// All the TEXT types are too big for Kexi text.
kexiType = KexiDB::Field::BLOB;
} else if(fld->length < 200) {
@@ -440,11 +440,11 @@ KexiDB::Field::Type MySQLMigrate::examineBlobField(const QString& table,
strings, "option1", "option2".
\return list of possible values the field can take
*/
-QStringList MySQLMigrate::examineEnumField(const QString& table,
+TQStringList MySQLMigrate::examineEnumField(const TQString& table,
const MYSQL_FIELD* fld) {
- QString vals;
- QString query = "SHOW COLUMNS FROM `" + drv_escapeIdentifier(table) +
- "` LIKE '" + QString::fromLatin1(fld->name) + "'";
+ TQString vals;
+ TQString query = "SHOW COLUMNS FROM `" + drv_escapeIdentifier(table) +
+ "` LIKE '" + TQString::tqfromLatin1(fld->name) + "'";
if(d->executeSQL(query)) {
MYSQL_RES *res = mysql_store_result(d->mysql);
@@ -452,7 +452,7 @@ QStringList MySQLMigrate::examineEnumField(const QString& table,
if (res != NULL) {
MYSQL_ROW row;
while ((row = mysql_fetch_row(res)) != NULL) {
- vals = QString(row[1]);
+ vals = TQString(row[1]);
}
mysql_free_result(res);
} else {
@@ -460,7 +460,7 @@ QStringList MySQLMigrate::examineEnumField(const QString& table,
}
} else {
// Huh? MySQL wont tell us what values it can take.
- return QStringList();
+ return TQStringList();
}
kdDebug() << "MySQLMigrate::examineEnumField: considering "
@@ -470,22 +470,22 @@ QStringList MySQLMigrate::examineEnumField(const QString& table,
if(!vals.startsWith("enum(")) {
// Huh? We're supposed to be parsing an enum!
kdDebug() << "MySQLMigrate::examineEnumField:1 not an enum!" << endl;
- return QStringList();
+ return TQStringList();
}
if(!vals.endsWith(")")) {
kdDebug() << "MySQLMigrate::examineEnumField:2 not an enum!" << endl;
- return QStringList();
+ return TQStringList();
}
- // It'd be nice to use QString.section or QStringList.split, but we need
+ // It'd be nice to use TQString.section or TQStringList.split, but we need
// to be careful as enum values can have commas and quote marks in them
// e.g. CREATE TABLE t(f enum('option,''') gives one option: "option,'"
vals = vals.remove(0,5);
- QRegExp rx = QRegExp("^'((?:[^,']|,|'')*)'");
- QStringList values = QStringList();
+ TQRegExp rx = TQRegExp("^'((?:[^,']|,|'')*)'");
+ TQStringList values = TQStringList();
int index = 0;
- while ((index = rx.search(vals, index, QRegExp::CaretAtOffset)) != -1) {
+ while ((index = rx.search(vals, index, TQRegExp::CaretAtOffset)) != -1) {
int len = rx.matchedLength();
if (len != -1) {
kdDebug() << "MySQLMigrate::examineEnumField:3 " << rx.cap(1) << endl;
@@ -494,8 +494,8 @@ QStringList MySQLMigrate::examineEnumField(const QString& table,
kdDebug() << "MySQLMigrate::examineEnumField:4 lost" << endl;
}
- QChar next = vals[index + len];
- if (next != QChar(',') && next != QChar(')')) {
+ TQChar next = vals[index + len];
+ if (next != TQChar(',') && next != TQChar(')')) {
kdDebug() << "MySQLMigrate::examineEnumField:5 " << (char)next << endl;
}
index += len + 1;
@@ -509,7 +509,7 @@ void MySQLMigrate::getConstraints(int flags, KexiDB::Field* fld) {
fld->setPrimaryKey(flags & PRI_KEY_FLAG);
fld->setAutoIncrement(flags & AUTO_INCREMENT_FLAG);
fld->setNotNull(flags & NOT_NULL_FLAG);
- fld->setUniqueKey(flags & UNIQUE_KEY_FLAG);
+ fld->setUniqueKey(flags & UNITQUE_KEY_FLAG);
//! @todo: Keys and uniqueness
}
diff --git a/kexi/migration/mysql/mysqlmigrate.h b/kexi/migration/mysql/mysqlmigrate.h
index 9f32bd2f..e7627e76 100644
--- a/kexi/migration/mysql/mysqlmigrate.h
+++ b/kexi/migration/mysql/mysqlmigrate.h
@@ -30,6 +30,7 @@ namespace KexiMigration
class MySQLMigrate : public KexiMigrate
{
Q_OBJECT
+ TQ_OBJECT
KEXIMIGRATION_DRIVER
private:
@@ -38,44 +39,44 @@ namespace KexiMigration
protected:
//Driver specific function to return table names
- virtual bool drv_tableNames(QStringList& tablenames);
+ virtual bool drv_tableNames(TQStringList& tablenames);
//Driver specific implementation to read a table schema
virtual bool drv_readTableSchema(
- const QString& originalName, KexiDB::TableSchema& tableSchema);
+ const TQString& originalName, KexiDB::TableSchema& tableSchema);
//Driver specific connection implementation
virtual bool drv_connect();
virtual bool drv_disconnect();
virtual tristate drv_queryStringListFromSQL(
- const QString& sqlStatement, uint columnNumber,
- QStringList& stringList, int numRecords = -1);
+ const TQString& sqlStatement, uint columnNumber,
+ TQStringList& stringList, int numRecords = -1);
- virtual tristate drv_fetchRecordFromSQL(const QString& sqlStatement,
+ virtual tristate drv_fetchRecordFromSQL(const TQString& sqlStatement,
KexiDB::RowData& data, bool &firstRecord);
- virtual bool drv_copyTable(const QString& srcTable,
+ virtual bool drv_copyTable(const TQString& srcTable,
KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
virtual bool drv_progressSupported() { return true; }
- virtual bool drv_getTableSize(const QString& table, Q_ULLONG& size);
+ virtual bool drv_getTableSize(const TQString& table, TQ_ULLONG& size);
//TODO: move this somewhere to low level class (MIGRATION?)
-// virtual bool drv_getTablesList( QStringList &list );
+// virtual bool drv_getTablesList( TQStringList &list );
//TODO: move this somewhere to low level class (MIGRATION?)
-// virtual bool drv_containsTable( const QString &tableName );
+// virtual bool drv_containsTable( const TQString &tableName );
public:
// MySQLMigrate();
- MySQLMigrate(QObject *parent, const char *name, const QStringList& args = QStringList());
+ MySQLMigrate(TQObject *tqparent, const char *name, const TQStringList& args = TQStringList());
~MySQLMigrate();
- KexiDB::Field::Type type(const QString& table, const MYSQL_FIELD* t);
+ KexiDB::Field::Type type(const TQString& table, const MYSQL_FIELD* t);
- KexiDB::Field::Type examineBlobField(const QString& table,
+ KexiDB::Field::Type examineBlobField(const TQString& table,
const MYSQL_FIELD* fld);
- QStringList examineEnumField(const QString& table,
+ TQStringList examineEnumField(const TQString& table,
const MYSQL_FIELD* fld);
void getConstraints(int mysqlConstraints, KexiDB::Field* fld);
void getOptions(int flags, KexiDB::Field* fld);
diff --git a/kexi/migration/pqxx/pg_type.h b/kexi/migration/pqxx/pg_type.h
index e0ead91a..a8b94f0a 100644
--- a/kexi/migration/pqxx/pg_type.h
+++ b/kexi/migration/pqxx/pg_type.h
@@ -152,10 +152,10 @@
//XX:XX:XX:XX:XX:XX, MAC address
#define MACADDROID 829
-//IP address/netmask, host address, netmask optional
+//IP address/nettqmask, host address, nettqmask optional
#define INETOID 869
-//network IP address/netmask, network address
+//network IP address/nettqmask, network address
#define CIDROID 650
//access control list
diff --git a/kexi/migration/pqxx/pqxxmigrate.cpp b/kexi/migration/pqxx/pqxxmigrate.cpp
index 15715897..c01d68fd 100644
--- a/kexi/migration/pqxx/pqxxmigrate.cpp
+++ b/kexi/migration/pqxx/pqxxmigrate.cpp
@@ -21,9 +21,9 @@
#include "pqxxmigrate.h"
#include "pg_type.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <kdebug.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
//I maybe should not use stl?
#include <string>
@@ -50,15 +50,15 @@ KEXIMIGRATE_DRIVER_INFO( PqxxMigrate, pqxx )
//==================================================================================
//Constructor
/*PqxxMigrate::PqxxMigrate()
- : KexiMigrate(parent, name, args)
+ : KexiMigrate(tqparent, name, args)
{
m_res=0;
m_trans=0;
m_conn=0;
}*/
-PqxxMigrate::PqxxMigrate(QObject *parent, const char *name, const QStringList &args)
- : KexiMigrate(parent, name, args)
+PqxxMigrate::PqxxMigrate(TQObject *tqparent, const char *name, const TQStringList &args)
+ : KexiMigrate(tqparent, name, args)
{
m_res=0;
m_trans=0;
@@ -78,7 +78,7 @@ PqxxMigrate::~PqxxMigrate()
//any any other attributes required by kexi
//helped by reading the 'tables' test program
bool PqxxMigrate::drv_readTableSchema(
- const QString& originalName, KexiDB::TableSchema& tableSchema)
+ const TQString& originalName, KexiDB::TableSchema& tableSchema)
{
// m_table = new KexiDB::TableSchema(table);
@@ -91,9 +91,9 @@ bool PqxxMigrate::drv_readTableSchema(
//Loop round the fields
for (uint i = 0; i < (uint)m_res->columns(); i++)
{
- QString fldName(m_res->column_name(i));
+ TQString fldName(m_res->column_name(i));
KexiDB::Field::Type fldType = type(m_res->column_type(i), fldName);
- QString fldID( KexiUtils::string2Identifier(fldName) );
+ TQString fldID( KexiUtils::string2Identifier(fldName) );
const pqxx::oid toid = tableOid(originalName);
if (toid==0)
return false;
@@ -124,7 +124,7 @@ bool PqxxMigrate::drv_readTableSchema(
//==================================================================================
//get a list of tables and put into the supplied string list
-bool PqxxMigrate::drv_tableNames(QStringList& tableNames)
+bool PqxxMigrate::drv_tableNames(TQStringList& tableNames)
{
/*
//pg_ = standard postgresql tables, pga_ = tables added by pgaccess, sql_ = probably information schemas, kexi__ = existing kexi tables
@@ -135,7 +135,7 @@ bool PqxxMigrate::drv_tableNames(QStringList& tableNames)
for (pqxx::result::const_iterator c = m_res->begin(); c != m_res->end(); ++c)
{
// Copy the result into the return list
- tableNames << QString::fromLatin1 (c[0].c_str());
+ tableNames << TQString::tqfromLatin1 (c[0].c_str());
}
return true;
}
@@ -147,7 +147,7 @@ bool PqxxMigrate::drv_tableNames(QStringList& tableNames)
//==================================================================================
//Convert a postgresql type to a kexi type
-KexiDB::Field::Type PqxxMigrate::type(int t, const QString& fname)
+KexiDB::Field::Type PqxxMigrate::type(int t, const TQString& fname)
{
switch(t)
{
@@ -193,8 +193,8 @@ bool PqxxMigrate::drv_connect()
{
kdDebug() << "drv_connect: " << m_migrateData->sourceName << endl;
- QString conninfo;
- QString socket;
+ TQString conninfo;
+ TQString socket;
//Setup local/remote connection
if (m_migrateData->source->hostName.isEmpty())
@@ -217,15 +217,15 @@ bool PqxxMigrate::drv_connect()
if (m_migrateData->source->port == 0)
m_migrateData->source->port = 5432;
- conninfo += QString::fromLatin1(" port='%1'").arg(m_migrateData->source->port);
+ conninfo += TQString::tqfromLatin1(" port='%1'").tqarg(m_migrateData->source->port);
- conninfo += QString::fromLatin1(" dbname='%1'").arg(m_migrateData->sourceName);
+ conninfo += TQString::tqfromLatin1(" dbname='%1'").tqarg(m_migrateData->sourceName);
if (!m_migrateData->source->userName.isNull())
- conninfo += QString::fromLatin1(" user='%1'").arg(m_migrateData->source->userName);
+ conninfo += TQString::tqfromLatin1(" user='%1'").tqarg(m_migrateData->source->userName);
if (!m_migrateData->source->password.isNull())
- conninfo += QString::fromLatin1(" password='%1'").arg(m_migrateData->source->password);
+ conninfo += TQString::tqfromLatin1(" password='%1'").tqarg(m_migrateData->source->password);
try
{
@@ -257,7 +257,7 @@ bool PqxxMigrate::drv_disconnect()
}
//==================================================================================
//Perform a query on the database and store result in m_res
-bool PqxxMigrate::query(const QString& statement)
+bool PqxxMigrate::query(const TQString& statement)
{
kdDebug() << "query: " << statement.latin1() << endl;
@@ -303,10 +303,10 @@ void PqxxMigrate::clearResultInfo()
//=========================================================================
//Return the OID for a table
-pqxx::oid PqxxMigrate::tableOid(const QString& table)
+pqxx::oid PqxxMigrate::tableOid(const TQString& table)
{
- QString statement;
- static QString otable;
+ TQString statement;
+ static TQString otable;
static pqxx::oid toid;
pqxx::nontransaction* tran = 0;
@@ -368,7 +368,7 @@ pqxx::oid PqxxMigrate::tableOid(const QString& table)
//TODO: Add result caching for speed
bool PqxxMigrate::primaryKey(pqxx::oid table_uid, int col) const
{
- QString statement;
+ TQString statement;
bool pkey;
int keyf;
@@ -377,7 +377,7 @@ bool PqxxMigrate::primaryKey(pqxx::oid table_uid, int col) const
try
{
- statement = QString("SELECT indkey FROM pg_index WHERE ((indisprimary = true) AND (indrelid = %1))").arg(table_uid);
+ statement = TQString("SELECT indkey FROM pg_index WHERE ((indisprimary = true) AND (indrelid = %1))").tqarg(table_uid);
tran = new pqxx::nontransaction(*m_conn, "find_pkey");
tmpres = new pqxx::result(tran->exec(statement.latin1()));
@@ -425,7 +425,7 @@ bool PqxxMigrate::primaryKey(pqxx::oid table_uid, int col) const
On success the result is stored in \a string and true is returned.
\return cancelled if there are no records available. */
tristate PqxxMigrate::drv_queryStringListFromSQL(
- const QString& sqlStatement, uint columnNumber, QStringList& stringList, int numRecords)
+ const TQString& sqlStatement, uint columnNumber, TQStringList& stringList, int numRecords)
{
std::string result;
int i = 0;
@@ -436,7 +436,7 @@ tristate PqxxMigrate::drv_queryStringListFromSQL(
{
if (it.size() > 0 && it.size() > columnNumber) {
it.at(columnNumber).to(result);
- stringList.append( QString::fromUtf8(result.c_str()) );
+ stringList.append( TQString::fromUtf8(result.c_str()) );
}
else {
clearResultInfo();
@@ -480,7 +480,7 @@ tristate PqxxMigrate::drv_queryStringListFromSQL(
mysql_free_result(res);
return false;
}
- string = QString::fromLatin1(row[columnNumber], lengths[columnNumber]);
+ string = TQString::tqfromLatin1(row[columnNumber], lengths[columnNumber]);
mysql_free_result(res);
} else {
kdDebug() << "PqxxMigrate::drv_querySingleStringFromSQL(): null result" << endl;
@@ -491,7 +491,7 @@ tristate PqxxMigrate::drv_queryStringListFromSQL(
}*/
}
-tristate PqxxMigrate::drv_fetchRecordFromSQL(const QString& sqlStatement,
+tristate PqxxMigrate::drv_fetchRecordFromSQL(const TQString& sqlStatement,
KexiDB::RowData& data, bool &firstRecord)
{
if (firstRecord || !m_res) {
@@ -520,7 +520,7 @@ tristate PqxxMigrate::drv_fetchRecordFromSQL(const QString& sqlStatement,
//=========================================================================
/*! Copy PostgreSQL table to KexiDB database */
-bool PqxxMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *destConn,
+bool PqxxMigrate::drv_copyTable(const TQString& srcTable, KexiDB::Connection *destConn,
KexiDB::TableSchema* dstTable)
{
std::vector<std::string> R;
@@ -533,7 +533,7 @@ bool PqxxMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *des
const KexiDB::QueryColumnInfo::Vector fieldsExpanded( dstTable->query()->fieldsExpanded() );
for (int n=0; (stream >> R); ++n)
{
- QValueList<QVariant> vals;
+ TQValueList<TQVariant> vals;
std::vector<std::string>::const_iterator i, end( R.end() );
int index = 0;
for ( i = R.begin(); i != end; ++i, index++) {
@@ -560,7 +560,7 @@ bool PqxxMigrate::drv_copyTable(const QString& srcTable, KexiDB::Connection *des
//TODO: Add result caching for speed
bool PqxxMigrate::uniqueKey(pqxx::oid table_uid, int col) const
{
- QString statement;
+ TQString statement;
bool ukey;
int keyf;
@@ -569,7 +569,7 @@ bool PqxxMigrate::uniqueKey(pqxx::oid table_uid, int col) const
try
{
- statement = QString("SELECT indkey FROM pg_index WHERE ((indisunique = true) AND (indrelid = %1))").arg(table_uid);
+ statement = TQString("SELECT indkey FROM pg_index WHERE ((indisunique = true) AND (indrelid = %1))").tqarg(table_uid);
tran = new pqxx::nontransaction(*m_conn, "find_ukey");
tmpres = new pqxx::result(tran->exec(statement.latin1()));
@@ -635,7 +635,7 @@ bool PqxxMigrate::notEmpty(pqxx::oid /*table_uid*/, int /*col*/) const
//==================================================================================
//Return a list of database names
-/*bool PqxxMigrate::drv_getDatabasesList( QStringList &list )
+/*bool PqxxMigrate::drv_getDatabasesList( TQStringList &list )
{
KexiDBDrvDbg << "pqxxSqlConnection::drv_getDatabaseList" << endl;
@@ -647,7 +647,7 @@ bool PqxxMigrate::notEmpty(pqxx::oid /*table_uid*/, int /*col*/) const
// Read value of column 0 into a string N
c[0].to(N);
// Copy the result into the return list
- list << QString::fromLatin1 (N.c_str());
+ list << TQString::tqfromLatin1 (N.c_str());
KexiDBDrvDbg << N.c_str() << endl;
}
return true;
diff --git a/kexi/migration/pqxx/pqxxmigrate.h b/kexi/migration/pqxx/pqxxmigrate.h
index c09c8a7a..ee33c138 100644
--- a/kexi/migration/pqxx/pqxxmigrate.h
+++ b/kexi/migration/pqxx/pqxxmigrate.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef PQXXIMPORT_H
-#define PQXXIMPORT_H
+#ifndef PTQXXIMPORT_H
+#define PTQXXIMPORT_H
#include <migration/keximigrate.h>
@@ -34,26 +34,27 @@ namespace KexiMigration
class PqxxMigrate : public KexiMigrate
{
Q_OBJECT
+ TQ_OBJECT
KEXIMIGRATION_DRIVER
public:
- PqxxMigrate(QObject *parent, const char *name, const QStringList &args = QStringList());
+ PqxxMigrate(TQObject *tqparent, const char *name, const TQStringList &args = TQStringList());
virtual ~PqxxMigrate();
protected:
//Driver specific function to return table names
- virtual bool drv_tableNames(QStringList& tablenames);
+ virtual bool drv_tableNames(TQStringList& tablenames);
//Driver specific implementation to read a table schema
virtual bool drv_readTableSchema(
- const QString& originalName, KexiDB::TableSchema& tableSchema);
+ const TQString& originalName, KexiDB::TableSchema& tableSchema);
//Driver specific connection implementation
virtual bool drv_connect();
virtual bool drv_disconnect();
virtual tristate drv_queryStringListFromSQL(
- const QString& sqlStatement, uint columnNumber, QStringList& stringList,
+ const TQString& sqlStatement, uint columnNumber, TQStringList& stringList,
int numRecords = -1);
/*! Fetches single record from result obtained
@@ -64,10 +65,10 @@ namespace KexiMigration
On success the result is stored in \a data and true is returned,
\a data is resized to appropriate size. cancelled is returned on EOF. */
//! @todo SQL-dependent!
- virtual tristate drv_fetchRecordFromSQL(const QString& sqlStatement,
+ virtual tristate drv_fetchRecordFromSQL(const TQString& sqlStatement,
KexiDB::RowData& data, bool &firstRecord);
- virtual bool drv_copyTable(const QString& srcTable,
+ virtual bool drv_copyTable(const TQString& srcTable,
KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
private:
@@ -85,15 +86,15 @@ namespace KexiMigration
pqxx::result::const_iterator m_fetchRecordFromSQL_iter;
//perform a query on the database
- bool query(const QString& statement);
+ bool query(const TQString& statement);
//Clear the result info
void clearResultInfo ();
- pqxx::oid tableOid(const QString& tablename);
+ pqxx::oid tableOid(const TQString& tablename);
//Convert the pqxx type to a kexi type
- KexiDB::Field::Type type(int t, const QString& fname);
+ KexiDB::Field::Type type(int t, const TQString& fname);
//Find out the field constraints
//Return whether or not the field is a pkey