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

List:       kde-commits
Subject:    [poxml] /: use QFile::decodeName for handing filenames to Qt
From:       Pino Toscano <pino () kde ! org>
Date:       2014-03-09 12:35:32
Message-ID: E1WMcx2-0006Mz-7x () scm ! kde ! org
[Download RAW message or body]

Git commit 5a4a57331e7e4ccb28384ee0b3af35c71a7e4d4d by Pino Toscano.
Committed on 09/03/2014 at 12:35.
Pushed by pino into branch 'master'.

use QFile::decodeName for handing filenames to Qt

M  +1    -1    parser.cpp
M  +1    -1    po2xml.cpp
M  +1    -1    xml2pot.cpp

http://commits.kde.org/poxml/5a4a57331e7e4ccb28384ee0b3af35c71a7e4d4d

diff --git a/parser.cpp b/parser.cpp
index f54a815..94a4583 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -851,7 +851,7 @@ bool StructureParser::characters(const QString &ch)
 MsgList parseXML(const char *filename)
 {
     StructureParser handler;
-    QFile xmlFile( filename );
+    QFile xmlFile(QFile::decodeName(filename));
     xmlFile.open(QIODevice::ReadOnly);
 
     QByteArray ccontents = xmlFile.readAll();
diff --git a/po2xml.cpp b/po2xml.cpp
index 42e8f3b..b800042 100644
--- a/po2xml.cpp
+++ b/po2xml.cpp
@@ -85,7 +85,7 @@ int main( int argc, char **argv )
         translations.insert(msgid, msgstr);
     }
 
-    QFile xml(argv[1]);
+    QFile xml(QFile::decodeName(argv[1]));
     xml.open(QIODevice::ReadOnly);
     QTextStream ds(&xml);
     ds.setCodec("UTF-8");
diff --git a/xml2pot.cpp b/xml2pot.cpp
index 7b78c5d..7cee000 100644
--- a/xml2pot.cpp
+++ b/xml2pot.cpp
@@ -64,7 +64,7 @@ int main( int argc, char **argv )
         return 1;
     }
 
-    const QByteArray fname = QFileInfo(argv[1]).fileName().toUtf8();
+    const QByteArray fname = QFileInfo(QFile::decodeName(argv[1])).fileName().toUtf8();
 
     for (MsgList::ConstIterator it = english.constBegin();
          it != english.constEnd(); ++it)
[prev in list] [next in list] [prev in thread] [next in thread] 

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