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_thunderbird.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_thunderbird.cxx')
-rw-r--r-- | kmailcvt/filter_thunderbird.cxx | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kmailcvt/filter_thunderbird.cxx b/kmailcvt/filter_thunderbird.cxx index e5d71564c..a9e091d9b 100644 --- a/kmailcvt/filter_thunderbird.cxx +++ b/kmailcvt/filter_thunderbird.cxx @@ -49,10 +49,10 @@ void FilterThunderbird::import(FilterInfo *info) * We ask the user to choose Evolution's root directory. * This should be usually ~/.thunderbird/xxxx.default/Mail/Local Folders/ */ - QString thunderDir = QDir::homeDirPath() + "/.thunderbird/"; - QDir d( thunderDir ); + TQString thunderDir = TQDir::homeDirPath() + "/.thunderbird/"; + TQDir d( thunderDir ); if ( !d.exists() ) { - thunderDir = QDir::homeDirPath(); + thunderDir = TQDir::homeDirPath(); } KFileDialog *kfd; @@ -68,31 +68,31 @@ void FilterThunderbird::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 MailArchives */ - QDir dir(mailDir); - QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs, QDir::Name); // Removal of . and .. + TQDir dir(mailDir); + TQStringList rootSubDirs = dir.entryList("[^\\.]*", TQDir::Dirs, TQDir::Name); // Removal of . and .. 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) { if(info->shouldTerminate()) break; importDirContents(info, dir.filePath(*filename), *filename, *filename); info->setOverall((int) ((float) currentDir / numSubDirs * 100)); } /** import last but not least all archives from the root-dir */ - QDir importDir (mailDir); - QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name); - for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { + TQDir importDir (mailDir); + TQStringList files = importDir.entryList("[^\\.]*", TQDir::Files, TQDir::Name); + for ( TQStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { if(info->shouldTerminate()) break; - QString temp_mailfile = *mailFile; + TQString temp_mailfile = *mailFile; if (temp_mailfile.endsWith(".msf") || temp_mailfile.endsWith("msgFilterRules.dat")) {} else { info->addLog( i18n("Start import file %1...").arg( temp_mailfile ) ); - importMBox(info, mailDir + temp_mailfile , temp_mailfile, QString::null); + importMBox(info, mailDir + temp_mailfile , temp_mailfile, TQString::null); } } @@ -113,17 +113,17 @@ void FilterThunderbird::import(FilterInfo *info) * @param KMailRootDir The directory's root directory in KMail's folder structure. * @param KMailSubDir The directory's direct ancestor in KMail's folder structure. */ -void FilterThunderbird::importDirContents(FilterInfo *info, const QString& dirName, const QString& KMailRootDir, const QString& KMailSubDir) +void FilterThunderbird::importDirContents(FilterInfo *info, const TQString& dirName, const TQString& KMailRootDir, const TQString& KMailSubDir) { if(info->shouldTerminate()) return; /** Here Import all archives in the current dir */ - QDir dir(dirName); + TQDir dir(dirName); - QDir importDir (dirName); - QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name); - for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { + TQDir importDir (dirName); + TQStringList files = importDir.entryList("[^\\.]*", TQDir::Files, TQDir::Name); + for ( TQStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) { if(info->shouldTerminate()) break; - QString temp_mailfile = *mailFile; + TQString temp_mailfile = *mailFile; if (temp_mailfile.endsWith(".msf") || temp_mailfile.endsWith("msgFilterRules.dat")) {} else { info->addLog( i18n("Start import file %1...").arg( temp_mailfile ) ); @@ -132,11 +132,11 @@ void FilterThunderbird::importDirContents(FilterInfo *info, const QString& dirNa } /** 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) { if(info->shouldTerminate()) break; - QString kSubDir; + TQString kSubDir; if(!KMailSubDir.isNull()) { kSubDir = KMailSubDir + "/" + *filename; } else { @@ -153,18 +153,18 @@ void FilterThunderbird::importDirContents(FilterInfo *info, const QString& dirNa * @param KMailRootDir The directory's root directory in KMail's folder structure. * @param KMailSubDir The directory's equivalent in KMail's folder structure. * */ -void FilterThunderbird::importMBox(FilterInfo *info, const QString& mboxName, const QString& rootDir, const QString& targetDir) +void FilterThunderbird::importMBox(FilterInfo *info, const TQString& mboxName, const TQString& rootDir, const TQString& targetDir) { - QFile mbox(mboxName); + TQFile mbox(mboxName); bool first_msg = true; if (!mbox.open(IO_ReadOnly)) { info->alert(i18n("Unable to open %1, skipping").arg(mboxName)); } else { - QFileInfo filenameInfo(mboxName); + TQFileInfo filenameInfo(mboxName); info->setCurrent(0); if( mboxName.length() > 20 ) { - QString tmp_info = mboxName; + TQString tmp_info = mboxName; tmp_info = tmp_info.replace( mailDir, "../" ); if (tmp_info.contains(".sbd")) tmp_info.remove(".sbd"); @@ -172,26 +172,26 @@ void FilterThunderbird::importMBox(FilterInfo *info, const QString& mboxName, co } else info->setFrom(mboxName); if(targetDir.contains(".sbd")) { - QString tmp_info = targetDir; + TQString tmp_info = targetDir; tmp_info.remove(".sbd"); info->setTo(tmp_info); } else info->setTo(targetDir); - QByteArray input(MAX_LINE); + TQByteArray input(MAX_LINE); long l = 0; while (!mbox.atEnd()) { KTempFile tmp; /** @todo check if the file is really a mbox, maybe search for 'from' string at start */ /* comment by Danny: - * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only + * Don't use TQTextStream to read from mbox, etter use TQDataStream. TQTextStream only * support Unicode/Latin1/Locale. So you lost information from emails with * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64 - * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you + * (e.g. 8Bit). It also not help to convert the TQTextStream to Unicode. By this you * get Unicode/UTF-email but KMail can't detect the correct charset. */ - QCString seperate; + TQCString seperate; if(!first_msg) tmp.file()->writeBlock( input, l ); @@ -204,8 +204,8 @@ void FilterThunderbird::importMBox(FilterInfo *info, const QString& mboxName, co tmp.close(); first_msg = false; - QString destFolder; - QString _targetDir = targetDir; + TQString destFolder; + TQString _targetDir = targetDir; if(!targetDir.isNull()) { if(_targetDir.contains(".sbd")) _targetDir.remove(".sbd"); |