summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-15 05:38:54 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-15 05:38:54 (GMT)
commit37d71b2653b9f31ee73fdd09b0d2be757d4537bd (patch)
tree5877aa8f77e34db7ab6d9c58180d32952c65b49c /src/tools/moc
parenteaa981c943293bf346a041aa4ad3d254e99ebd78 (diff)
parentdd2be9c7e7540870ddc532f02bd83860273cbbd6 (diff)
downloadQt-37d71b2653b9f31ee73fdd09b0d2be757d4537bd.zip
Qt-37d71b2653b9f31ee73fdd09b0d2be757d4537bd.tar.gz
Qt-37d71b2653b9f31ee73fdd09b0d2be757d4537bd.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index ebe1834..4997690 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -359,11 +359,10 @@ int runMoc(int _argc, char **_argv)
if (autoInclude) {
+ int spos = filename.lastIndexOf(QDir::separator().toLatin1());
int ppos = filename.lastIndexOf('.');
- moc.noInclude = (ppos >= 0
- && tolower(filename[ppos + 1]) != 'h'
- && tolower(filename[ppos + 1]) != QDir::separator().toLatin1()
- );
+ // spos >= -1 && ppos > spos => ppos >= 0
+ moc.noInclude = (ppos > spos && tolower(filename[ppos + 1]) != 'h');
}
if (moc.includeFiles.isEmpty()) {
if (moc.includePath.isEmpty()) {