summaryrefslogtreecommitdiffstats
path: root/kbabel/filters/gettext/gettextexport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/filters/gettext/gettextexport.cpp')
-rw-r--r--kbabel/filters/gettext/gettextexport.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/kbabel/filters/gettext/gettextexport.cpp b/kbabel/filters/gettext/gettextexport.cpp
index e951847b..c2fe9c67 100644
--- a/kbabel/filters/gettext/gettextexport.cpp
+++ b/kbabel/filters/gettext/gettextexport.cpp
@@ -40,8 +40,8 @@
#include "catalogsettings.h"
#include "kbprojectsettings.h"
-#include <qfile.h>
-#include <qtextcodec.h>
+#include <tqfile.h>
+#include <tqtextcodec.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -51,12 +51,12 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_gettextexport, KGenericFactory<GettextExportP
using namespace KBabel;
-GettextExportPlugin::GettextExportPlugin(QObject* parent, const char* name, const QStringList &) :
+GettextExportPlugin::GettextExportPlugin(TQObject* parent, const char* name, const TQStringList &) :
CatalogExportPlugin(parent,name), m_wrapWidth( -1 )
{
}
-ConversionStatus GettextExportPlugin::save(const QString& localFile , const QString& mimetype, const Catalog* catalog)
+ConversionStatus GettextExportPlugin::save(const TQString& localFile , const TQString& mimetype, const Catalog* catalog)
{
// check, whether we know how to handle the extra data
if( catalog->importPluginID() != "GNU gettext")
@@ -66,14 +66,14 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
if( mimetype != "application/x-gettext")
return UNSUPPORTED_TYPE;
- QFile file(localFile);
+ TQFile file(localFile);
if(file.open(IO_WriteOnly))
{
int progressRatio = QMAX(100/ QMAX(catalog->numberOfEntries(),1), 1);
emit signalResetProgressBar(i18n("saving file"),100);
- QTextStream stream(&file);
+ TQTextStream stream(&file);
SaveSettings _saveSettings = catalog->saveSettings();
@@ -86,26 +86,26 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
switch(_saveSettings.encoding)
{
case ProjectSettingsBase::UTF8:
- stream.setCodec(QTextCodec::codecForName("utf-8"));
+ stream.setCodec(TQTextCodec::codecForName("utf-8"));
break;
case ProjectSettingsBase::UTF16:
- stream.setCodec(QTextCodec::codecForName("utf-16"));
+ stream.setCodec(TQTextCodec::codecForName("utf-16"));
break;
default:
- stream.setCodec(QTextCodec::codecForLocale());
+ stream.setCodec(TQTextCodec::codecForLocale());
break;
}
}
// only save header if it is not empty
- const QString headerComment( catalog->header().comment() );
+ const TQString headerComment( catalog->header().comment() );
// ### TODO: why is this useful to have a header with an empty msgstr?
if( !headerComment.isEmpty() || !catalog->header().msgstr().isEmpty() )
{
// write header
writeComment( stream, headerComment );
- const QString headerMsgid = catalog->header().msgid().first();
+ const TQString headerMsgid = catalog->header().msgid().first();
// Gettext PO files should have an empty msgid as header
if ( !headerMsgid.isEmpty() )
@@ -122,7 +122,7 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
stream << "\n";
}
- QStringList list;
+ TQStringList list;
for( uint counter = 0; counter < catalog->numberOfEntries() ; counter++ )
{
if(counter%10==0) {
@@ -132,7 +132,7 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
// write entry
writeComment( stream, catalog->comment(counter) );
- const QString msgctxt = catalog->msgctxt(counter);
+ const TQString msgctxt = catalog->msgctxt(counter);
if (! msgctxt.isEmpty() )
{
writeKeyword( stream, "msgctxt", msgctxt );
@@ -154,8 +154,8 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
const int forms = catalog->msgstr( counter ).count();
for ( int i = 0; i < forms; ++i )
{
- QString keyword ( "msgstr[" );
- keyword += QString::number( i );
+ TQString keyword ( "msgstr[" );
+ keyword += TQString::number( i );
keyword += ']';
writeKeyword( stream, keyword, *( catalog->msgstr( counter ).at( i ) ) );
@@ -173,9 +173,9 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
if( _saveSettings.saveObsolete )
{
- QValueList<QString>::ConstIterator oit;
+ TQValueList<TQString>::ConstIterator oit;
- QStringList _obsolete = catalog->catalogExtraData();
+ TQStringList _obsolete = catalog->catalogExtraData();
for( oit = _obsolete.begin(); oit != _obsolete.end(); ++oit )
{
@@ -203,7 +203,7 @@ ConversionStatus GettextExportPlugin::save(const QString& localFile , const QStr
return OK;
}
-void GettextExportPlugin::writeComment( QTextStream& stream, const QString& comment ) const
+void GettextExportPlugin::writeComment( TQTextStream& stream, const TQString& comment ) const
{
if( !comment.isEmpty() )
{
@@ -218,13 +218,13 @@ void GettextExportPlugin::writeComment( QTextStream& stream, const QString& comm
stream << "\n";
continue;
}
- const QString span ( ( newpos == -1 ) ? comment.mid( pos ) : comment.mid( pos, newpos-pos ) );
+ const TQString span ( ( newpos == -1 ) ? comment.mid( pos ) : comment.mid( pos, newpos-pos ) );
const int len = span.length();
- QString spaces; // Stored leading spaces
+ TQString spaces; // Stored leading spaces
for ( int i = 0 ; i < len ; ++i )
{
- const QChar& ch = span[ i ];
+ const TQChar& ch = span[ i ];
if ( ch == '#' )
{
stream << spaces << span.mid( i );
@@ -252,7 +252,7 @@ void GettextExportPlugin::writeComment( QTextStream& stream, const QString& comm
}
}
-void GettextExportPlugin::writeKeyword( QTextStream& stream, const QString& keyword, const QString& text ) const
+void GettextExportPlugin::writeKeyword( TQTextStream& stream, const TQString& keyword, const TQString& text ) const
{
if ( text.isEmpty() )
{
@@ -263,20 +263,20 @@ void GettextExportPlugin::writeKeyword( QTextStream& stream, const QString& keyw
else if ( m_wrapWidth == -1 )
{
// Traditional KBabel wrapping
- QStringList list = QStringList::split( '\n', text );
+ TQStringList list = TQStringList::split( '\n', text );
if ( text.startsWith( "\n" ) )
- list.prepend( QString() );
+ list.prepend( TQString() );
if(list.isEmpty())
- list.append( QString() );
+ list.append( TQString() );
if( list.count() > 1 )
- list.prepend( QString() );
+ list.prepend( TQString() );
stream << keyword << " ";
- QStringList::const_iterator it;
+ TQStringList::const_iterator it;
for( it = list.constBegin(); it != list.constEnd(); ++it )
{
stream << "\"" << (*it) << "\"\n";
@@ -290,7 +290,7 @@ void GettextExportPlugin::writeKeyword( QTextStream& stream, const QString& keyw
// No wrapping (like Gettext's --no.wrap or -w0 )
// we need to remove the \n characters, as they are extra characters
- QString realText( text );
+ TQString realText( text );
realText.remove( '\n' );
stream << keyword << " \"" << realText << "\"\n";
return;
@@ -301,7 +301,7 @@ void GettextExportPlugin::writeKeyword( QTextStream& stream, const QString& keyw
// From here on, we assume that we have an non-empty text and a positive non-null m_wrapWidth
// we need to remove the \n characters, as they are extra characters
- QString realText( text );
+ TQString realText( text );
realText.remove( '\n' );
bool needFirstEmptyLine = false;