summaryrefslogtreecommitdiffstats
path: root/knode/knconvert.cpp
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 /knode/knconvert.cpp
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 'knode/knconvert.cpp')
-rw-r--r--knode/knconvert.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/knode/knconvert.cpp b/knode/knconvert.cpp
index 40461139b..8fdb4890c 100644
--- a/knode/knconvert.cpp
+++ b/knode/knconvert.cpp
@@ -12,10 +12,10 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/
-#include <qlayout.h>
-#include <qwidgetstack.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
+#include <tqlayout.h>
+#include <tqwidgetstack.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
#include <klocale.h>
#include <kfiledialog.h>
@@ -33,7 +33,7 @@
#include "resource.h"
-bool KNConvert::needToConvert(const QString &oldVersion)
+bool KNConvert::needToConvert(const TQString &oldVersion)
{
bool ret=(
(oldVersion.left(3)=="0.3") ||
@@ -44,31 +44,31 @@ bool KNConvert::needToConvert(const QString &oldVersion)
}
-KNConvert::KNConvert(const QString &version)
- : QDialog(0,0,true), l_ogList(0), c_onversionDone(false), v_ersion(version)
+KNConvert::KNConvert(const TQString &version)
+ : TQDialog(0,0,true), l_ogList(0), c_onversionDone(false), v_ersion(version)
{
setCaption(kapp->makeStdCaption(i18n("Conversion")));
- QVBoxLayout *topL=new QVBoxLayout(this, 5,5);
- s_tack=new QWidgetStack(this);
+ TQVBoxLayout *topL=new TQVBoxLayout(this, 5,5);
+ s_tack=new TQWidgetStack(this);
topL->addWidget(s_tack, 1);
topL->addWidget(new KSeparator(this));
- QHBoxLayout *btnL=new QHBoxLayout(topL, 5);
- s_tartBtn=new QPushButton(i18n("Start Conversion..."), this);
+ TQHBoxLayout *btnL=new TQHBoxLayout(topL, 5);
+ s_tartBtn=new TQPushButton(i18n("Start Conversion..."), this);
s_tartBtn->setDefault(true);
btnL->addStretch(1);
btnL->addWidget(s_tartBtn);
c_ancelBtn=new KPushButton(KStdGuiItem::cancel(), this);
btnL->addWidget(c_ancelBtn);
- connect(s_tartBtn, SIGNAL(clicked()), this, SLOT(slotStart()));
- connect(c_ancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(s_tartBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStart()));
+ connect(c_ancelBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
- w_1=new QWidget(s_tack);
+ w_1=new TQWidget(s_tack);
s_tack->addWidget(w_1, 1);
- QGridLayout *w1L=new QGridLayout(w_1, 5,3, 5,5);
+ TQGridLayout *w1L=new TQGridLayout(w_1, 5,3, 5,5);
- QLabel *l1=new QLabel(i18n(
+ TQLabel *l1=new TQLabel(i18n(
"<b>Congratulations, you have upgraded to KNode version %1.</b><br>\
Unfortunately this version uses a different format for some data-files, so \
in order to keep your existing data it is necessary to convert it first. This is \
@@ -76,37 +76,37 @@ now done automatically by KNode. If you want to, a backup of your existing data
will be created before the conversion starts.").arg(KNODE_VERSION), w_1);
w1L->addMultiCellWidget(l1, 0,0, 0,2);
- c_reateBkup=new QCheckBox(i18n("Create backup of old data"), w_1);
+ c_reateBkup=new TQCheckBox(i18n("Create backup of old data"), w_1);
w1L->addMultiCellWidget(c_reateBkup, 2,2, 0,2);
- connect(c_reateBkup, SIGNAL(toggled(bool)), this, SLOT(slotCreateBkupToggled(bool)));
+ connect(c_reateBkup, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCreateBkupToggled(bool)));
- b_ackupPathLabel=new QLabel(i18n("Save backup in:"), w_1);
+ b_ackupPathLabel=new TQLabel(i18n("Save backup in:"), w_1);
w1L->addWidget(b_ackupPathLabel, 3,0);
- b_ackupPath=new KLineEdit(QDir::homeDirPath()+QString("/knodedata-")+v_ersion+".tar.gz", w_1);
+ b_ackupPath=new KLineEdit(TQDir::homeDirPath()+TQString("/knodedata-")+v_ersion+".tar.gz", w_1);
w1L->addWidget(b_ackupPath, 3,1);
- b_rowseBtn= new QPushButton(i18n("Browse..."), w_1);
- connect(b_rowseBtn, SIGNAL(clicked()), this, SLOT(slotBrowse()));
+ b_rowseBtn= new TQPushButton(i18n("Browse..."), w_1);
+ connect(b_rowseBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowse()));
w1L->addWidget(b_rowseBtn, 3,2);
w1L->setColStretch(1,1);
w1L->addRowSpacing(1,15);
w1L->setRowStretch(4,1);
w1L->addRowSpacing(4,15);
- w_2=new QLabel(s_tack);
+ w_2=new TQLabel(s_tack);
w_2->setText(i18n("<b>Converting, please wait...</b>"));
w_2->setAlignment(AlignCenter);
s_tack->addWidget(w_2, 2);
- w_3=new QWidget(s_tack);
+ w_3=new TQWidget(s_tack);
s_tack->addWidget(w_3, 3);
- QVBoxLayout *w3L=new QVBoxLayout(w_3, 5,5);
+ TQVBoxLayout *w3L=new TQVBoxLayout(w_3, 5,5);
- r_esultLabel=new QLabel(w_3);
+ r_esultLabel=new TQLabel(w_3);
w3L->addWidget(r_esultLabel);
- QLabel *l2=new QLabel(i18n("Processed tasks:"), w_3);
- l_ogList=new QListBox(w_3);
+ TQLabel *l2=new TQLabel(i18n("Processed tasks:"), w_3);
+ l_ogList=new TQListBox(w_3);
w3L->addSpacing(15);
w3L->addWidget(l2);
w3L->addWidget(l_ogList, 1);
@@ -118,7 +118,7 @@ will be created before the conversion starts.").arg(KNODE_VERSION), w_1);
KNConvert::~KNConvert()
{
- for ( QValueList<Converter*>::Iterator it = mConverters.begin(); it != mConverters.end(); ++it )
+ for ( TQValueList<Converter*>::Iterator it = mConverters.begin(); it != mConverters.end(); ++it )
delete (*it);
}
@@ -126,7 +126,7 @@ KNConvert::~KNConvert()
void KNConvert::convert()
{
int errors=0;
- for ( QValueList<Converter*>::Iterator it = mConverters.begin(); it != mConverters.end(); ++it )
+ for ( TQValueList<Converter*>::Iterator it = mConverters.begin(); it != mConverters.end(); ++it )
if( !(*it)->doConvert() )
errors++;
@@ -172,12 +172,12 @@ void KNConvert::slotStart()
return;
}
- QString dataDir=locateLocal("data","knode/");
+ TQString dataDir=locateLocal("data","knode/");
t_ar=new KProcess;
*t_ar << "tar";
*t_ar << "-cz" << dataDir
<< "-f" << b_ackupPath->text();
- connect(t_ar, SIGNAL(processExited(KProcess*)), this, SLOT(slotTarExited(KProcess*)));
+ connect(t_ar, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotTarExited(KProcess*)));
if(!t_ar->start()) {
delete t_ar;
t_ar = 0;
@@ -199,7 +199,7 @@ void KNConvert::slotCreateBkupToggled(bool b)
void KNConvert::slotBrowse()
{
- QString newPath=KFileDialog::getSaveFileName(b_ackupPath->text());
+ TQString newPath=KFileDialog::getSaveFileName(b_ackupPath->text());
if(!newPath.isEmpty())
b_ackupPath->setText(newPath);
@@ -240,12 +240,12 @@ void KNConvert::slotTarExited(KProcess *proc)
bool KNConvert::Converter04::doConvert()
{
- QString dir=locateLocal("data","knode/")+"folders/";
+ TQString dir=locateLocal("data","knode/")+"folders/";
int num;
bool error=false;
//Drafts
- if(QFile::exists(dir+"folder1.idx")) {
+ if(TQFile::exists(dir+"folder1.idx")) {
num=convertFolder(dir+"folder1", dir+"drafts_1");
if(num==-1) {
error=true;
@@ -259,7 +259,7 @@ bool KNConvert::Converter04::doConvert()
l_og->append(i18n("nothing to be done for folder \"Drafts\""));
//Outbox
- if(QFile::exists(dir+"folder2.idx")) {
+ if(TQFile::exists(dir+"folder2.idx")) {
num=convertFolder(dir+"folder2", dir+"outbox_2");
if(num==-1) {
error=true;
@@ -273,7 +273,7 @@ bool KNConvert::Converter04::doConvert()
l_og->append(i18n("nothing to be done for folder \"Outbox\""));
//Sent
- if(QFile::exists(dir+"folder3.idx")) {
+ if(TQFile::exists(dir+"folder3.idx")) {
num=convertFolder(dir+"folder3", dir+"sent_3");
if(num==-1) {
error=true;
@@ -287,20 +287,20 @@ bool KNConvert::Converter04::doConvert()
l_og->append(i18n("nothing to be done for folder \"Sent\""));
//remove old info-files
- QFile::remove(dir+"standard.info");
- QFile::remove(dir+".standard.info");
+ TQFile::remove(dir+"standard.info");
+ TQFile::remove(dir+".standard.info");
return (!error);
}
-int KNConvert::Converter04::convertFolder(QString srcPrefix, QString dstPrefix)
+int KNConvert::Converter04::convertFolder(TQString srcPrefix, TQString dstPrefix)
{
- QFile srcMBox(srcPrefix+".mbox"),
+ TQFile srcMBox(srcPrefix+".mbox"),
srcIdx(srcPrefix+".idx"),
dstMBox(dstPrefix+".mbox"),
dstIdx(dstPrefix+".idx");
- QTextStream ts(&dstMBox);
- ts.setEncoding(QTextStream::Latin1);
+ TQTextStream ts(&dstMBox);
+ ts.setEncoding(TQTextStream::Latin1);
OldFolderIndex oldIdx;
NewFolderIndex newIdx;
@@ -399,7 +399,7 @@ int KNConvert::Converter04::convertFolder(QString srcPrefix, QString dstPrefix)
//read mbox-data
unsigned int size=oldIdx.eo-oldIdx.so;
- QCString buff(size+10);
+ TQCString buff(size+10);
srcMBox.at(oldIdx.so);
int readBytes=srcMBox.readBlock(buff.data(), size);
buff.at(readBytes)='\0'; //terminate string;