diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmailcvt/filter_thebat.cxx | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-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 'kmailcvt/filter_thebat.cxx')
-rw-r--r-- | kmailcvt/filter_thebat.cxx | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kmailcvt/filter_thebat.cxx b/kmailcvt/filter_thebat.cxx index 0e634e784..fa00b915d 100644 --- a/kmailcvt/filter_thebat.cxx +++ b/kmailcvt/filter_thebat.cxx @@ -19,8 +19,8 @@ #include <config.h> -#include <qregexp.h> -#include <qvaluelist.h> +#include <tqregexp.h> +#include <tqvaluelist.h> #include <klocale.h> #include <kfiledialog.h> @@ -50,7 +50,7 @@ FilterTheBat::~FilterTheBat( void ) /** Recursive import of The Bat! maildir. */ void FilterTheBat::import( FilterInfo *info ) { - QString _homeDir = QDir::homeDirPath(); + TQString _homeDir = TQDir::homeDirPath(); KFileDialog *kfd; kfd = new KFileDialog( _homeDir, "", 0, "kfiledialog", true ); @@ -65,16 +65,16 @@ void FilterTheBat::import( FilterInfo *info ) * If the user only select homedir no import needed because * there should be no files and we surely import wrong files. */ - else if ( mailDir == QDir::homeDirPath() || mailDir == ( QDir::homeDirPath() + "/" ) ) { + else if ( mailDir == TQDir::homeDirPath() || mailDir == ( TQDir::homeDirPath() + "/" ) ) { info->addLog( i18n( "No files found for import." ) ); } else { info->setOverall(0); /** Recursive import of the MailFolders */ - QDir dir(mailDir); - QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs , QDir::Name); + TQDir dir(mailDir); + TQStringList rootSubDirs = dir.entryList("[^\\.]*", TQDir::Dirs , TQDir::Name); int currentDir = 1, numSubDirs = rootSubDirs.size(); - for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) { + for(TQStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) { importDirContents(info, dir.filePath(*filename)); info->setOverall((int) ((float) currentDir / numSubDirs * 100)); if(info->shouldTerminate()) break; @@ -97,24 +97,24 @@ void FilterTheBat::import( FilterInfo *info ) * @param info Information storage for the operation. * @param dirName The name of the directory to import. */ -void FilterTheBat::importDirContents( FilterInfo *info, const QString& dirName) +void FilterTheBat::importDirContents( FilterInfo *info, const TQString& dirName) { if(info->shouldTerminate()) return; /** Here Import all archives in the current dir */ - QDir dir(dirName); - QDir importDir (dirName); - QStringList files = importDir.entryList("*.[tT][bB][bB]", QDir::Files, QDir::Name); - for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { - QString temp_mailfile = *mailFile; + TQDir dir(dirName); + TQDir importDir (dirName); + TQStringList files = importDir.entryList("*.[tT][bB][bB]", TQDir::Files, TQDir::Name); + for ( TQStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { + TQString temp_mailfile = *mailFile; importFiles(info, (dirName + "/" + temp_mailfile)); if(info->shouldTerminate()) return; } /** If there are subfolders, we import them one by one */ - QDir subfolders(dirName); - QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs , QDir::Name); - for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) { + TQDir subfolders(dirName); + TQStringList subDirs = subfolders.entryList("[^\\.]*", TQDir::Dirs , TQDir::Name); + for(TQStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) { importDirContents(info, subfolders.filePath(*filename)); if(info->shouldTerminate()) return; } @@ -125,7 +125,7 @@ void FilterTheBat::importDirContents( FilterInfo *info, const QString& dirName) * @param info Information storage for the operation. * @param dirName The name of the directory to import. */ -void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName) +void FilterTheBat::importFiles( FilterInfo *info, const TQString& FileName) { // Format of a tbb-file from The Bat! 3.x @@ -139,13 +139,13 @@ void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName) // ---------------------------------------- long l = 0; - QByteArray input(50); - QRegExp regexp("!.p.0"); - QFile tbb(FileName); + TQByteArray input(50); + TQRegExp regexp("!.p.0"); + TQFile tbb(FileName); int iFound = 0; int count = 0; long endOfEmail = 0; - QValueList<long> offsets; + TQValueList<long> offsets; if (!tbb.open(IO_ReadOnly)) { info->alert(i18n("Unable to open %1, skipping").arg(FileName)); @@ -155,8 +155,8 @@ void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName) // does not work correct. Maybe in come in a continuous loop !!! // Reason: // if you use readLine() to read from a file with binary data - // QFile::at() and QFile::atEnd() return wrong value. So we - // never get QFile::atEnd() == true in some cases. This looks + // TQFile::at() and TQFile::atEnd() return wrong value. So we + // never get TQFile::atEnd() == true in some cases. This looks // like a bug in Qt3 maybe fixed in Qt4. // while((l = tbb.readBlock(input.data(),50)) ) { @@ -164,7 +164,7 @@ void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName) tbb.close(); return; } - QString _tmp = input.data(); + TQString _tmp = input.data(); if (tbb.atEnd()) break; @@ -191,22 +191,22 @@ void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName) long lastPos = 3128; long endPos = 0; - QString _path = "TheBat-Import/"; - QString _tmp = FileName; + TQString _path = "TheBat-Import/"; + TQString _tmp = FileName; _tmp = _tmp.remove(_tmp.length() - 13, 13); _path += _tmp.remove( mailDir ,TRUE); - QString _info = _path; + TQString _info = _path; info->addLog(i18n("Import folder %1...").arg(_info.remove(0,14))); info->setTo(_path); info->setFrom("../" + _info + "/messages.tbb"); - for(QValueList<long>::Iterator it = offsets.begin() ; it != offsets.end() ; ++it) { + for(TQValueList<long>::Iterator it = offsets.begin() ; it != offsets.end() ; ++it) { if(info->shouldTerminate()) { tbb.close(); return; } endPos = *it; - QByteArray input(endPos-lastPos); + TQByteArray input(endPos-lastPos); tbb.readBlock(input.data(), endPos-lastPos); KTempFile tmp; |