forked from qt-creator/qt-creator
Include namespaces inside header guard
Task: QTCREATORBUG-2724 RevBy: Friedemann Kleint <qtc-committer@nokia.com>
This commit is contained in:
@@ -74,8 +74,15 @@ void LibraryParameters::generateCode(QtProjectParameters:: Type t,
|
||||
|
||||
const QString indent = QString(indentation, QLatin1Char(' '));
|
||||
|
||||
// Do we have namespaces?
|
||||
QStringList namespaceList = className.split(QLatin1String("::"));
|
||||
if (namespaceList.empty()) // Paranoia!
|
||||
return;
|
||||
|
||||
const QString unqualifiedClassName = namespaceList.takeLast();
|
||||
|
||||
// 1) Header
|
||||
const QString guard = Utils::headerGuard(headerFileName);
|
||||
const QString guard = Utils::headerGuard(headerFileName, namespaceList);
|
||||
headerStr << "#ifndef " << guard
|
||||
<< "\n#define " << guard << '\n' << '\n';
|
||||
|
||||
@@ -94,14 +101,6 @@ void LibraryParameters::generateCode(QtProjectParameters:: Type t,
|
||||
headerStr << '\n';
|
||||
}
|
||||
|
||||
// Do we have namespaces?
|
||||
QStringList namespaceList = className.split(QLatin1String("::"));
|
||||
if (namespaceList.empty()) // Paranoia!
|
||||
return;
|
||||
|
||||
const QString unqualifiedClassName = namespaceList.back();
|
||||
namespaceList.pop_back();
|
||||
|
||||
const QString namespaceIndent = Utils::writeOpeningNameSpaces(namespaceList, indent, headerStr);
|
||||
|
||||
// Class declaraction
|
||||
|
||||
Reference in New Issue
Block a user