Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37768108
en ru br
ALT Linux repos
S:4.8.7-alt25
5.0: 4.5.2-alt1.M50.1
4.1: 4.4.3-alt1.M41.1
4.0: 4.3.4-alt5.M40.1
3.0: 4.0.1-alt1
+updates:4.0.1-alt2
+backports:4.2.3-alt7.1.M30

Group :: System/Libraries
RPM: qt4

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 0188-fix-moc-parser-same-name-header.diff
Download


qt-bugs@ issue : none
Trolltech task ID : none
applied: yes
author: Helio Chissini de Castro <helio@kde.org>
os: unix
In situations where included header have same name as their parent dir, i.e.
include/QtMyModule/QtMyModule and #include <QtMyModule> on code. moc will fail if parent dir was
added in front of includepath.
moc -Iinclude -Iinclude/QtMyModule fails
moc -Iinclude/QtMyModule works
This patch move dir test to proper place, as entry is validated only if is a real file, not a dir.
Detected by qca2 plugins code that uses QtCrypto/QtCrypto
Thanks to Thiago to find proper syntax
Index: src/tools/moc/preprocessor.cpp
===================================================================
--- src/tools/moc/preprocessor.cpp.orig
+++ src/tools/moc/preprocessor.cpp
@@ -799,7 +799,7 @@ void Preprocessor::preprocess(const QByt
             QFileInfo fi;
             if (local)
                 fi.setFile(QFileInfo(QString::fromLocal8Bit(filename)).dir(), QString::fromLocal8Bit(include));
-            for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {
+            for (int j = 0; j < Preprocessor::includes.size() && ( !fi.exists() || fi.isDir() ); ++j) {
                 const IncludePath &p = Preprocessor::includes.at(j);
                 if (p.isFrameworkPath) {
                     const int slashPos = include.indexOf('/');
@@ -819,7 +819,7 @@ void Preprocessor::preprocess(const QByt
                 }
             }
 
-            if (!fi.exists() || fi.isDir())
+            if ( !fi.exists() )
                 continue;
             include = fi.canonicalFilePath().toLocal8Bit();
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin