diff --git a/doc/src/projects/creator-projects-opening.qdoc b/doc/src/projects/creator-projects-opening.qdoc index e4ba25aebc1..dd825a89a28 100644 --- a/doc/src/projects/creator-projects-opening.qdoc +++ b/doc/src/projects/creator-projects-opening.qdoc @@ -40,45 +40,26 @@ and enter the information again in the \gui {Configure Project} tab. The \gui {Configure Project} tab displays a list of development environments - for target platforms that are installed on the development PC. Select the Qt - versions that you want to use to build the project for each target. + for target platforms that are installed on the development PC and + configured in \gui Tools > \gui Options > \gui {Build & Run} > \gui Targets. + Select the targets that you want to build the project for. \image qtcreator-open-project-targets.png "Configure Project tab" Even if you do not intend to build the project, the C++ and QML code models need a Qt version and tool chain to offer code completion. To specify them, - select the \gui options link, or select \gui {Tools > Options > Build & Run - > Unconfigured Project}. + select the \gui Options link, or select \gui {Tools > Options > Build & Run + > Targets}. - If \QC cannot find an existing build for a particular development - environment (Qt version) and target, it starts out from a clean slate, and - creates a new build in the specified directory. \QC suggests a name + If \QC cannot find an existing build for a particular target, it starts out + from a clean slate, and creates new debug and release build configurations + in the specified directory. \QC suggests a name and location for the directory that you can change. - By default, \QC does a \l{glossary-shadow-build}{shadow build} and also - creates the directory. However, shadow building is not supported for the - following targets on Windows: - - \list - - \o Maemo5 - - \o MeeGo Harmattan - - \if defined(qcmanual) - \o Symbian Devices - \endif - - \endlist - If you have built the project before, \QC can use the existing build configuration to make the exact same build as found in the directory - available to \QC. - - If you know you have a build, but it is not listed, click \gui {Add Build} - to locate it. Select a directory, and \QC scans it (including - subdirectories) for additional builds of the project. \QC adds the found - builds to the target list. + available to \QC. To import a build, specify a directory in the + \gui {Import Build from} section and select \gui {Import}. You can edit the build configuration later. For more information, see \l{Editing Build Configurations}. @@ -90,11 +71,8 @@ \o Select \gui File > \gui{Open File or Project} and select the project to open. - \o In the \gui {Project Setup} dialog, select the Qt versions to use as - build targets for your project, and click \gui{Finish}. - - \note If you have only one development environment installed, this - dialog is skipped. + \o In the \gui {Configure Project} tab, select build targets for your + project, and click \gui {Configure Project}. \endlist diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp index a0923a2feb1..5382374249b 100644 --- a/src/libs/cplusplus/FastPreprocessor.cpp +++ b/src/libs/cplusplus/FastPreprocessor.cpp @@ -42,7 +42,7 @@ FastPreprocessor::FastPreprocessor(const Snapshot &snapshot) QByteArray FastPreprocessor::run(QString fileName, const QString &source) { - _preproc.setExpandMacros(false); + _preproc.setExpandFunctionlikeMacros(false); _preproc.setKeepComments(true); if (Document::Ptr doc = _snapshot.document(fileName)) { diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index e6ba93de810..303205408ae 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -593,7 +593,7 @@ void Preprocessor::State::popTokenBuffer() Preprocessor::Preprocessor(Client *client, Environment *env) : m_client(client) , m_env(env) - , m_expandMacros(true) + , m_expandFunctionlikeMacros(true) , m_keepComments(false) { } @@ -615,14 +615,14 @@ QByteArray Preprocessor::run(const QString &fileName, return preprocessed; } -bool Preprocessor::expandMacros() const +bool Preprocessor::expandFunctionlikeMacros() const { - return m_expandMacros; + return m_expandFunctionlikeMacros; } -void Preprocessor::setExpandMacros(bool expandMacros) +void Preprocessor::setExpandFunctionlikeMacros(bool expandMacros) { - m_expandMacros = expandMacros; + m_expandFunctionlikeMacros = expandMacros; } bool Preprocessor::keepComments() const @@ -741,9 +741,6 @@ void Preprocessor::skipPreprocesorDirective(PPToken *tk) bool Preprocessor::handleIdentifier(PPToken *tk) { - if (!expandMacros()) - return false; - ScopedBoolSwap s(m_state.m_inPreprocessorDirective, true); static const QByteArray ppLine("__LINE__"); @@ -813,6 +810,9 @@ bool Preprocessor::handleIdentifier(PPToken *tk) PPToken oldMarkerTk; if (macro->isFunctionLike()) { + if (!expandFunctionlikeMacros()) + return false; + // Collect individual tokens that form the macro arguments. QVector > allArgTks; bool hasArgs = collectActualArguments(tk, &allArgTks); @@ -1137,10 +1137,17 @@ void Preprocessor::trackExpansionCycles(PPToken *tk) } } +static void adjustForCommentNewlines(unsigned *currentLine, const PPToken &tk) +{ + if (tk.is(T_COMMENT) || tk.is(T_DOXY_COMMENT)) + (*currentLine) += tk.asByteArrayRef().count('\n'); +} + void Preprocessor::synchronizeOutputLines(const PPToken &tk, bool forceLine) { if (m_state.m_expansionStatus != NotExpanding || (!forceLine && m_env->currentLine == tk.lineno)) { + adjustForCommentNewlines(&m_env->currentLine, tk); return; } @@ -1157,8 +1164,7 @@ void Preprocessor::synchronizeOutputLines(const PPToken &tk, bool forceLine) } m_env->currentLine = tk.lineno; - if (tk.is(T_COMMENT) || tk.is(T_DOXY_COMMENT)) - m_env->currentLine += tk.asByteArrayRef().count('\n'); + adjustForCommentNewlines(&m_env->currentLine, tk); } void Preprocessor::removeTrailingOutputLines() diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index 310f1cef108..fef49ac6f1b 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -81,8 +81,8 @@ public: QByteArray run(const QString &filename, const QString &source); QByteArray run(const QString &filename, const QByteArray &source, bool noLines = false, bool markGeneratedTokens = true); - bool expandMacros() const; - void setExpandMacros(bool expandMacros); + bool expandFunctionlikeMacros() const; + void setExpandFunctionlikeMacros(bool expandFunctionlikeMacros); bool keepComments() const; void setKeepComments(bool keepComments); @@ -197,7 +197,7 @@ private: Environment *m_env; QByteArray m_scratchBuffer; - bool m_expandMacros; + bool m_expandFunctionlikeMacros; bool m_keepComments; State m_state; diff --git a/src/libs/glsl/glsl.g b/src/libs/glsl/glsl.g index 67f564c05fb..3c6ae7ce5c9 100644 --- a/src/libs/glsl/glsl.g +++ b/src/libs/glsl/glsl.g @@ -456,7 +456,7 @@ private: #include #include #include -#include +#include using namespace GLSL; @@ -591,7 +591,7 @@ AST *Parser::parse(int startToken) static int tks[] = { T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET, - T_SEMICOLON, T_COMMA, T_COLON, + T_SEMICOLON, T_COLON, T_COMMA, T_NUMBER, T_TYPE_NAME, T_IDENTIFIER, T_LEFT_BRACE, T_LEFT_PAREN, T_LEFT_BRACKET, T_WHILE, diff --git a/src/libs/glsl/glslparser.cpp b/src/libs/glsl/glslparser.cpp index cf4bbe42f37..d82096b6d31 100644 --- a/src/libs/glsl/glslparser.cpp +++ b/src/libs/glsl/glslparser.cpp @@ -1,5 +1,5 @@ -#line 427 "./glsl.g" +#line 423 "./glsl.g" /************************************************************************** ** @@ -171,7 +171,7 @@ AST *Parser::parse(int startToken) static int tks[] = { T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET, - T_SEMICOLON, T_COMMA, T_COLON, + T_SEMICOLON, T_COLON, T_COMMA, T_NUMBER, T_TYPE_NAME, T_IDENTIFIER, T_LEFT_BRACE, T_LEFT_PAREN, T_LEFT_BRACKET, T_WHILE, @@ -215,137 +215,137 @@ AST *Parser::parse(int startToken) return 0; } -#line 647 "./glsl.g" +#line 641 "./glsl.g" void Parser::reduce(int ruleno) { switch(ruleno) { -#line 656 "./glsl.g" +#line 650 "./glsl.g" case 0: { ast(1) = makeAstNode(string(1)); } break; -#line 663 "./glsl.g" +#line 657 "./glsl.g" case 1: { ast(1) = makeAstNode(string(1)); } break; -#line 670 "./glsl.g" +#line 664 "./glsl.g" case 2: { ast(1) = makeAstNode(_engine->identifier("true", 4)); } break; -#line 677 "./glsl.g" +#line 671 "./glsl.g" case 3: { ast(1) = makeAstNode(_engine->identifier("false", 5)); } break; -#line 684 "./glsl.g" +#line 678 "./glsl.g" case 4: { // nothing to do. } break; -#line 691 "./glsl.g" +#line 685 "./glsl.g" case 5: { ast(1) = ast(2); } break; -#line 698 "./glsl.g" +#line 692 "./glsl.g" case 6: { // nothing to do. } break; -#line 705 "./glsl.g" +#line 699 "./glsl.g" case 7: { ast(1) = makeAstNode(AST::Kind_ArrayAccess, expression(1), expression(3)); } break; -#line 712 "./glsl.g" +#line 706 "./glsl.g" case 8: { // nothing to do. } break; -#line 719 "./glsl.g" +#line 713 "./glsl.g" case 9: { ast(1) = makeAstNode(expression(1), string(3)); } break; -#line 726 "./glsl.g" +#line 720 "./glsl.g" case 10: { ast(1) = makeAstNode(AST::Kind_PostIncrement, expression(1)); } break; -#line 733 "./glsl.g" +#line 727 "./glsl.g" case 11: { ast(1) = makeAstNode(AST::Kind_PostDecrement, expression(1)); } break; -#line 740 "./glsl.g" +#line 734 "./glsl.g" case 12: { // nothing to do. } break; -#line 747 "./glsl.g" +#line 741 "./glsl.g" case 13: { // nothing to do. } break; -#line 754 "./glsl.g" +#line 748 "./glsl.g" case 14: { ast(1) = makeAstNode (sym(1).function.id, sym(1).function.arguments); } break; -#line 762 "./glsl.g" +#line 756 "./glsl.g" case 15: { ast(1) = makeAstNode (expression(1), sym(3).function.id, sym(3).function.arguments); } break; -#line 770 "./glsl.g" +#line 764 "./glsl.g" case 16: { // nothing to do. } break; -#line 777 "./glsl.g" +#line 771 "./glsl.g" case 17: { // nothing to do. } break; -#line 784 "./glsl.g" +#line 778 "./glsl.g" case 18: { sym(1).function.id = sym(1).function_identifier; sym(1).function.arguments = 0; } break; -#line 792 "./glsl.g" +#line 786 "./glsl.g" case 19: { sym(1).function.id = sym(1).function_identifier; sym(1).function.arguments = 0; } break; -#line 800 "./glsl.g" +#line 794 "./glsl.g" case 20: { sym(1).function.id = sym(1).function_identifier; @@ -353,7 +353,7 @@ case 20: { makeAstNode< List >(expression(2)); } break; -#line 809 "./glsl.g" +#line 803 "./glsl.g" case 21: { sym(1).function.arguments = @@ -361,379 +361,379 @@ case 21: { (sym(1).function.arguments, expression(3)); } break; -#line 818 "./glsl.g" +#line 812 "./glsl.g" case 22: { // nothing to do. } break; -#line 825 "./glsl.g" +#line 819 "./glsl.g" case 23: { ast(1) = makeAstNode(type(1)); } break; -#line 832 "./glsl.g" +#line 826 "./glsl.g" case 24: { ast(1) = makeAstNode(string(1)); } break; -#line 839 "./glsl.g" +#line 833 "./glsl.g" case 25: { // nothing to do. } break; -#line 846 "./glsl.g" +#line 840 "./glsl.g" case 26: { ast(1) = makeAstNode(AST::Kind_PreIncrement, expression(2)); } break; -#line 853 "./glsl.g" +#line 847 "./glsl.g" case 27: { ast(1) = makeAstNode(AST::Kind_PreDecrement, expression(2)); } break; -#line 860 "./glsl.g" +#line 854 "./glsl.g" case 28: { ast(1) = makeAstNode(sym(1).kind, expression(2)); } break; -#line 867 "./glsl.g" +#line 861 "./glsl.g" case 29: { sym(1).kind = AST::Kind_UnaryPlus; } break; -#line 874 "./glsl.g" +#line 868 "./glsl.g" case 30: { sym(1).kind = AST::Kind_UnaryMinus; } break; -#line 881 "./glsl.g" +#line 875 "./glsl.g" case 31: { sym(1).kind = AST::Kind_LogicalNot; } break; -#line 888 "./glsl.g" +#line 882 "./glsl.g" case 32: { sym(1).kind = AST::Kind_BitwiseNot; } break; -#line 895 "./glsl.g" +#line 889 "./glsl.g" case 33: { // nothing to do. } break; -#line 902 "./glsl.g" +#line 896 "./glsl.g" case 34: { ast(1) = makeAstNode(AST::Kind_Multiply, expression(1), expression(3)); } break; -#line 909 "./glsl.g" +#line 903 "./glsl.g" case 35: { ast(1) = makeAstNode(AST::Kind_Divide, expression(1), expression(3)); } break; -#line 916 "./glsl.g" +#line 910 "./glsl.g" case 36: { ast(1) = makeAstNode(AST::Kind_Modulus, expression(1), expression(3)); } break; -#line 923 "./glsl.g" +#line 917 "./glsl.g" case 37: { // nothing to do. } break; -#line 930 "./glsl.g" +#line 924 "./glsl.g" case 38: { ast(1) = makeAstNode(AST::Kind_Plus, expression(1), expression(3)); } break; -#line 937 "./glsl.g" +#line 931 "./glsl.g" case 39: { ast(1) = makeAstNode(AST::Kind_Minus, expression(1), expression(3)); } break; -#line 944 "./glsl.g" +#line 938 "./glsl.g" case 40: { // nothing to do. } break; -#line 951 "./glsl.g" +#line 945 "./glsl.g" case 41: { ast(1) = makeAstNode(AST::Kind_ShiftLeft, expression(1), expression(3)); } break; -#line 958 "./glsl.g" +#line 952 "./glsl.g" case 42: { ast(1) = makeAstNode(AST::Kind_ShiftRight, expression(1), expression(3)); } break; -#line 965 "./glsl.g" +#line 959 "./glsl.g" case 43: { // nothing to do. } break; -#line 972 "./glsl.g" +#line 966 "./glsl.g" case 44: { ast(1) = makeAstNode(AST::Kind_LessThan, expression(1), expression(3)); } break; -#line 979 "./glsl.g" +#line 973 "./glsl.g" case 45: { ast(1) = makeAstNode(AST::Kind_GreaterThan, expression(1), expression(3)); } break; -#line 986 "./glsl.g" +#line 980 "./glsl.g" case 46: { ast(1) = makeAstNode(AST::Kind_LessEqual, expression(1), expression(3)); } break; -#line 993 "./glsl.g" +#line 987 "./glsl.g" case 47: { ast(1) = makeAstNode(AST::Kind_GreaterEqual, expression(1), expression(3)); } break; -#line 1000 "./glsl.g" +#line 994 "./glsl.g" case 48: { // nothing to do. } break; -#line 1007 "./glsl.g" +#line 1001 "./glsl.g" case 49: { ast(1) = makeAstNode(AST::Kind_Equal, expression(1), expression(3)); } break; -#line 1014 "./glsl.g" +#line 1008 "./glsl.g" case 50: { ast(1) = makeAstNode(AST::Kind_NotEqual, expression(1), expression(3)); } break; -#line 1021 "./glsl.g" +#line 1015 "./glsl.g" case 51: { // nothing to do. } break; -#line 1028 "./glsl.g" +#line 1022 "./glsl.g" case 52: { ast(1) = makeAstNode(AST::Kind_BitwiseAnd, expression(1), expression(3)); } break; -#line 1035 "./glsl.g" +#line 1029 "./glsl.g" case 53: { // nothing to do. } break; -#line 1042 "./glsl.g" +#line 1036 "./glsl.g" case 54: { ast(1) = makeAstNode(AST::Kind_BitwiseXor, expression(1), expression(3)); } break; -#line 1049 "./glsl.g" +#line 1043 "./glsl.g" case 55: { // nothing to do. } break; -#line 1056 "./glsl.g" +#line 1050 "./glsl.g" case 56: { ast(1) = makeAstNode(AST::Kind_BitwiseOr, expression(1), expression(3)); } break; -#line 1063 "./glsl.g" +#line 1057 "./glsl.g" case 57: { // nothing to do. } break; -#line 1070 "./glsl.g" +#line 1064 "./glsl.g" case 58: { ast(1) = makeAstNode(AST::Kind_LogicalAnd, expression(1), expression(3)); } break; -#line 1077 "./glsl.g" +#line 1071 "./glsl.g" case 59: { // nothing to do. } break; -#line 1084 "./glsl.g" +#line 1078 "./glsl.g" case 60: { ast(1) = makeAstNode(AST::Kind_LogicalXor, expression(1), expression(3)); } break; -#line 1091 "./glsl.g" +#line 1085 "./glsl.g" case 61: { // nothing to do. } break; -#line 1098 "./glsl.g" +#line 1092 "./glsl.g" case 62: { ast(1) = makeAstNode(AST::Kind_LogicalOr, expression(1), expression(3)); } break; -#line 1105 "./glsl.g" +#line 1099 "./glsl.g" case 63: { // nothing to do. } break; -#line 1112 "./glsl.g" +#line 1106 "./glsl.g" case 64: { ast(1) = makeAstNode(AST::Kind_Conditional, expression(1), expression(3), expression(5)); } break; -#line 1119 "./glsl.g" +#line 1113 "./glsl.g" case 65: { // nothing to do. } break; -#line 1126 "./glsl.g" +#line 1120 "./glsl.g" case 66: { ast(1) = makeAstNode(sym(2).kind, expression(1), expression(3)); } break; -#line 1133 "./glsl.g" +#line 1127 "./glsl.g" case 67: { sym(1).kind = AST::Kind_Assign; } break; -#line 1140 "./glsl.g" +#line 1134 "./glsl.g" case 68: { sym(1).kind = AST::Kind_AssignMultiply; } break; -#line 1147 "./glsl.g" +#line 1141 "./glsl.g" case 69: { sym(1).kind = AST::Kind_AssignDivide; } break; -#line 1154 "./glsl.g" +#line 1148 "./glsl.g" case 70: { sym(1).kind = AST::Kind_AssignModulus; } break; -#line 1161 "./glsl.g" +#line 1155 "./glsl.g" case 71: { sym(1).kind = AST::Kind_AssignPlus; } break; -#line 1168 "./glsl.g" +#line 1162 "./glsl.g" case 72: { sym(1).kind = AST::Kind_AssignMinus; } break; -#line 1175 "./glsl.g" +#line 1169 "./glsl.g" case 73: { sym(1).kind = AST::Kind_AssignShiftLeft; } break; -#line 1182 "./glsl.g" +#line 1176 "./glsl.g" case 74: { sym(1).kind = AST::Kind_AssignShiftRight; } break; -#line 1189 "./glsl.g" +#line 1183 "./glsl.g" case 75: { sym(1).kind = AST::Kind_AssignAnd; } break; -#line 1196 "./glsl.g" +#line 1190 "./glsl.g" case 76: { sym(1).kind = AST::Kind_AssignXor; } break; -#line 1203 "./glsl.g" +#line 1197 "./glsl.g" case 77: { sym(1).kind = AST::Kind_AssignOr; } break; -#line 1210 "./glsl.g" +#line 1204 "./glsl.g" case 78: { // nothing to do. } break; -#line 1217 "./glsl.g" +#line 1211 "./glsl.g" case 79: { ast(1) = makeAstNode(AST::Kind_Comma, expression(1), expression(3)); } break; -#line 1224 "./glsl.g" +#line 1218 "./glsl.g" case 80: { // nothing to do. } break; -#line 1231 "./glsl.g" +#line 1225 "./glsl.g" case 81: { // nothing to do. } break; -#line 1238 "./glsl.g" +#line 1232 "./glsl.g" case 82: { ast(1) = makeAstNode(sym(1).declaration_list); } break; -#line 1245 "./glsl.g" +#line 1239 "./glsl.g" case 83: { ast(1) = makeAstNode(sym(2).precision, type(3)); } break; -#line 1252 "./glsl.g" +#line 1246 "./glsl.g" case 84: { if (sym(1).type_qualifier.qualifier != QualifiedTypeAST::Struct) { @@ -743,7 +743,7 @@ case 84: { ast(1) = makeAstNode(type); } break; -#line 1263 "./glsl.g" +#line 1257 "./glsl.g" case 85: { if ((sym(1).type_qualifier.qualifier & QualifiedTypeAST::Struct) == 0) { @@ -761,7 +761,7 @@ case 85: { makeAstNode(qualtype, string(6))); } break; -#line 1282 "./glsl.g" +#line 1276 "./glsl.g" case 86: { if ((sym(1).type_qualifier.qualifier & QualifiedTypeAST::Struct) == 0) { @@ -780,7 +780,7 @@ case 86: { (makeAstNode(qualtype), string(6))); } break; -#line 1302 "./glsl.g" +#line 1296 "./glsl.g" case 87: { if ((sym(1).type_qualifier.qualifier & QualifiedTypeAST::Struct) == 0) { @@ -799,7 +799,7 @@ case 87: { (makeAstNode(qualtype, expression(8)), string(6))); } break; -#line 1322 "./glsl.g" +#line 1316 "./glsl.g" case 88: { TypeAST *type = makeAstNode @@ -808,59 +808,59 @@ case 88: { ast(1) = makeAstNode(type); } break; -#line 1332 "./glsl.g" +#line 1326 "./glsl.g" case 89: { function(1)->finishParams(); } break; -#line 1339 "./glsl.g" +#line 1333 "./glsl.g" case 90: { // nothing to do. } break; -#line 1346 "./glsl.g" +#line 1340 "./glsl.g" case 91: { // nothing to do. } break; -#line 1353 "./glsl.g" +#line 1347 "./glsl.g" case 92: { function(1)->params = makeAstNode< List > (sym(2).param_declaration); } break; -#line 1361 "./glsl.g" +#line 1355 "./glsl.g" case 93: { function(1)->params = makeAstNode< List > (function(1)->params, sym(3).param_declaration); } break; -#line 1369 "./glsl.g" +#line 1363 "./glsl.g" case 94: { function(1) = makeAstNode(type(1), string(2)); } break; -#line 1376 "./glsl.g" +#line 1370 "./glsl.g" case 95: { sym(1).param_declarator.type = type(1); sym(1).param_declarator.name = string(2); } break; -#line 1384 "./glsl.g" +#line 1378 "./glsl.g" case 96: { sym(1).param_declarator.type = makeAstNode(type(1), expression(4)); sym(1).param_declarator.name = string(2); } break; -#line 1392 "./glsl.g" +#line 1386 "./glsl.g" case 97: { ast(1) = makeAstNode @@ -871,7 +871,7 @@ case 97: { sym(3).param_declarator.name); } break; -#line 1404 "./glsl.g" +#line 1398 "./glsl.g" case 98: { ast(1) = makeAstNode @@ -880,7 +880,7 @@ case 98: { sym(2).param_declarator.name); } break; -#line 1414 "./glsl.g" +#line 1408 "./glsl.g" case 99: { ast(1) = makeAstNode @@ -890,7 +890,7 @@ case 99: { (const QString *)0); } break; -#line 1425 "./glsl.g" +#line 1419 "./glsl.g" case 100: { ast(1) = makeAstNode @@ -898,44 +898,44 @@ case 100: { (const QString *)0); } break; -#line 1434 "./glsl.g" +#line 1428 "./glsl.g" case 101: { sym(1).qualifier = ParameterDeclarationAST::In; } break; -#line 1441 "./glsl.g" +#line 1435 "./glsl.g" case 102: { sym(1).qualifier = ParameterDeclarationAST::In; } break; -#line 1448 "./glsl.g" +#line 1442 "./glsl.g" case 103: { sym(1).qualifier = ParameterDeclarationAST::Out; } break; -#line 1455 "./glsl.g" +#line 1449 "./glsl.g" case 104: { sym(1).qualifier = ParameterDeclarationAST::InOut; } break; -#line 1462 "./glsl.g" +#line 1456 "./glsl.g" case 105: { // nothing to do. } break; -#line 1469 "./glsl.g" +#line 1463 "./glsl.g" case 106: { sym(1).declaration_list = makeAstNode< List > (sym(1).declaration); } break; -#line 1477 "./glsl.g" +#line 1471 "./glsl.g" case 107: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -944,7 +944,7 @@ case 107: { (sym(1).declaration_list, decl); } break; -#line 1487 "./glsl.g" +#line 1481 "./glsl.g" case 108: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -954,7 +954,7 @@ case 108: { (sym(1).declaration_list, decl); } break; -#line 1498 "./glsl.g" +#line 1492 "./glsl.g" case 109: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -964,7 +964,7 @@ case 109: { (sym(1).declaration_list, decl); } break; -#line 1509 "./glsl.g" +#line 1503 "./glsl.g" case 110: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -975,7 +975,7 @@ case 110: { (sym(1).declaration_list, decl); } break; -#line 1521 "./glsl.g" +#line 1515 "./glsl.g" case 111: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -986,7 +986,7 @@ case 111: { (sym(1).declaration_list, decl); } break; -#line 1533 "./glsl.g" +#line 1527 "./glsl.g" case 112: { TypeAST *type = VariableDeclarationAST::declarationType(sym(1).declaration_list); @@ -996,40 +996,40 @@ case 112: { (sym(1).declaration_list, decl); } break; -#line 1544 "./glsl.g" +#line 1538 "./glsl.g" case 113: { ast(1) = makeAstNode(type(1)); } break; -#line 1551 "./glsl.g" +#line 1545 "./glsl.g" case 114: { ast(1) = makeAstNode(type(1), string(2)); } break; -#line 1558 "./glsl.g" +#line 1552 "./glsl.g" case 115: { ast(1) = makeAstNode (makeAstNode(type(1)), string(2)); } break; -#line 1566 "./glsl.g" +#line 1560 "./glsl.g" case 116: { ast(1) = makeAstNode (makeAstNode(type(1), expression(4)), string(2)); } break; -#line 1574 "./glsl.g" +#line 1568 "./glsl.g" case 117: { ast(1) = makeAstNode (makeAstNode(type(1)), string(2), expression(6)); } break; -#line 1582 "./glsl.g" +#line 1576 "./glsl.g" case 118: { ast(1) = makeAstNode @@ -1037,26 +1037,26 @@ case 118: { string(2), expression(7)); } break; -#line 1591 "./glsl.g" +#line 1585 "./glsl.g" case 119: { ast(1) = makeAstNode (type(1), string(2), expression(4)); } break; -#line 1599 "./glsl.g" +#line 1593 "./glsl.g" case 120: { ast(1) = makeAstNode(string(2)); } break; -#line 1606 "./glsl.g" +#line 1600 "./glsl.g" case 121: { ast(1) = makeAstNode(0, type(1), (List *)0); } break; -#line 1613 "./glsl.g" +#line 1607 "./glsl.g" case 122: { ast(1) = makeAstNode @@ -1064,207 +1064,207 @@ case 122: { sym(1).type_qualifier.layout_list); } break; -#line 1622 "./glsl.g" +#line 1616 "./glsl.g" case 123: { sym(1).qualifier = QualifiedTypeAST::Invariant; } break; -#line 1629 "./glsl.g" +#line 1623 "./glsl.g" case 124: { sym(1).qualifier = QualifiedTypeAST::Smooth; } break; -#line 1636 "./glsl.g" +#line 1630 "./glsl.g" case 125: { sym(1).qualifier = QualifiedTypeAST::Flat; } break; -#line 1643 "./glsl.g" +#line 1637 "./glsl.g" case 126: { sym(1).qualifier = QualifiedTypeAST::NoPerspective; } break; -#line 1650 "./glsl.g" +#line 1644 "./glsl.g" case 127: { sym(1) = sym(3); } break; -#line 1657 "./glsl.g" +#line 1651 "./glsl.g" case 128: { sym(1).layout_list = makeAstNode< List >(sym(1).layout); } break; -#line 1664 "./glsl.g" +#line 1658 "./glsl.g" case 129: { sym(1).layout_list = makeAstNode< List >(sym(1).layout_list, sym(3).layout); } break; -#line 1671 "./glsl.g" +#line 1665 "./glsl.g" case 130: { sym(1).layout = makeAstNode(string(1), (const QString *)0); } break; -#line 1678 "./glsl.g" +#line 1672 "./glsl.g" case 131: { sym(1).layout = makeAstNode(string(1), string(3)); } break; -#line 1685 "./glsl.g" +#line 1679 "./glsl.g" case 132: { sym(1).qualifier = QualifiedTypeAST::Const; } break; -#line 1692 "./glsl.g" +#line 1686 "./glsl.g" case 133: { sym(1).type_qualifier.qualifier = sym(1).qualifier; sym(1).type_qualifier.layout_list = 0; } break; -#line 1700 "./glsl.g" +#line 1694 "./glsl.g" case 134: { sym(1).type_qualifier.layout_list = sym(1).layout_list; sym(1).type_qualifier.qualifier = 0; } break; -#line 1708 "./glsl.g" +#line 1702 "./glsl.g" case 135: { sym(1).type_qualifier.layout_list = sym(1).layout_list; sym(1).type_qualifier.qualifier = sym(2).qualifier; } break; -#line 1716 "./glsl.g" +#line 1710 "./glsl.g" case 136: { sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier; sym(1).type_qualifier.layout_list = 0; } break; -#line 1724 "./glsl.g" +#line 1718 "./glsl.g" case 137: { sym(1).type_qualifier.qualifier = sym(1).qualifier; sym(1).type_qualifier.layout_list = 0; } break; -#line 1732 "./glsl.g" +#line 1726 "./glsl.g" case 138: { sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier; sym(1).type_qualifier.layout_list = 0; } break; -#line 1740 "./glsl.g" +#line 1734 "./glsl.g" case 139: { sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier | sym(3).qualifier; sym(1).type_qualifier.layout_list = 0; } break; -#line 1748 "./glsl.g" +#line 1742 "./glsl.g" case 140: { sym(1).type_qualifier.qualifier = QualifiedTypeAST::Invariant; sym(1).type_qualifier.layout_list = 0; } break; -#line 1756 "./glsl.g" +#line 1750 "./glsl.g" case 141: { sym(1).qualifier = QualifiedTypeAST::Const; } break; -#line 1763 "./glsl.g" +#line 1757 "./glsl.g" case 142: { sym(1).qualifier = QualifiedTypeAST::Attribute; } break; -#line 1770 "./glsl.g" +#line 1764 "./glsl.g" case 143: { sym(1).qualifier = QualifiedTypeAST::Varying; } break; -#line 1777 "./glsl.g" +#line 1771 "./glsl.g" case 144: { sym(1).qualifier = QualifiedTypeAST::CentroidVarying; } break; -#line 1784 "./glsl.g" +#line 1778 "./glsl.g" case 145: { sym(1).qualifier = QualifiedTypeAST::In; } break; -#line 1791 "./glsl.g" +#line 1785 "./glsl.g" case 146: { sym(1).qualifier = QualifiedTypeAST::Out; } break; -#line 1798 "./glsl.g" +#line 1792 "./glsl.g" case 147: { sym(1).qualifier = QualifiedTypeAST::CentroidIn; } break; -#line 1805 "./glsl.g" +#line 1799 "./glsl.g" case 148: { sym(1).qualifier = QualifiedTypeAST::CentroidOut; } break; -#line 1812 "./glsl.g" +#line 1806 "./glsl.g" case 149: { sym(1).qualifier = QualifiedTypeAST::PatchIn; } break; -#line 1819 "./glsl.g" +#line 1813 "./glsl.g" case 150: { sym(1).qualifier = QualifiedTypeAST::PatchOut; } break; -#line 1826 "./glsl.g" +#line 1820 "./glsl.g" case 151: { sym(1).qualifier = QualifiedTypeAST::SampleIn; } break; -#line 1833 "./glsl.g" +#line 1827 "./glsl.g" case 152: { sym(1).qualifier = QualifiedTypeAST::SampleOut; } break; -#line 1840 "./glsl.g" +#line 1834 "./glsl.g" case 153: { sym(1).qualifier = QualifiedTypeAST::Uniform; } break; -#line 1847 "./glsl.g" +#line 1841 "./glsl.g" case 154: { // nothing to do. } break; -#line 1854 "./glsl.g" +#line 1848 "./glsl.g" case 155: { if (!type(2)->setPrecision(sym(1).precision)) { @@ -1273,595 +1273,595 @@ case 155: { ast(1) = type(2); } break; -#line 1864 "./glsl.g" +#line 1858 "./glsl.g" case 156: { // nothing to do. } break; -#line 1871 "./glsl.g" +#line 1865 "./glsl.g" case 157: { ast(1) = makeAstNode(type(1)); } break; -#line 1878 "./glsl.g" +#line 1872 "./glsl.g" case 158: { ast(1) = makeAstNode(type(1), expression(3)); } break; -#line 1885 "./glsl.g" +#line 1879 "./glsl.g" case 159: { ast(1) = makeBasicType(T_VOID); } break; -#line 1892 "./glsl.g" +#line 1886 "./glsl.g" case 160: { ast(1) = makeBasicType(T_FLOAT); } break; -#line 1899 "./glsl.g" +#line 1893 "./glsl.g" case 161: { ast(1) = makeBasicType(T_DOUBLE); } break; -#line 1906 "./glsl.g" +#line 1900 "./glsl.g" case 162: { ast(1) = makeBasicType(T_INT); } break; -#line 1913 "./glsl.g" +#line 1907 "./glsl.g" case 163: { ast(1) = makeBasicType(T_UINT); } break; -#line 1920 "./glsl.g" +#line 1914 "./glsl.g" case 164: { ast(1) = makeBasicType(T_BOOL); } break; -#line 1927 "./glsl.g" +#line 1921 "./glsl.g" case 165: { ast(1) = makeBasicType(T_VEC2); } break; -#line 1934 "./glsl.g" +#line 1928 "./glsl.g" case 166: { ast(1) = makeBasicType(T_VEC3); } break; -#line 1941 "./glsl.g" +#line 1935 "./glsl.g" case 167: { ast(1) = makeBasicType(T_VEC4); } break; -#line 1948 "./glsl.g" +#line 1942 "./glsl.g" case 168: { ast(1) = makeBasicType(T_DVEC2); } break; -#line 1955 "./glsl.g" +#line 1949 "./glsl.g" case 169: { ast(1) = makeBasicType(T_DVEC3); } break; -#line 1962 "./glsl.g" +#line 1956 "./glsl.g" case 170: { ast(1) = makeBasicType(T_DVEC4); } break; -#line 1969 "./glsl.g" +#line 1963 "./glsl.g" case 171: { ast(1) = makeBasicType(T_BVEC2); } break; -#line 1976 "./glsl.g" +#line 1970 "./glsl.g" case 172: { ast(1) = makeBasicType(T_BVEC3); } break; -#line 1983 "./glsl.g" +#line 1977 "./glsl.g" case 173: { ast(1) = makeBasicType(T_BVEC4); } break; -#line 1990 "./glsl.g" +#line 1984 "./glsl.g" case 174: { ast(1) = makeBasicType(T_IVEC2); } break; -#line 1997 "./glsl.g" +#line 1991 "./glsl.g" case 175: { ast(1) = makeBasicType(T_IVEC3); } break; -#line 2004 "./glsl.g" +#line 1998 "./glsl.g" case 176: { ast(1) = makeBasicType(T_IVEC4); } break; -#line 2011 "./glsl.g" +#line 2005 "./glsl.g" case 177: { ast(1) = makeBasicType(T_UVEC2); } break; -#line 2018 "./glsl.g" +#line 2012 "./glsl.g" case 178: { ast(1) = makeBasicType(T_UVEC3); } break; -#line 2025 "./glsl.g" +#line 2019 "./glsl.g" case 179: { ast(1) = makeBasicType(T_UVEC4); } break; -#line 2032 "./glsl.g" +#line 2026 "./glsl.g" case 180: { ast(1) = makeBasicType(T_MAT2); } break; -#line 2039 "./glsl.g" +#line 2033 "./glsl.g" case 181: { ast(1) = makeBasicType(T_MAT3); } break; -#line 2046 "./glsl.g" +#line 2040 "./glsl.g" case 182: { ast(1) = makeBasicType(T_MAT4); } break; -#line 2053 "./glsl.g" +#line 2047 "./glsl.g" case 183: { ast(1) = makeBasicType(T_MAT2); } break; -#line 2060 "./glsl.g" +#line 2054 "./glsl.g" case 184: { ast(1) = makeBasicType(T_MAT2X3); } break; -#line 2067 "./glsl.g" +#line 2061 "./glsl.g" case 185: { ast(1) = makeBasicType(T_MAT2X4); } break; -#line 2074 "./glsl.g" +#line 2068 "./glsl.g" case 186: { ast(1) = makeBasicType(T_MAT3X2); } break; -#line 2081 "./glsl.g" +#line 2075 "./glsl.g" case 187: { ast(1) = makeBasicType(T_MAT3); } break; -#line 2088 "./glsl.g" +#line 2082 "./glsl.g" case 188: { ast(1) = makeBasicType(T_MAT3X4); } break; -#line 2095 "./glsl.g" +#line 2089 "./glsl.g" case 189: { ast(1) = makeBasicType(T_MAT4X2); } break; -#line 2102 "./glsl.g" +#line 2096 "./glsl.g" case 190: { ast(1) = makeBasicType(T_MAT4X3); } break; -#line 2109 "./glsl.g" +#line 2103 "./glsl.g" case 191: { ast(1) = makeBasicType(T_MAT4); } break; -#line 2116 "./glsl.g" +#line 2110 "./glsl.g" case 192: { ast(1) = makeBasicType(T_DMAT2); } break; -#line 2123 "./glsl.g" +#line 2117 "./glsl.g" case 193: { ast(1) = makeBasicType(T_DMAT3); } break; -#line 2130 "./glsl.g" +#line 2124 "./glsl.g" case 194: { ast(1) = makeBasicType(T_DMAT4); } break; -#line 2137 "./glsl.g" +#line 2131 "./glsl.g" case 195: { ast(1) = makeBasicType(T_DMAT2); } break; -#line 2144 "./glsl.g" +#line 2138 "./glsl.g" case 196: { ast(1) = makeBasicType(T_DMAT2X3); } break; -#line 2151 "./glsl.g" +#line 2145 "./glsl.g" case 197: { ast(1) = makeBasicType(T_DMAT2X4); } break; -#line 2158 "./glsl.g" +#line 2152 "./glsl.g" case 198: { ast(1) = makeBasicType(T_DMAT3X2); } break; -#line 2165 "./glsl.g" +#line 2159 "./glsl.g" case 199: { ast(1) = makeBasicType(T_DMAT3); } break; -#line 2172 "./glsl.g" +#line 2166 "./glsl.g" case 200: { ast(1) = makeBasicType(T_DMAT3X4); } break; -#line 2179 "./glsl.g" +#line 2173 "./glsl.g" case 201: { ast(1) = makeBasicType(T_DMAT4X2); } break; -#line 2186 "./glsl.g" +#line 2180 "./glsl.g" case 202: { ast(1) = makeBasicType(T_DMAT4X3); } break; -#line 2193 "./glsl.g" +#line 2187 "./glsl.g" case 203: { ast(1) = makeBasicType(T_DMAT4); } break; -#line 2200 "./glsl.g" +#line 2194 "./glsl.g" case 204: { ast(1) = makeBasicType(T_SAMPLER1D); } break; -#line 2207 "./glsl.g" +#line 2201 "./glsl.g" case 205: { ast(1) = makeBasicType(T_SAMPLER2D); } break; -#line 2214 "./glsl.g" +#line 2208 "./glsl.g" case 206: { ast(1) = makeBasicType(T_SAMPLER3D); } break; -#line 2221 "./glsl.g" +#line 2215 "./glsl.g" case 207: { ast(1) = makeBasicType(T_SAMPLERCUBE); } break; -#line 2228 "./glsl.g" +#line 2222 "./glsl.g" case 208: { ast(1) = makeBasicType(T_SAMPLER1DSHADOW); } break; -#line 2235 "./glsl.g" +#line 2229 "./glsl.g" case 209: { ast(1) = makeBasicType(T_SAMPLER2DSHADOW); } break; -#line 2242 "./glsl.g" +#line 2236 "./glsl.g" case 210: { ast(1) = makeBasicType(T_SAMPLERCUBESHADOW); } break; -#line 2249 "./glsl.g" +#line 2243 "./glsl.g" case 211: { ast(1) = makeBasicType(T_SAMPLER1DARRAY); } break; -#line 2256 "./glsl.g" +#line 2250 "./glsl.g" case 212: { ast(1) = makeBasicType(T_SAMPLER2DARRAY); } break; -#line 2263 "./glsl.g" +#line 2257 "./glsl.g" case 213: { ast(1) = makeBasicType(T_SAMPLER1DARRAYSHADOW); } break; -#line 2270 "./glsl.g" +#line 2264 "./glsl.g" case 214: { ast(1) = makeBasicType(T_SAMPLER2DARRAYSHADOW); } break; -#line 2277 "./glsl.g" +#line 2271 "./glsl.g" case 215: { ast(1) = makeBasicType(T_SAMPLERCUBEARRAY); } break; -#line 2284 "./glsl.g" +#line 2278 "./glsl.g" case 216: { ast(1) = makeBasicType(T_SAMPLERCUBEARRAYSHADOW); } break; -#line 2291 "./glsl.g" +#line 2285 "./glsl.g" case 217: { ast(1) = makeBasicType(T_ISAMPLER1D); } break; -#line 2298 "./glsl.g" +#line 2292 "./glsl.g" case 218: { ast(1) = makeBasicType(T_ISAMPLER2D); } break; -#line 2305 "./glsl.g" +#line 2299 "./glsl.g" case 219: { ast(1) = makeBasicType(T_ISAMPLER3D); } break; -#line 2312 "./glsl.g" +#line 2306 "./glsl.g" case 220: { ast(1) = makeBasicType(T_ISAMPLERCUBE); } break; -#line 2319 "./glsl.g" +#line 2313 "./glsl.g" case 221: { ast(1) = makeBasicType(T_ISAMPLER1DARRAY); } break; -#line 2326 "./glsl.g" +#line 2320 "./glsl.g" case 222: { ast(1) = makeBasicType(T_ISAMPLER2DARRAY); } break; -#line 2333 "./glsl.g" +#line 2327 "./glsl.g" case 223: { ast(1) = makeBasicType(T_ISAMPLERCUBEARRAY); } break; -#line 2340 "./glsl.g" +#line 2334 "./glsl.g" case 224: { ast(1) = makeBasicType(T_USAMPLER1D); } break; -#line 2347 "./glsl.g" +#line 2341 "./glsl.g" case 225: { ast(1) = makeBasicType(T_USAMPLER2D); } break; -#line 2354 "./glsl.g" +#line 2348 "./glsl.g" case 226: { ast(1) = makeBasicType(T_USAMPLER3D); } break; -#line 2361 "./glsl.g" +#line 2355 "./glsl.g" case 227: { ast(1) = makeBasicType(T_USAMPLERCUBE); } break; -#line 2368 "./glsl.g" +#line 2362 "./glsl.g" case 228: { ast(1) = makeBasicType(T_USAMPLER1DARRAY); } break; -#line 2375 "./glsl.g" +#line 2369 "./glsl.g" case 229: { ast(1) = makeBasicType(T_USAMPLER2DARRAY); } break; -#line 2382 "./glsl.g" +#line 2376 "./glsl.g" case 230: { ast(1) = makeBasicType(T_USAMPLERCUBEARRAY); } break; -#line 2389 "./glsl.g" +#line 2383 "./glsl.g" case 231: { ast(1) = makeBasicType(T_SAMPLER2DRECT); } break; -#line 2396 "./glsl.g" +#line 2390 "./glsl.g" case 232: { ast(1) = makeBasicType(T_SAMPLER2DRECTSHADOW); } break; -#line 2403 "./glsl.g" +#line 2397 "./glsl.g" case 233: { ast(1) = makeBasicType(T_ISAMPLER2DRECT); } break; -#line 2410 "./glsl.g" +#line 2404 "./glsl.g" case 234: { ast(1) = makeBasicType(T_USAMPLER2DRECT); } break; -#line 2417 "./glsl.g" +#line 2411 "./glsl.g" case 235: { ast(1) = makeBasicType(T_SAMPLERBUFFER); } break; -#line 2424 "./glsl.g" +#line 2418 "./glsl.g" case 236: { ast(1) = makeBasicType(T_ISAMPLERBUFFER); } break; -#line 2431 "./glsl.g" +#line 2425 "./glsl.g" case 237: { ast(1) = makeBasicType(T_USAMPLERBUFFER); } break; -#line 2438 "./glsl.g" +#line 2432 "./glsl.g" case 238: { ast(1) = makeBasicType(T_SAMPLER2DMS); } break; -#line 2445 "./glsl.g" +#line 2439 "./glsl.g" case 239: { ast(1) = makeBasicType(T_ISAMPLER2DMS); } break; -#line 2452 "./glsl.g" +#line 2446 "./glsl.g" case 240: { ast(1) = makeBasicType(T_USAMPLER2DMS); } break; -#line 2459 "./glsl.g" +#line 2453 "./glsl.g" case 241: { ast(1) = makeBasicType(T_SAMPLER2DMSARRAY); } break; -#line 2466 "./glsl.g" +#line 2460 "./glsl.g" case 242: { ast(1) = makeBasicType(T_ISAMPLER2DMSARRAY); } break; -#line 2473 "./glsl.g" +#line 2467 "./glsl.g" case 243: { ast(1) = makeBasicType(T_USAMPLER2DMSARRAY); } break; -#line 2480 "./glsl.g" +#line 2474 "./glsl.g" case 244: { // nothing to do. } break; -#line 2487 "./glsl.g" +#line 2481 "./glsl.g" case 245: { ast(1) = makeAstNode(string(1)); } break; -#line 2494 "./glsl.g" +#line 2488 "./glsl.g" case 246: { sym(1).precision = TypeAST::Highp; } break; -#line 2501 "./glsl.g" +#line 2495 "./glsl.g" case 247: { sym(1).precision = TypeAST::Mediump; } break; -#line 2508 "./glsl.g" +#line 2502 "./glsl.g" case 248: { sym(1).precision = TypeAST::Lowp; } break; -#line 2515 "./glsl.g" +#line 2509 "./glsl.g" case 249: { ast(1) = makeAstNode(string(2), sym(4).field_list); } break; -#line 2522 "./glsl.g" +#line 2516 "./glsl.g" case 250: { ast(1) = makeAstNode(sym(3).field_list); } break; -#line 2529 "./glsl.g" +#line 2523 "./glsl.g" case 251: { // nothing to do. } break; -#line 2536 "./glsl.g" +#line 2530 "./glsl.g" case 252: { sym(1).field_list = appendLists(sym(1).field_list, sym(2).field_list); } break; -#line 2543 "./glsl.g" +#line 2537 "./glsl.g" case 253: { sym(1).field_list = StructTypeAST::fixInnerTypes(type(1), sym(2).field_list); } break; -#line 2550 "./glsl.g" +#line 2544 "./glsl.g" case 254: { sym(1).field_list = StructTypeAST::fixInnerTypes @@ -1870,106 +1870,106 @@ case 254: { sym(1).type_qualifier.layout_list), sym(3).field_list); } break; -#line 2560 "./glsl.g" +#line 2554 "./glsl.g" case 255: { // nothing to do. sym(1).field_list = makeAstNode< List >(sym(1).field); } break; -#line 2568 "./glsl.g" +#line 2562 "./glsl.g" case 256: { sym(1).field_list = makeAstNode< List >(sym(1).field_list, sym(3).field); } break; -#line 2575 "./glsl.g" +#line 2569 "./glsl.g" case 257: { sym(1).field = makeAstNode(string(1)); } break; -#line 2582 "./glsl.g" +#line 2576 "./glsl.g" case 258: { sym(1).field = makeAstNode (string(1), makeAstNode((TypeAST *)0)); } break; -#line 2590 "./glsl.g" +#line 2584 "./glsl.g" case 259: { sym(1).field = makeAstNode (string(1), makeAstNode((TypeAST *)0, expression(3))); } break; -#line 2598 "./glsl.g" +#line 2592 "./glsl.g" case 260: { // nothing to do. } break; -#line 2605 "./glsl.g" +#line 2599 "./glsl.g" case 261: { ast(1) = makeAstNode(sym(1).declaration); } break; -#line 2612 "./glsl.g" +#line 2606 "./glsl.g" case 262: { // nothing to do. } break; -#line 2619 "./glsl.g" +#line 2613 "./glsl.g" case 263: { // nothing to do. } break; -#line 2626 "./glsl.g" +#line 2620 "./glsl.g" case 264: { // nothing to do. } break; -#line 2633 "./glsl.g" +#line 2627 "./glsl.g" case 265: { // nothing to do. } break; -#line 2640 "./glsl.g" +#line 2634 "./glsl.g" case 266: { // nothing to do. } break; -#line 2647 "./glsl.g" +#line 2641 "./glsl.g" case 267: { // nothing to do. } break; -#line 2654 "./glsl.g" +#line 2648 "./glsl.g" case 268: { // nothing to do. } break; -#line 2661 "./glsl.g" +#line 2655 "./glsl.g" case 269: { // nothing to do. } break; -#line 2668 "./glsl.g" +#line 2662 "./glsl.g" case 270: { // nothing to do. } break; -#line 2675 "./glsl.g" +#line 2669 "./glsl.g" case 271: { CompoundStatementAST *stmt = makeAstNode(); @@ -1978,7 +1978,7 @@ case 271: { ast(1) = stmt; } break; -#line 2685 "./glsl.g" +#line 2679 "./glsl.g" case 272: { CompoundStatementAST *stmt = makeAstNode(sym(2).statement_list); @@ -1987,19 +1987,19 @@ case 272: { ast(1) = stmt; } break; -#line 2695 "./glsl.g" +#line 2689 "./glsl.g" case 273: { // nothing to do. } break; -#line 2702 "./glsl.g" +#line 2696 "./glsl.g" case 274: { // nothing to do. } break; -#line 2709 "./glsl.g" +#line 2703 "./glsl.g" case 275: { CompoundStatementAST *stmt = makeAstNode(); @@ -2008,7 +2008,7 @@ case 275: { ast(1) = stmt; } break; -#line 2719 "./glsl.g" +#line 2713 "./glsl.g" case 276: { CompoundStatementAST *stmt = makeAstNode(sym(2).statement_list); @@ -2017,186 +2017,186 @@ case 276: { ast(1) = stmt; } break; -#line 2729 "./glsl.g" +#line 2723 "./glsl.g" case 277: { sym(1).statement_list = makeAstNode< List >(sym(1).statement); } break; -#line 2736 "./glsl.g" +#line 2730 "./glsl.g" case 278: { sym(1).statement_list = makeAstNode< List >(sym(1).statement_list, sym(2).statement); } break; -#line 2743 "./glsl.g" +#line 2737 "./glsl.g" case 279: { ast(1) = makeAstNode(); // Empty statement } break; -#line 2750 "./glsl.g" +#line 2744 "./glsl.g" case 280: { ast(1) = makeAstNode(expression(1)); } break; -#line 2757 "./glsl.g" +#line 2751 "./glsl.g" case 281: { ast(1) = makeAstNode(expression(3), sym(5).ifstmt.thenClause, sym(5).ifstmt.elseClause); } break; -#line 2764 "./glsl.g" +#line 2758 "./glsl.g" case 282: { sym(1).ifstmt.thenClause = statement(1); sym(1).ifstmt.elseClause = statement(3); } break; -#line 2772 "./glsl.g" +#line 2766 "./glsl.g" case 283: { sym(1).ifstmt.thenClause = statement(1); sym(1).ifstmt.elseClause = 0; } break; -#line 2780 "./glsl.g" +#line 2774 "./glsl.g" case 284: { // nothing to do. } break; -#line 2787 "./glsl.g" +#line 2781 "./glsl.g" case 285: { ast(1) = makeAstNode (type(1), string(2), expression(4)); } break; -#line 2795 "./glsl.g" +#line 2789 "./glsl.g" case 286: { ast(1) = makeAstNode(expression(3), statement(6)); } break; -#line 2802 "./glsl.g" +#line 2796 "./glsl.g" case 287: { ast(1) = makeAstNode(); } break; -#line 2809 "./glsl.g" +#line 2803 "./glsl.g" case 288: { ast(1) = makeAstNode(sym(1).statement_list); } break; -#line 2816 "./glsl.g" +#line 2810 "./glsl.g" case 289: { ast(1) = makeAstNode(expression(2)); } break; -#line 2823 "./glsl.g" +#line 2817 "./glsl.g" case 290: { ast(1) = makeAstNode(); } break; -#line 2830 "./glsl.g" +#line 2824 "./glsl.g" case 291: { ast(1) = makeAstNode(expression(3), statement(5)); } break; -#line 2837 "./glsl.g" +#line 2831 "./glsl.g" case 292: { ast(1) = makeAstNode(statement(2), expression(5)); } break; -#line 2844 "./glsl.g" +#line 2838 "./glsl.g" case 293: { ast(1) = makeAstNode(statement(3), sym(4).forstmt.condition, sym(4).forstmt.increment, statement(6)); } break; -#line 2851 "./glsl.g" +#line 2845 "./glsl.g" case 294: { // nothing to do. } break; -#line 2858 "./glsl.g" +#line 2852 "./glsl.g" case 295: { // nothing to do. } break; -#line 2865 "./glsl.g" +#line 2859 "./glsl.g" case 296: { // nothing to do. } break; -#line 2872 "./glsl.g" +#line 2866 "./glsl.g" case 297: { // nothing to do. } break; -#line 2879 "./glsl.g" +#line 2873 "./glsl.g" case 298: { sym(1).forstmt.condition = expression(1); sym(1).forstmt.increment = 0; } break; -#line 2887 "./glsl.g" +#line 2881 "./glsl.g" case 299: { sym(1).forstmt.condition = expression(1); sym(1).forstmt.increment = expression(3); } break; -#line 2895 "./glsl.g" +#line 2889 "./glsl.g" case 300: { ast(1) = makeAstNode(AST::Kind_Continue); } break; -#line 2902 "./glsl.g" +#line 2896 "./glsl.g" case 301: { ast(1) = makeAstNode(AST::Kind_Break); } break; -#line 2909 "./glsl.g" +#line 2903 "./glsl.g" case 302: { ast(1) = makeAstNode(); } break; -#line 2916 "./glsl.g" +#line 2910 "./glsl.g" case 303: { ast(1) = makeAstNode(expression(2)); } break; -#line 2923 "./glsl.g" +#line 2917 "./glsl.g" case 304: { ast(1) = makeAstNode(AST::Kind_Discard); } break; -#line 2930 "./glsl.g" +#line 2924 "./glsl.g" case 305: { ast(1) = makeAstNode(sym(1).declaration_list); } break; -#line 2937 "./glsl.g" +#line 2931 "./glsl.g" case 306: { if (sym(1).declaration) { @@ -2207,7 +2207,7 @@ case 306: { } } break; -#line 2949 "./glsl.g" +#line 2943 "./glsl.g" case 307: { if (sym(1).declaration_list && sym(2).declaration) { @@ -2223,49 +2223,49 @@ case 307: { } } break; -#line 2966 "./glsl.g" +#line 2960 "./glsl.g" case 308: { // nothing to do. } break; -#line 2973 "./glsl.g" +#line 2967 "./glsl.g" case 309: { // nothing to do. } break; -#line 2980 "./glsl.g" +#line 2974 "./glsl.g" case 310: { ast(1) = 0; } break; -#line 2987 "./glsl.g" +#line 2981 "./glsl.g" case 311: { function(1)->body = statement(2); } break; -#line 2994 "./glsl.g" +#line 2988 "./glsl.g" case 312: { ast(1) = 0; } break; -#line 3002 "./glsl.g" +#line 2996 "./glsl.g" case 313: { ast(1) = ast(2); } break; -#line 3009 "./glsl.g" +#line 3003 "./glsl.g" case 314: { ast(1) = ast(2); } break; -#line 3015 "./glsl.g" +#line 3009 "./glsl.g" } // end switch } // end Parser::reduce() diff --git a/src/libs/glsl/glslparser.h b/src/libs/glsl/glslparser.h index 7bf70e24f82..bab2616954b 100644 --- a/src/libs/glsl/glslparser.h +++ b/src/libs/glsl/glslparser.h @@ -1,5 +1,5 @@ -#line 217 "./glsl.g" +#line 215 "./glsl.g" /************************************************************************** ** diff --git a/src/libs/glsl/glslsemantic.cpp b/src/libs/glsl/glslsemantic.cpp index d2200593da8..80afd402e9d 100644 --- a/src/libs/glsl/glslsemantic.cpp +++ b/src/libs/glsl/glslsemantic.cpp @@ -811,6 +811,9 @@ bool Semantic::visit(ParameterDeclarationAST *ast) bool Semantic::visit(VariableDeclarationAST *ast) { + if (!ast->type) + return false; + const Type *ty = type(ast->type); ExprResult initializer = expression(ast->initializer); if (ast->name) { diff --git a/src/plugins/git/gerrit/gerritdialog.cpp b/src/plugins/git/gerrit/gerritdialog.cpp index 49f02d1805e..136a30a98e5 100644 --- a/src/plugins/git/gerrit/gerritdialog.cpp +++ b/src/plugins/git/gerrit/gerritdialog.cpp @@ -142,6 +142,7 @@ GerritDialog::GerritDialog(const QSharedPointer &p, m_treeView->setUniformRowHeights(true); m_treeView->setRootIsDecorated(false); m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); + m_treeView->setSortingEnabled(true); QItemSelectionModel *selectionModel = m_treeView->selectionModel(); connect(selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), @@ -245,6 +246,7 @@ void GerritDialog::slotRefresh() const QString &query = m_queryLineEdit->text().trimmed(); updateCompletions(query); m_model->refresh(query); + m_treeView->sortByColumn(-1); } const QStandardItem *GerritDialog::itemAt(const QModelIndex &i, int column) const diff --git a/src/plugins/projectexplorer/profile.cpp b/src/plugins/projectexplorer/profile.cpp index 934038dd90e..867282ca723 100644 --- a/src/plugins/projectexplorer/profile.cpp +++ b/src/plugins/projectexplorer/profile.cpp @@ -101,11 +101,14 @@ Profile::~Profile() delete d; } -Profile *Profile::clone() const +Profile *Profile::clone(bool keepName) const { Profile *p = new Profile; - p->d->m_displayName = QCoreApplication::translate("ProjectExplorer::Profile", "Clone of %1") - .arg(d->m_displayName); + if (keepName) + p->d->m_displayName = d->m_displayName; + else + p->d->m_displayName = QCoreApplication::translate("ProjectExplorer::Profile", "Clone of %1") + .arg(d->m_displayName); p->d->m_autodetected = false; p->d->m_data = d->m_data; p->d->m_isValid = d->m_isValid; @@ -133,20 +136,45 @@ QString Profile::displayName() const return d->m_displayName; } +static QString candidateName(const QString &name, const QString &postfix) +{ + if (name.contains(postfix)) + return QString(); + return name + QLatin1Char('-') + postfix; +} + void Profile::setDisplayName(const QString &name) { - // make name unique: + ProfileManager *pm = ProfileManager::instance(); + QList profileInfo = pm->profileInformation(); + QStringList nameList; - foreach (Profile *p, ProfileManager::instance()->profiles()) + foreach (Profile *p, pm->profiles()) { nameList << p->displayName(); + foreach (ProfileInformation *pi, profileInfo) { + const QString postfix = pi->displayNamePostfix(p); + if (!postfix.isEmpty()) + nameList << candidateName(p->displayName(), postfix); + } + } + + QStringList candidateNames; + candidateNames << name; + + foreach (ProfileInformation *pi, profileInfo) { + const QString postfix = pi->displayNamePostfix(this); + if (!postfix.isEmpty()) + candidateNames << candidateName(name, postfix); + } QString uniqueName = Project::makeUnique(name, nameList); if (uniqueName != name) { - ToolChain *tc = ToolChainProfileInformation::toolChain(this); - if (tc) { - const QString tcPostfix = QString::fromLatin1("-%1").arg(tc->displayName()); - if (!name.contains(tcPostfix)) - uniqueName = Project::makeUnique(name + tcPostfix, nameList); + foreach (const QString &candidate, candidateNames) { + const QString tmp = Project::makeUnique(candidate, nameList); + if (tmp == candidate) { + uniqueName = tmp; + break; + } } } diff --git a/src/plugins/projectexplorer/profile.h b/src/plugins/projectexplorer/profile.h index 88d619dc616..4db326dbdfb 100644 --- a/src/plugins/projectexplorer/profile.h +++ b/src/plugins/projectexplorer/profile.h @@ -82,7 +82,7 @@ public: void addToEnvironment(Utils::Environment &env) const; QString toHtml(); - Profile *clone() const; + Profile *clone(bool keepName = false) const; private: // Unimplemented. diff --git a/src/plugins/projectexplorer/profileinformation.cpp b/src/plugins/projectexplorer/profileinformation.cpp index c75f265a9aa..29a90d8811e 100644 --- a/src/plugins/projectexplorer/profileinformation.cpp +++ b/src/plugins/projectexplorer/profileinformation.cpp @@ -178,6 +178,12 @@ ProfileConfigWidget *ToolChainProfileInformation::createConfigWidget(Profile *p) return new Internal::ToolChainInformationConfigWidget(p); } +QString ToolChainProfileInformation::displayNamePostfix(const Profile *p) const +{ + ToolChain *tc = toolChain(p); + return tc ? tc->displayName() : QString(); +} + ProfileInformation::ItemList ToolChainProfileInformation::toUserOutput(Profile *p) const { ToolChain *tc = toolChain(p); @@ -327,6 +333,12 @@ ProfileConfigWidget *DeviceProfileInformation::createConfigWidget(Profile *p) co return new Internal::DeviceInformationConfigWidget(p); } +QString DeviceProfileInformation::displayNamePostfix(const Profile *p) const +{ + IDevice::ConstPtr dev = device(p); + return dev.isNull() ? QString() : dev->displayName(); +} + ProfileInformation::ItemList DeviceProfileInformation::toUserOutput(Profile *p) const { IDevice::ConstPtr dev = device(p); diff --git a/src/plugins/projectexplorer/profileinformation.h b/src/plugins/projectexplorer/profileinformation.h index 24485b33e69..641743924f7 100644 --- a/src/plugins/projectexplorer/profileinformation.h +++ b/src/plugins/projectexplorer/profileinformation.h @@ -107,6 +107,8 @@ public: ProfileConfigWidget *createConfigWidget(Profile *p) const; + QString displayNamePostfix(const Profile *p) const; + ItemList toUserOutput(Profile *p) const; void addToEnvironment(const Profile *p, Utils::Environment &env) const; @@ -196,6 +198,8 @@ public: ProfileConfigWidget *createConfigWidget(Profile *p) const; + QString displayNamePostfix(const Profile *p) const; + ItemList toUserOutput(Profile *p) const; static IDevice::ConstPtr device(const Profile *p); diff --git a/src/plugins/projectexplorer/profilemanager.cpp b/src/plugins/projectexplorer/profilemanager.cpp index dcfe0e9bfc2..2c2ad231e68 100644 --- a/src/plugins/projectexplorer/profilemanager.cpp +++ b/src/plugins/projectexplorer/profilemanager.cpp @@ -452,6 +452,7 @@ void ProfileManager::addProfile(Profile *p) { if (!p) return; + p->setDisplayName(p->displayName()); // make name unique d->validateProfile(p); d->m_profileList.append(p); if (!d->m_defaultProfile || @@ -466,4 +467,10 @@ void ProfileInformation::addToEnvironment(const Profile *p, Utils::Environment & Q_UNUSED(env); } +QString ProfileInformation::displayNamePostfix(const Profile *p) const +{ + Q_UNUSED(p); + return QString(); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/profilemanager.h b/src/plugins/projectexplorer/profilemanager.h index 1132f80b836..48da926dc6a 100644 --- a/src/plugins/projectexplorer/profilemanager.h +++ b/src/plugins/projectexplorer/profilemanager.h @@ -82,6 +82,8 @@ public: virtual void addToEnvironment(const Profile *p, Utils::Environment &env) const; + virtual QString displayNamePostfix(const Profile *p) const; + signals: void validationNeeded(); }; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index f1cadcbc513..8e84ccc54cd 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -294,7 +294,7 @@ void ProjectWindow::handleProfilesChanges() int index = m_tabWidget->currentIndex(); QList projects = m_tabIndexToProject; foreach (ProjectExplorer::Project *project, projects) { - if (m_usesTargetPage.value(project) != useTargetPage(project)) { + if (m_hasTarget.value(project) != hasTarget(project)) { changed = true; deregisterProject(project); registerProject(project); @@ -304,21 +304,9 @@ void ProjectWindow::handleProfilesChanges() m_tabWidget->setCurrentIndex(index); } -bool ProjectWindow::useTargetPage(ProjectExplorer::Project *project) +bool ProjectWindow::hasTarget(ProjectExplorer::Project *project) { - if (project->targets().isEmpty()) - return false; - if (project->targets().size() > 1) - return true; - int count = 0; - QList profiles = ProfileManager::instance()->profiles(); - foreach (Profile *p, profiles) { - if (project->supportsProfile(p)) - ++count; - if (count > 1) - return true; - } - return false; + return !project->targets().isEmpty(); } void ProjectWindow::registerProject(ProjectExplorer::Project *project) @@ -338,25 +326,11 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project) QStringList subtabs; - bool usesTargetPage = useTargetPage(project); - m_usesTargetPage.insert(project, usesTargetPage); + bool projectHasTarget = hasTarget(project); + m_hasTarget.insert(project, projectHasTarget); - if (!usesTargetPage){ - // Show the target specific pages directly - if (project->activeTarget()) { - QList factories = - ExtensionSystem::PluginManager::getObjects(); - - qSort(factories.begin(), factories.end(), &IPanelFactory::prioritySort); - - foreach (ITargetPanelFactory *factory, factories) - if (factory->supports(project->activeTarget())) - subtabs << factory->displayName(); - } - } else { - // Use the Targets page + if (projectHasTarget) // Use the Targets page subtabs << QCoreApplication::translate("TargetSettingsPanelFactory", "Targets"); - } // Add the project specific pages QList factories = ExtensionSystem::PluginManager::getObjects(); @@ -410,7 +384,7 @@ void ProjectWindow::showProperties(int index, int subIndex) m_previousTargetSubIndex = previousPanelWidget->currentSubIndex(); } - if (m_usesTargetPage.value(project)) { + if (m_hasTarget.value(project)) { if (subIndex == 0) { // Targets page removeCurrentWidget(); @@ -422,32 +396,17 @@ void ProjectWindow::showProperties(int index, int subIndex) m_centralWidget->setCurrentWidget(m_currentWidget); } ++pos; - } else if (project->activeTarget()) { - // No Targets page, target specific pages are first in the list - QList factories = ExtensionSystem::PluginManager::getObjects(); - qSort(factories.begin(), factories.end(), &ITargetPanelFactory::prioritySort); - foreach (ITargetPanelFactory *panelFactory, factories) { - if (panelFactory->supports(project->activeTarget())) { - if (subIndex == pos) { - fac = panelFactory; - break; - } - ++pos; - } - } } - if (!fac) { - QList factories = ExtensionSystem::PluginManager::getObjects(); - qSort(factories.begin(), factories.end(), &IPanelFactory::prioritySort); - foreach (IProjectPanelFactory *panelFactory, factories) { - if (panelFactory->supports(project)) { - if (subIndex == pos) { - fac = panelFactory; - break; - } - ++pos; + QList factories = ExtensionSystem::PluginManager::getObjects(); + qSort(factories.begin(), factories.end(), &IPanelFactory::prioritySort); + foreach (IProjectPanelFactory *panelFactory, factories) { + if (panelFactory->supports(project)) { + if (subIndex == pos) { + fac = panelFactory; + break; } + ++pos; } } diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index 2028f597c32..6fa3d5d19b0 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -93,14 +93,14 @@ private slots: void removedTarget(ProjectExplorer::Target*); private: - bool useTargetPage(ProjectExplorer::Project *project); + bool hasTarget(ProjectExplorer::Project *project); void removeCurrentWidget(); DoubleTabWidget *m_tabWidget; QStackedWidget *m_centralWidget; QWidget *m_currentWidget; QList m_tabIndexToProject; - QMap m_usesTargetPage; + QMap m_hasTarget; int m_previousTargetSubIndex; }; diff --git a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp index 2eef2b43548..6725cd3bcee 100644 --- a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp +++ b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp @@ -152,20 +152,20 @@ void TargetSetupPageWrapper::updateNoteText() text = tr("

The project %1 is not yet configured.

" "

Qt Creator cannot parse the project, because no target " "has been set up. You can set up targets " - "in the settings.

") + "in the options.

") .arg(m_project->displayName()); else if (p->isValid()) text = tr("

The project %1 is not yet configured.

" - "

Qt Creator uses the target: %2 " + "

Qt Creator uses the target %2 " "to parse the project. You can edit " - "these in the settings.

") + "targets in the options.

") .arg(m_project->displayName()) .arg(p->displayName()); else text = tr("

The project %1 is not yet configured.

" - "

Qt Creator uses the invalid target: %2 " + "

Qt Creator uses the invalid target %2 " "to parse the project. You can edit " - "these in the settings

") + "targets in the options

") .arg(m_project->displayName()) .arg(p->displayName()); diff --git a/src/plugins/qtsupport/qtprofileinformation.cpp b/src/plugins/qtsupport/qtprofileinformation.cpp index 84b7409bf32..a6d1db6b11c 100644 --- a/src/plugins/qtsupport/qtprofileinformation.cpp +++ b/src/plugins/qtsupport/qtprofileinformation.cpp @@ -98,6 +98,12 @@ QtProfileInformation::createConfigWidget(ProjectExplorer::Profile *p) const return new Internal::QtProfileConfigWidget(p); } +QString QtProfileInformation::displayNamePostfix(const ProjectExplorer::Profile *p) const +{ + BaseQtVersion *version = qtVersion(p); + return version ? version->displayName() : QString(); +} + ProjectExplorer::ProfileInformation::ItemList QtProfileInformation::toUserOutput(ProjectExplorer::Profile *p) const { diff --git a/src/plugins/qtsupport/qtprofileinformation.h b/src/plugins/qtsupport/qtprofileinformation.h index e5369c710d5..9b3c65241e8 100644 --- a/src/plugins/qtsupport/qtprofileinformation.h +++ b/src/plugins/qtsupport/qtprofileinformation.h @@ -56,6 +56,8 @@ public: ProjectExplorer::ProfileConfigWidget *createConfigWidget(ProjectExplorer::Profile *p) const; + QString displayNamePostfix(const ProjectExplorer::Profile *p) const; + ItemList toUserOutput(ProjectExplorer::Profile *p) const; void addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const; diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 363f50900fb..c870147fdb8 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -120,7 +120,6 @@ private: AssistKind m_assistKind; IAssistProposalWidget *m_proposalWidget; QScopedPointer m_proposal; - bool m_proposalApplied; bool m_receivedContentWhileWaiting; QTimer m_automaticProposalTimer; CompletionSettings m_settings; @@ -140,7 +139,6 @@ CodeAssistantPrivate::CodeAssistantPrivate(CodeAssistant *assistant) , m_requestRunner(0) , m_requestProvider(0) , m_proposalWidget(0) - , m_proposalApplied(false) , m_receivedContentWhileWaiting(false) , m_settings(TextEditorSettings::instance()->completionSettings()) { diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 0f4af0d3944..3b52de6c4de 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -127,6 +127,16 @@ public: ProKey(const QString &str, int off, int len, uint hash); void setValue(const QString &str); +#ifdef Q_CC_MSVC + // Workaround strange MSVC behaviour when exporting classes with ProKey members. + ALWAYS_INLINE ProKey(const ProKey &other) : ProString(other.toString()) {} + ALWAYS_INLINE ProKey &operator=(const ProKey &other) + { + toString() = other.toString(); + return *this; + } +#endif + ALWAYS_INLINE ProString &toString() { return *(ProString *)this; } ALWAYS_INLINE const ProString &toString() const { return *(const ProString *)this; } diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index c9c5a79b465..120eb8ac29e 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -1096,7 +1096,7 @@ bool QMakeEvaluator::loadSpec() // We can't resolve symlinks as they do on Unix, so configure.exe puts // the source of the qmake.conf at the end of the default/qmake.conf in // the QMAKESPEC_ORIGINAL variable. - const ProString &orig_spec = first(ProString("QMAKESPEC_ORIGINAL")); + const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL")); m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString(); #endif valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull); diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index af26d291580..ae6f83708ce 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -306,7 +306,7 @@ protected: static QString simplified(QByteArray buf); private: - void compare_input_output(); + void compare_input_output(bool keepComments = false); private slots: void va_args(); @@ -332,6 +332,8 @@ private slots: void comparisons(); void comments_within(); void comments_within_data(); + void comments_within2(); + void comments_within2_data(); void multitokens_argument(); void multitokens_argument_data(); }; @@ -1179,13 +1181,131 @@ void tst_Preprocessor::comments_within_data() QTest::newRow("case 4") << original << expected; } -void tst_Preprocessor::compare_input_output() +void tst_Preprocessor::comments_within2() +{ + compare_input_output(true); +} + +void tst_Preprocessor::comments_within2_data() +{ + QTest::addColumn("input"); + QTest::addColumn("output"); + + QByteArray original; + QByteArray expected; + + original = "#define FOO int x;\n" + "\n" + " // comment\n" + " // comment\n" + " // comment\n" + " // comment\n" + "FOO\n" + "x = 10\n"; + expected = + "# 1 \"\"\n" + "\n" + "\n" + " // comment\n" + " // comment\n" + " // comment\n" + " // comment\n" + "# expansion begin 76,3 ~3\n" + "int x;\n" + "# expansion end\n" + "# 8 \"\"\n" + "x = 10\n"; + QTest::newRow("case 1") << original << expected; + + + original = "#define FOO int x;\n" + "\n" + " /* comment\n" + " comment\n" + " comment\n" + " comment */\n" + "FOO\n" + "x = 10\n"; + expected = + "# 1 \"\"\n" + "\n" + "\n" + " /* comment\n" + " comment\n" + " comment\n" + " comment */\n" + "# expansion begin 79,3 ~3\n" + "int x;\n" + "# expansion end\n" + "# 8 \"\"\n" + "x = 10\n"; + QTest::newRow("case 2") << original << expected; + + + original = "#define FOO int x;\n" + "\n" + " // comment\n" + " // comment\n" + " // comment\n" + " // comment\n" + "FOO\n" + "// test\n" + "// test again\n" + "x = 10\n"; + expected = + "# 1 \"\"\n" + "\n" + "\n" + " // comment\n" + " // comment\n" + " // comment\n" + " // comment\n" + "# expansion begin 76,3 ~3\n" + "int x;\n" + "# expansion end\n" + "# 8 \"\"\n" + "// test\n" + "// test again\n" + "x = 10\n"; + QTest::newRow("case 3") << original << expected; + + + original = "#define FOO int x;\n" + "\n" + "void foo() { /* comment\n" + " comment\n" + " comment\n" + " comment */\n" + "FOO\n" + "/* \n" + "*/\n" + "x = 10\n"; + expected = + "# 1 \"\"\n" + "\n" + "\n" + "void foo() { /* comment\n" + " comment\n" + " comment\n" + " comment */\n" + "# expansion begin 91,3 ~3\n" + "int x;\n" + "# expansion end\n" + "# 8 \"\"\n" + "/* \n" + "*/\n" + "x = 10\n"; + QTest::newRow("case 4") << original << expected; +} + +void tst_Preprocessor::compare_input_output(bool keepComments) { QFETCH(QByteArray, input); QFETCH(QByteArray, output); Environment env; Preprocessor preprocess(0, &env); + preprocess.setKeepComments(keepComments); QByteArray prep = preprocess.run(QLatin1String(""), input); QCOMPARE(output, prep); } diff --git a/tests/system/objects.map b/tests/system/objects.map index d3f3627dcff..c8df65ecf5a 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -20,6 +20,7 @@ :Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Continue' type='QToolButton' unnamed='1' visible='1'} :Debugger Toolbar.Exit Debugger_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Stop Debugger' type='QToolButton' unnamed='1' visible='1'} :Debugger Toolbar.StatusText_Utils::StatusLabel {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' type='Utils::StatusLabel' unnamed='1'} +:Edit Environment_ProjectExplorer::EnvironmentItemsDialog {type='ProjectExplorer::EnvironmentItemsDialog' unnamed='1' visible='1' windowTitle='Edit Environment'} :Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'} :Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'} :New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'} @@ -45,6 +46,7 @@ :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} @@ -61,16 +63,13 @@ :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='QtSupport__Internal__QtVersionManager' type='QtSupport::Internal::QtOptionsPageWidget' visible='1'} :scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'} -:scrollArea.Details_Utils::DetailsButton {container=':Qt Creator.scrollArea_QScrollArea' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1'} +:scrollArea.Details_Utils::DetailsButton {text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'} -:scrollArea.Library not available_QLabel {container=':Qt Creator.scrollArea_QScrollArea' name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1'} +:scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' occurrence='1' text='Debug' type='QCheckBox' unnamed='1' visible='1'} :scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' occurrence='1' text='Release' type='QCheckBox' unnamed='1' visible='1'} -:scrollArea.Qt Version:_QComboBox {aboveWidget=':scrollArea.Use Shadow Building_QCheckBox' container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Qt Version:_QLabel' type='QComboBox' unnamed='1' visible='1'} -:scrollArea.Qt Version:_QLabel {container=':Qt Gui Application.scrollArea_QScrollArea' text='Qt Version:' type='QLabel' unnamed='1' visible='1'} :scrollArea.Use Shadow Building_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Shadow build' type='QCheckBox' unnamed='1' visible='1'} -:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1'} -:scrollArea.qtVersionComboBox_QComboBox {container=':Qt Creator.scrollArea_QScrollArea' name='qtVersionComboBox' type='QComboBox' visible='1'} -:scrollArea_QTableView {container=':Qt Creator.scrollArea_QScrollArea' type='QTableView' unnamed='1' visible='1'} +:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:scrollArea_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index b5931194659..672c7ff4b63 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -168,18 +168,17 @@ def selectBuildConfig(targetCount, currentTarget, configName): def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableShadowBuild=False, enableQmlDebug=False): switchViewTo(ViewConstants.PROJECTS) switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD) - detailsButton = waitForObject(":scrollArea.Details_Utils::DetailsButton") - ensureChecked(detailsButton) + ensureChecked(waitForObject(":scrollArea.Details_Utils::DetailsButton")) ensureChecked("{name='shadowBuildCheckBox' type='QCheckBox' visible='1'}", enableShadowBuild) buildCfCombo = waitForObject("{type='QComboBox' name='buildConfigurationComboBox' visible='1' " - "container=':Qt Creator.scrollArea_QScrollArea'}") + "window=':Qt Creator_Core::Internal::MainWindow'}") if shouldBeDebug: test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build") else: test.compare(buildCfCombo.currentText, 'Release', "Verifying whether it's a release build") try: libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000) - mouseClick(libLabel, libLabel.width - 5, 5, 0, Qt.LeftButton) + mouseClick(libLabel, libLabel.width - 10, libLabel.height / 2, 0, Qt.LeftButton) except: pass # Since waitForObject waits for the object to be enabled, @@ -190,11 +189,11 @@ def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableSha # Don't rebuild now clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) try: - problemFound = waitForObject("{container=':Qt Creator.scrollArea_QScrollArea' type='QLabel' " - "name='problemLabel' visible='1'}", 1000) + problemFound = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' " + "type='QLabel' name='problemLabel' visible='1'}", 1000) if problemFound: test.warning('%s' % problemFound.text) except: pass - clickButton(detailsButton) + clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton")) switchViewTo(ViewConstants.EDIT) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 5957ac610fe..f981982bbe5 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -122,3 +122,7 @@ class SubprocessType: test.fatal("Could not determine the WindowType for SubprocessType %s" % subprocessType) return None +class QtInformation: + QT_VERSION = 0 + QT_BINPATH = 1 + QT_LIBPATH = 2 diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py index 8b7551f0b31..cd73dfaaa3a 100644 --- a/tests/system/shared/hook_utils.py +++ b/tests/system/shared/hook_utils.py @@ -9,44 +9,49 @@ def modifyRunSettingsForHookInto(projectName, port): # this uses the defaultQtVersion currently switchViewTo(ViewConstants.PROJECTS) switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.BUILD) - qtVersionTT = str(waitForObject("{type='QComboBox' name='qtVersionComboBox' visible='1'}").toolTip) - mkspec = __getMkspec__(qtVersionTT) - qmakeVersion = __getQMakeVersion__(qtVersionTT) - qmakeLibPath = __getQMakeLibPath__(qtVersionTT) - qmakeBinPath = __getQMakeBinPath__(qtVersionTT) + qtVersion, mkspec, qtBinPath, qtLibPath = getQtInformationForBuildSettings(True) + if None in (qtVersion, mkspec, qtBinPath, qtLibPath): + test.fatal("At least one of the Qt information returned None - leaving...", + "Qt version: %s, mkspec: %s, Qt BinPath: %s, Qt LibPath: %s" % + (qtVersion, mkspec, qtBinPath, qtLibPath)) + return False + qtVersion = ".".join(qtVersion.split(".")[:2]) switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.RUN) - result = __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion) + result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion) if result: - clickButton(waitForObject("{container=':Qt Creator.scrollArea_QScrollArea' text='Details' " + clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' " "type='Utils::DetailsButton' unnamed='1' visible='1' " "leftWidget={type='QLabel' text~='Us(e|ing) Build Environment' unnamed='1' visible='1'}}")) envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}") model = envVarsTableView.model() + changingVars = [] for row in range(model.rowCount()): # get var name index = model.index(row, 0) envVarsTableView.scrollTo(index) varName = str(model.data(index).toString()) - # if its a special SQUISH var simply unset it + # if its a special SQUISH var simply unset it, SQUISH_LIBQTDIR and PATH will be replaced with Qt paths if varName == "PATH": - currentItem = __doubleClickQTableView__(":scrollArea_QTableView", row, 1) - test.log("replacing PATH with '%s'" % qmakeBinPath) - replaceEditorContent(currentItem, qmakeBinPath) + test.log("Replacing PATH with '%s'" % qtBinPath) + changingVars.append("PATH=%s" % qtBinPath) elif varName.find("SQUISH") == 0: if varName == "SQUISH_LIBQTDIR": - currentItem = __doubleClickQTableView__(":scrollArea_QTableView", row, 1) if platform.system() in ('Microsoft', 'Windows'): - replacement = qmakeBinPath + replacement = qtBinPath else: - replacement = qmakeLibPath - test.log("Changing SQUISH_LIBQTDIR", - "Replacing '%s' with '%s'" % (currentItem.text, replacement)) - replaceEditorContent(currentItem, replacement) + replacement = qtLibPath + test.log("Replacing SQUISH_LIBQTDIR with '%s'" % replacement) + changingVars.append("SQUISH_LIBQTDIR=%s" % replacement) else: - mouseClick(waitForObject("{container=':scrollArea_QTableView' " - "type='QModelIndex' row='%d' column='1'}" % row), 5, 5, 0, Qt.LeftButton) - clickButton(waitForObject("{type='QPushButton' text='Unset' unnamed='1' visible='1'}")) + changingVars.append(varName) #test.log("Unsetting %s for run" % varName) + clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}")) + editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' " + "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}") + typeLines(editor, changingVars) + clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' " + "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")) switchViewTo(ViewConstants.EDIT) return result @@ -214,17 +219,17 @@ def __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion): test.warning("Configured Squish directory seems to be missing - using fallback without hooking into subprocess.", "Failed to find '%s'" % startAUT) return False - addButton = waitForObject("{container=':Qt Creator.scrollArea_QScrollArea' occurrence='2' text='Add' type='QPushButton' unnamed='1' visible='1'}") + addButton = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' occurrence='2' text='Add' type='QPushButton' unnamed='1' visible='1'}") clickButton(addButton) addMenu = addButton.menu() activateItem(waitForObjectItem(objectMap.realName(addMenu), 'Custom Executable')) - exePathChooser = waitForObject("{buddy={container=':Qt Creator.scrollArea_QScrollArea' text='Command:' type='QLabel'} " + exePathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' text='Command:' type='QLabel' unnamed='1' visible='1'} " "type='Utils::PathChooser' unnamed='1' visible='1'}", 2000) exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit") - argLineEd = waitForObject("{buddy={container={type='QScrollArea' name='scrollArea'} " + argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " "type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' " "unnamed='1' visible='1'}") - wdPathChooser = waitForObject("{buddy={container=':Qt Creator.scrollArea_QScrollArea' text='Working directory:' type='QLabel'} " + wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' text='Working directory:' type='QLabel'} " "type='Utils::PathChooser' unnamed='1' visible='1'}") replaceEditorContent(exeLineEd, startAUT) # the following is currently only configured for release builds (will be enhanced later) @@ -246,40 +251,6 @@ def getChildByClass(parent, classToSearchFor, occurence=1): else: return children[occurence - 1] -# helper that tries to get the mkspec entry of the QtVersion ToolTip -def __getMkspec__(qtToolTip): - return ___searchInsideQtVersionToolTip___(qtToolTip, "mkspec:") - -# helper that tries to get the qmake version entry of the QtVersion ToolTip -def __getQMakeVersion__(qtToolTip): - return ___searchInsideQtVersionToolTip___(qtToolTip, "Version:") - -# helper that tries to get the path of the qmake libraries of the QtVersion ToolTip -def __getQMakeLibPath__(qtToolTip): - qmake = ___searchInsideQtVersionToolTip___(qtToolTip, "qmake:") - result = getOutputFromCmdline("%s -v" % qmake) - for line in result.splitlines(): - if "Using Qt version" in line: - return line.rsplit(" ", 1)[1] - -# helper that tries to get the path of qmake of the QtVersion ToolTip -def __getQMakeBinPath__(qtToolTip): - qmake = ___searchInsideQtVersionToolTip___(qtToolTip, "qmake:") - endIndex = qmake.find(os.sep + "qmake") - return qmake[:endIndex] - -# helper that does the work for __getMkspec__() and __getQMakeVersion__() -def ___searchInsideQtVersionToolTip___(qtToolTip, what): - result = None - tmp = qtToolTip.split("") - for i in range(len(tmp)): - if i % 2 == 0: - continue - if what in tmp[i]: - result = tmp[i + 1].split("", 1)[0] - break - return result - # get the Squish path that is needed to successfully hook into the compiled app def getSquishPath(mkspec, qmakev): qmakev = ".".join(qmakev.split(".")[0:2]) @@ -309,7 +280,7 @@ def getSquishPath(mkspec, qmakev): if testData.field(record, "qtversion") == qmakev and testData.field(record, "mkspec") == mkspec: path = os.path.expanduser(testData.field(record, "path")) break - if not os.path.exists(path): + if path == None or not os.path.exists(path): test.warning("Path '%s' from fallback test data file does not exist!" % path, "See the README file how to set up your environment.") return None diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py index 022727b3123..794ece68b51 100644 --- a/tests/system/shared/project_explorer.py +++ b/tests/system/shared/project_explorer.py @@ -35,30 +35,14 @@ def prepareBuildSettings(targetCount, currentTarget, setReleaseBuild=True, disab for current in range(targetCount): if setForAll or current == currentTarget: switchToBuildOrRunSettingsFor(targetCount, current, ProjectSettings.BUILD) - qtCombo = waitForObject(":scrollArea.qtVersionComboBox_QComboBox") - chooseThis = None - wait = False - try: - if qtCombo.currentText != defaultQtVersion: - selectFromCombo(qtCombo, defaultQtVersion) - if setReleaseBuild: - chooseThis = "%s Release" % defaultQtVersion - else: - chooseThis = "%s Debug" % defaultQtVersion - editBuildCfg = waitForObject("{container={type='QScrollArea' name='scrollArea'} " - "leftWidget={container={type='QScrollArea' name='scrollArea'} " - "text='Edit build configuration:' type='QLabel'}" - "unnamed='1' type='QComboBox' visible='1'}", 20000) - if editBuildCfg.currentText != chooseThis: - wait = True - clickItem(editBuildCfg, chooseThis.replace(".", "\\."), 5, 5, 0, Qt.LeftButton) - else: - wait = False - except: - if current == currentTarget: - success = False - if wait and chooseThis != None: - waitFor("editBuildCfg.currentText==chooseThis") + # TODO: Improve selection of Release/Debug version + if setReleaseBuild: + chooseThis = "Release" + else: + chooseThis = "Debug" + editBuildCfg = waitForObject("{leftWidget={text='Edit build configuration:' type='QLabel' " + "unnamed='1' visible='1'} unnamed='1' type='QComboBox' visible='1'}", 20000) + selectFromCombo(editBuildCfg, chooseThis) ensureChecked("{name='shadowBuildCheckBox' type='QCheckBox' visible='1'}", not disableShadowBuild) # get back to the current target if currentTarget < 0 or currentTarget >= targetCount: @@ -117,3 +101,78 @@ def setRunInTerminal(targetCount, currentTarget, runInTerminal=True): ensureChecked("{window=':Qt Creator_Core::Internal::MainWindow' text='Run in terminal'\ type='QCheckBox' unnamed='1' visible='1'}", runInTerminal) switchViewTo(ViewConstants.EDIT) + +# helper function to get some Qt information for the current (already configured) project +# param alreadyOnProjectsBuildSettings if set to True you have to make sure that you're +# on the Projects view on the Build settings page (otherwise this function will end +# up in a ScriptError) +# param afterSwitchTo if you want to leave the Projects view/Build settings when returning +# from this function you can set this parameter to one of the ViewConstants +# this function returns an array of 4 elements (all could be None): +# * the first element holds the Qt version +# * the second element holds the mkspec +# * the third element holds the Qt bin path +# * the fourth element holds the Qt lib path +# of the current active project +def getQtInformationForBuildSettings(alreadyOnProjectsBuildSettings=False, afterSwitchTo=None): + if not alreadyOnProjectsBuildSettings: + switchViewTo(ViewConstants.PROJECTS) + switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.BUILD) + clickButton(waitForObject(":Qt Creator_SystemSettings.Details_Utils::DetailsButton")) + model = waitForObject(":scrollArea_QTableView").model() + qtDir = None + for row in range(model.rowCount()): + index = model.index(row, 0) + text = str(model.data(index).toString()) + if text == "QTDIR": + qtDir = str(model.data(model.index(row, 1)).toString()) + break + if qtDir == None: + test.fatal("UI seems to have changed - couldn't get QTDIR for this configuration.") + return None, None, None, None + + qmakeCallLabel = waitForObject("{text?='qmake: qmake*' type='QLabel' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + mkspec = __getMkspecFromQMakeCall__(str(qmakeCallLabel.text)) + qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION) + qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH) + qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH) + if afterSwitchTo: + if ViewConstants.WELCOME <= afterSwitchTo <= ViewConstans.LAST_AVAILABLE: + switchViewTo(afterSwitchTo) + else: + test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo) + return qtVersion, mkspec, qtBinPath, qtLibPath + +def __getMkspecFromQMakeCall__(qmakeCall): + qCall = qmakeCall.split("")[1].strip() + tmp = qCall.split() + for i in range(len(tmp)): + if tmp[i] == '-spec' and i + 1 < len(tmp): + return tmp[i + 1] + test.fatal("Couldn't get mkspec from qmake call '%s'" % qmakeCall) + return None + +# this function queries information from qmake +# param qtDir set this to a path that holds a valid Qt +# param which set this to one of the QtInformation "constants" +# the function will return the wanted information or None if something went wrong +def getQtInformationByQMakeCall(qtDir, which): + qmake = os.path.join(qtDir, "bin", "qmake") + if platform.system() in ('Microsoft', 'Windows'): + qmake += ".exe" + if not os.path.exists(qmake): + test.fatal("Given Qt directory does not exist or does not contain bin/qmake.", + "Constructed path: '%s'" % qmake) + return None + query = "" + if which == QtInformation.QT_VERSION: + query = "QT_VERSION" + elif which == QtInformation.QT_BINPATH: + query = "QT_INSTALL_BINS" + elif which == QtInformation.QT_LIBPATH: + query = "QT_INSTALL_LIBS" + else: + test.fatal("You're trying to fetch an unknown information (%s)" % which) + return None + return getOutputFromCmdline("%s -query %s" % (qmake, query)).strip() diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 8556bc5c495..f5a302243cb 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -223,11 +223,10 @@ class JIRA: if args[0] in ('Mobile Qt Application', 'Qt Gui Application', 'Qt Custom Designer Widget'): if QtQuickConstants.Targets.HARMATTAN in args[1]: args[1].remove(QtQuickConstants.Targets.HARMATTAN) + elif QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN) in args[1]: + args[1].remove(QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN)) else: - if args[1] and isinstance(args[1][0], (str, unicode)): - args[1].remove(QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN)) - else: - test.warning('Expected Harmattan in targets, failed to find, but bug still marked as open') + test.warning('Expected Harmattan in targets, failed to find, but bug still marked as open') test.xverify(False, "Removed Harmattan from expected targets.") def _workaroundCreator6853_(self, *args):