summaryrefslogtreecommitdiffstats
path: root/kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc')
-rw-r--r--kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc144
1 files changed, 72 insertions, 72 deletions
diff --git a/kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc b/kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc
index b3e69b65c..86fc10752 100644
--- a/kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc
+++ b/kpilot/conduits/sysinfoconduit/sysinfo-conduit.cc
@@ -29,10 +29,10 @@
#include <pi-version.h>
-#include <qtimer.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
+#include <tqtimer.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
#include <kconfig.h>
#include <kdebug.h>
@@ -49,7 +49,7 @@
#include "sysinfo-conduit.moc"
#include "sysinfoSettings.h"
-const QString SysInfoConduit::defaultpage = CSL1("KPilot System Information Page\n"
+const TQString SysInfoConduit::defaultpage = CSL1("KPilot System Information Page\n"
"==============================\n"
"(Kpilot was unable to find the correct template file, \n"
"so this simple template was used.)\n\n"
@@ -156,7 +156,7 @@ unsigned long version_conduit_sysinfo = Pilot::PLUGIN_API;
SysInfoConduit::SysInfoConduit(KPilotLink * o,
const char *n,
- const QStringList & a) :
+ const TQStringList & a) :
ConduitAction(o, n, a)
{
FUNCTIONSETUP;
@@ -196,7 +196,7 @@ void SysInfoConduit::readConfig()
readConfig();
- QTimer::singleShot(0, this, SLOT(hardwareInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(hardwareInfo()));
return true;
}
@@ -204,7 +204,7 @@ void SysInfoConduit::hardwareInfo()
{
FUNCTIONSETUP;
if (fHardwareInfo) {
- QString unknown = i18n("unknown");
+ TQString unknown = i18n("unknown");
/* Retrieve values for
* - #deviceid#
@@ -214,14 +214,14 @@ void SysInfoConduit::hardwareInfo()
* - #devicetype#
*/
KPilotSysInfo sysinfo = fHandle->getSysInfo();
- fValues[CSL1("deviceid")] = QString::fromLatin1(sysinfo.getProductID());
+ fValues[CSL1("deviceid")] = TQString::fromLatin1(sysinfo.getProductID());
const KPilotCard *device = fHandle->getCardInfo();
if (device)
{
- fValues[CSL1("devicename")] = QString::fromLatin1(device->getCardName());
+ fValues[CSL1("devicename")] = TQString::fromLatin1(device->getCardName());
fValues[CSL1("devicemodel")] = unknown; // TODO
- fValues[CSL1("manufacturer")] = QString::fromLatin1(device->getCardManufacturer());
+ fValues[CSL1("manufacturer")] = TQString::fromLatin1(device->getCardManufacturer());
}
else
{
@@ -235,7 +235,7 @@ void SysInfoConduit::hardwareInfo()
KPILOT_DELETE(device);
keepParts.append(CSL1("hardware"));
} else removeParts.append(CSL1("hardware"));
- QTimer::singleShot(0, this, SLOT(userInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(userInfo()));
}
void SysInfoConduit::userInfo()
@@ -257,15 +257,15 @@ void SysInfoConduit::userInfo()
{
fValues[CSL1("pw")] = i18n("No password set");
}
- fValues[CSL1("uid")] = QString::number(user.data()->userID);
- fValues[CSL1("viewerid")] = QString::number(user.data()->viewerID);
+ fValues[CSL1("uid")] = TQString::number(user.data()->userID);
+ fValues[CSL1("viewerid")] = TQString::number(user.data()->viewerID);
keepParts.append(CSL1("user"));
}
else
{
removeParts.append(CSL1("user"));
}
- QTimer::singleShot(0, this, SLOT(memoryInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(memoryInfo()));
}
void SysInfoConduit::memoryInfo()
@@ -280,13 +280,13 @@ void SysInfoConduit::memoryInfo()
const KPilotCard *device = fHandle->getCardInfo();
if (device)
{
- fValues[CSL1("rom")] = QString::number(device->getRomSize()/1024);
- fValues[CSL1("totalmem")] = QString::number(device->getRamSize()/1024);
- fValues[CSL1("freemem")] = QString::number(device->getRamFree()/1024);
+ fValues[CSL1("rom")] = TQString::number(device->getRomSize()/1024);
+ fValues[CSL1("totalmem")] = TQString::number(device->getRamSize()/1024);
+ fValues[CSL1("freemem")] = TQString::number(device->getRamFree()/1024);
}
keepParts.append(CSL1("memory"));
} else removeParts.append(CSL1("memory"));
- QTimer::singleShot(0, this, SLOT(storageInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(storageInfo()));
}
void SysInfoConduit::storageInfo()
@@ -299,8 +299,8 @@ void SysInfoConduit::storageInfo()
const KPilotCard *device = fHandle->getCardInfo(1);
if (device) {
fValues[CSL1("cards")] = CSL1("%1 (%2, %3 kB of %3 kB free)")
- .arg(QString::fromLatin1(device->getCardName()))
- .arg(QString::fromLatin1(device->getCardManufacturer()))
+ .arg(TQString::fromLatin1(device->getCardName()))
+ .arg(TQString::fromLatin1(device->getCardManufacturer()))
.arg(device->getRamFree()/1024)
.arg(device->getRamSize()/1024);
KPILOT_DELETE(device);
@@ -309,7 +309,7 @@ void SysInfoConduit::storageInfo()
}
keepParts.append(CSL1("storage"));
} else removeParts.append(CSL1("storage"));
- QTimer::singleShot(0, this, SLOT(dbListInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(dbListInfo()));
}
void SysInfoConduit::dbListInfo()
@@ -322,7 +322,7 @@ void SysInfoConduit::dbListInfo()
dblist=deviceLink()->getDBList();
keepParts.append(CSL1("dblist"));
} else removeParts.append(CSL1("dblist"));
- QTimer::singleShot(0, this, SLOT(recNumberInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(recNumberInfo()));
}
void SysInfoConduit::recNumberInfo()
@@ -336,34 +336,34 @@ void SysInfoConduit::recNumberInfo()
* - #memos#
*/
PilotDatabase *fDatabase = 0L;
- QString ERROR = CSL1("ERROR");
+ TQString ERROR = CSL1("ERROR");
fValues[CSL1("addresses")] = ERROR;
fValues[CSL1("events")] = ERROR;
fValues[CSL1("todos")] = ERROR;
fValues[CSL1("memos")] = ERROR;
fDatabase = deviceLink()->database(CSL1("AddressDB"));
if (fDatabase) {
- fValues[CSL1("addresses")] = QString::number(fDatabase->recordCount());
+ fValues[CSL1("addresses")] = TQString::number(fDatabase->recordCount());
KPILOT_DELETE(fDatabase);
}
fDatabase = deviceLink()->database(CSL1("DatebookDB"));
if (fDatabase) {
- fValues[CSL1("events")] = QString::number(fDatabase->recordCount());
+ fValues[CSL1("events")] = TQString::number(fDatabase->recordCount());
KPILOT_DELETE(fDatabase);
}
fDatabase = deviceLink()->database(CSL1("ToDoDB"));
if (fDatabase) {
- fValues[CSL1("todos")] = QString::number(fDatabase->recordCount());
+ fValues[CSL1("todos")] = TQString::number(fDatabase->recordCount());
KPILOT_DELETE(fDatabase);
}
fDatabase = deviceLink()->database(CSL1("MemoDB"));
if (fDatabase) {
- fValues[CSL1("memos")] = QString::number(fDatabase->recordCount());
+ fValues[CSL1("memos")] = TQString::number(fDatabase->recordCount());
KPILOT_DELETE(fDatabase);
}
keepParts.append(CSL1("records"));
} else removeParts.append(CSL1("records"));
- QTimer::singleShot(0, this, SLOT(syncInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(syncInfo()));
}
void SysInfoConduit::syncInfo()
@@ -377,16 +377,16 @@ void SysInfoConduit::syncInfo()
*/
KPilotUser user = deviceLink()->getPilotUser();
time_t lastsync = user.getLastSyncDate();
- QDateTime qlastsync;
+ TQDateTime qlastsync;
qlastsync.setTime_t(lastsync);
fValues[CSL1("lastsync")] = qlastsync.toString(Qt::LocalDate);
lastsync = user.getLastSuccessfulSyncDate();
qlastsync.setTime_t(lastsync);
fValues[CSL1("lastsuccsync")] = qlastsync.toString(Qt::LocalDate);
- fValues[CSL1("lastsyncpc")] = QString::number(user.getLastSyncPC());
+ fValues[CSL1("lastsyncpc")] = TQString::number(user.getLastSyncPC());
keepParts.append(CSL1("sync"));
} else removeParts.append(CSL1("sync"));
- QTimer::singleShot(0, this, SLOT(pcVersionInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(pcVersionInfo()));
}
void SysInfoConduit::pcVersionInfo()
@@ -400,7 +400,7 @@ void SysInfoConduit::pcVersionInfo()
* - #kpilot#
* - #pilotlink#
*/
- fValues[CSL1("kpilot")] = QString::fromLatin1(KPILOT_VERSION);
+ fValues[CSL1("kpilot")] = TQString::fromLatin1(KPILOT_VERSION);
fValues[CSL1("kde")] = i18n("unknown");
fValues[CSL1("qt")] = i18n("unknown");
fValues[CSL1("os")] = i18n("unknown");
@@ -408,29 +408,29 @@ void SysInfoConduit::pcVersionInfo()
struct utsname name;
if (uname (&name) >= 0) {
fValues[CSL1("os")] = CSL1("%1 %3, %5")
- .arg(QString::fromLatin1(name.sysname))
- .arg(QString::fromLatin1(name.release))
- .arg(QString::fromLatin1(name.machine));
- fValues[CSL1("hostname")] = CSL1("%2").arg(QString::fromLatin1(name.nodename));
+ .arg(TQString::fromLatin1(name.sysname))
+ .arg(TQString::fromLatin1(name.release))
+ .arg(TQString::fromLatin1(name.machine));
+ fValues[CSL1("hostname")] = CSL1("%2").arg(TQString::fromLatin1(name.nodename));
}
#ifdef KDE_VERSION_STRING
- fValues[CSL1("kde")] = QString::fromLatin1(KDE_VERSION_STRING);
+ fValues[CSL1("kde")] = TQString::fromLatin1(KDE_VERSION_STRING);
#endif
#ifdef QT_VERSION_STR
- fValues[CSL1("qt")] = QString::fromLatin1(QT_VERSION_STR);
+ fValues[CSL1("qt")] = TQString::fromLatin1(QT_VERSION_STR);
#endif
fValues[CSL1("pilotlink")] = CSL1("%1.%2.%3%4")
.arg(PILOT_LINK_VERSION)
.arg(PILOT_LINK_MAJOR)
.arg(PILOT_LINK_MINOR)
#ifdef PILOT_LINK_PATCH
- .arg(QString::fromLatin1(PILOT_LINK_PATCH));
+ .arg(TQString::fromLatin1(PILOT_LINK_PATCH));
#else
- .arg(QString());
+ .arg(TQString());
#endif
keepParts.append(CSL1("pcversion"));
} else removeParts.append(CSL1("pcversion"));
- QTimer::singleShot(0, this, SLOT(palmVersionInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(palmVersionInfo()));
}
void SysInfoConduit::palmVersionInfo()
@@ -440,7 +440,7 @@ void SysInfoConduit::palmVersionInfo()
/* Retrieve values for
* - #palmos#
*/
-/* fValues["palmos"] = QString("PalmOS %1.%2 (compat %3.%4)")
+/* fValues["palmos"] = TQString("PalmOS %1.%2 (compat %3.%4)")
.arg(fHandle->getSysInfo()->getMajorVersion())
.arg(fHandle->getSysInfo()->getMinorVersion())
.arg(fHandle->getSysInfo()->getCompatMajorVersion())
@@ -450,7 +450,7 @@ void SysInfoConduit::palmVersionInfo()
keepParts.append(CSL1("palmversion"));
} else removeParts.append(CSL1("palmversion"));
- QTimer::singleShot(0, this, SLOT(debugInfo()));
+ TQTimer::singleShot(0, this, TQT_SLOT(debugInfo()));
}
void SysInfoConduit::debugInfo()
@@ -463,18 +463,18 @@ void SysInfoConduit::debugInfo()
fValues[CSL1("debug")] = i18n("No debug data");
keepParts.append(CSL1("debug"));
} else removeParts.append(CSL1("debug"));
- QTimer::singleShot(0, this, SLOT(writeFile()));
+ TQTimer::singleShot(0, this, TQT_SLOT(writeFile()));
}
void SysInfoConduit::writeFile()
{
FUNCTIONSETUP;
- fValues[CSL1("date")] = QDateTime::currentDateTime().toString(Qt::LocalDate);
+ fValues[CSL1("date")] = TQDateTime::currentDateTime().toString(Qt::LocalDate);
- QString output;
+ TQString output;
// Open the template file
- QString templatefile;
+ TQString templatefile;
switch(fOutputType)
{
case eOutputText:
@@ -495,9 +495,9 @@ void SysInfoConduit::writeFile()
#ifdef DEBUG
DEBUGKPILOT<<"Loading template file "<<templatefile<<endl;
#endif
- QFile infile(templatefile);
+ TQFile infile(templatefile);
if (infile.open(IO_ReadOnly)) {
- QTextStream instream(&infile);
+ TQTextStream instream(&infile);
output = instream.read();
infile.close();
loaded=true;
@@ -512,32 +512,32 @@ void SysInfoConduit::writeFile()
}
// Remove all parts not extracted
- for ( QStringList::Iterator it = removeParts.begin(); it != removeParts.end(); ++it ) {
- QRegExp re(CSL1("<!--#if%1#.*#endif%1#-->").arg(*it).arg(*it));
+ for ( TQStringList::Iterator it = removeParts.begin(); it != removeParts.end(); ++it ) {
+ TQRegExp re(CSL1("<!--#if%1#.*#endif%1#-->").arg(*it).arg(*it));
re.setMinimal(true);
output.remove(re);
}
- for ( QStringList::Iterator it = keepParts.begin(); it != keepParts.end(); ++it ) {
- QRegExp re(CSL1("<!--#if%1#(.*)#endif%1#-->").arg(*it).arg(*it));
+ for ( TQStringList::Iterator it = keepParts.begin(); it != keepParts.end(); ++it ) {
+ TQRegExp re(CSL1("<!--#if%1#(.*)#endif%1#-->").arg(*it).arg(*it));
re.setMinimal(true);
output.replace(re, CSL1("\\1"));
}
// Do a loop through all keys in fValues
- QMap<QString,QString>::Iterator it;
+ TQMap<TQString,TQString>::Iterator it;
for ( it = fValues.begin(); it != fValues.end(); ++it ) {
output.replace(CSL1("#%1#").arg(it.key()), it.data());
}
// Insert the list of databases
- QRegExp re(CSL1("#dblist\\[(.*)\\]#"));
+ TQRegExp re(CSL1("#dblist\\[(.*)\\]#"));
re.setMinimal(true);
while (re.search(output)>=0){
- QString dbstring;
- QString subpatt=re.cap(1);
+ TQString dbstring;
+ TQString subpatt=re.cap(1);
for (KPilotLink::DBInfoList::ConstIterator i = dblist.begin(); i != dblist.end(); ++i ) {
DBInfo dbi = *i;
- QString newpatt(subpatt);
+ TQString newpatt(subpatt);
char tmpchr[5];
::memset(&tmpchr[0], 0, 5);
/* Patterns for the dblist argument:
@@ -552,16 +552,16 @@ void SysInfoConduit::writeFile()
* %8 .. modifyDate
* %9 .. backupDate
*/
- newpatt.replace(CSL1("%0"), QString::fromLatin1(dbi.name));
+ newpatt.replace(CSL1("%0"), TQString::fromLatin1(dbi.name));
set_long(&tmpchr[0],dbi.type);
- newpatt.replace(CSL1("%1"), QString::fromLatin1(tmpchr));
+ newpatt.replace(CSL1("%1"), TQString::fromLatin1(tmpchr));
set_long(&tmpchr[0],dbi.creator);
- newpatt.replace(CSL1("%2"), QString::fromLatin1(tmpchr));
- newpatt.replace(CSL1("%3"), QString::number(dbi.index));
- newpatt.replace(CSL1("%4"), QString::number(dbi.flags));
- newpatt.replace(CSL1("%5"), QString::number(dbi.miscFlags));
- newpatt.replace(CSL1("%6"), QString::number(dbi.version));
- QDateTime tm;
+ newpatt.replace(CSL1("%2"), TQString::fromLatin1(tmpchr));
+ newpatt.replace(CSL1("%3"), TQString::number(dbi.index));
+ newpatt.replace(CSL1("%4"), TQString::number(dbi.flags));
+ newpatt.replace(CSL1("%5"), TQString::number(dbi.miscFlags));
+ newpatt.replace(CSL1("%6"), TQString::number(dbi.version));
+ TQDateTime tm;
tm.setTime_t(dbi.createDate);
newpatt.replace(CSL1("%7"), tm.toString(Qt::LocalDate));
tm.setTime_t(dbi.modifyDate);
@@ -576,12 +576,12 @@ void SysInfoConduit::writeFile()
}
// Write out the result
- QFile outfile(fOutputFile);
+ TQFile outfile(fOutputFile);
#ifdef DEBUG
DEBUGKPILOT << fname << ": Writing file <" << fOutputFile << ">" << endl;
#endif
if (fOutputFile.isEmpty() || (!outfile.open(IO_WriteOnly)) ) {
- QFileInfo fi(QDir::home(), CSL1("KPilotSysInfo.")+QFileInfo(templatefile).extension() );
+ TQFileInfo fi(TQDir::home(), CSL1("KPilotSysInfo.")+TQFileInfo(templatefile).extension() );
fOutputFile=fi.absFilePath();
WARNINGKPILOT << "Unable to open output file, using " << fOutputFile << " instead." << endl;
emit logMessage(i18n("Unable to open output file, using %1 instead.").arg(fOutputFile));
@@ -589,18 +589,18 @@ void SysInfoConduit::writeFile()
if (!outfile.open(IO_WriteOnly)) {
WARNINGKPILOT<< "Unable to open " << fOutputFile << endl;
emit logError(i18n("Unable to open %1").arg(fOutputFile));
- QTimer::singleShot(0, this, SLOT(cleanup()));
+ TQTimer::singleShot(0, this, TQT_SLOT(cleanup()));
return;
}
}
// Finally, write the actual text out to the file.
- QTextStream outstream(&outfile);
+ TQTextStream outstream(&outfile);
outstream<<output;
outfile.close();
emit logMessage(i18n("Handheld system information written to the file %1").arg(fOutputFile));
- QTimer::singleShot(0, this, SLOT(cleanup()));
+ TQTimer::singleShot(0, this, TQT_SLOT(cleanup()));
}
void SysInfoConduit::cleanup()