summaryrefslogtreecommitdiffstats
path: root/kbiff/kbiff.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-07-02 19:34:37 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-02 19:34:37 +0200
commit979e7a713aabb63ffbe53b6a42a90e87bf4d1969 (patch)
treed81fe703502efa28fdcb3a10a9310af33ddf581b /kbiff/kbiff.cpp
parent9be78eabfff24f317148c216f609e4d4778e3d58 (diff)
downloadkbiff-979e7a713aabb63ffbe53b6a42a90e87bf4d1969.tar.gz
kbiff-979e7a713aabb63ffbe53b6a42a90e87bf4d1969.zip
Initial TQt conversion
Diffstat (limited to 'kbiff/kbiff.cpp')
-rw-r--r--kbiff/kbiff.cpp170
1 files changed, 85 insertions, 85 deletions
diff --git a/kbiff/kbiff.cpp b/kbiff/kbiff.cpp
index 95abaab..a87b891 100644
--- a/kbiff/kbiff.cpp
+++ b/kbiff/kbiff.cpp
@@ -7,8 +7,8 @@
*/
#include "kbiff.h"
#include "kbiff.moc"
-#include <qmovie.h>
-#include <qtooltip.h>
+#include <ntqmovie.h>
+#include <ntqtooltip.h>
#include <kaudioplayer.h>
#include <kconfig.h>
@@ -30,9 +30,9 @@
#include <dcopclient.h>
-KBiff::KBiff(DCOPClient *client_, QWidget *parent_)
+KBiff::KBiff(DCOPClient *client_, TQWidget *parent_)
: DCOPObjectProxy(client_),
- QLabel(parent_),
+ TQLabel(parent_),
statusTimer(0),
status(0),
statusChanged(true),
@@ -67,13 +67,13 @@ KBiff::~KBiff()
// we no longer want to be registered
DCOPClient *client = kapp->dcopClient();
- QCString proxy = QCString("kbiff-") + QCString().setNum(getpid());
+ TQCString proxy = TQCString("kbiff-") + TQCString().setNum(getpid());
if (client->isApplicationRegistered(proxy) == true)
{
- QByteArray params;
- QDataStream ds(params, IO_WriteOnly);
+ TQByteArray params;
+ TQDataStream ds(params, IO_WriteOnly);
ds << proxy;
- client->send("kbiff", "kbiff", "proxyDeregister(QString)", params);
+ client->send("kbiff", "kbiff", "proxyDeregister(TQString)", params);
}
client->detach();
}
@@ -106,9 +106,9 @@ void KBiff::processSetup(const KBiffSetup* setup_, bool run_)
// if we aren't going the status route, we should at least
// provide a tooltip!
if (dostatus == false)
- QToolTip::add(this, profile);
+ TQToolTip::add(this, profile);
else
- QToolTip::remove(this);
+ TQToolTip::remove(this);
// set all the new mailboxes
setMailboxList(setup_->getMailboxList(), setup_->getPoll());
@@ -152,9 +152,9 @@ void KBiff::processSetup(const KBiffSetup* setup_, bool run_)
delete setup_;
}
-void KBiff::setMailboxList(const QList<KBiffMailbox>& mailbox_list, unsigned int poll)
+void KBiff::setMailboxList(const TQList<KBiffMailbox>& mailbox_list, unsigned int poll)
{
- QList<KBiffMailbox> tmp_list = mailbox_list;
+ TQList<KBiffMailbox> tmp_list = mailbox_list;
myMUTEX = true;
if (isRunning())
@@ -169,10 +169,10 @@ void KBiff::setMailboxList(const QList<KBiffMailbox>& mailbox_list, unsigned int
monitor->setMailbox(*url);
monitor->setPollInterval(poll);
monitor->setMailboxKey(mbox->key);
- connect(monitor, SIGNAL(signal_newMail(const int, const QString&)),
- this, SLOT(haveNewMail(const int, const QString&)));
- connect(monitor, SIGNAL(signal_currentStatus(const int, const QString&, const KBiffMailState)),
- this, SLOT(currentStatus(const int, const QString&, const KBiffMailState)));
+ connect(monitor, SIGNAL(signal_newMail(const int, const TQString&)),
+ this, SLOT(haveNewMail(const int, const TQString&)));
+ connect(monitor, SIGNAL(signal_currentStatus(const int, const TQString&, const KBiffMailState)),
+ this, SLOT(currentStatus(const int, const TQString&, const KBiffMailState)));
connect(monitor, SIGNAL(signal_noMail()), this, SLOT(displayPixmap()));
connect(monitor, SIGNAL(signal_noMail()),
this, SLOT(haveNoNewMail()));
@@ -182,10 +182,10 @@ void KBiff::setMailboxList(const QList<KBiffMailbox>& mailbox_list, unsigned int
connect(monitor, SIGNAL(signal_noConn()), this, SLOT(displayPixmap()));
connect(monitor, SIGNAL(signal_noConn()),
this, SLOT(haveNoNewMail()));
- connect(monitor, SIGNAL(signal_invalidLogin(const QString&)),
- this, SLOT(invalidLogin(const QString&)));
- connect(monitor, SIGNAL(signal_fetchMail(const QString&)),
- this, SLOT(slotLaunchFetchClient(const QString&)));
+ connect(monitor, SIGNAL(signal_invalidLogin(const TQString&)),
+ this, SLOT(invalidLogin(const TQString&)));
+ connect(monitor, SIGNAL(signal_fetchMail(const TQString&)),
+ this, SLOT(slotLaunchFetchClient(const TQString&)));
monitorList.append(monitor);
}
myMUTEX = false;
@@ -213,7 +213,7 @@ void KBiff::readSessionConfig()
///////////////////////////////////////////////////////////////////////////
// Protected Virtuals
///////////////////////////////////////////////////////////////////////////
-void KBiff::mousePressEvent(QMouseEvent *e)
+void KBiff::mousePressEvent(TQMouseEvent *e)
{
// regardless of which button, get rid of the status box
if (status)
@@ -242,9 +242,9 @@ void KBiff::mousePressEvent(QMouseEvent *e)
}
}
-void KBiff::enterEvent(QEvent *e)
+void KBiff::enterEvent(TQEvent *e)
{
- QLabel::enterEvent(e);
+ TQLabel::enterEvent(e);
// return now if the user doesn't want this feature.
// *sniff*.. the ingrate.. I worked so hard on this, too... *sob*
@@ -256,15 +256,15 @@ void KBiff::enterEvent(QEvent *e)
return;
// popup the status in one second
- statusTimer = new QTimer(this);
+ statusTimer = new TQTimer(this);
connect(statusTimer, SIGNAL(timeout()), this, SLOT(popupStatus()));
statusTimer->start(1000, true);
}
-void KBiff::leaveEvent(QEvent *e)
+void KBiff::leaveEvent(TQEvent *e)
{
- QLabel::leaveEvent(e);
+ TQLabel::leaveEvent(e);
// stop the timer if it is going
if (statusTimer)
@@ -303,14 +303,14 @@ void KBiff::popupStatus()
}
status->updateListView(statusList);
- status->popup(QCursor::pos());
+ status->popup(TQCursor::pos());
}
-bool KBiff::isGIF8x(const QString& file_name)
+bool KBiff::isGIF8x(const TQString& file_name)
{
/* The first test checks if we can open the file */
- QFile gif8x(file_name);
+ TQFile gif8x(file_name);
if (gif8x.open(IO_ReadOnly) == false)
return false;
@@ -378,7 +378,7 @@ void KBiff::displayPixmap()
// we will try to deduce the pixmap (or gif) name now. it will
// vary depending on the dock and mail state
- QString pixmap_name;
+ TQString pixmap_name;
bool has_new = false, has_old = false, has_no = true, has_noconn = false;
KBiffMonitor *monitor;
for (monitor = monitorList.first();
@@ -435,7 +435,7 @@ void KBiff::displayPixmap()
if (docked)
{
// we need to check if this has path info encoded into it
- QFileInfo info(pixmap_name);
+ TQFileInfo info(pixmap_name);
// if info.fileName() returns pixmap_name, then we no there
// isn't any paths attached and we can just prepend our 'mini'
@@ -446,7 +446,7 @@ void KBiff::displayPixmap()
// so we have some path junk on it. we get the filename
// by itself, prepend our 'mini' and tack it onto the end
// of the original dirpath. simple
- QString filename(info.fileName());
+ TQString filename(info.fileName());
filename.prepend("mini-");
// we aren't guaranteed that the dirpath will end in a /
@@ -454,18 +454,18 @@ void KBiff::displayPixmap()
pixmap_name = info.dirPath() + "/" + filename;
}
}
- QString filename = KGlobal::iconLoader()->iconPath( pixmap_name, KIcon::User );
- QFileInfo file(filename);
+ TQString filename = KGlobal::iconLoader()->iconPath( pixmap_name, KIcon::User );
+ TQFileInfo file(filename);
// at this point, we have the file to display. so display it
if (isGIF8x(file.absFilePath()))
- setMovie(QMovie(file.absFilePath()));
+ setMovie(TQMovie(file.absFilePath()));
else
- setPixmap(QPixmap(file.absFilePath()));
+ setPixmap(TQPixmap(file.absFilePath()));
adjustSize();
}
-void KBiff::currentStatus(const int num, const QString& the_mailbox, const KBiffMailState the_state)
+void KBiff::currentStatus(const int num, const TQString& the_mailbox, const KBiffMailState the_state)
{
statusChanged = true;
// iterate through all saved notify dialogs to see if "our" one is
@@ -508,7 +508,7 @@ void KBiff::currentStatus(const int num, const QString& the_mailbox, const KBiff
}
}
-void KBiff::haveNewMail(const int num, const QString& the_mailbox)
+void KBiff::haveNewMail(const int num, const TQString& the_mailbox)
{
displayPixmap();
@@ -563,7 +563,7 @@ void KBiff::haveNoNewMail()
}
}
-QString KBiff::getURLWithNewMail()
+TQString KBiff::getURLWithNewMail()
{
KBiffMonitor *monitor;
for (monitor = monitorList.first();
@@ -577,9 +577,9 @@ QString KBiff::getURLWithNewMail()
return monitorList.first()->getMailbox();
}
-QString KBiff::getMailBoxWithNewMail()
+TQString KBiff::getMailBoxWithNewMail()
{
- QString url(getURLWithNewMail());
+ TQString url(getURLWithNewMail());
int slashPos = url.find('/');
if(slashPos == -1)
@@ -588,7 +588,7 @@ QString KBiff::getMailBoxWithNewMail()
return url.mid(url.find(':') + 1);
}
-QString KBiff::replaceCommandArgs(QString cmdStr)
+TQString KBiff::replaceCommandArgs(TQString cmdStr)
{
bool expand = false;
for(unsigned int i = 0; i < cmdStr.length(); i++)
@@ -628,7 +628,7 @@ void KBiff::dock()
if (docked)
kapp->setTopWidget(this);
else
- kapp->setTopWidget(new QWidget);
+ kapp->setTopWidget(new TQWidget);
}
if (docked == false)
@@ -643,7 +643,7 @@ void KBiff::dock()
// (un)dock it!
this->show();
- QTimer::singleShot(1000, this, SLOT(displayPixmap()));
+ TQTimer::singleShot(1000, this, SLOT(displayPixmap()));
}
void KBiff::setup()
@@ -757,7 +757,7 @@ void KBiff::popupMenu()
popup->insertItem(i18n("E&xit"), kapp, SLOT(quit()));
- popup->popup(QCursor::pos());
+ popup->popup(TQCursor::pos());
}
void KBiff::reset()
@@ -802,12 +802,12 @@ bool KBiff::isRunning()
return is_running;
}
-void KBiff::executeCommand(const QString& command)
+void KBiff::executeCommand(const TQString& command)
{
KRun::runCommand(command);
}
-void KBiff::slotLaunchFetchClient(const QString& fetchClient)
+void KBiff::slotLaunchFetchClient(const TQString& fetchClient)
{
if (!fetchClient.isEmpty())
executeCommand(fetchClient);
@@ -819,21 +819,21 @@ void KBiff::slotLaunchMailClient()
executeCommand(replaceCommandArgs(mailClient));
}
-void KBiff::slotPlaySound(const QString& play_sound)
+void KBiff::slotPlaySound(const TQString& play_sound)
{
// make sure something is specified
if (!play_sound.isNull())
KAudioPlayer::play(play_sound);
}
-bool KBiff::process(const QCString&, const QCString& function,
- const QByteArray& data, QCString& replyType,
- QByteArray &replyData)
+bool KBiff::process(const TQCString&, const TQCString& function,
+ const TQByteArray& data, TQCString& replyType,
+ TQByteArray &replyData)
{
- QDataStream args(data, IO_ReadOnly);
- QDataStream reply(replyData, IO_WriteOnly);
- QString proxy;
- if (function == "proxyRegister(QString)")
+ TQDataStream args(data, IO_ReadOnly);
+ TQDataStream reply(replyData, IO_WriteOnly);
+ TQString proxy;
+ if (function == "proxyRegister(TQString)")
{
args >> proxy;
proxyList.append(proxy);
@@ -841,7 +841,7 @@ bool KBiff::process(const QCString&, const QCString& function,
return true;
}
- else if (function == "proxyDeregister(QString)")
+ else if (function == "proxyDeregister(TQString)")
{
args >> proxy;
proxyList.remove(proxy);
@@ -849,9 +849,9 @@ bool KBiff::process(const QCString&, const QCString& function,
return true;
}
- else if (function == "hasMailbox(QString)")
+ else if (function == "hasMailbox(TQString)")
{
- QString mailbox;
+ TQString mailbox;
args >> mailbox;
reply << (bool) findMailbox(mailbox, proxy);
@@ -859,16 +859,16 @@ bool KBiff::process(const QCString&, const QCString& function,
return true;
}
- else if (function == "mailCount(QString)")
+ else if (function == "mailCount(TQString)")
{
reply << -1;
replyType = "int";
return true;
}
- else if (function == "newMailCount(QString)")
+ else if (function == "newMailCount(TQString)")
{
- QString mailbox;
+ TQString mailbox;
args >> mailbox;
reply << newMailCount(mailbox);
@@ -880,26 +880,26 @@ bool KBiff::process(const QCString&, const QCString& function,
return false;
}
-int KBiff::newMailCount(const QString& url)
+int KBiff::newMailCount(const TQString& url)
{
int newmail = -1;
- QString proxy;
+ TQString proxy;
if (findMailbox(url, proxy) == true)
{
- if (proxy != QString::null)
+ if (proxy != TQString::null)
{
- QByteArray data;
- QDataStream ds(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream ds(data, IO_WriteOnly);
ds << url;
- QByteArray reply_data;
- QCString reply_type;
- QDataStream reply(reply_data, IO_ReadOnly);
+ TQByteArray reply_data;
+ TQCString reply_type;
+ TQDataStream reply(reply_data, IO_ReadOnly);
DCOPClient *dcc = kapp->dcopClient();
if (dcc->call(proxy.ascii(), "kbiff",
- "newMailCount(QString)", data, reply_type,
+ "newMailCount(TQString)", data, reply_type,
reply_data) == true)
{
reply >> newmail;
@@ -923,7 +923,7 @@ int KBiff::newMailCount(const QString& url)
return newmail;
}
-bool KBiff::findMailbox(const QString& url, QString& proxy)
+bool KBiff::findMailbox(const TQString& url, TQString& proxy)
{
bool has_mailbox = false;
KBiffMonitor *monitor;
@@ -937,17 +937,17 @@ bool KBiff::findMailbox(const QString& url, QString& proxy)
}
if (has_mailbox == false)
{
- QByteArray data, replyData;
- QCString replyType;
- QDataStream ds(data, IO_WriteOnly);
+ TQByteArray data, replyData;
+ TQCString replyType;
+ TQDataStream ds(data, IO_WriteOnly);
ds << url;
// okay, now try to iterate through our proxies
- QStringList::Iterator it = proxyList.begin();
+ TQStringList::Iterator it = proxyList.begin();
for ( ; it != proxyList.end(); it++)
{
DCOPClient *dcc = kapp->dcopClient();
- if (dcc->call(QCString((*it).ascii()), "kbiff",
- "hasMailbox(QString)", data, replyType,
+ if (dcc->call(TQCString((*it).ascii()), "kbiff",
+ "hasMailbox(TQString)", data, replyType,
replyData) == true)
{
has_mailbox = true;
@@ -973,19 +973,19 @@ void KBiff::registerMe(DCOPClient *client)
{
// okay, there is a running kbiff already. we will let it
// know that we are active and let it feed us requests
- QCString proxy = QCString("kbiff-") + QCString().setNum(getpid());
- QByteArray params, reply;
- QCString reply_type;
- QDataStream ds(params, IO_WriteOnly);
+ TQCString proxy = TQCString("kbiff-") + TQCString().setNum(getpid());
+ TQByteArray params, reply;
+ TQCString reply_type;
+ TQDataStream ds(params, IO_WriteOnly);
ds << proxy;
- client->send("kbiff", "kbiff", "proxyRegister(QString)", params);
- client->registerAs(QCString(proxy));
+ client->send("kbiff", "kbiff", "proxyRegister(TQString)", params);
+ client->registerAs(TQCString(proxy));
}
}
-void KBiff::invalidLogin(const QString& mailbox)
+void KBiff::invalidLogin(const TQString& mailbox)
{
- QString title(i18n("Invalid Login to %1").arg(mailbox));
+ TQString title(i18n("Invalid Login to %1").arg(mailbox));
KMessageBox::sorry(0,
i18n("I was not able to login to the remote server.\n"
"This means that either the server is down or you have "