From 34d897165dddfde4d62037f1da85d41c1546406d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 7 Aug 2014 22:09:42 -0300 Subject: Fix the build: add missing #includes for QWidget, for QDataStream and for Q_GADGET (technically, qobjectdefs.h) Change-Id: Ia7e8b12ff4c67827bb7782a0337714e330de1db1 Reviewed-by: Erik Verbruggen Reviewed-by: hjk --- share/qtcreator/qml/qmlpuppet/container/addimportcontainer.cpp | 1 + src/libs/qmljs/qmljscodeformatter.h | 1 + src/libs/utils/tooltip/tipcontents.h | 1 + src/shared/qtsingleapplication/qtlocalpeer.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.cpp b/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.cpp index d07078b3fb..7f18e59749 100644 --- a/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.cpp @@ -30,6 +30,7 @@ #include "addimportcontainer.h" #include +#include namespace QmlDesigner { diff --git a/src/libs/qmljs/qmljscodeformatter.h b/src/libs/qmljs/qmljscodeformatter.h index 0652e5f0c2..482fb103d6 100644 --- a/src/libs/qmljs/qmljscodeformatter.h +++ b/src/libs/qmljs/qmljscodeformatter.h @@ -38,6 +38,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE class QTextDocument; diff --git a/src/libs/utils/tooltip/tipcontents.h b/src/libs/utils/tooltip/tipcontents.h index 5cac25ee19..897a8e46e1 100644 --- a/src/libs/utils/tooltip/tipcontents.h +++ b/src/libs/utils/tooltip/tipcontents.h @@ -34,6 +34,7 @@ #include #include +#include namespace Utils { diff --git a/src/shared/qtsingleapplication/qtlocalpeer.cpp b/src/shared/qtsingleapplication/qtlocalpeer.cpp index 09c69ce525..33cca898a0 100644 --- a/src/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/src/shared/qtsingleapplication/qtlocalpeer.cpp @@ -30,6 +30,7 @@ #include "qtlocalpeer.h" #include +#include #include #if defined(Q_OS_WIN) -- cgit v1.2.1 From 4d12c017de5cf452480d6a627c927ae8c4278300 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 22 Sep 2014 17:55:20 +0200 Subject: Debugger: Wiggle LLDB startup LLDB 320.* from XCode 601 was unhappy. This is an trial-and-error to get it start up again. Change-Id: I5dda0eef785d70abbb5798c3884ace89a8426969 (cherry picked from commit 1af0f77ea9c4cc6407dc193f53023c103e827168) Reviewed-by: Fawzi Mohamed Reviewed-by: Eike Ziller --- share/qtcreator/debugger/lldbbridge.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 2c4a7dd221..bb38de3388 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -665,10 +665,11 @@ class Dumper(DumperBase): self.report('state="%s",msg="%s",exe="%s"' % (state, error, self.executable_)) def runEngine(self, _): + self.prepare() s = threading.Thread(target=self.loop, args=[]) s.start() - def loop(self): + def prepare(self): error = lldb.SBError() listener = self.debugger.GetListener() @@ -710,7 +711,9 @@ class Dumper(DumperBase): self.report('pid="%s"' % self.process.GetProcessID()) self.reportState("enginerunandinferiorrunok") + def loop(self): event = lldb.SBEvent() + listener = self.debugger.GetListener() while True: if listener.WaitForEvent(10000000, event): self.handleEvent(event) -- cgit v1.2.1 From 92f94ab4b1cc49d2c4a1a3eb2184c65fb7793f0a Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Thu, 18 Sep 2014 14:27:43 +0200 Subject: iossim: correct bring to front for Xcode 6 Change-Id: I7e161a20a4b24635df4f6f373966c7e52cfb593b Reviewed-by: Eike Ziller Reviewed-by: Fawzi Mohamed --- src/tools/3rdparty/iossim/iphonesimulator.mm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/tools/3rdparty/iossim/iphonesimulator.mm b/src/tools/3rdparty/iossim/iphonesimulator.mm index 7845a7af46..0e75fc51a9 100644 --- a/src/tools/3rdparty/iossim/iphonesimulator.mm +++ b/src/tools/3rdparty/iossim/iphonesimulator.mm @@ -261,16 +261,25 @@ static void ChildSignal(int /*arg*/) { } - (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error { + if (started) { + // bring to front... + [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript" + arguments:[NSArray arrayWithObjects: + @"-e", @"tell application \"System Events\"", + @"-e", @" set listOfProcesses to (name of every process where background only is false)", + @"-e", @"end tell", + @"-e", @"repeat with processName in listOfProcesses", + @"-e", @" if processName starts with \"iOS Simulator\" or processName starts with \"iPhone Simulator\" then", + @"-e", @" tell application processName to activate", + @"-e", @" end if", + @"-e", @"end repeat", nil]]; + } if (startOnly && session) { - [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript" - arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]]; msgprintf(@"Simulator started (no session)"); [self doExit:EXIT_SUCCESS]; return; } if (started) { - [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript" - arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]]; int pid = [session simulatedApplicationPID]; if (shouldStartDebugger) { char*args[4] = { NULL, NULL, (char*)[[[NSNumber numberWithInt:pid] description] UTF8String], NULL }; -- cgit v1.2.1 From bc30d602aa361a83975055c8f0dfb042943c81da Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 24 Sep 2014 15:04:09 +0200 Subject: TextEditor: Only disable block selection when we have one. This reduces unnecessary calls to ensureCursorVisible. Task-number: QTCREATORBUG-12860 Change-Id: Iaf59642f3cee645f75d5319d3f6adc236b3f2ee2 Reviewed-by: Christian Stenger --- src/plugins/texteditor/basetexteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index c32bcc9105..7f2ee7cdd9 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5862,7 +5862,8 @@ void BaseTextEditorWidget::cut() void BaseTextEditorWidget::selectAll() { - d->disableBlockSelection(); + if (d->m_inBlockSelectionMode) + d->disableBlockSelection(); QPlainTextEdit::selectAll(); } -- cgit v1.2.1 From 4d8002a973715be85a668087cfd768b17cd2bbe3 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 25 Sep 2014 13:52:20 +0200 Subject: Squish: Add shared file for clang-related code Change-Id: I2eaa39afbfeb0031f191ce9adead80c0d0960542 Reviewed-by: Christian Stenger --- tests/system/shared/clang.py | 79 ++++++++++++++++++++++++++++++ tests/system/shared/qtcreator.py | 3 +- tests/system/suite_CSUP/tst_CSUP06/test.py | 52 ++++---------------- 3 files changed, 91 insertions(+), 43 deletions(-) create mode 100644 tests/system/shared/clang.py diff --git a/tests/system/shared/clang.py b/tests/system/shared/clang.py new file mode 100644 index 0000000000..dee70a0e6a --- /dev/null +++ b/tests/system/shared/clang.py @@ -0,0 +1,79 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## Contact: http://www.qt-project.org/legal +## +## This file is part of Qt Creator. +## +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and Digia. For licensing terms and +## conditions see http://qt.digia.com/licensing. For further information +## use the contact form at http://qt.digia.com/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Digia gives you certain additional +## rights. These rights are described in the Digia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +############################################################################# + +def startCreatorTryingClang(): + try: + # start Qt Creator with enabled ClangCodeModel plugin (without modifying settings) + startApplication("qtcreator -load ClangCodeModel" + SettingsPath) + errorMsg = "{type='QMessageBox' unnamed='1' visible='1' windowTitle='Qt Creator'}" + errorOK = "{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" % errorMsg + if waitFor("object.exists(errorOK)", 5000): + clickButton(errorOK) # Error message + clickButton(errorOK) # Help message + raise Exception("ClangCodeModel not found.") + return True + except: + # ClangCodeModel plugin has not been built - start without it + test.warning("ClangCodeModel plugin not available - performing test without.") + startApplication("qtcreator" + SettingsPath) + return False + +def __openCodeModelOptions__(): + invokeMenuItem("Tools", "Options...") + waitForObjectItem(":Options_QListView", "C++") + clickItem(":Options_QListView", "C++", 14, 15, 0, Qt.LeftButton) + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Code Model") + +def iterateAvailableCodeModels(): + __openCodeModelOptions__() + cppChooser = findObject("{type='QComboBox' name='cppChooser' visible='1'}") + models = [str(cppChooser.currentText)] # Make sure default is first in list + if cppChooser.count > 1: + furtherModels = dumpItems(cppChooser.model()) + furtherModels.remove(models[0]) + models.extend(furtherModels) + clickButton(waitForObject(":Options.OK_QPushButton")) + return models + +def selectCodeModel(codeModel): + __openCodeModelOptions__() + expectedObjNames = ['cChooser', 'cppChooser', 'objcChooser', 'objcppChooser', 'hChooser'] + for exp in expectedObjNames: + test.verify(checkIfObjectExists("{type='QComboBox' name='%s' visible='1'}" % exp), + "Verifying whether combobox '%s' exists." % exp) + combo = findObject("{type='QComboBox' name='%s' visible='1'}" % exp) + try: + selectFromCombo(combo, codeModel) + except: + test.fatal("Could not find code model '%s'. Canceling dialog." % codeModel) + clickButton(waitForObject(":Options.Cancel_QPushButton")) + return + test.verify(verifyChecked("{name='ignorePCHCheckBox' type='QCheckBox' visible='1'}"), + "Verifying whether 'Ignore pre-compiled headers' is checked by default.") + clickButton(waitForObject(":Options.OK_QPushButton")) diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 086aa9411e..ee54ebe858 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -54,7 +54,8 @@ source("../../shared/editor_utils.py") source("../../shared/project_explorer.py") source("../../shared/hook_utils.py") source("../../shared/debugger.py") -source("../../shared/workarounds.py") +source("../../shared/clang.py") +source("../../shared/workarounds.py") # include this at last # ATTENTION: if a test case calls startApplication("qtcreator...") for several times this # function must be called BEFORE any call except the first (which is done always automatically) diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 03076d1843..7d313ca6ee 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -29,28 +29,6 @@ source("../../shared/qtcreator.py") -def makeClangDefaultCodeModel(pluginAvailable): - invokeMenuItem("Tools", "Options...") - waitForObjectItem(":Options_QListView", "C++") - clickItem(":Options_QListView", "C++", 14, 15, 0, Qt.LeftButton) - clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Code Model") - expectedObjNames = ['cChooser', 'cppChooser', 'objcChooser', 'objcppChooser', 'hChooser'] - for exp in expectedObjNames: - test.verify(checkIfObjectExists("{type='QComboBox' name='%s' visible='1'}" % exp), - "Verifying whether combobox '%s' exists." % exp) - combo = findObject("{type='QComboBox' name='%s' visible='1'}" % exp) - if test.verify(combo.enabled == pluginAvailable, "Verifying whether combobox is enabled."): - if test.compare(combo.currentText, "Qt Creator Built-in", - "Verifying whether default is Qt Creator's builtin code model"): - items = dumpItems(combo.model()) - if (pluginAvailable and - test.verify("Clang" in items, - "Verifying whether clang code model can be chosen.")): - selectFromCombo(combo, "Clang") - test.verify(verifyChecked("{name='ignorePCHCheckBox' type='QCheckBox' visible='1'}"), - "Verifying whether 'Ignore pre-compiled headers' is checked by default.") - clickButton(waitForObject(":Options.OK_QPushButton")) - def moveDownToNextNonEmptyLine(editor): currentLine = "" # there's no do-while in python - so use empty line which fails while not currentLine: @@ -176,30 +154,22 @@ def main(): examplePath = os.path.join(srcPath, "creator", "tests", "manual", "cplusplus-tools") if not neededFilePresent(os.path.join(examplePath, "cplusplus-tools.pro")): return - try: - # start Qt Creator with enabled ClangCodeModel plugin (without modifying settings) - startApplication("qtcreator -load ClangCodeModel" + SettingsPath) - errorMsg = "{type='QMessageBox' unnamed='1' visible='1' windowTitle='Qt Creator'}" - errorOK = "{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" % errorMsg - if waitFor("object.exists(errorOK)", 5000): - clickButton(errorOK) # Error message - clickButton(errorOK) # Help message - raise Exception("ClangCodeModel not found.") - clangCodeModelPluginAvailable = True - models = ["builtin", "clang"] - except: - # ClangCodeModel plugin has not been built - start without it - test.warning("ClangCodeModel plugin not available - performing test without.") - startApplication("qtcreator" + SettingsPath) - clangCodeModelPluginAvailable = False - models = ["builtin"] + clangLoaded = startCreatorTryingClang() if not startedWithoutPluginError(): return templateDir = prepareTemplate(examplePath) examplePath = os.path.join(templateDir, "cplusplus-tools.pro") openQmakeProject(examplePath, Targets.DESKTOP_531_DEFAULT) + models = iterateAvailableCodeModels() + test.compare(len(models), 1 + clangLoaded, "Verifying number of available code models") + test.compare("Qt Creator Built-in", models[0], + "Verifying whether default is Qt Creator's builtin code model") + test.compare("Clang" in models, clangLoaded, + "Verifying whether clang code model can be chosen.") for current in models: + if current != models[0]: + selectCodeModel(current) test.log("Testing code model: %s" % current) if not openDocument("cplusplus-tools.Sources.main\\.cpp"): earlyExit("Failed to open main.cpp.") @@ -207,11 +177,9 @@ def main(): editor = getEditorForFileSuffix("main.cpp") if editor: checkIncludeCompletion(editor) - checkSymbolCompletion(editor, current != "builtin") + checkSymbolCompletion(editor, current == "Clang") invokeMenuItem('File', 'Revert "main.cpp" to Saved') clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) - if current == "builtin": - makeClangDefaultCodeModel(clangCodeModelPluginAvailable) snooze(1) # 'Close "main.cpp"' might still be disabled # editor must be closed to get the second code model applied on re-opening the file invokeMenuItem('File', 'Close "main.cpp"') -- cgit v1.2.1 From 4957137ef67ae0352b9a2e1b27f0f8d3089f2c07 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 24 Sep 2014 16:31:18 +0200 Subject: Squish: Run tst_CSUP03 with Clang code model, too Change-Id: I5b240b2fbd7999b2228871ddf8faa72509c49465 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP03/test.py | 71 ++++++++++++++++-------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index f05647b3c3..136a55b59b 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -64,7 +64,7 @@ def constructExpectedCode(original, codeLines, funcSuffix): return "\n".join(tmp) + "\n" def main(): - startApplication("qtcreator" + SettingsPath) + startCreatorTryingClang() if not startedWithoutPluginError(): return projectName = createNewNonQtProject() @@ -82,38 +82,45 @@ def main(): "while with braces" : ["", "int dummy = 0;", "while (dummy < 10) {", "++dummy;"], "do while" : ["", "int dummy = 0;", "do", "++dummy;", "while (dummy < 10);"] } - editor = getEditorForFileSuffix("main.cpp") - if not editor: - test.fatal("Failed to get an editor - leaving test.") - invokeMenuItem("File", "Exit") - return + models = iterateAvailableCodeModels() + for current in models: + if current != models[0]: + selectCodeModel(current) + test.log("Testing code model: %s" % current) + openDocument("untitled.Sources.main\\.cpp") + editor = getEditorForFileSuffix("main.cpp") + if not editor: + test.fatal("Failed to get an editor - leaving test.") + invokeMenuItem("File", "Exit") + return - originalContent = str(editor.plainText) - for case, codeLines in code.items(): - funcSuffix = case.title().replace(" ", "") - test.log("Testing: Extract Function for '%s'" % case) - if not placeCursorToLine(editor, "{"): - continue - typeLines(editor, codeLines) - if not placeCursorToLine(editor, codeLines[2]): + originalContent = str(editor.plainText) + for case, codeLines in code.items(): + funcSuffix = case.title().replace(" ", "") + test.log("Testing: Extract Function for '%s'" % case) + if not placeCursorToLine(editor, "{"): + continue + typeLines(editor, codeLines) + if not placeCursorToLine(editor, codeLines[2]): + revertMainCpp() + continue + type(editor, home) + markText(editor, "Right", 2) + snooze(1) # avoid timing issue with the parser + invokeContextMenuItem(editor, 'Refactor', 'Extract Function') + funcEdit = waitForObject("{buddy={text='Enter function name' type='QLabel' unnamed='1' " + "visible='1' window=%s} type='QLineEdit' unnamed='1' visible='1'}" + % inputDialog) + replaceEditorContent(funcEdit, "myFunc%s" % funcSuffix) + clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" + % inputDialog)) + waitFor("'void myFunc%s' in str(editor.plainText)" % funcSuffix, 2500) + # verify the change + modifiedCode = str(editor.plainText) + expectedCode = constructExpectedCode(originalContent, codeLines, funcSuffix) + test.compare(modifiedCode, expectedCode, "Verifying whether code matches expected.") + # reverting to initial state of main.cpp revertMainCpp() - continue - type(editor, home) - markText(editor, "Right", 2) - snooze(1) # avoid timing issue with the parser - invokeContextMenuItem(editor, 'Refactor', 'Extract Function') - funcEdit = waitForObject("{buddy={text='Enter function name' type='QLabel' unnamed='1' " - "visible='1' window=%s} type='QLineEdit' unnamed='1' visible='1'}" - % inputDialog) - replaceEditorContent(funcEdit, "myFunc%s" % funcSuffix) - clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" - % inputDialog)) - waitFor("'void myFunc%s' in str(editor.plainText)" % funcSuffix, 2500) - # verify the change - modifiedCode = str(editor.plainText) - expectedCode = constructExpectedCode(originalContent, codeLines, funcSuffix) - test.compare(modifiedCode, expectedCode, "Verifying whether code matches expected.") - # reverting to initial state of main.cpp - revertMainCpp() + invokeMenuItem('File', 'Close All') invokeMenuItem('File', 'Exit') -- cgit v1.2.1 From 6447eb9cbf73a7520889ded8ad36188a064f005e Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 25 Sep 2014 12:13:23 +0200 Subject: Squish: Run tst_CSUP04 with Clang code model, too Change-Id: I3a2f029e0f1c85ecbd3c161b097f4e975014f714 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP04/test.py | 68 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index dd8fa406d5..280bd65544 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -39,44 +39,48 @@ def main(): # copy example project to temp directory templateDir = prepareTemplate(sourceExample) examplePath = os.path.join(templateDir, proFile) - startApplication("qtcreator" + SettingsPath) + startCreatorTryingClang() if not startedWithoutPluginError(): return # open example project openQmakeProject(examplePath) # wait for parsing to complete progressBarWait(30000) - # open .cpp file in editor - if not openDocument("propertyanimation.Sources.main\\.cpp"): - test.fatal("Could not open main.cpp") - invokeMenuItem("File", "Exit") - return - test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), - "Verifying if: .cpp file is opened in Edit mode.") - # place cursor on line "QmlApplicationViewer viewer;" - editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - # invoke find usages from context menu on word "viewer" - if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "", 10): - invokeMenuItem("File", "Exit") - return - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(14) - result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) - test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " - "File with used text is opened.") - # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. - openDocument("propertyanimation.Sources.main\\.cpp") - if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): - return - for i in range(4): - type(editorWidget, "") - type(editorWidget, "") - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(3) - # exit qt creator - invokeMenuItem("File", "Save All") + models = iterateAvailableCodeModels() + for current in models: + if current != models[0]: + selectCodeModel(current) + test.log("Testing code model: %s" % current) + # open .cpp file in editor + if not openDocument("propertyanimation.Sources.main\\.cpp"): + test.fatal("Could not open main.cpp") + invokeMenuItem("File", "Exit") + return + test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), + "Verifying if: .cpp file is opened in Edit mode.") + # place cursor on line "QmlApplicationViewer viewer;" + editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + # invoke find usages from context menu on word "viewer" + if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "", 10): + invokeMenuItem("File", "Exit") + return + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(14) + result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) + test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " + "File with used text is opened.") + # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. + openDocument("propertyanimation.Sources.main\\.cpp") + if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): + return + for i in range(4): + type(editorWidget, "") + type(editorWidget, "") + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(3) + invokeMenuItem("File", "Close All") invokeMenuItem("File", "Exit") def waitForSearchResults(): -- cgit v1.2.1 From ea93a6531c3994cadfac95035433f5aa61d8562f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 25 Sep 2014 12:16:37 +0200 Subject: Squish: Run tst_CSUP05 with Clang code model, too Change-Id: Ief81ba27d8cbd43de5ef9c71b586da8cc372a8bb Reviewed-by: Christian Stenger --- tests/system/objects.map | 1 + tests/system/suite_CSUP/tst_CSUP05/test.py | 101 +++++++++++++++-------------- 2 files changed, 54 insertions(+), 48 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 6f612b4fd4..dee62b502f 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -190,6 +190,7 @@ :RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) Build Environment' type='QLabel' unnamed='1' visible='1'} :Save Changes.Always save files before build_QCheckBox {name='saveBeforeBuildCheckBox' text='Always save files before build' type='QCheckBox' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} +:Save Changes.Do not Save_QPushButton {text='Do not Save' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} :Save Changes.Save All_QPushButton {text='Save All' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} :Save Changes_Core::Internal::SaveItemsDialog {name='Core__Internal__SaveItemsDialog' type='Core::Internal::SaveItemsDialog' visible='1' windowTitle='Save Changes'} :Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'} diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py index 32271b0ae7..457b177621 100644 --- a/tests/system/suite_CSUP/tst_CSUP05/test.py +++ b/tests/system/suite_CSUP/tst_CSUP05/test.py @@ -39,59 +39,64 @@ def main(): # copy example project to temp directory templateDir = prepareTemplate(sourceExample) examplePath = os.path.join(templateDir, proFile) - startApplication("qtcreator" + SettingsPath) + startCreatorTryingClang() if not startedWithoutPluginError(): return # open example project openQmakeProject(examplePath) # wait for parsing to complete progressBarWait(30000) - # open .cpp file in editor - if not openDocument("propertyanimation.Sources.main\\.cpp"): - test.fatal("Could not open main.cpp") - invokeMenuItem("File", "Exit") - return - test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), - "Verifying if: .cpp file is opened in Edit mode.") - # select some word for example "viewer" and press Ctrl+F. - editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - if not placeCursorToLine(editorWidget, "QmlApplicationViewer viewer;"): - invokeMenuItem("File", "Exit") - return - type(editorWidget, "") - markText(editorWidget, "Left", 6) - type(editorWidget, "") - # verify if find toolbar exists and if search text contains selected word - test.verify(checkIfObjectExists(":*Qt Creator.Find_Find::Internal::FindToolBar"), - "Verifying if: Find/Replace pane is displayed at the bottom of the view.") - test.compare(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit").displayText, "viewer", - "Verifying if: Find line edit contains 'viewer' text.") - # insert some word to "Replace with:" field and select "Replace All". - replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "find") - oldCodeText = str(editorWidget.plainText) - clickButton(waitForObject(":Qt Creator.Replace All_QToolButton")) - mouseClick(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), 5, 5, 0, Qt.LeftButton) - newCodeText = str(editorWidget.plainText) - test.compare(newCodeText, oldCodeText.replace("viewer", "find").replace("Viewer", "find"), - "Verifying if: Found text is replaced with new word properly.") - # select some other word in .cpp file and select "Edit" -> "Find/Replace". - clickButton(waitForObject(":Qt Creator.CloseFind_QToolButton")) - placeCursorToLine(editorWidget, "find.setOrientation(QmlApplicationfind::ScreenOrientationAuto);") - for i in range(25): + models = iterateAvailableCodeModels() + for current in models: + if current != models[0]: + selectCodeModel(current) + test.log("Testing code model: %s" % current) + # open .cpp file in editor + if not openDocument("propertyanimation.Sources.main\\.cpp"): + test.fatal("Could not open main.cpp") + invokeMenuItem("File", "Exit") + return + test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), + "Verifying if: .cpp file is opened in Edit mode.") + # select some word for example "viewer" and press Ctrl+F. + editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + if not placeCursorToLine(editorWidget, "QmlApplicationViewer viewer;"): + invokeMenuItem("File", "Exit") + return type(editorWidget, "") - markText(editorWidget, "Left", 18) - invokeMenuItem("Edit", "Find/Replace", "Find/Replace") - replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "QmlApplicationViewer") - oldCodeText = str(editorWidget.plainText) - clickButton(waitForObject(":Qt Creator.Replace_QToolButton")) - newCodeText = str(editorWidget.plainText) - # "::" is used to replace only one occurrence by python - test.compare(newCodeText, oldCodeText.replace("QmlApplicationfind::", "QmlApplicationViewer::"), - "Verifying if: Only selected word is replaced, the rest of found words are not replaced.") - # close Find/Replace tab. - clickButton(waitForObject(":Qt Creator.CloseFind_QToolButton")) - test.verify(checkIfObjectExists(":*Qt Creator.Find_Find::Internal::FindToolBar", False), - "Verifying if: Find/Replace tab is closed.") - # exit qt creator - invokeMenuItem("File", "Save All") + markText(editorWidget, "Left", 6) + type(editorWidget, "") + # verify if find toolbar exists and if search text contains selected word + test.verify(checkIfObjectExists(":*Qt Creator.Find_Find::Internal::FindToolBar"), + "Verifying if: Find/Replace pane is displayed at the bottom of the view.") + test.compare(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit").displayText, "viewer", + "Verifying if: Find line edit contains 'viewer' text.") + # insert some word to "Replace with:" field and select "Replace All". + replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "find") + oldCodeText = str(editorWidget.plainText) + clickButton(waitForObject(":Qt Creator.Replace All_QToolButton")) + mouseClick(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), 5, 5, 0, Qt.LeftButton) + newCodeText = str(editorWidget.plainText) + test.compare(newCodeText, oldCodeText.replace("viewer", "find").replace("Viewer", "find"), + "Verifying if: Found text is replaced with new word properly.") + # select some other word in .cpp file and select "Edit" -> "Find/Replace". + clickButton(waitForObject(":Qt Creator.CloseFind_QToolButton")) + placeCursorToLine(editorWidget, "find.setOrientation(QmlApplicationfind::ScreenOrientationAuto);") + for i in range(25): + type(editorWidget, "") + markText(editorWidget, "Left", 18) + invokeMenuItem("Edit", "Find/Replace", "Find/Replace") + replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "QmlApplicationViewer") + oldCodeText = str(editorWidget.plainText) + clickButton(waitForObject(":Qt Creator.Replace_QToolButton")) + newCodeText = str(editorWidget.plainText) + # "::" is used to replace only one occurrence by python + test.compare(newCodeText, oldCodeText.replace("QmlApplicationfind::", "QmlApplicationViewer::"), + "Verifying if: Only selected word is replaced, the rest of found words are not replaced.") + # close Find/Replace tab. + clickButton(waitForObject(":Qt Creator.CloseFind_QToolButton")) + test.verify(checkIfObjectExists(":*Qt Creator.Find_Find::Internal::FindToolBar", False), + "Verifying if: Find/Replace tab is closed.") + invokeMenuItem("File", "Close All") + clickButton(waitForObject(":Save Changes.Do not Save_QPushButton")) invokeMenuItem("File", "Exit") -- cgit v1.2.1 From a4321bbfe14d8e041f45840468d7ea18f0d3f97b Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 24 Sep 2014 18:01:22 +0200 Subject: Squish: Run tst_memberoperator with Clang code model, too Change-Id: I3b4b2ed3523e94d5a6dee6957b5b16d4092122fd Reviewed-by: Christian Stenger --- .../suite_editors/tst_memberoperator/test.py | 46 ++++++++++++++-------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/tests/system/suite_editors/tst_memberoperator/test.py b/tests/system/suite_editors/tst_memberoperator/test.py index 04c992fe04..4f976fdbde 100644 --- a/tests/system/suite_editors/tst_memberoperator/test.py +++ b/tests/system/suite_editors/tst_memberoperator/test.py @@ -30,26 +30,38 @@ source("../../shared/qtcreator.py") def main(): - startApplication("qtcreator" + SettingsPath) + startCreatorTryingClang() if not startedWithoutPluginError(): return createProject_Qt_Console(tempDir(), "SquishProject") - selectFromLocator("main.cpp") - cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + models = iterateAvailableCodeModels() + for current in models: + if current != models[0]: + selectCodeModel(current) + test.log("Testing code model: %s" % current) + selectFromLocator("main.cpp") + cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - for record in testData.dataset("usages.tsv"): - include = testData.field(record, "include") - if include: - placeCursorToLine(cppwindow, "#include ") - typeLines(cppwindow, ("", "#include " + include)) - placeCursorToLine(cppwindow, "return a.exec();") - typeLines(cppwindow, ("", testData.field(record, "declaration"))) - type(cppwindow, testData.field(record, "usage")) - snooze(1) # maybe find something better - type(cppwindow, testData.field(record, "operator")) - waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500) - test.compare(str(lineUnderCursor(cppwindow)).strip(), testData.field(record, "expected")) - invokeMenuItem("File", 'Revert "main.cpp" to Saved') - clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) + for record in testData.dataset("usages.tsv"): + include = testData.field(record, "include") + if include: + placeCursorToLine(cppwindow, "#include ") + typeLines(cppwindow, ("", "#include " + include)) + placeCursorToLine(cppwindow, "return a.exec();") + typeLines(cppwindow, ("", testData.field(record, "declaration"))) + type(cppwindow, testData.field(record, "usage")) + snooze(1) # maybe find something better + type(cppwindow, testData.field(record, "operator")) + waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500) + found = str(lineUnderCursor(cppwindow)).strip() + exp = testData.field(record, "expected") + if current == "Clang" and exp[-2:] == "->": + test.xcompare(found, exp) # QTCREATORBUG-11581 + else: + test.compare(found, exp) + invokeMenuItem("File", 'Revert "main.cpp" to Saved') + clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) + snooze(1) + invokeMenuItem("File", "Close All") invokeMenuItem("File", "Exit") -- cgit v1.2.1 From bf5f14a4e1941965019fc378cd2dc312231940b1 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 12 Sep 2014 13:31:12 +0200 Subject: Debugger: Fix QHash display of "compact" keys Add make std::string usable as "compact" key. Change-Id: Idbfcf9d299e2dde392025166a20c3d0ab60239a6 (cherry picked from commit 2776536a7efd6758de1d6720b2c05a9fe0bc65a5) Reviewed-by: Christian Stenger --- share/qtcreator/debugger/dumper.py | 70 +++++++++++++++++++++------------- share/qtcreator/debugger/gdbbridge.py | 12 +++--- share/qtcreator/debugger/lldbbridge.py | 2 +- share/qtcreator/debugger/pdumper.py | 2 +- share/qtcreator/debugger/qttypes.py | 6 ++- tests/auto/debugger/tst_dumpers.cpp | 6 +-- 6 files changed, 59 insertions(+), 39 deletions(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index c610acb371..3cd1b33f96 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -190,18 +190,6 @@ def showException(msg, exType, exValue, exTraceback): pass -def stripClassTag(typeName): - if typeName.startswith("class "): - return typeName[6:] - if typeName.startswith("struct "): - return typeName[7:] - if typeName.startswith("const "): - return typeName[6:] - if typeName.startswith("volatile "): - return typeName[9:] - return typeName - - class Children: def __init__(self, d, numChild = 1, childType = None, childNumChild = None, maxNumChild = None, addrBase = None, addrStep = None): @@ -215,7 +203,7 @@ class Children: if childType is None: self.childType = None else: - self.childType = stripClassTag(str(childType)) + self.childType = d.stripClassTag(str(childType)) if not self.d.isCli: self.d.put('childtype="%s",' % self.childType) if childNumChild is None: @@ -271,8 +259,11 @@ class PairedChildrenData: self.isCompact = d.isMapCompact(self.keyType, self.valueType) self.childType = valueType if self.isCompact else pairType ns = d.qtNamespace() - self.keyIsQString = str(self.keyType) == ns + "QString" - self.keyIsQByteArray = str(self.keyType) == ns + "QByteArray" + keyTypeName = d.stripClassTag(str(self.keyType)) + self.keyIsQString = keyTypeName == ns + "QString" + self.keyIsQByteArray = keyTypeName == ns + "QByteArray" + self.keyIsStdString = keyTypeName == "std::string" \ + or keyTypeName.startswith("std::basic_string") try: if self.currentType.value: - typeName = stripClassTag(self.currentType.value) + typeName = self.stripClassTag(self.currentType.value) if len(typeName) > 0 and typeName != self.currentChildType: self.put('type="%s",' % typeName) # str(type.unqualified()) ? @@ -583,7 +583,7 @@ class Dumper(DumperBase): arg += a #warn("CALL: %s -> %s(%s)" % (value, func, arg)) - typeName = stripClassTag(str(value.type)) + typeName = self.stripClassTag(str(value.type)) if typeName.find(":") >= 0: typeName = "'" + typeName + "'" # 'class' is needed, see http://sourceware.org/bugzilla/show_bug.cgi?id=11912 @@ -604,7 +604,7 @@ class Dumper(DumperBase): return None def makeValue(self, type, init): - type = "::" + stripClassTag(str(type)); + type = "::" + self.stripClassTag(str(type)); # Avoid malloc symbol clash with QVector. gdb.execute("set $d = (%s*)calloc(sizeof(%s), 1)" % (type, type)) gdb.execute("set *$d = {%s}" % init) @@ -615,7 +615,7 @@ class Dumper(DumperBase): return value def makeExpression(self, value): - type = "::" + stripClassTag(str(value.type)) + type = "::" + self.stripClassTag(str(value.type)) #warn(" TYPE: %s" % type) #exp = "(*(%s*)(&%s))" % (type, value.address) exp = "(*(%s*)(%s))" % (type, value.address) @@ -917,7 +917,7 @@ class Dumper(DumperBase): self.lookupType("unsigned long")), None, -1) def stripNamespaceFromType(self, typeName): - type = stripClassTag(typeName) + type = self.stripClassTag(typeName) ns = self.qtNamespace() if len(ns) > 0 and type.startswith(ns): type = type[len(ns):] @@ -1727,7 +1727,7 @@ class CliDumper(Dumper): self.putValue("") try: if self.currentType.value: - typeName = stripClassTag(self.currentType.value) + typeName = self.stripClassTag(self.currentType.value) self.put('<%s> = {' % typeName) if self.currentValue.value is None: diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index bb38de3388..73e5b35493 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -882,7 +882,7 @@ class Dumper(DumperBase): return self.target.FindFirstGlobalVariable(symbolName) def stripNamespaceFromType(self, typeName): - #type = stripClassTag(typeName) + #type = self.stripClassTag(typeName) type = typeName ns = self.qtNamespace() if len(ns) > 0 and type.startswith(ns): diff --git a/share/qtcreator/debugger/pdumper.py b/share/qtcreator/debugger/pdumper.py index e0144490ab..32de9c002e 100644 --- a/share/qtcreator/debugger/pdumper.py +++ b/share/qtcreator/debugger/pdumper.py @@ -78,7 +78,7 @@ def qdebug(options = None, def itemFormat(self, item): format = self.formats.get(str(cleanAddress(item.value.address))) if format is None: - format = self.typeformats.get(stripClassTag(str(item.value.type))) + format = self.typeformats.get(self.stripClassTag(str(item.value.type))) return format def dumpFrame(self, frame): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 8333ccfe63..3729fd04b3 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -618,6 +618,7 @@ def qdump__QHash(d, value): isCompact = d.isMapCompact(keyType, valueType) childType = valueType if isCompact else innerType with Children(d, size, maxNumChild=1000, childType=childType): + j = 0 for i in d.childRange(): if i == 0: node = hashDataFirstNode(d_ptr, numBuckets) @@ -631,9 +632,10 @@ def qdump__QHash(d, value): # LLDB can't access directly since it's in anonymous union # for Qt4 optimized int keytype key = it[1]["key"] - d.putMapName(key) + d.putMapName(key, j) d.putItem(it["value"]) d.putType(valueType) + j += 1 else: d.putItem(it) @@ -1231,7 +1233,7 @@ def _qdump__QObject(d, value): d.putFields(value) # Parent and children. - if stripClassTag(str(value.type)) == ns + "QObject": + if d.stripClassTag(str(value.type)) == ns + "QObject": d.putSubItem("parent", d_ptr["parent"]) d.putSubItem("children", d_ptr["children"]) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 412656a7fc..96737a42b5 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1658,8 +1658,8 @@ void tst_Dumpers::dumper_data() + Check("h1.2.value.1", "[1]", "2", "int") + Check("h2", "<2 items>", "@QHash") - + Check("h2.22", "[22]", "22", "float") - + Check("h2.11", "[11]", "11", "float") + + Check("h2.0", "[0] 22", "22", "float") + + Check("h2.1", "[1] 11", "11", "float") + Check("h3", "<9 items>", "@QHash<@QString, int>") + Check("h3.0", "[0]", "", "@QHashNode<@QString, int>") @@ -1713,7 +1713,7 @@ void tst_Dumpers::dumper_data() + CheckType("h7.2.value", "@QPointer<@QObject>") + Check("h8", "<3 items>", "Hash") - + Check("h8.11", "[11]", "11", "float") + + Check("h8.0", "[0] 22", "22", "float") + Check("it1.key", "22", "int") + Check("it1.value", "22", "float") + Check("it3.key", "33", "int") -- cgit v1.2.1 From fe8ed7f5a666629ae43f8fc0888484a8bfa3b210 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 26 Sep 2014 12:45:42 +0200 Subject: Session: Fix saving session data on shutdown from project mode This was broken in d52ee686d1ae63090e066faf4e2b66b90620b774. Task-number: QTCREATORBUG-13098 Change-Id: Ia075e13fdd00e561b78058a3cab0cb02d2eb5fe6 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/modemanager.cpp | 2 +- src/plugins/coreplugin/modemanager.h | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 9e387d4f44..349d93ef76 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -320,7 +320,7 @@ bool ModeManager::isModeSelectorVisible() return d->m_modeSelectorVisible; } -QObject *ModeManager::instance() +ModeManager *ModeManager::instance() { return m_instance; } diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index a6689368be..9e708e0e02 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -52,7 +52,7 @@ class CORE_EXPORT ModeManager : public QObject Q_OBJECT public: - static QObject *instance(); + static ModeManager *instance(); static IMode *currentMode(); static IMode *mode(Id id); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 2c4d8eb102..ce7f8b39a4 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1277,6 +1277,8 @@ void ProjectExplorerPlugin::updateRunWithoutDeployMenu() ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown() { + disconnect(ModeManager::instance(), &ModeManager::currentModeChanged, + this, &ProjectExplorerPlugin::currentModeChanged); d->m_proWindow->aboutToShutdown(); // disconnect from session SessionManager::closeAllProjects(); d->m_projectsMode = 0; @@ -1673,9 +1675,8 @@ void ProjectExplorerPlugin::restoreSession() SessionManager::loadSession(d->m_sessionToRestoreAtStartup); // update welcome page - connect(ModeManager::instance(), - SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), - SLOT(currentModeChanged(Core::IMode*,Core::IMode*))); + connect(ModeManager::instance(), &ModeManager::currentModeChanged, + this, &ProjectExplorerPlugin::currentModeChanged); #if HAS_WELCOME_PAGE connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString))); -- cgit v1.2.1 From 9d3ae49e3014ffff59bf174412afaf9c7b800bd5 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 26 Sep 2014 14:46:59 +0200 Subject: Session: Fix compilation This was broken in fe8ed7f5a666629ae43f8fc0888484a8bfa3b210 Change-Id: Iff4dffa6ba6cfdeeb3664c026ce642b80e4deeeb Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/projectexplorer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index ce7f8b39a4..a113adbf9e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1277,8 +1277,8 @@ void ProjectExplorerPlugin::updateRunWithoutDeployMenu() ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown() { - disconnect(ModeManager::instance(), &ModeManager::currentModeChanged, - this, &ProjectExplorerPlugin::currentModeChanged); + disconnect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), + this, SLOT(currentModeChanged(Core::IMode*,Core::IMode*))); d->m_proWindow->aboutToShutdown(); // disconnect from session SessionManager::closeAllProjects(); d->m_projectsMode = 0; @@ -1675,8 +1675,8 @@ void ProjectExplorerPlugin::restoreSession() SessionManager::loadSession(d->m_sessionToRestoreAtStartup); // update welcome page - connect(ModeManager::instance(), &ModeManager::currentModeChanged, - this, &ProjectExplorerPlugin::currentModeChanged); + connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), + this, SLOT(currentModeChanged(Core::IMode*,Core::IMode*))); #if HAS_WELCOME_PAGE connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString))); -- cgit v1.2.1 From bacf4f0afb53b27780df7a529abffbd16a5eeb16 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 25 Sep 2014 17:54:52 +0200 Subject: Squish: Do not crash tst_simple_debug if debugger can't stop Change-Id: Iedf0335088739ed60f321b6479711298067f9038 Reviewed-by: Christian Stenger --- tests/system/objects.map | 2 ++ tests/system/suite_debugger/tst_simple_debug/test.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/tests/system/objects.map b/tests/system/objects.map index dee62b502f..01ae88f58f 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -47,6 +47,8 @@ :Cannot Open Project.Show Details..._QPushButton {text='Show Details...' type='QPushButton' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'} :Cannot Open Project_QMessageBox {text?='Failed to open project in *' type='QMessageBox' unnamed='1' visible='1'} :Cannot Open Project_QTextEdit {type='QTextEdit' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'} +:Close Debugging Session.Yes_QPushButton {text='Yes' type='QPushButton' unnamed='1' visible='1' window=':Close Debugging Session_Utils::CheckableMessageBox'} +:Close Debugging Session_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Close Debugging Session'} :CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'} :CodePaster__Internal__PasteSelectDialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'} :CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget {name='listWidget' type='QListWidget' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'} diff --git a/tests/system/suite_debugger/tst_simple_debug/test.py b/tests/system/suite_debugger/tst_simple_debug/test.py index d7a0f6b5f6..b4cb9ba48d 100644 --- a/tests/system/suite_debugger/tst_simple_debug/test.py +++ b/tests/system/suite_debugger/tst_simple_debug/test.py @@ -84,6 +84,10 @@ def main(): ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") clickButton(waitForObject("{type='CloseButton' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}")) + try: + clickButton(waitForObject(":Close Debugging Session.Yes_QPushButton", 2000)) + except: + pass if platform.system() == 'Darwin' and JIRA.isBugStillOpen(11595): try: expectedBreakpointsOrder.remove({os.path.join(workingDir, projectName, "main.cpp"):10}) -- cgit v1.2.1 From 705935352003399fc9e8f61e8ad291ca70546ed0 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 26 Sep 2014 13:42:22 +0200 Subject: Perforce: Disable actions when outside a repository. Task-number: QTCREATORBUG-13092 Change-Id: I3d059af748f0160ebfc97bebbd43de9210f17250 Reviewed-by: Christian Stenger --- src/plugins/perforce/perforceplugin.cpp | 44 ++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 76d4f86d2f..eb01750ed5 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -781,13 +781,37 @@ void PerforcePlugin::filelog(const QString &workingDir, const QString &fileName, void PerforcePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { - if (!enableMenuAction(as, m_menuAction)) { - m_commandLocator->setEnabled(false); + const bool menuActionEnabled = enableMenuAction(as, m_menuAction); + const bool enableActions = currentState().hasTopLevel() && menuActionEnabled; + m_commandLocator->setEnabled(enableActions); + m_logRepositoryAction->setEnabled(enableActions); + m_editAction->setEnabled(enableActions); + m_addAction->setEnabled(enableActions); + m_deleteAction->setEnabled(enableActions); + m_openedAction->setEnabled(enableActions); + m_revertFileAction->setEnabled(enableActions); + m_diffFileAction->setEnabled(enableActions); + m_diffProjectAction->setEnabled(enableActions); + m_updateProjectAction->setEnabled(enableActions); + m_revertProjectAction->setEnabled(enableActions); + m_revertUnchangedAction->setEnabled(enableActions); + m_diffAllAction->setEnabled(enableActions); + m_submitProjectAction->setEnabled(enableActions); + m_pendingAction->setEnabled(enableActions); + m_describeAction->setEnabled(enableActions); + m_annotateCurrentAction->setEnabled(enableActions); + m_annotateAction->setEnabled(enableActions); + m_filelogCurrentAction->setEnabled(enableActions); + m_filelogAction->setEnabled(enableActions); + m_logProjectAction->setEnabled(enableActions); + m_logRepositoryAction->setEnabled(enableActions); + m_submitCurrentLogAction->setEnabled(enableActions); + m_updateAllAction->setEnabled(enableActions); + m_diffSelectedFiles->setEnabled(enableActions); + m_undoAction->setEnabled(enableActions); + m_redoAction->setEnabled(enableActions); + if (!menuActionEnabled) return; - } - const bool hasTopLevel = currentState().hasTopLevel(); - m_commandLocator->setEnabled(hasTopLevel); - m_logRepositoryAction->setEnabled(hasTopLevel); const QString fileName = currentState().currentFileName(); m_editAction->setParameter(fileName); @@ -805,14 +829,6 @@ void PerforcePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) m_submitProjectAction->setParameter(projectName); m_revertProjectAction->setParameter(projectName); m_revertUnchangedAction->setParameter(projectName); - - m_diffAllAction->setEnabled(true); - m_openedAction->setEnabled(true); - m_describeAction->setEnabled(true); - m_annotateAction->setEnabled(true); - m_filelogAction->setEnabled(true); - m_pendingAction->setEnabled(true); - m_updateAllAction->setEnabled(true); } bool PerforcePlugin::managesDirectory(const QString &directory, QString *topLevel /* = 0 */) -- cgit v1.2.1 From 6bf9a19276a65882f846455d282d157893b6ef48 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sat, 27 Sep 2014 08:01:54 +0200 Subject: Generic Project: Fix adding wrong include directories Task-number: QTCREATORBUG-12727 Task-number: QTCREATORBUG-12873 Change-Id: I1dffad5af9ac254fa17f89291db7baf640ed1851 Reviewed-by: Daniel Teske Reviewed-by: Eike Ziller --- src/plugins/genericprojectmanager/genericproject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index c3b82136e6..d994da68cf 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -174,8 +174,8 @@ bool GenericProject::addFiles(const QStringList &filePaths) QSet includes = projectIncludePaths().toSet(); QSet toAdd; - foreach (const QString &filePaths, filePaths) { - QString directory = QFileInfo(filePaths).absolutePath(); + foreach (const QString &filePath, filePaths) { + QString directory = QFileInfo(filePath).absolutePath(); if (!includes.contains(directory) && !toAdd.contains(directory)) toAdd << directory; -- cgit v1.2.1