Rex Dieter 29094f
From 8200205224117ba5c16527fb07b679696ba211a7 Mon Sep 17 00:00:00 2001
Rex Dieter 29094f
From: Glen Kaukola <gkaukola@cs.ucr.edu>
Rex Dieter 29094f
Date: Sat, 27 Mar 2010 18:05:02 +0000
Rex Dieter 29094f
Subject: [PATCH 19/33] kdesupport/automoc krazy2 fixes.
Rex Dieter 29094f
Rex Dieter 29094f
svn path=/trunk/kdesupport/automoc/; revision=1108065
Rex Dieter 29094f
---
Rex Dieter 29094f
 kde4automoc.cpp | 19 ++++++++++---------
Rex Dieter 29094f
 1 file changed, 10 insertions(+), 9 deletions(-)
Rex Dieter 29094f
Rex Dieter 29094f
diff --git a/kde4automoc.cpp b/kde4automoc.cpp
Rex Dieter 29094f
index 314ab96..d5a00d7 100644
Rex Dieter 29094f
--- a/kde4automoc.cpp
Rex Dieter 29094f
+++ b/kde4automoc.cpp
Rex Dieter 29094f
@@ -183,7 +183,7 @@ void AutoMoc::lazyInit()
Rex Dieter 29094f
     foreach (const QString &path, incPaths) {
Rex Dieter 29094f
         Q_ASSERT(!path.isEmpty());
Rex Dieter 29094f
         mocIncludes << "-I" + path;
Rex Dieter 29094f
-        if (path.endsWith(".framework/Headers")) {
Rex Dieter 29094f
+        if (path.endsWith(QLatin1String(".framework/Headers"))) {
Rex Dieter 29094f
             QDir framework(path);
Rex Dieter 29094f
             // Go up twice to get to the framework root
Rex Dieter 29094f
             framework.cdUp();
Rex Dieter 29094f
@@ -344,8 +344,9 @@ bool AutoMoc::run()
Rex Dieter 29094f
     foreach (const QString &absFilename, sourceFiles) {
Rex Dieter 29094f
         //qDebug() << absFilename;
Rex Dieter 29094f
         const QFileInfo sourceFileInfo(absFilename);
Rex Dieter 29094f
-        if (absFilename.endsWith(".cpp") || absFilename.endsWith(".cc") || absFilename.endsWith(".mm") ||
Rex Dieter 29094f
-                absFilename.endsWith(".cxx") || absFilename.endsWith(".C")) {
Rex Dieter 29094f
+        if (absFilename.endsWith(QLatin1String(".cpp")) || absFilename.endsWith(QLatin1String(".cc")) || 
Rex Dieter 29094f
+            absFilename.endsWith(QLatin1String(".mm")) || absFilename.endsWith(QLatin1String(".cxx")) ||
Rex Dieter 29094f
+            absFilename.endsWith(QLatin1String(".C"))) {
Rex Dieter 29094f
             //qDebug() << "check .cpp file";
Rex Dieter 29094f
             QFile sourceFile(absFilename);
Rex Dieter 29094f
             sourceFile.open(QIODevice::ReadOnly);
Rex Dieter 29094f
@@ -398,7 +399,7 @@ bool AutoMoc::run()
Rex Dieter 29094f
                     //qDebug() << "found moc include: " << currentMoc << " at offset " << matchOffset;
Rex Dieter 29094f
                     const QFileInfo currentMocInfo(currentMoc);
Rex Dieter 29094f
                     QString basename = currentMocInfo.completeBaseName();
Rex Dieter 29094f
-                    const bool moc_style = basename.startsWith("moc_");
Rex Dieter 29094f
+                    const bool moc_style = basename.startsWith(QLatin1String("moc_"));
Rex Dieter 29094f
 
Rex Dieter 29094f
                     // If the moc include is of the moc_foo.cpp style we expect the Q_OBJECT class
Rex Dieter 29094f
                     // declaration in a header file.
Rex Dieter 29094f
@@ -442,15 +443,15 @@ bool AutoMoc::run()
Rex Dieter 29094f
                                 if (!headerFound) {
Rex Dieter 29094f
                                     cerr << "automoc4: The file \"" << absFilename <<
Rex Dieter 29094f
                                         "\" includes the moc file \"" << currentMoc << "\", but neither \"" <<
Rex Dieter 29094f
-                                        absPath + basename + "{" + headerExtensions.join(",") + "}\" nor \"" <<
Rex Dieter 29094f
-                                        filepath + "{" + headerExtensions.join(",") + "}" <<
Rex Dieter 29094f
+                                        absPath + basename + '{' + headerExtensions.join(",") + "}\" nor \"" <<
Rex Dieter 29094f
+                                        filepath + '{' + headerExtensions.join(",") + '}' <<
Rex Dieter 29094f
                                         "\" exist." << endl;
Rex Dieter 29094f
                                     ::exit(EXIT_FAILURE);
Rex Dieter 29094f
                                 }
Rex Dieter 29094f
                             } else {
Rex Dieter 29094f
                                 cerr << "automoc4: The file \"" << absFilename <<
Rex Dieter 29094f
                                     "\" includes the moc file \"" << currentMoc << "\", but \"" <<
Rex Dieter 29094f
-                                    absPath + basename + "{" + headerExtensions.join(",") + "}" <<
Rex Dieter 29094f
+                                    absPath + basename + '{' + headerExtensions.join(",") + '}' <<
Rex Dieter 29094f
                                     "\" does not exist." << endl;
Rex Dieter 29094f
                                 ::exit(EXIT_FAILURE);
Rex Dieter 29094f
                             }
Rex Dieter 29094f
@@ -464,8 +465,8 @@ bool AutoMoc::run()
Rex Dieter 29094f
                             matchOffset + currentMoc.length());
Rex Dieter 29094f
                 } while(matchOffset >= 0);
Rex Dieter 29094f
             }
Rex Dieter 29094f
-        } else if (absFilename.endsWith(".h") || absFilename.endsWith(".hpp") ||
Rex Dieter 29094f
-                absFilename.endsWith(".hxx") || absFilename.endsWith(".H")) {
Rex Dieter 29094f
+        } else if (absFilename.endsWith(QLatin1String(".h")) || absFilename.endsWith(QLatin1String(".hpp")) ||
Rex Dieter 29094f
+                absFilename.endsWith(QLatin1String(".hxx")) || absFilename.endsWith(QLatin1String(".H"))) {
Rex Dieter 29094f
             if (!includedMocs.contains(absFilename) && !notIncludedMocs.contains(absFilename)) {
Rex Dieter 29094f
                 // if this header is not getting processed yet and is explicitly mentioned for the
Rex Dieter 29094f
                 // automoc the moc is run unconditionally on the header and the resulting file is
Rex Dieter 29094f
-- 
Rex Dieter 29094f
2.4.3
Rex Dieter 29094f