[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: meinproc
From:       Bernhard Rosenkraenzer <bero () redhat ! de>
Date:       2001-08-15 11:20:27
[Download RAW message or body]

On Wed, 15 Aug 2001, Erik K. Pedersen wrote:

> One of the examples I tried was the Danish index.docbook coming with  kmines.
> The index.docbook you ship, and the one I produce are identical,and full of
> what you say above. That is produced by po2xml I believe.

Guess po2xml needs fixing...

Here's what I usually do about those files (yes, I know it's a bad hack):

#include <qstring.h>
#include <qfile.h>
#include <qtextstream.h>
int main(int argc, char **argv)
{
        QString line;
        QString current=QString::null;
        QString inf=argv[1];
        QString outf=inf + ".new";
        QString backup=inf + ".sux";
        QFile in(inf);
        QFile out(outf);
        in.open(IO_ReadOnly);
        out.open(IO_WriteOnly|IO_Truncate);
        QTextStream outt(&out);
        while(in.readLine(line, 4096)>=0) {
                if(line.left(1)==">" || current.isEmpty()) {
                        current = current.left(current.length()-1);
                        current += line;
                } else {
                        outt << current;
                        current = line;
                }
        }
        outt << current;
        in.close();
        out.close();
        rename(QFile::encodeName(inf), QFile::encodeName(backup));
        rename(QFile::encodeName(outf), QFile::encodeName(inf));
}


Does it work if you run the file through this little app?

LLaP
bero

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic