summaryrefslogtreecommitdiffstats
path: root/kpilot/lib/plugin.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kpilot/lib/plugin.cc
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpilot/lib/plugin.cc')
-rw-r--r--kpilot/lib/plugin.cc158
1 files changed, 79 insertions, 79 deletions
diff --git a/kpilot/lib/plugin.cc b/kpilot/lib/plugin.cc
index e9bcc9221..128c8ba99 100644
--- a/kpilot/lib/plugin.cc
+++ b/kpilot/lib/plugin.cc
@@ -35,17 +35,17 @@
#include <stdlib.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qtabwidget.h>
-#include <qtextview.h>
-#include <qtimer.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqtabwidget.h>
+#include <tqtextview.h>
+#include <tqtimer.h>
#include <dcopclient.h>
#include <kaboutapplication.h>
@@ -65,9 +65,9 @@
#include "plugin.moc"
-ConduitConfigBase::ConduitConfigBase(QWidget *parent,
+ConduitConfigBase::ConduitConfigBase(TQWidget *parent,
const char *name) :
- QObject(parent,name),
+ TQObject(parent,name),
fModified(false),
fWidget(0L),
fConduitName(i18n("Unnamed"))
@@ -86,7 +86,7 @@ ConduitConfigBase::~ConduitConfigBase()
emit changed(true);
}
-/* virtual */ QString ConduitConfigBase::maybeSaveText() const
+/* virtual */ TQString ConduitConfigBase::maybeSaveText() const
{
FUNCTIONSETUP;
@@ -108,36 +108,36 @@ ConduitConfigBase::~ConduitConfigBase()
return true;
}
-QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
+TQWidget *ConduitConfigBase::aboutPage(TQWidget *parent, KAboutData *ad)
{
FUNCTIONSETUP;
- QWidget *w = new QWidget(parent, "aboutpage");
+ TQWidget *w = new TQWidget(parent, "aboutpage");
- QString s;
- QLabel *text;
+ TQString s;
+ TQLabel *text;
KIconLoader *l = KGlobal::iconLoader();
const KAboutData *p = ad ? ad : KGlobal::instance()->aboutData();
- QGridLayout *grid = new QGridLayout(w, 5, 4, SPACING);
+ TQGridLayout *grid = new TQGridLayout(w, 5, 4, SPACING);
grid->addColSpacing(0, SPACING);
grid->addColSpacing(4, SPACING);
- QPixmap applicationIcon =
- l->loadIcon(QString::fromLatin1(p->appName()),
+ TQPixmap applicationIcon =
+ l->loadIcon(TQString::fromLatin1(p->appName()),
KIcon::Desktop,
64, KIcon::DefaultState, 0L,
true);
if (applicationIcon.isNull())
{
- applicationIcon = l->loadIcon(QString::fromLatin1("kpilot"),
+ applicationIcon = l->loadIcon(TQString::fromLatin1("kpilot"),
KIcon::Desktop);
}
- text = new QLabel(w);
+ text = new TQLabel(w);
// Experiment with a long non-<qt> string. Use that to find
// sensible widths for the columns.
//
@@ -148,7 +148,7 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
int lineheight = text->size().height();
// Use the label to display the applciation icon
- text->setText(QString::null);
+ text->setText(TQString::null);
text->setPixmap(applicationIcon);
text->adjustSize();
grid->addWidget(text, 0, 1);
@@ -165,8 +165,8 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
grid->setColStretch(3,50);
linktext->setMinimumSize(linewidth,kMax(260,60+12*lineheight));
linktext->setFixedHeight(kMax(260,60+12*lineheight));
- linktext->setVScrollBarMode(QScrollView::Auto/*AlwaysOn*/);
- text = new QLabel(w);
+ linktext->setVScrollBarMode(TQScrollView::Auto/*AlwaysOn*/);
+ text = new TQLabel(w);
grid->addMultiCellWidget(text,0,0,2,3);
grid->addMultiCellWidget(linktext,1,2,1,3);
@@ -183,14 +183,14 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
if (!p->homepage().isEmpty())
{
- s = QString::null;
+ s = TQString::null;
s += CSL1("<a href=\"%1\">").arg(p->homepage());
s += p->homepage();
s += CSL1("</a><br>");
linktext->append(s);
}
- s = QString::null;
+ s = TQString::null;
s += i18n("Send questions and comments to <a href=\"mailto:%1\">%2</a>.")
.arg( CSL1("kdepim-users@kde.org") )
.arg( CSL1("kdepim-users@kde.org") );
@@ -203,16 +203,16 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
"<a href=\"help:/kpilot/trademarks.html\">KPilot User's Guide</a>.");
s += CSL1("<br>");
linktext->append(s);
- linktext->append(QString::null);
+ linktext->append(TQString::null);
- QValueList<KAboutPerson> pl = p->authors();
- QValueList<KAboutPerson>::ConstIterator i;
+ TQValueList<KAboutPerson> pl = p->authors();
+ TQValueList<KAboutPerson>::ConstIterator i;
s = i18n("<b>Authors:</b> ");
- QString comma = CSL1(", ");
+ TQString comma = CSL1(", ");
unsigned int count=1;
for (i=pl.begin(); i!=pl.end(); ++i)
@@ -220,13 +220,13 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
s.append(CSL1("%1 (<i>%2</i>)%3")
.arg((*i).name())
.arg((*i).task())
- .arg(count<pl.count() ? comma : QString::null)
+ .arg(count<pl.count() ? comma : TQString::null)
);
count++;
}
linktext->append(s);
- s = QString::null;
+ s = TQString::null;
pl = p->credits();
if (pl.count()>0)
{
@@ -237,7 +237,7 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
s.append(CSL1("%1 (<i>%2</i>)%3")
.arg((*i).name())
.arg((*i).task())
- .arg(count<pl.count() ? comma : QString::null)
+ .arg(count<pl.count() ? comma : TQString::null)
);
count++;
}
@@ -250,15 +250,15 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
return w;
}
-/* static */ void ConduitConfigBase::addAboutPage(QTabWidget *tw,
+/* static */ void ConduitConfigBase::addAboutPage(TQTabWidget *tw,
KAboutData *ad)
{
FUNCTIONSETUP;
Q_ASSERT(tw);
- QWidget *w = aboutPage(tw,ad);
- QSize sz = w->size();
+ TQWidget *w = aboutPage(tw,ad);
+ TQSize sz = w->size();
if (sz.width() < tw->size().width())
{
@@ -278,7 +278,7 @@ QWidget *ConduitConfigBase::aboutPage(QWidget *parent, KAboutData *ad)
ConduitAction::ConduitAction(KPilotLink *p,
const char *name,
- const QStringList &args) :
+ const TQStringList &args) :
SyncAction(p,name),
fDatabase(0L),
fLocalDatabase(0L),
@@ -290,14 +290,14 @@ ConduitAction::ConduitAction(KPilotLink *p,
{
FUNCTIONSETUP;
- QString cResolution(args.grep(QRegExp(CSL1("--conflictResolution \\d*"))).first());
+ TQString cResolution(args.grep(TQRegExp(CSL1("--conflictResolution \\d*"))).first());
if (cResolution.isEmpty())
{
fConflictResolution=(SyncAction::ConflictResolution)
- cResolution.replace(QRegExp(CSL1("--conflictResolution (\\d*)")), CSL1("\\1")).toInt();
+ cResolution.replace(TQRegExp(CSL1("--conflictResolution (\\d*)")), CSL1("\\1")).toInt();
}
- for (QStringList::ConstIterator it = args.begin();
+ for (TQStringList::ConstIterator it = args.begin();
it != args.end();
++it)
{
@@ -320,7 +320,7 @@ ConduitAction::ConduitAction(KPilotLink *p,
KPILOT_DELETE(fCtrPC);
}
-bool ConduitAction::openDatabases(const QString &name, bool *retrieved)
+bool ConduitAction::openDatabases(const TQString &name, bool *retrieved)
{
FUNCTIONSETUP;
@@ -335,7 +335,7 @@ bool ConduitAction::openDatabases(const QString &name, bool *retrieved)
KPILOT_DELETE(fLocalDatabase);
- QString localPathName = PilotLocalDatabase::getDBPath() + name;
+ TQString localPathName = PilotLocalDatabase::getDBPath() + name;
// we always want to use the conduits/ directory for our local
// databases. this keeps our backups and data that our conduits use
@@ -359,7 +359,7 @@ bool ConduitAction::openDatabases(const QString &name, bool *retrieved)
// if there is no backup db yet, fetch it from the palm, open it and set the full sync flag.
if (!localDB->isOpen() )
{
- QString dbpath(localDB->dbPathName());
+ TQString dbpath(localDB->dbPathName());
KPILOT_DELETE(localDB);
DEBUGKPILOT << fname
<< ": Backup database " << dbpath
@@ -383,8 +383,8 @@ bool ConduitAction::openDatabases(const QString &name, bool *retrieved)
dbinfo.flags &= ~dlpDBFlagOpen;
// make sure the dir for the backup db really exists!
- QFileInfo fi(dbpath);
- QString path(QFileInfo(dbpath).dir(true).absPath());
+ TQFileInfo fi(dbpath);
+ TQString path(TQFileInfo(dbpath).dir(true).absPath());
if (!path.endsWith(CSL1("/"))) path.append(CSL1("/"));
if (!KStandardDirs::exists(path))
{
@@ -477,9 +477,9 @@ void ConduitAction::finished()
// this is a percentage...
int allowedVolatility = 70;
- QString caption = i18n("Large Changes Detected");
+ TQString caption = i18n("Large Changes Detected");
// args are already i18n'd
- QString query = i18n("The %1 conduit has made a "
+ TQString query = i18n("The %1 conduit has made a "
"large number of changes to your %2. Do you want "
"to allow this change?\nDetails:\n\t%3");
@@ -494,7 +494,7 @@ void ConduitAction::finished()
/*
int rc = questionYesNo(query, caption,
- QString::null, 0 );
+ TQString::null, 0 );
if (rc == KMessageBox::Yes)
{
// TODO: add commit and rollback code.
@@ -514,7 +514,7 @@ void ConduitAction::finished()
ConduitProxy::ConduitProxy(KPilotLink *p,
- const QString &name,
+ const TQString &name,
const SyncAction::SyncMode &m) :
ConduitAction(p,name.latin1(),m.list()),
fDesktopName(name)
@@ -548,7 +548,7 @@ ConduitProxy::ConduitProxy(KPilotLink *p,
<< endl;
KLibrary *library = KLibLoader::self()->library(
- QFile::encodeName(fLibraryName));
+ TQFile::encodeName(fLibraryName));
if (!library)
{
WARNINGKPILOT << "Can't load library "
@@ -582,11 +582,11 @@ ConduitProxy::ConduitProxy(KPilotLink *p,
return false;
}
- QStringList l = syncMode().list();
+ TQStringList l = syncMode().list();
DEBUGKPILOT << fname << ": Flags: " << syncMode().name() << endl;
- QObject *object = factory->create(fHandle,name(),"SyncAction",l);
+ TQObject *object = factory->create(fHandle,name(),"SyncAction",l);
if (!object)
{
@@ -607,17 +607,17 @@ ConduitProxy::ConduitProxy(KPilotLink *p,
addSyncLogEntry(i18n("[Conduit %1]").arg(fDesktopName));
// Handle the syncDone signal properly & unload the conduit.
- QObject::connect(fConduit,SIGNAL(syncDone(SyncAction *)),
- this,SLOT(execDone(SyncAction *)));
+ TQObject::connect(fConduit,TQT_SIGNAL(syncDone(SyncAction *)),
+ this,TQT_SLOT(execDone(SyncAction *)));
// Proxy all the log and error messages.
- QObject::connect(fConduit,SIGNAL(logMessage(const QString &)),
- this,SIGNAL(logMessage(const QString &)));
- QObject::connect(fConduit,SIGNAL(logError(const QString &)),
- this,SIGNAL(logError(const QString &)));
- QObject::connect(fConduit,SIGNAL(logProgress(const QString &,int)),
- this,SIGNAL(logProgress(const QString &,int)));
-
- QTimer::singleShot(0,fConduit,SLOT(execConduit()));
+ TQObject::connect(fConduit,TQT_SIGNAL(logMessage(const TQString &)),
+ this,TQT_SIGNAL(logMessage(const TQString &)));
+ TQObject::connect(fConduit,TQT_SIGNAL(logError(const TQString &)),
+ this,TQT_SIGNAL(logError(const TQString &)));
+ TQObject::connect(fConduit,TQT_SIGNAL(logProgress(const TQString &,int)),
+ this,TQT_SIGNAL(logProgress(const TQString &,int)));
+
+ TQTimer::singleShot(0,fConduit,TQT_SLOT(execConduit()));
return true;
}
@@ -649,11 +649,11 @@ void ConduitProxy::execDone(SyncAction *p)
namespace PluginUtility
{
-QString findArgument(const QStringList &a, const QString &arg)
+TQString findArgument(const TQStringList &a, const TQString &arg)
{
FUNCTIONSETUP;
- QString search;
+ TQString search;
if (arg.startsWith( CSL1("--") ))
{
@@ -666,20 +666,20 @@ QString findArgument(const QStringList &a, const QString &arg)
search.append( CSL1("=") );
- QStringList::ConstIterator end = a.end();
- for (QStringList::ConstIterator i = a.begin(); i != end; ++i)
+ TQStringList::ConstIterator end = a.end();
+ for (TQStringList::ConstIterator i = a.begin(); i != end; ++i)
{
if ((*i).startsWith( search ))
{
- QString s = (*i).mid(search.length());
+ TQString s = (*i).mid(search.length());
return s;
}
}
- return QString::null;
+ return TQString::null;
}
-/* static */ bool isRunning(const QCString &n)
+/* static */ bool isRunning(const TQCString &n)
{
DCOPClient *dcop = KApplication::kApplication()->dcopClient();
QCStringList apps = dcop->registeredApplications();
@@ -689,7 +689,7 @@ QString findArgument(const QStringList &a, const QString &arg)
/* static */ unsigned long pluginVersion(const KLibrary *lib)
{
- QString symbol = CSL1("version_");
+ TQString symbol = CSL1("version_");
symbol.append(lib->name());
if (!lib->hasSymbol(symbol.latin1())) return 0;
@@ -699,21 +699,21 @@ QString findArgument(const QStringList &a, const QString &arg)
}
-/* static */ QString pluginVersionString(const KLibrary *lib)
+/* static */ TQString pluginVersionString(const KLibrary *lib)
{
- QString symbol= CSL1("id_");
+ TQString symbol= CSL1("id_");
symbol.append(lib->name());
- if (!lib->hasSymbol(symbol.latin1())) return QString::null;
+ if (!lib->hasSymbol(symbol.latin1())) return TQString::null;
- return QString::fromLatin1(*((const char **)(lib->symbol(symbol.latin1()))));
+ return TQString::fromLatin1(*((const char **)(lib->symbol(symbol.latin1()))));
}
}
-CUDCounter::CUDCounter(QString s) :
+CUDCounter::CUDCounter(TQString s) :
fC(0),fU(0),fD(0),fStart(0),fEnd(0),fType(s)
{
}
@@ -743,9 +743,9 @@ void CUDCounter::setEndCount(unsigned int t)
fEnd = t;
}
-QString CUDCounter::moo() const
+TQString CUDCounter::moo() const
{
- QString result = fType + ": " +
+ TQString result = fType + ": " +
i18n("Start: %1. End: %2. ").arg(fStart).arg(fEnd);
if (fC > 0) result += i18n("%1 new. ").arg(fC);