summaryrefslogtreecommitdiffstats
path: root/src/modules/mircimport
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/mircimport
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/mircimport')
-rw-r--r--src/modules/mircimport/libkvimircimport.cpp76
-rw-r--r--src/modules/mircimport/libkvimircimport.h21
2 files changed, 50 insertions, 47 deletions
diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp
index 4f3ac568..394dedf5 100644
--- a/src/modules/mircimport/libkvimircimport.cpp
+++ b/src/modules/mircimport/libkvimircimport.cpp
@@ -31,9 +31,9 @@
#include "kvi_qstring.h"
-#include <qmessagebox.h>
-#include <qdir.h>
-#include <qpushbutton.h>
+#include <tqmessagebox.h>
+#include <tqdir.h>
+#include <tqpushbutton.h>
#include "kvi_tal_vbox.h"
KviMircServersIniImport * g_pMircServersIniImport = 0;
@@ -50,7 +50,7 @@ KviMircServersIniImport::~KviMircServersIniImport()
g_pMircServersIniImport = 0;
}
-int KviMircServersIniImport::doImport(const QString& filename)
+int KviMircServersIniImport::doImport(const TQString& filename)
{
KviConfig cfg(filename,KviConfig::Read,true);
int iCount = 0;
@@ -58,30 +58,30 @@ int KviMircServersIniImport::doImport(const QString& filename)
{
cfg.setGroup("servers");
int i = 0;
- QString key;
- QString entry;
+ TQString key;
+ TQString entry;
do {
- KviQString::sprintf(key,"n%d",i);
+ KviTQString::sprintf(key,"n%d",i);
entry = cfg.readEntry(key,"");
if(!entry.isEmpty())
{
- QString description;
- QString serv;
- QString port;
+ TQString description;
+ TQString serv;
+ TQString port;
kvi_u32_t uPort = 0;
// <description>SERVER:<server:port>GROUP:<network>
- int idx = KviQString::find(entry,"SERVER:");
+ int idx = KviTQString::tqfind(entry,"SERVER:");
if(idx != -1)
{
description = entry.left(idx);
entry.remove(0,idx + 7);
- idx = KviQString::find(entry,"GROUP:");
+ idx = KviTQString::tqfind(entry,"GROUP:");
if(idx != -1)
{
port = entry.left(idx);
entry.remove(0,idx + 6);
}
- idx = KviQString::find(port,':');
+ idx = KviTQString::tqfind(port,':');
if(idx != -1)
{
serv = port.left(idx);
@@ -108,9 +108,9 @@ int KviMircServersIniImport::doImport(const QString& filename)
}
} while(!entry.isEmpty());
} else {
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs("%Q doesn't look like a servers.ini file.\nImport failed."),&filename);
- QMessageBox::warning(0,__tr2qs("Warning - KVIrc"),tmp);
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs("%Q doesn't look like a servers.ini file.\nImport failed."),&filename);
+ TQMessageBox::warning(0,__tr2qs("Warning - KVIrc"),tmp);
}
return iCount;
}
@@ -118,7 +118,7 @@ int KviMircServersIniImport::doImport(const QString& filename)
void KviMircServersIniImport::start()
{
//KviStr buffer;
- QString buffer;
+ TQString buffer;
if(!KviFileDialog::askForOpenFileName(buffer,__tr("Choose a servers.ini file"),0,"*.ini",false,true))return;
doImport(buffer);
@@ -143,26 +143,26 @@ void KviMircServersIniImport::die()
KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircServersIniImport * f)
: KviTalWizard(0)
{
- QString capt = __tr2qs("Remote mIRC servers.ini Import Wizard");
+ TQString capt = __tr2qs("Remote mIRC servers.ini Import Wizard");
setCaption(capt);
m_pRequest = 0;
m_pFilter = f;
- QLabel * l = new QLabel(this);
+ TQLabel * l = new TQLabel(this);
l->setText(__tr2qs("<center><b>Welcome!</b><br><br>This wizard will guide you in the process of " \
"downloading a list of IRC servers. Please click \"<b>Next</b>\" to begin the operation.</center>"));
addPage(l,capt);
KviTalVBox * vb = new KviTalVBox(this);
- l = new QLabel(vb);
+ l = new TQLabel(vb);
l->setText(__tr2qs("<center>Here you can modify the URL that the list will be downloaded from. In most cases the default URL is acceptable.</center>"));
vb->setStretchFactor(l,1);
- m_pUrlEdit = new QLineEdit(vb);
+ m_pUrlEdit = new TQLineEdit(vb);
m_pUrlEdit->setText(KVI_WWWMIRCCOUK_SERVERSINI);
@@ -170,11 +170,11 @@ KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircSe
vb = new KviTalVBox(this);
- l = new QLabel(__tr2qs("Please wait while the list is being downloaded"),vb);
+ l = new TQLabel(__tr2qs("Please wait while the list is being downloaded"),vb);
vb->setStretchFactor(l,1);
- m_pOutput = new QLabel(vb);
- m_pOutput->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ m_pOutput = new TQLabel(vb);
+ m_pOutput->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
addPage(vb,__tr2qs("List Download"));
@@ -182,7 +182,7 @@ KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircSe
setNextEnabled(vb,false);
setFinishEnabled(vb,true);
- connect(this,SIGNAL(selected(const QString &)),this,SLOT(pageSelected(const QString &)));
+ connect(this,TQT_SIGNAL(selected(const TQString &)),this,TQT_SLOT(pageSelected(const TQString &)));
}
KviRemoteMircServerImportWizard::~KviRemoteMircServerImportWizard()
@@ -190,7 +190,7 @@ KviRemoteMircServerImportWizard::~KviRemoteMircServerImportWizard()
if(m_pRequest)delete m_pRequest;
}
-void KviRemoteMircServerImportWizard::pageSelected(const QString &title)
+void KviRemoteMircServerImportWizard::pageSelected(const TQString &title)
{
if(title == __tr2qs("List Download"))
{
@@ -198,7 +198,7 @@ void KviRemoteMircServerImportWizard::pageSelected(const QString &title)
}
}
-void KviRemoteMircServerImportWizard::closeEvent(QCloseEvent *)
+void KviRemoteMircServerImportWizard::closeEvent(TQCloseEvent *)
{
m_pFilter->die();
}
@@ -211,15 +211,15 @@ void KviRemoteMircServerImportWizard::done(int r)
void KviRemoteMircServerImportWizard::start()
{
- QString url = m_pUrlEdit->text();
+ TQString url = m_pUrlEdit->text();
if(url.isEmpty())url = KVI_WWWMIRCCOUK_SERVERSINI;
finishButton()->setEnabled(false);
if(m_pRequest)delete m_pRequest;
m_pRequest = new KviHttpRequest();
- connect(m_pRequest,SIGNAL(terminated(bool)),this,SLOT(getListTerminated(bool)));
- connect(m_pRequest,SIGNAL(status(const QString &)),this,SLOT(getListMessage(const QString &)));
+ connect(m_pRequest,TQT_SIGNAL(terminated(bool)),this,TQT_SLOT(getListTerminated(bool)));
+ connect(m_pRequest,TQT_SIGNAL(status(const TQString &)),this,TQT_SLOT(getListMessage(const TQString &)));
g_pApp->getTmpFileName(m_szTmpFileName,"servers.ini");
if(!m_pRequest->get(KviUrl(url),KviHttpRequest::StoreToFile,m_szTmpFileName))
@@ -231,7 +231,7 @@ void KviRemoteMircServerImportWizard::start()
}
}
-void KviRemoteMircServerImportWizard::getListMessage(const QString &message)
+void KviRemoteMircServerImportWizard::getListMessage(const TQString &message)
{
if(!message.isEmpty())m_pOutput->setText(message);
}
@@ -243,21 +243,21 @@ void KviRemoteMircServerImportWizard::getListTerminated(bool bSuccess)
if(bSuccess)
{
m_pOutput->setText(__tr2qs("File downloaded: processing ..."));
- m_pOutput->repaint();
+ m_pOutput->tqrepaint();
#ifndef COMPILE_ON_WINDOWS
g_pApp->syncX();
#endif //!COMPILE_ON_WINDOWS
int iCount = m_pFilter->doImport(m_szTmpFileName);
- QString tmp;
+ TQString tmp;
if(iCount > 0)
- tmp = __tr2qs("%1 servers imported succesfully").arg(iCount);
+ tmp = __tr2qs("%1 servers imported succesfully").tqarg(iCount);
else
tmp = __tr2qs("No servers imported");
m_pOutput->setText(tmp);
- QDir d;
+ TQDir d;
d.remove(m_szTmpFileName);
} else m_pOutput->setText(m_pRequest->lastError());
@@ -309,11 +309,11 @@ static KviModuleExtension * mircimport_remote_filter_alloc(KviModuleExtensionAll
static bool mircimport_module_init(KviModule * m)
{
- QString szPath;
- QPixmap * pix = 0;
+ TQString szPath;
+ TQPixmap * pix = 0;
if(g_pApp->findImage(szPath,"kvi_mircimport.png"))
{
- pix = new QPixmap(szPath);
+ pix = new TQPixmap(szPath);
if(pix->isNull())
{
delete pix;
diff --git a/src/modules/mircimport/libkvimircimport.h b/src/modules/mircimport/libkvimircimport.h
index 360e8346..1883da10 100644
--- a/src/modules/mircimport/libkvimircimport.h
+++ b/src/modules/mircimport/libkvimircimport.h
@@ -27,17 +27,18 @@
#include "kvi_http.h"
#include <kvi_tal_wizard.h>
-#include <qlineedit.h>
-#include <qlabel.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
class KviMircServersIniImport : public KviMexServerImport
{
Q_OBJECT
+ TQ_OBJECT
public:
KviMircServersIniImport(KviModuleExtensionDescriptor * d);
~KviMircServersIniImport();
public:
- int doImport(const QString& filename);
+ int doImport(const TQString& filename);
virtual void start();
virtual void die();
};
@@ -47,6 +48,7 @@ class KviRemoteMircServerImportWizard;
class KviRemoteMircServersIniImport : public KviMircServersIniImport
{
Q_OBJECT
+ TQ_OBJECT
public:
KviRemoteMircServersIniImport(KviModuleExtensionDescriptor * d);
~KviRemoteMircServersIniImport();
@@ -60,23 +62,24 @@ public:
class KviRemoteMircServerImportWizard : public KviTalWizard
{
Q_OBJECT
+ TQ_OBJECT
public:
KviRemoteMircServerImportWizard(KviRemoteMircServersIniImport * f);
~KviRemoteMircServerImportWizard();
protected:
- QLineEdit * m_pUrlEdit;
- QLabel * m_pOutput;
+ TQLineEdit * m_pUrlEdit;
+ TQLabel * m_pOutput;
KviRemoteMircServersIniImport * m_pFilter;
KviHttpRequest * m_pRequest;
- QString m_szTmpFileName;
+ TQString m_szTmpFileName;
protected:
- virtual void closeEvent(QCloseEvent *e);
+ virtual void closeEvent(TQCloseEvent *e);
virtual void done(int r);
void start();
protected slots:
- void getListMessage(const QString &message);
+ void getListMessage(const TQString &message);
void getListTerminated(bool bSuccess);
- void pageSelected(const QString &title);
+ void pageSelected(const TQString &title);
};
#endif //_LIBKVIMIRCIMPORT_H_