summaryrefslogtreecommitdiffstats
path: root/kbabel/filters/gettext
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/filters/gettext
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/filters/gettext')
-rw-r--r--kbabel/filters/gettext/gettextexport.cpp22
-rw-r--r--kbabel/filters/gettext/gettextexport.h10
-rw-r--r--kbabel/filters/gettext/gettextimport.cpp76
-rw-r--r--kbabel/filters/gettext/gettextimport.h14
4 files changed, 61 insertions, 61 deletions
diff --git a/kbabel/filters/gettext/gettextexport.cpp b/kbabel/filters/gettext/gettextexport.cpp
index c2fe9c67..21db665e 100644
--- a/kbabel/filters/gettext/gettextexport.cpp
+++ b/kbabel/filters/gettext/gettextexport.cpp
@@ -21,11 +21,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -51,12 +51,12 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_gettextexport, KGenericFactory<GettextExportP
using namespace KBabel;
-GettextExportPlugin::GettextExportPlugin(TQObject* parent, const char* name, const TQStringList &) :
- CatalogExportPlugin(parent,name), m_wrapWidth( -1 )
+GettextExportPlugin::GettextExportPlugin(TQObject* tqparent, const char* name, const TQStringList &) :
+ CatalogExportPlugin(tqparent,name), m_wrapWidth( -1 )
{
}
-ConversionStatus GettextExportPlugin::save(const TQString& localFile , const TQString& mimetype, const Catalog* catalog)
+ConversiontqStatus 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")
@@ -70,7 +70,7 @@ ConversionStatus GettextExportPlugin::save(const TQString& localFile , const TQS
if(file.open(IO_WriteOnly))
{
- int progressRatio = QMAX(100/ QMAX(catalog->numberOfEntries(),1), 1);
+ int progressRatio = TQMAX(100/ TQMAX(catalog->numberOfEntries(),1), 1);
emit signalResetProgressBar(i18n("saving file"),100);
TQTextStream stream(&file);
@@ -196,7 +196,7 @@ ConversionStatus GettextExportPlugin::save(const TQString& localFile , const TQS
}
else
{
- //emit signalError(i18n("Wasn't able to open file %1").arg(filename.ascii()));
+ //emit signalError(i18n("Wasn't able to open file %1").tqarg(filename.ascii()));
return OS_ERROR;
}
@@ -211,7 +211,7 @@ void GettextExportPlugin::writeComment( TQTextStream& stream, const TQString& co
int pos = 0;
for(;;)
{
- const int newpos = comment.find( '\n', pos, false );
+ const int newpos = comment.tqfind( '\n', pos, false );
if ( newpos == pos )
{
++pos;
@@ -305,7 +305,7 @@ void GettextExportPlugin::writeKeyword( TQTextStream& stream, const TQString& ke
realText.remove( '\n' );
bool needFirstEmptyLine = false;
- if ( realText.find( "\\n" ) != -1 )
+ if ( realText.tqfind( "\\n" ) != -1 )
{
// We have more than one (logical) line, so write the extra empty line
needFirstEmptyLine = true;
@@ -340,7 +340,7 @@ void GettextExportPlugin::writeKeyword( TQTextStream& stream, const TQString& ke
// Be sure that at least two useful characters are written, even if the wrap width is too small
availableWidth = 2;
}
- const int newlinePos = realText.find ( "\\n", pos );
+ const int newlinePos = realText.tqfind ( "\\n", pos );
if ( ( newlinePos >= 0 ) && ( newlinePos - pos + 2 < availableWidth ) )
{
// The newline is near than the maximum available numbers of characters
diff --git a/kbabel/filters/gettext/gettextexport.h b/kbabel/filters/gettext/gettextexport.h
index 2d1b9681..cfe46ed0 100644
--- a/kbabel/filters/gettext/gettextexport.h
+++ b/kbabel/filters/gettext/gettextexport.h
@@ -20,11 +20,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -53,8 +53,8 @@ class TQTextCodec;
class GettextExportPlugin: public KBabel::CatalogExportPlugin
{
public:
- GettextExportPlugin(TQObject* parent, const char* name, const TQStringList &);
- virtual KBabel::ConversionStatus save(const TQString& file, const TQString& mimetype, const KBabel::Catalog* catalog);
+ GettextExportPlugin(TQObject* tqparent, const char* name, const TQStringList &);
+ virtual KBabel::ConversiontqStatus save(const TQString& file, const TQString& mimetype, const KBabel::Catalog* catalog);
private:
/**
diff --git a/kbabel/filters/gettext/gettextimport.cpp b/kbabel/filters/gettext/gettextimport.cpp
index 9210c1a9..848cfeb1 100644
--- a/kbabel/filters/gettext/gettextimport.cpp
+++ b/kbabel/filters/gettext/gettextimport.cpp
@@ -1,4 +1,4 @@
-// kate: space-indent on; indent-width 3; replace-tabs on;
+// kate: space-indent on; indent-width 3; tqreplace-tabs on;
/* ****************************************************************************
This file is part of KBabel
@@ -23,11 +23,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -53,11 +53,11 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_gettextimport, KGenericFactory<GettextImportP
using namespace KBabel;
-GettextImportPlugin::GettextImportPlugin(TQObject* parent, const char* name, const TQStringList &) : CatalogImportPlugin(parent,name)
+GettextImportPlugin::GettextImportPlugin(TQObject* tqparent, const char* name, const TQStringList &) : CatalogImportPlugin(tqparent,name)
{
}
-ConversionStatus GettextImportPlugin::load(const TQString& filename, const TQString&)
+ConversiontqStatus GettextImportPlugin::load(const TQString& filename, const TQString&)
{
kdDebug( KBABEL ) << k_funcinfo << endl;
@@ -117,7 +117,7 @@ ConversionStatus GettextImportPlugin::load(const TQString& filename, const TQStr
kdDebug(KBABEL) << "start parsing..." << endl;
// first read header
- const ConversionStatus status = readHeader(stream);
+ const ConversiontqStatus status = readHeader(stream);
if ( status == RECOVERED_PARSE_ERROR )
@@ -163,7 +163,7 @@ ConversionStatus GettextImportPlugin::load(const TQString& filename, const TQStr
}
// check if header seems to indicate docbook content generated by xml2pot
- const bool docbookContent = (tempHeader.msgstr().find("application/x-xml2pot") != tempHeader.msgstr().end());
+ const bool docbookContent = (tempHeader.msgstr().tqfind("application/x-xml2pot") != tempHeader.msgstr().end());
// now parse the rest of the file
uint counter=0;
@@ -179,7 +179,7 @@ ConversionStatus GettextImportPlugin::load(const TQString& filename, const TQStr
return STOPPED;
}
- const ConversionStatus success=readEntry(stream);
+ const ConversiontqStatus success=readEntry(stream);
if(success==OK)
{
@@ -200,7 +200,7 @@ ConversionStatus GettextImportPlugin::load(const TQString& filename, const TQStr
appendCatalogItem(tempCatItem);
// check if first comment seems to indicate a docbook source file
if(counter==0)
- docbookFile = ( tempCatItem.comment().find(".docbook") != -1 );
+ docbookFile = ( tempCatItem.comment().tqfind(".docbook") != -1 );
}
}
else if(success==RECOVERED_PARSE_ERROR)
@@ -297,12 +297,12 @@ TQTextCodec* GettextImportPlugin::codecForArray(TQByteArray& array, bool* hadCod
}
TQTextStream stream( array, IO_ReadOnly );
- // ### TODO Qt4: see if it can be done with TQByteArray alone, in an encoding-neutral way.
+ // ### TODO TQt4: see if it can be done with TQByteArray alone, in an encoding-neutral way.
// Set ISO-8859-1 as it is a relatively neutral encoding when reading (compared to UTF-8 or a random locale encoing)
stream.setEncoding( TQTextStream::Latin1 );
// first read header
- ConversionStatus status = readHeader(stream);
+ ConversiontqStatus status = readHeader(stream);
if(status!=OK && status != RECOVERED_PARSE_ERROR)
{
kdDebug(KBABEL) << "wasn't able to read header" << endl;
@@ -360,11 +360,11 @@ TQTextCodec* GettextImportPlugin::codecForArray(TQByteArray& array, bool* hadCod
return codec;
}
-ConversionStatus GettextImportPlugin::readHeader(TQTextStream& stream)
+ConversiontqStatus GettextImportPlugin::readHeader(TQTextStream& stream)
{
CatalogItem temp;
int filePos=stream.device()->at();
- ConversionStatus status=readEntry(stream);
+ ConversiontqStatus status=readEntry(stream);
if(status==OK || status==RECOVERED_PARSE_ERROR)
{
@@ -380,7 +380,7 @@ ConversionStatus GettextImportPlugin::readHeader(TQTextStream& stream)
return PARSE_ERROR;
}
-ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
+ConversiontqStatus GettextImportPlugin::readEntry(TQTextStream& stream)
{
//kdDebug( KBABEL ) << k_funcinfo << " START" << endl;
enum {Begin,Comment,Msgctxt,Msgid,Msgstr} part=Begin;
@@ -408,7 +408,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
//kdDebug() << "Parsing line: " << line << endl;
- // ### Qt4: no need of a such a check
+ // ### TQt4: no need of a such a check
if(line.isNull()) // file end
break;
else if ( line.startsWith( "<<<<<<<" ) || line.startsWith( "=======" ) || line.startsWith( ">>>>>>>" ) )
@@ -439,7 +439,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
part=Comment;
_comment=line;
}
- else if(line.find(TQRegExp("^msgctxt\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgctxt\\s*\".*\"$")) != -1)
{
part=Msgctxt;
@@ -449,7 +449,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
_msgctxt=line;
seenMsgctxt=true;
}
- else if(line.find(TQRegExp("^msgid\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\".*\"$")) != -1)
{
part=Msgid;
@@ -460,7 +460,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*(_msgid).begin())=line;
}
// one of the quotation marks is missing
- else if(line.find(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
{
part=Msgid;
@@ -494,7 +494,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
{
_comment+=("\n"+line);
}
- else if(line.find(TQRegExp("^msgctxt\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgctxt\\s*\".*\"$")) != -1)
{
part=Msgctxt;
@@ -504,7 +504,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
_msgctxt=line;
seenMsgctxt=true;
}
- else if(line.find(TQRegExp("^msgid\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\".*\"$")) != -1)
{
part=Msgid;
@@ -515,7 +515,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*(_msgid).begin())=line;
}
// one of the quotation marks is missing
- else if(line.find(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
{
part=Msgid;
@@ -539,7 +539,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
{
if(line.isEmpty())
continue;
- else if(line.find(TQRegExp("^\".*\\n?\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^\".*\\n?\"$")) != -1)
{
// remove quotes at beginning and the end of the lines
line.remove(TQRegExp("^\""));
@@ -551,7 +551,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
else
_msgctxt+=("\n"+line);
}
- else if(line.find(TQRegExp("^msgid\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\".*\"$")) != -1)
{
part=Msgid;
@@ -562,7 +562,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*(_msgid).begin())=line;
}
// one of the quotation marks is missing
- else if(line.find(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid\\s*\"?.*\"?$")) != -1)
{
part=Msgid;
@@ -586,7 +586,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
{
if(line.isEmpty())
continue;
- else if(line.find(TQRegExp("^\".*\\n?\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^\".*\\n?\"$")) != -1)
{
// remove quotes at beginning and the end of the lines
line.remove(TQRegExp("^\""));
@@ -604,7 +604,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
else
(*it)+=("\n"+line);
}
- else if(line.find(TQRegExp("^msgid_plural\\s*\".*\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid_plural\\s*\".*\"$")) != -1)
{
part=Msgid;
_gettextPluralForm = true;
@@ -616,7 +616,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
_msgid.append(line);
}
// one of the quotation marks is missing
- else if(line.find(TQRegExp("^msgid_plural\\s*\"?.*\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^msgid_plural\\s*\"?.*\"?$")) != -1)
{
part=Msgid;
_gettextPluralForm = true;
@@ -631,7 +631,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
recoverableError=true;
}
else if(!_gettextPluralForm
- && (line.find(TQRegExp("^msgstr\\s*\".*\\n?\"$")) != -1))
+ && (line.tqfind(TQRegExp("^msgstr\\s*\".*\\n?\"$")) != -1))
{
part=Msgstr;
@@ -642,7 +642,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*msgstrIt)=line;
}
else if(!_gettextPluralForm
- && line.find(TQRegExp("^msgstr\\s*\"?.*\\n?\"?$")) != -1)
+ && line.tqfind(TQRegExp("^msgstr\\s*\"?.*\\n?\"?$")) != -1)
{
part=Msgstr;
@@ -656,7 +656,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
recoverableError=true;
}
else if( _gettextPluralForm
- && (line.find(TQRegExp("^msgstr\\[0\\]\\s*\".*\\n?\"$")) != -1))
+ && (line.tqfind(TQRegExp("^msgstr\\[0\\]\\s*\".*\\n?\"$")) != -1))
{
part=Msgstr;
@@ -667,7 +667,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*msgstrIt)=line;
}
else if( _gettextPluralForm
- && (line.find(TQRegExp("^msgstr\\[0\\]\\s*\"?.*\\n?\"?$")) != -1))
+ && (line.tqfind(TQRegExp("^msgstr\\[0\\]\\s*\"?.*\\n?\"?$")) != -1))
{
part=Msgstr;
@@ -694,7 +694,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
break;
}
// a line of the msgid with a missing quotation mark
- else if(line.find(TQRegExp("^\"?.+\\n?\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^\"?.+\\n?\"?$")) != -1)
{
recoverableError=true;
@@ -726,7 +726,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
if(line.isEmpty())
continue;
// another line of the msgstr
- else if(line.find(TQRegExp("^\".*\\n?\"$")) != -1)
+ else if(line.tqfind(TQRegExp("^\".*\\n?\"$")) != -1)
{
// remove quotes at beginning and the end of the lines
line.remove(TQRegExp("^\""));
@@ -738,7 +738,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
(*msgstrIt)+=("\n"+line);
}
else if( _gettextPluralForm
- && (line.find(TQRegExp("^msgstr\\[[0-9]+\\]\\s*\".*\\n?\"$")) != -1))
+ && (line.tqfind(TQRegExp("^msgstr\\[[0-9]+\\]\\s*\".*\\n?\"$")) != -1))
{
// remove quotes at beginning and the end of the lines
line.remove(TQRegExp("^msgstr\\[[0-9]+\\]\\s*\"?"));
@@ -747,7 +747,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
msgstrIt=_msgstr.append(line);
}
else if( _gettextPluralForm
- && (line.find(TQRegExp("^msgstr\\[[0-9]\\]\\s*\"?.*\\n?\"?$")) != -1))
+ && (line.tqfind(TQRegExp("^msgstr\\[[0-9]\\]\\s*\"?.*\\n?\"?$")) != -1))
{
// remove quotes at beginning and the end of the lines
line.remove(TQRegExp("^msgstr\\[[0-9]\\]\\s*\"?"));
@@ -758,7 +758,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
if(!line.isEmpty())
recoverableError=true;
}
- else if((line.find(TQRegExp("^\\s*msgid")) != -1) || (line.find(TQRegExp("^\\s*#")) != -1))
+ else if((line.tqfind(TQRegExp("^\\s*msgid")) != -1) || (line.tqfind(TQRegExp("^\\s*#")) != -1))
{
// We have read successfully one entry, so end loop.
stream.device()->at(pos);// reset position in stream to beginning of this line
@@ -771,7 +771,7 @@ ConversionStatus GettextImportPlugin::readEntry(TQTextStream& stream)
break;
}
// another line of the msgstr with a missing quotation mark
- else if(line.find(TQRegExp("^\"?.+\\n?\"?$")) != -1)
+ else if(line.tqfind(TQRegExp("^\"?.+\\n?\"?$")) != -1)
{
recoverableError=true;
diff --git a/kbabel/filters/gettext/gettextimport.h b/kbabel/filters/gettext/gettextimport.h
index 54ced3f0..5549168b 100644
--- a/kbabel/filters/gettext/gettextimport.h
+++ b/kbabel/filters/gettext/gettextimport.h
@@ -20,11 +20,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -49,14 +49,14 @@ class TQTextCodec;
class GettextImportPlugin: public KBabel::CatalogImportPlugin
{
public:
- GettextImportPlugin(TQObject* parent, const char* name, const TQStringList &);
- virtual KBabel::ConversionStatus load(const TQString& file, const TQString& mimetype);
+ GettextImportPlugin(TQObject* tqparent, const char* name, const TQStringList &);
+ virtual KBabel::ConversiontqStatus load(const TQString& file, const TQString& mimetype);
virtual const TQString id() { return "GNU gettext"; }
private:
TQTextCodec* codecForArray(TQByteArray& arary, bool* hadCodec);
- KBabel::ConversionStatus readHeader(TQTextStream& stream);
- KBabel::ConversionStatus readEntry(TQTextStream& stream);
+ KBabel::ConversiontqStatus readHeader(TQTextStream& stream);
+ KBabel::ConversiontqStatus readEntry(TQTextStream& stream);
// description of the last read entry
TQString _msgctxt;