summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-11-22 17:39:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 11:54:12 +0100
commit9a9920ef7bc751d08ed8c425dc67730a28b4c355 (patch)
treeab252f38d661a8dd1aaf600b102f56bf6d9f31c9 /src
parentbbb06afe37e6a58d13f51d355d2a36b4d4d03d39 (diff)
downloadqtactiveqt-9a9920ef7bc751d08ed8c425dc67730a28b4c355.tar.gz
replace slashify function with toNativeSeparators
Change-Id: I619823767e02261e75d441e3924fd111a0ff7cb7 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/idc/main.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp
index 98e2b52..a28d56c 100644
--- a/src/tools/idc/main.cpp
+++ b/src/tools/idc/main.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <QDir>
#include <QFile>
#include <QProcess>
#include <QLibraryInfo>
@@ -194,19 +195,6 @@ static HRESULT dumpIdl(const QString &input, const QString &idlfile, const QStri
return res;
}
-static void slashify(QString &s)
-{
- if (!s.contains(QLatin1Char('/')))
- return;
-
- int i = 0;
- while (i < (int)s.length()) {
- if (s[i] == QLatin1Char('/'))
- s[i] = QLatin1Char('\\');
- ++i;
- }
-}
-
int runIdc(int argc, char **argv)
{
QString error;
@@ -284,9 +272,9 @@ int runIdc(int argc, char **argv)
fprintf(stderr, "No interface definition file and no type library file specified!\n");
return 3;
}
- slashify(input);
+ input = QDir::toNativeSeparators(input);
if (!tlbfile.isEmpty()) {
- slashify(tlbfile);
+ tlbfile = QDir::toNativeSeparators(tlbfile);
QFile file(tlbfile);
if (!file.open(QIODevice::ReadOnly)) {
fprintf(stderr, "Couldn't open %s for read\n", (const char*)tlbfile.toLocal8Bit().data());
@@ -299,7 +287,7 @@ int runIdc(int argc, char **argv)
fprintf(stderr, "\n");
return ok ? 0 : 4;
} else if (!idlfile.isEmpty()) {
- slashify(idlfile);
+ idlfile = QDir::toNativeSeparators(idlfile);
idlfile = quotePath(idlfile);
fprintf(stderr, "\n\n%s\n\n", (const char*)idlfile.toLocal8Bit().data());
quotePath(input);