Changeset 561 for trunk/src/tools/moc/moc.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/tools/moc/moc.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 338 338 { 339 339 def->isVirtual = false; 340 while (test(INLINE) || test(STATIC) || test(VIRTUAL) 341 || testFunctionAttribute(def)) { 342 if (lookup() == VIRTUAL) 343 def->isVirtual = true; 344 } 340 //skip modifiers and attributes 341 while (test(INLINE) || test(STATIC) || 342 (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual 343 || testFunctionAttribute(def)) {} 345 344 bool templateFunction = (lookup() == TEMPLATE); 346 345 def->type = parseType(); … … 430 429 { 431 430 def->isVirtual = false; 432 while (test(EXPLICIT) || test(INLINE) || test(STATIC) || test(VIRTUAL) 433 || testFunctionAttribute(def)) { 434 if (lookup() == VIRTUAL) 435 def->isVirtual = true; 436 } 431 //skip modifiers and attributes 432 while (test(EXPLICIT) || test(INLINE) || test(STATIC) || 433 (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual 434 || testFunctionAttribute(def)) {} 437 435 bool tilde = test(TILDE); 438 436 def->type = parseType(); … … 753 751 754 752 if (!noInclude) { 755 if (includePath.size() && includePath.right(1) != "/")756 includePath += "/";753 if (includePath.size() && !includePath.endsWith('/')) 754 includePath += '/'; 757 755 for (int i = 0; i < includeFiles.size(); ++i) { 758 756 QByteArray inc = includeFiles.at(i); … … 760 758 if (includePath.size() && includePath != "./") 761 759 inc.prepend(includePath); 762 inc = "\"" + inc + "\"";760 inc = '\"' + inc + '\"'; 763 761 } 764 762 fprintf(out, "#include %s\n", inc.constData()); … … 767 765 if (classList.size() && classList.first().classname == "Qt") 768 766 fprintf(out, "#include <QtCore/qobject.h>\n"); 767 768 if (mustIncludeQMetaTypeH) 769 fprintf(out, "#include <QtCore/qmetatype.h>\n"); 769 770 770 771 fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n" … … 860 861 parseFunction(&funcDef); 861 862 if (funcDef.isVirtual) 862 error("Signals cannot be declared virtual");863 warning("Signals cannot be declared virtual"); 863 864 if (funcDef.inlineCode) 864 865 error("Not a signal declaration"); … … 899 900 else if (type == "ULongLong") 900 901 type = "qulonglong"; 902 else if (type == "qreal") 903 mustIncludeQMetaTypeH = true; 904 901 905 propDef.type = type; 902 906 … … 905 909 while (test(IDENTIFIER)) { 906 910 QByteArray l = lexem(); 911 912 if (l[0] == 'C' && l == "CONSTANT") { 913 propDef.constant = true; 914 continue; 915 } else if(l[0] == 'F' && l == "FINAL") { 916 propDef.final = true; 917 continue; 918 } 919 907 920 QByteArray v, v2; 908 921 if (test(LPAREN)) { … … 960 973 warning(msg.constData()); 961 974 } 962 if(!propDef.notify.isEmpty()) 975 if (propDef.constant && !propDef.write.isNull()) { 976 QByteArray msg; 977 msg += "Property declaration "; 978 msg += propDef.name; 979 msg += " is both WRITEable and CONSTANT. CONSTANT will be ignored."; 980 propDef.constant = false; 981 warning(msg.constData()); 982 } 983 if (propDef.constant && !propDef.notify.isNull()) { 984 QByteArray msg; 985 msg += "Property declaration "; 986 msg += propDef.name; 987 msg += " is both NOTIFYable and CONSTANT. CONSTANT will be ignored."; 988 propDef.constant = false; 989 warning(msg.constData()); 990 } 991 992 if(!propDef.notify.isEmpty()) 963 993 def->notifyableProperties++; 964 994
Note:
See TracChangeset
for help on using the changeset viewer.