Advertisement
Guest User

Untitled

a guest
Mar 26th, 2010
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. Index: automoc/kde4automoc.cpp
  2. ===================================================================
  3. --- automoc/kde4automoc.cpp (revision 1107607)
  4. +++ automoc/kde4automoc.cpp (working copy)
  5. @@ -183,7 +183,7 @@
  6. foreach (const QString &path, incPaths) {
  7. Q_ASSERT(!path.isEmpty());
  8. mocIncludes << "-I" + path;
  9. - if (path.endsWith(".framework/Headers")) {
  10. + if (path.endsWith(QLatin1String(".framework/Headers"))) {
  11. QDir framework(path);
  12. // Go up twice to get to the framework root
  13. framework.cdUp();
  14. @@ -344,8 +344,9 @@
  15. foreach (const QString &absFilename, sourceFiles) {
  16. //qDebug() << absFilename;
  17. const QFileInfo sourceFileInfo(absFilename);
  18. - if (absFilename.endsWith(".cpp") || absFilename.endsWith(".cc") || absFilename.endsWith(".mm") ||
  19. - absFilename.endsWith(".cxx") || absFilename.endsWith(".C")) {
  20. + if (absFilename.endsWith(QLatin1String(".cpp")) || absFilename.endsWith(QLatin1String(".cc")) ||
  21. + absFilename.endsWith(QLatin1String(".mm")) || absFilename.endsWith(QLatin1String(".cxx")) ||
  22. + absFilename.endsWith(QLatin1String(".C"))) {
  23. //qDebug() << "check .cpp file";
  24. QFile sourceFile(absFilename);
  25. sourceFile.open(QIODevice::ReadOnly);
  26. @@ -398,7 +399,7 @@
  27. //qDebug() << "found moc include: " << currentMoc << " at offset " << matchOffset;
  28. const QFileInfo currentMocInfo(currentMoc);
  29. QString basename = currentMocInfo.completeBaseName();
  30. - const bool moc_style = basename.startsWith("moc_");
  31. + const bool moc_style = basename.startsWith(QLatin1String("moc_"));
  32.  
  33. // If the moc include is of the moc_foo.cpp style we expect the Q_OBJECT class
  34. // declaration in a header file.
  35. @@ -442,15 +443,15 @@
  36. if (!headerFound) {
  37. cerr << "automoc4: The file \"" << absFilename <<
  38. "\" includes the moc file \"" << currentMoc << "\", but neither \"" <<
  39. - absPath + basename + "{" + headerExtensions.join(",") + "}\" nor \"" <<
  40. - filepath + "{" + headerExtensions.join(",") + "}" <<
  41. + absPath + basename + '{' + headerExtensions.join(",") + "}\" nor \"" <<
  42. + filepath + '{' + headerExtensions.join(",") + '}' <<
  43. "\" exist." << endl;
  44. ::exit(EXIT_FAILURE);
  45. }
  46. } else {
  47. cerr << "automoc4: The file \"" << absFilename <<
  48. "\" includes the moc file \"" << currentMoc << "\", but \"" <<
  49. - absPath + basename + "{" + headerExtensions.join(",") + "}" <<
  50. + absPath + basename + '{' + headerExtensions.join(",") + '}' <<
  51. "\" does not exist." << endl;
  52. ::exit(EXIT_FAILURE);
  53. }
  54. @@ -464,8 +465,8 @@
  55. matchOffset + currentMoc.length());
  56. } while(matchOffset >= 0);
  57. }
  58. - } else if (absFilename.endsWith(".h") || absFilename.endsWith(".hpp") ||
  59. - absFilename.endsWith(".hxx") || absFilename.endsWith(".H")) {
  60. + } else if (absFilename.endsWith(QLatin1String(".h")) || absFilename.endsWith(QLatin1String(".hpp")) ||
  61. + absFilename.endsWith(QLatin1String(".hxx")) || absFilename.endsWith(QLatin1String(".H"))) {
  62. if (!includedMocs.contains(absFilename) && !notIncludedMocs.contains(absFilename)) {
  63. // if this header is not getting processed yet and is explicitly mentioned for the
  64. // automoc the moc is run unconditionally on the header and the resulting file is
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement