summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorDavid Fries <david@fries.net>2010-06-14 11:57:46 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-06-14 12:25:29 (GMT)
commit78e74249014b152b93dae07bf194b16769016ad0 (patch)
tree449e3187a1e9fc2a8b599b7b44859bb258647627 /src/tools
parent3fd27b2800d41ec10aa798c572c25939cd77e1a7 (diff)
downloadQt-78e74249014b152b93dae07bf194b16769016ad0.zip
Qt-78e74249014b152b93dae07bf194b16769016ad0.tar.gz
Qt-78e74249014b152b93dae07bf194b16769016ad0.tar.bz2
fix detection of header files
Disable the include generation iff a dot which is not followed by [hH] is found after the last path separator. This implies that dots in directory names are now ignored, and that files without an extension are always considered headers (e.g., STL headers and Qt forwarding headers). Task-number: QTBUG-11369 Merge-request: 686 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/tools')
-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()) {