summaryrefslogtreecommitdiffstats
path: root/kmailcvt/filter_pmail.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'kmailcvt/filter_pmail.cxx')
-rw-r--r--kmailcvt/filter_pmail.cxx74
1 files changed, 37 insertions, 37 deletions
diff --git a/kmailcvt/filter_pmail.cxx b/kmailcvt/filter_pmail.cxx
index 2eafb7f7..5fcc1256 100644
--- a/kmailcvt/filter_pmail.cxx
+++ b/kmailcvt/filter_pmail.cxx
@@ -20,7 +20,7 @@
#include <config.h>
#include <klocale.h>
#include <kfiledialog.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <ktempfile.h>
#include <kdebug.h>
@@ -47,7 +47,7 @@ void FilterPMail::import(FilterInfo *info)
// Select directory from where I have to import files
KFileDialog *kfd;
- kfd = new KFileDialog( QDir::homeDirPath(), "", 0, "kfiledialog", true );
+ kfd = new KFileDialog( TQDir::homeDirPath(), "", 0, "kfiledialog", true );
kfd->setMode(KFile::Directory | KFile::LocalOnly);
kfd->exec();
chosenDir = kfd->selectedFile();
@@ -60,7 +60,7 @@ void FilterPMail::import(FilterInfo *info)
// Count total number of files to be processed
info->addLog(i18n("Counting files..."));
dir.setPath (chosenDir);
- QStringList files = dir.entryList("*.[cC][nN][mM]; *.[pP][mM][mM]; *.[mM][bB][xX]", QDir::Files, QDir::Name);
+ TQStringList files = dir.entryList("*.[cC][nN][mM]; *.[pP][mM][mM]; *.[mM][bB][xX]", TQDir::Files, TQDir::Name);
totalFiles = files.count();
currentFile = 0;
kdDebug() << "Count is " << totalFiles << endl;
@@ -82,20 +82,20 @@ void FilterPMail::import(FilterInfo *info)
}
/** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */
-void FilterPMail::processFiles(const QString& mask, void(FilterPMail::* workFunc)(const QString&) )
+void FilterPMail::processFiles(const TQString& mask, void(FilterPMail::* workFunc)(const TQString&) )
{
if (inf->shouldTerminate()) return;
- QStringList files = dir.entryList(mask, QDir::Files, QDir::Name);
+ TQStringList files = dir.entryList(mask, TQDir::Files, TQDir::Name);
//kdDebug() << "Mask is " << mask << " count is " << files.count() << endl;
- for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
+ for ( TQStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
// Notify current file
- QFileInfo mailfileinfo(*mailFile);
+ TQFileInfo mailfileinfo(*mailFile);
inf->setFrom(mailfileinfo.fileName());
// Clear the other fields
- inf->setTo(QString::null);
- inf->setCurrent(QString::null);
+ inf->setTo(TQString::null);
+ inf->setCurrent(TQString::null);
inf->setCurrent(-1);
// call worker function, increase progressbar
@@ -109,9 +109,9 @@ void FilterPMail::processFiles(const QString& mask, void(FilterPMail::* workFunc
/** this function imports one *.CNM message */
-void FilterPMail::importNewMessage(const QString& file)
+void FilterPMail::importNewMessage(const TQString& file)
{
- QString destFolder("PegasusMail-Import/New Messages");
+ TQString destFolder("PegasusMail-Import/New Messages");
inf->setTo(destFolder);
/* comment by Danny Kukawka:
@@ -126,7 +126,7 @@ void FilterPMail::importNewMessage(const QString& file)
/** this function imports one mail folder file (*.PMM) */
-void FilterPMail::importMailFolder(const QString& file)
+void FilterPMail::importMailFolder(const TQString& file)
{
// Format of a PMM file:
// First comes a header with 128 bytes. At the beginning is the name of
@@ -160,21 +160,21 @@ void FilterPMail::importMailFolder(const QString& file)
} pmm_head;
long l = 0;
- QFile f(file);
+ TQFile f(file);
if (!f.open(IO_ReadOnly)) {
inf->alert(i18n("Unable to open %1, skipping").arg(file));
} else {
// Get folder name
l = f.readBlock((char *) &pmm_head, sizeof(pmm_head));
- QString folder("PegasusMail-Import/");
+ TQString folder("PegasusMail-Import/");
if(folderParsed)
- folder.append(getFolderName((QString)pmm_head.id));
+ folder.append(getFolderName((TQString)pmm_head.id));
else
folder.append(pmm_head.folder);
inf->setTo(folder);
- inf->addLog(i18n("Importing %1").arg("../" + QString(pmm_head.folder)));
+ inf->addLog(i18n("Importing %1").arg("../" + TQString(pmm_head.folder)));
- QByteArray input(MAX_LINE);
+ TQByteArray input(MAX_LINE);
bool first_msg = true;
while (!f.atEnd()) {
@@ -215,21 +215,21 @@ void FilterPMail::importMailFolder(const QString& file)
/** imports a 'unix' format mail folder (*.MBX) */
-void FilterPMail::importUnixMailFolder(const QString& file)
+void FilterPMail::importUnixMailFolder(const TQString& file)
{
struct {
char folder[58];
char id[31];
} pmg_head;
- QFile f;
- QString folder("PegasusMail-Import/"), s(file), seperate;
- QByteArray line(MAX_LINE);
+ TQFile f;
+ TQString folder("PegasusMail-Import/"), s(file), seperate;
+ TQByteArray line(MAX_LINE);
int n = 0, l = 0;
/** Get the folder name */
- s.replace( QRegExp("mbx$"), "pmg");
- s.replace( QRegExp("MBX$"), "PMG");
+ s.replace( TQRegExp("mbx$"), "pmg");
+ s.replace( TQRegExp("MBX$"), "PMG");
f.setName(s);
if (! f.open( IO_ReadOnly ) ) {
inf->alert( i18n("Unable to open %1, skipping").arg( s ) );
@@ -239,7 +239,7 @@ void FilterPMail::importUnixMailFolder(const QString& file)
f.close();
if(folderParsed)
- folder.append(getFolderName((QString)pmg_head.id));
+ folder.append(getFolderName((TQString)pmg_head.id));
else
folder.append(pmg_head.folder);
@@ -252,7 +252,7 @@ void FilterPMail::importUnixMailFolder(const QString& file)
if (! f.open( IO_ReadOnly ) ) {
inf->alert( i18n("Unable to open %1, skipping").arg( s ) );
} else {
- inf->addLog(i18n("Importing %1").arg("../" + QString(pmg_head.folder)));
+ inf->addLog(i18n("Importing %1").arg("../" + TQString(pmg_head.folder)));
l = f.readLine( line.data(),MAX_LINE); // read the first line which is unneeded
while ( ! f.atEnd() ) {
KTempFile tempfile;
@@ -289,20 +289,20 @@ bool FilterPMail::parseFolderMatrix()
kdDebug() << "Start parsing the foldermatrix." << endl;
inf->addLog(i18n("Parsing the folder structure..."));
- QFile hierarch(chosenDir + "/hierarch.pm");
+ TQFile hierarch(chosenDir + "/hierarch.pm");
if (! hierarch.open( IO_ReadOnly ) ) {
inf->alert( i18n("Unable to open %1, skipping").arg( chosenDir + "hierarch.pm" ) );
return false;
} else {
- QStringList tmpList;
- QString tmpRead;
+ TQStringList tmpList;
+ TQString tmpRead;
while ( !hierarch.atEnd() && hierarch.readLine(tmpRead,100)) {
- QString tmpArray[5];
+ TQString tmpArray[5];
tmpRead.remove(tmpRead.length() -2,2);
- QStringList tmpList = QStringList::split(",", tmpRead, false);
+ TQStringList tmpList = TQStringList::split(",", tmpRead, false);
int i = 0;
- for ( QStringList::Iterator it = tmpList.begin(); it != tmpList.end(); ++it, i++) {
- QString _tmp = *it;
+ for ( TQStringList::Iterator it = tmpList.begin(); it != tmpList.end(); ++it, i++) {
+ TQString _tmp = *it;
if(i < 5) tmpArray[i] = _tmp.remove("\"");
else {
hierarch.close();
@@ -317,20 +317,20 @@ bool FilterPMail::parseFolderMatrix()
}
/** get the foldername for a given file ID from folderMatrix */
-QString FilterPMail::getFolderName(QString ID)
+TQString FilterPMail::getFolderName(TQString ID)
{
bool found = false;
- QString folder;
- QString search = ID;
+ TQString folder;
+ TQString search = ID;
while (!found)
{
for ( FolderStructureIterator it = folderMatrix.begin(); it != folderMatrix.end(); it++) {
FolderStructure tmp = *it;
- QString _ID = tmp[2];
+ TQString _ID = tmp[2];
if(_ID == search) {
- QString _type = tmp[0] + tmp[1];
+ TQString _type = tmp[0] + tmp[1];
if(( _type == "21")) {
found = true;
break;