summaryrefslogtreecommitdiffstats
path: root/kexi/core/kexidbshortcutfile.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/core/kexidbshortcutfile.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/core/kexidbshortcutfile.cpp')
-rw-r--r--kexi/core/kexidbshortcutfile.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kexi/core/kexidbshortcutfile.cpp b/kexi/core/kexidbshortcutfile.cpp
index 4a503d43..451eb66a 100644
--- a/kexi/core/kexidbshortcutfile.cpp
+++ b/kexi/core/kexidbshortcutfile.cpp
@@ -25,8 +25,8 @@
#include <kconfig.h>
#include <kdebug.h>
-#include <qstringlist.h>
-#include <qdir.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
//! Version of the KexiDBShortcutFile format.
#define KexiDBShortcutFile_version 2
@@ -45,14 +45,14 @@ class KexiDBShortcutFile::Private
: isDatabaseShortcut(true)
{
}
- QString fileName;
+ TQString fileName;
bool isDatabaseShortcut : 1;
};
-KexiDBShortcutFile::KexiDBShortcutFile( const QString& fileName )
+KexiDBShortcutFile::KexiDBShortcutFile( const TQString& fileName )
: d( new KexiDBShortcutFile::Private() )
{
- d->fileName = QDir(fileName).absPath();
+ d->fileName = TQDir(fileName).absPath();
}
KexiDBShortcutFile::~KexiDBShortcutFile()
@@ -60,16 +60,16 @@ KexiDBShortcutFile::~KexiDBShortcutFile()
delete d;
}
-bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, QString* _groupKey)
+bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, TQString* _groupKey)
{
KConfig config(d->fileName, true /* readOnly */, false /* local */ );
config.setGroup("File Information");
data.formatVersion = config.readNumEntry("version", KexiDBShortcutFile_version);
- QString groupKey;
+ TQString groupKey;
if (!_groupKey || _groupKey->isEmpty()) {
- QStringList groups(config.groupList());
- foreach (QStringList::ConstIterator, it, groups) {
+ TQStringList groups(config.groupList());
+ foreach (TQStringList::ConstIterator, it, groups) {
if ((*it).lower()!="file information") {
groupKey = *it;
break;
@@ -89,7 +89,7 @@ bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, QString* _groupK
}
config.setGroup(groupKey);
- QString type( config.readEntry("type", "database").lower() );
+ TQString type( config.readEntry("type", "database").lower() );
if (type=="database") {
d->isDatabaseShortcut = true;
@@ -97,7 +97,7 @@ bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, QString* _groupK
d->isDatabaseShortcut = false;
}
else {
- //ERR: i18n("No valid "type" field specified for section \"%1\": unknown value \"%2\".").arg(group).arg(type)
+ //ERR: i18n("No valid "type" field specified for section \"%1\": unknown value \"%2\".").tqarg(group).tqarg(type)
return false;
}
@@ -109,26 +109,26 @@ bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, QString* _groupK
<< " engine=" << config.readEntry("engine")
<< " server=" << config.readEntry("server")
<< " user=" << config.readEntry("user")
- << " password=" << QString().fill('*', config.readEntry("password").length())
+ << " password=" << TQString().fill('*', config.readEntry("password").length())
<< " comment=" << config.readEntry("comment")
<< endl;*/
//no filename by default
- data.connectionData()->setFileName(QString::null);
+ data.connectionData()->setFileName(TQString());
if (d->isDatabaseShortcut) {
data.setCaption( config.readEntry("caption") );
data.setDescription( config.readEntry("comment") );
- data.connectionData()->description = QString::null;
- data.connectionData()->caption = QString::null; /* connection name is not specified... */
+ data.connectionData()->description = TQString();
+ data.connectionData()->caption = TQString(); /* connection name is not specified... */
data.setDatabaseName( config.readEntry("name") );
}
else {
- data.setCaption( QString::null );
+ data.setCaption( TQString() );
data.connectionData()->caption = config.readEntry("caption");
- data.setDescription( QString::null );
+ data.setDescription( TQString() );
data.connectionData()->description = config.readEntry("comment");
- data.setDatabaseName( QString::null ); /* db name is not specified... */
+ data.setDatabaseName( TQString() ); /* db name is not specified... */
}
data.connectionData()->driverName = config.readEntry("engine");
if (data.connectionData()->driverName.isEmpty()) {
@@ -156,7 +156,7 @@ bool KexiDBShortcutFile::loadProjectData(KexiProjectData& data, QString* _groupK
}
bool KexiDBShortcutFile::saveProjectData(const KexiProjectData& data,
- bool savePassword, QString* _groupKey, bool overwriteFirstGroup)
+ bool savePassword, TQString* _groupKey, bool overwriteFirstGroup)
{
KConfig config(d->fileName, false /*rw*/, false /* local */);
config.setGroup("File Information");
@@ -169,16 +169,16 @@ bool KexiDBShortcutFile::saveProjectData(const KexiProjectData& data,
const bool thisIsConnectionData = data.databaseName().isEmpty();
//use or find a nonempty group key
- QString groupKey;
+ TQString groupKey;
if (_groupKey && !_groupKey->isEmpty()) {
groupKey = *_groupKey;
}
else {
- QString groupPrefix;
- const QStringList groups(config.groupList());
+ TQString groupPrefix;
+ const TQStringList groups(config.groupList());
if (overwriteFirstGroup && !groups.isEmpty()) {
// groupKey = groups.first(); //found
- foreach (QStringList::ConstIterator, it, groups) {
+ foreach (TQStringList::ConstIterator, it, groups) {
if ((*it).lower()!="file information") {
groupKey = *it;
break;
@@ -194,9 +194,9 @@ bool KexiDBShortcutFile::saveProjectData(const KexiProjectData& data,
groupPrefix = "Database%1"; //do not i18n!
int number = 1;
- while (config.hasGroup(groupPrefix.arg(number))) //a new group key couldn't exist
+ while (config.hasGroup(groupPrefix.tqarg(number))) //a new group key couldn't exist
number++;
- groupKey = groupPrefix.arg(number);
+ groupKey = groupPrefix.tqarg(number);
}
if (_groupKey) //return this one (generated or found)
*_groupKey = groupKey;
@@ -233,7 +233,7 @@ bool KexiDBShortcutFile::saveProjectData(const KexiProjectData& data,
config.writeEntry("password", data.constConnectionData()->password);
}
else {
- QString encryptedPassword = data.constConnectionData()->password;
+ TQString encryptedPassword = data.constConnectionData()->password;
KexiUtils::simpleCrypt(encryptedPassword);
config.writeEntry("encryptedPassword", encryptedPassword);
encryptedPassword.fill(' '); //for security
@@ -247,14 +247,14 @@ bool KexiDBShortcutFile::saveProjectData(const KexiProjectData& data,
return true;
}
-QString KexiDBShortcutFile::fileName() const
+TQString KexiDBShortcutFile::fileName() const
{
return d->fileName;
}
//---------------------------------------------
-KexiDBConnShortcutFile::KexiDBConnShortcutFile( const QString& fileName )
+KexiDBConnShortcutFile::KexiDBConnShortcutFile( const TQString& fileName )
: KexiDBShortcutFile( fileName )
{
}
@@ -263,7 +263,7 @@ KexiDBConnShortcutFile::~KexiDBConnShortcutFile()
{
}
-bool KexiDBConnShortcutFile::loadConnectionData(KexiDB::ConnectionData& data, QString* _groupKey)
+bool KexiDBConnShortcutFile::loadConnectionData(KexiDB::ConnectionData& data, TQString* _groupKey)
{
KexiProjectData pdata(data);
if (!loadProjectData(pdata, _groupKey))
@@ -273,7 +273,7 @@ bool KexiDBConnShortcutFile::loadConnectionData(KexiDB::ConnectionData& data, QS
}
bool KexiDBConnShortcutFile::saveConnectionData(const KexiDB::ConnectionData& data,
- bool savePassword, QString* groupKey, bool overwriteFirstGroup)
+ bool savePassword, TQString* groupKey, bool overwriteFirstGroup)
{
KexiProjectData pdata(data);
return saveProjectData(pdata, savePassword, groupKey, overwriteFirstGroup);
@@ -286,14 +286,14 @@ bool KexiDBConnShortcutFile::saveConnectionData(const KexiDB::ConnectionData& da
bool KexiDBConnSetShortcutFiles::loadConnectionDataSet(KexiDBConnectionSet& set)
{
set.clear();
-// QStringList dirs( KGlobal::dirs()->findDirs("data", "kexi/connections") );
+// TQStringList dirs( KGlobal::dirs()->findDirs("data", "kexi/connections") );
// kexidbg << dirs << endl;
- QStringList files( KGlobal::dirs()->findAllResources("data", "kexi/connections/*.kexic") );
+ TQStringList files( KGlobal::dirs()->findAllResources("data", "kexi/connections/*.kexic") );
// //also try for capital file extension
// files += KGlobal::dirs()->findAllResources("data", "kexi/connections/*.KEXIC");
kexidbg << files << endl;
- foreach(QStringList::ConstIterator, it, files) {
+ foreach(TQStringList::ConstIterator, it, files) {
KexiDB::ConnectionData *data = new KexiDB::ConnectionData();
KexiDBConnShortcutFile shortcutFile( *it );
if (!shortcutFile.loadConnectionData(*data)) {