diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/common/kbmailer.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/common/kbmailer.cpp')
-rw-r--r-- | kbabel/common/kbmailer.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kbabel/common/kbmailer.cpp b/kbabel/common/kbmailer.cpp index fb3ab3b1..0526bd74 100644 --- a/kbabel/common/kbmailer.cpp +++ b/kbabel/common/kbmailer.cpp @@ -33,11 +33,11 @@ **************************************************************************** */ -#include <qfileinfo.h> -#include <qregexp.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qwidget.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqwidget.h> #include <kapplication.h> #include <kio/netaccess.h> @@ -53,7 +53,7 @@ using namespace KBabel; -KBabelMailer::KBabelMailer( QWidget* parent, Project::Ptr project) +KBabelMailer::KBabelMailer( TQWidget* parent, Project::Ptr project) : _project( project ), m_parent( parent ) { m_tempDir.setAutoDelete( true ); @@ -65,12 +65,12 @@ KBabelMailer::~KBabelMailer() saveConfig( ); } -void KBabelMailer::sendOneFile(const QString& fileName) +void KBabelMailer::sendOneFile(const TQString& fileName) { if (!singleFileCompression) { kapp->invokeMailer("", "", "", "", "", "", fileName); } else { - const QString archive ( createArchive( QStringList( fileName ), QFileInfo( fileName ).baseName() ) ); + const TQString archive ( createArchive( TQStringList( fileName ), TQFileInfo( fileName ).baseName() ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } @@ -91,13 +91,13 @@ void KBabelMailer::sendOneFile( const KURL& url) } if (!singleFileCompression) { - QString fileName( url.filename() ); + TQString fileName( url.filename() ); if ( fileName.isEmpty() ) { fileName = "attachment"; } // ### TODO: the current implementation has the default to possibly overwrite an already existing temporary file - QString tempName( m_tempDir.name() ); + TQString tempName( m_tempDir.name() ); tempName += fileName; if ( KIO::NetAccess::download( url, tempName, m_parent ) ) kapp->invokeMailer("", "", "", "", "", "", fileName); @@ -108,47 +108,47 @@ void KBabelMailer::sendOneFile( const KURL& url) } else { - const QString archive ( createArchive( QStringList( url.url() ), url.filename() ) ); + const TQString archive ( createArchive( TQStringList( url.url() ), url.filename() ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } } } -void KBabelMailer::sendFiles(QStringList fileList, const QString& initialName) +void KBabelMailer::sendFiles(TQStringList fileList, const TQString& initialName) { - const QString archive ( createArchive( fileList, initialName ) ); + const TQString archive ( createArchive( fileList, initialName ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } } -QString KBabelMailer::createArchive(QStringList fileList, QString initialName) +TQString KBabelMailer::createArchive(TQStringList fileList, TQString initialName) { if ( m_tempDir.name().isEmpty() ) { kdWarning() << "KBabelMailer has not a valid temporary directory!" << endl; - return QString(); // No temporary directory! + return TQString(); // No temporary directory! } // do nothing if there are no files in the list if (fileList.empty()) - return QString::null; + return TQString::null; // determine the name of the archive, do nothing if none is given // or Cancel was pressed - initialName = ( initialName.isEmpty() ? QString("translations") : initialName ); + initialName = ( initialName.isEmpty() ? TQString("translations") : initialName ); bool ok = false; - QStringList list( archiveList ); + TQStringList list( archiveList ); list.prepend( initialName ); - QString archiveName ( KInputDialog::getItem( i18n("Save"), + TQString archiveName ( KInputDialog::getItem( i18n("Save"), i18n( "Enter the name of the archive without file extension" ), archiveList, 0, true, &ok, m_parent ) ); if ( !ok || archiveName.isEmpty() ) - return QString(); + return TQString(); // file extensions are determined from the type of compression - archiveName.remove( QRegExp( "\\.tar\\.(gz|bz2)$" ) ); + archiveName.remove( TQRegExp( "\\.tar\\.(gz|bz2)$" ) ); // Update the list of archive names, keep only the ten most recent ones. archiveList.remove( archiveName ); @@ -157,7 +157,7 @@ QString KBabelMailer::createArchive(QStringList fileList, QString initialName) archiveList.pop_back(); // set the correct extension and mimetype - QString mimetype; + TQString mimetype; if (bzipCompression) { archiveName += ".tar.bz2"; mimetype = "application/x-bzip2"; @@ -169,18 +169,18 @@ QString KBabelMailer::createArchive(QStringList fileList, QString initialName) return buildArchive (fileList, m_tempDir.name()+archiveName, mimetype, true); } -QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QString mimetype, bool remove) +TQString KBabelMailer::buildArchive(TQStringList fileList, TQString archiveName, TQString mimetype, bool remove) { Q_UNUSED( remove ); // create a new archive KTar archive(archiveName, mimetype); if (!archive.open(IO_WriteOnly)) { KMessageBox::error( m_parent, i18n("Error while trying to create archive file.") ); - return QString::null; + return TQString::null; } // add files to this archive - QStringList::const_iterator it; + TQStringList::const_iterator it; for (it = fileList.constBegin(); it != fileList.constEnd(); ++it) { #if KDE_IS_VERSION( 3, 5, 0 ) // Try to get a local URL instead of a remote one @@ -188,7 +188,7 @@ QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QS #else const KURL url( KURL::fromPathOrURL( *it ) ); #endif - QString poTempName; + TQString poTempName; if ( !KIO::NetAccess::download( url, poTempName, m_parent ) ) { KMessageBox::error( m_parent, i18n("Error while trying to read file %1.").arg( url.prettyURL() ) ); continue; @@ -198,11 +198,11 @@ QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QS // but only if "PoBaseDir" in the config file is set and the files // actually reside in one of its subdirectories. Else they are stored // without relative path. - QString poArchFileName = url.path(); + TQString poArchFileName = url.path(); if (_poBaseDir.isEmpty( ) || poArchFileName.find(_poBaseDir) != 0) - poArchFileName = QFileInfo( poArchFileName ).fileName(); + poArchFileName = TQFileInfo( poArchFileName ).fileName(); else - poArchFileName.remove( QRegExp( "^" + QRegExp::escape( _poBaseDir ) + "/?" ) ); + poArchFileName.remove( TQRegExp( "^" + TQRegExp::escape( _poBaseDir ) + "/?" ) ); if ( !archive.addLocalFile( poTempName, poArchFileName ) ) { KMessageBox::error( m_parent, i18n("Error while trying to copy file %1 into archive.").arg( url.prettyURL() ) ); |