diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-19 01:42:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-19 01:42:42 (GMT) |
commit | 4f1f806e2258ed003039d33eb0e64109a63f70fc (patch) | |
tree | 26bff685aa68ed4e27ede00f9d56f7985b8db37a | |
parent | c9be4ccfbd63323a2d70d341c9bc490a95195148 (diff) | |
parent | 572ab194c9b0dda3718320f7c5642110db58bec8 (diff) | |
download | Qt-4f1f806e2258ed003039d33eb0e64109a63f70fc.zip Qt-4f1f806e2258ed003039d33eb0e64109a63f70fc.tar.gz Qt-4f1f806e2258ed003039d33eb0e64109a63f70fc.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging:
Use file names in header include guards instead of namespace names
-rw-r--r-- | tools/activeqt/dumpcpp/main.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/activeqt/dumpcpp/main.cpp b/tools/activeqt/dumpcpp/main.cpp index bb65806..f95d31d 100644 --- a/tools/activeqt/dumpcpp/main.cpp +++ b/tools/activeqt/dumpcpp/main.cpp @@ -48,6 +48,7 @@ #include <QStringList> #include <QUuid> #include <QWidget> +#include <QFileInfo> #include <qt_windows.h> #include <ocidl.h> @@ -129,10 +130,10 @@ void writeEnums(QTextStream &out, const QMetaObject *mo) } } -void writeHeader(QTextStream &out, const QByteArray &nameSpace) +void writeHeader(QTextStream &out, const QByteArray &nameSpace, const QString &outFileName) { - out << "#ifndef QAX_DUMPCPP_" << nameSpace.toUpper() << "_H" << endl; - out << "#define QAX_DUMPCPP_" << nameSpace.toUpper() << "_H" << endl; + out << "#ifndef QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << endl; + out << "#define QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << endl; out << endl; out << "// Define this symbol to __declspec(dllexport) or __declspec(dllimport)" << endl; out << "#ifndef " << nameSpace.toUpper() << "_EXPORT" << endl; @@ -880,7 +881,7 @@ bool generateClass(QAxObject *object, const QByteArray &className, const QByteAr out << "****************************************************************************/" << endl; out << endl; - writeHeader(out, nameSpace); + writeHeader(out, nameSpace, outfile.fileName()); generateNameSpace(out, mo, nameSpace); // close namespace file @@ -1040,7 +1041,8 @@ bool generateTypeLibrary(const QByteArray &typeLib, const QByteArray &outname, O declOut << "****************************************************************************/" << endl; declOut << endl; - writeHeader(declOut, libName.toLatin1()); + QFileInfo cppFileInfo(cppFile); + writeHeader(declOut, libName.toLatin1(), cppFileInfo.fileName()); UINT typeCount = typelib->GetTypeInfoCount(); if (declFile.isOpen()) { |