diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-05-28 08:27:50 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-05-28 08:31:07 (GMT) |
commit | f390f9b51cf8686e9ed44f13a33c7349b9e96a09 (patch) | |
tree | 162c768769713a7215bca64daf8f2bdc75c9fbee /src/tools/moc | |
parent | 0bb0699d403b7541472a72a4057ecf0ca366a7cd (diff) | |
download | Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.zip Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.gz Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.bz2 |
improved string operations all over the place
used character operations whenever possible
better usage of QLatin1String
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 4 | ||||
-rw-r--r-- | src/tools/moc/moc.cpp | 6 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index ae8a76e..e94bb77 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1161,8 +1161,8 @@ void Generator::_generateFunctions(QList<FunctionDef> &list, int type) for (int j = 0; j < f.arguments.count(); ++j) { const ArgumentDef &a = f.arguments.at(j); if (j) { - sig += ","; - arguments += ","; + sig += ','; + arguments += ','; } sig += a.normalizedType; arguments += a.name; diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index a6a0ba1..8ca2823 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -752,14 +752,14 @@ void Moc::generate(FILE *out) if (!noInclude) { - if (includePath.size() && includePath.right(1) != "/") - includePath += "/"; + if (includePath.size() && !includePath.endsWith('/')) + includePath += '/'; for (int i = 0; i < includeFiles.size(); ++i) { QByteArray inc = includeFiles.at(i); if (inc[0] != '<' && inc[0] != '"') { if (includePath.size() && includePath != "./") inc.prepend(includePath); - inc = "\"" + inc + "\""; + inc = '\"' + inc + '\"'; } fprintf(out, "#include %s\n", inc.constData()); } diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 45cbbfd..3260ca2 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -807,7 +807,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) continue; QByteArray frameworkCandidate = include.left(slashPos); frameworkCandidate.append(".framework/Headers/"); - fi.setFile(QString::fromLocal8Bit(p.path + "/" + frameworkCandidate), QString::fromLocal8Bit(include.mid(slashPos + 1))); + fi.setFile(QString::fromLocal8Bit(p.path + '/' + frameworkCandidate), QString::fromLocal8Bit(include.mid(slashPos + 1))); } else { fi.setFile(QString::fromLocal8Bit(p.path), QString::fromLocal8Bit(include)); } |