summaryrefslogtreecommitdiffstats
path: root/kbabel/filters/gettext/gettextimport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/filters/gettext/gettextimport.cpp')
-rw-r--r--kbabel/filters/gettext/gettextimport.cpp76
1 files changed, 38 insertions, 38 deletions
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;