summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/coreplugin/find/findtoolbar.cpp1
-rw-r--r--src/plugins/coreplugin/generalsettings.cpp8
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp23
-rw-r--r--src/plugins/qmljseditor/qmljscomponentnamedialog.cpp1
-rw-r--r--tests/system/objects.map10
-rw-r--r--tests/system/shared/editor_utils.py13
-rw-r--r--tests/system/suite_tools/tst_codepasting/test.py2
7 files changed, 38 insertions, 20 deletions
diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp
index ab207391bd..6db9774afe 100644
--- a/src/plugins/coreplugin/find/findtoolbar.cpp
+++ b/src/plugins/coreplugin/find/findtoolbar.cpp
@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
m_horizontalSpacer = new QSpacerItem(40, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_close = new QToolButton;
+ m_close->setObjectName("closeFindToolBarButton");
auto findButtonsWidget = new QWidget;
diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp
index 5739933b00..0cd80ea6c6 100644
--- a/src/plugins/coreplugin/generalsettings.cpp
+++ b/src/plugins/coreplugin/generalsettings.cpp
@@ -163,10 +163,10 @@ void GeneralSettingsWidget::fillLanguageBox() const
QStringList(QLatin1String("qtcreator*.qm")));
for (const FilePath &languageFile : languageFiles) {
- const QString path = languageFile.path();
- int start = path.indexOf('_') + 1;
- int end = path.lastIndexOf('.');
- const QString locale = path.mid(start, end-start);
+ const QString name = languageFile.fileName();
+ int start = name.indexOf('_') + 1;
+ int end = name.lastIndexOf('.');
+ const QString locale = name.mid(start, end - start);
// no need to show a language that creator will not load anyway
if (hasQmFilesForLocale(locale, creatorTrPath.toString())) {
QLocale tmpLocale(locale);
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index f613daf1f7..e2d10dca3b 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -622,15 +622,22 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
Macros predefinedMacros;
QStringList toProcess;
- for (const QString &arg : cxxflags) {
- if (arg.startsWith("/D") || arg.startsWith("-D")) {
- const QString define = arg.mid(2);
- predefinedMacros.append(Macro::fromKeyValue(define));
- } else if (arg.startsWith("/U") || arg.startsWith("-U")) {
- predefinedMacros.append(
- {arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine});
+ for (auto arg = cxxflags.begin(); arg != cxxflags.end(); ++arg) {
+ if (arg->startsWith("/D") || arg->startsWith("-D")) {
+ if (arg->length() > 2)
+ predefinedMacros.append(Macro::fromKeyValue(arg->mid(2)));
+ else if (std::next(arg) != cxxflags.end())
+ predefinedMacros.append(Macro::fromKeyValue(*++arg));
+ } else if (arg->startsWith("/U") || arg->startsWith("-U")) {
+ if (arg->length() > 2) {
+ predefinedMacros.append({arg->mid(2).toLocal8Bit(),
+ MacroType::Undefine});
+ } else if (std::next(arg) != cxxflags.end()) {
+ predefinedMacros.append({(++arg)->toLocal8Bit(),
+ MacroType::Undefine});
+ }
} else {
- toProcess.append(arg);
+ toProcess.append(*arg);
}
}
diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp
index 6953e992b9..c94fbebe43 100644
--- a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp
+++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp
@@ -24,6 +24,7 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) :
{
setWindowTitle(Tr::tr("Move Component into Separate File"));
m_componentNameEdit = new Utils::ClassNameValidatingLineEdit;
+ m_componentNameEdit->setObjectName("componentNameEdit");
m_componentNameEdit->setPlaceholderText(Tr::tr("Component Name"));
m_messageLabel = new QLabel;
m_pathEdit = new Utils::PathChooser;
diff --git a/tests/system/objects.map b/tests/system/objects.map
index 074275eba8..09ef250542 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -2,7 +2,7 @@
:*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Continue_Core::Internal::FancyToolButton {name='Debug.Button' toolTip?='Continue *' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:*Qt Creator.Find_Find::Internal::FindToolBar {name='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
+:*Qt Creator.Find_Find::Internal::FindToolBar {type='Core::Internal::FindToolBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
:*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Interrupt_Core::Internal::FancyToolButton {name='Debug.Button' toolTip='Interrupt' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.ProjectSelectorDockWidget_QDockWidget {name='ProjectSelectorDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -61,7 +61,7 @@
:Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'}
-:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'}
+:Dialog_QmlJSEditor::Internal::ComponentNameDialog {type='QmlJSEditor::Internal::ComponentNameDialog' unnamed='1' visible='1' windowTitle='Move Component into Separate File'}
:Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerStatisticsMainView {container=':Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'}
:Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'}
:File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
@@ -118,7 +118,7 @@
:QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'}
:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.CloseFind_QToolButton {name='closeFindToolBarButton' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'}
:Qt Creator.Configure Project_QPushButton {text='Configure Project' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -132,8 +132,8 @@
:Qt Creator.QML debugging and profiling:_QLabel {text='QML debugging and profiling:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration.' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:Qt Creator.Replace_QToolButton {name='replaceButton' text='Replace' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Replace All_QToolButton {text='Replace All' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Replace_QToolButton {text='Replace' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Timeline_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='QmlProfiler.Timeline.DockDockWidget' type='QDockWidget' visible='1'}
:Qt Creator.Timeline_QTabBar {aboveWidget=':Qt Creator.Timeline_QDockWidget' container=':Qt Creator.DebugModeWidget_QSplitter' type='QTabBar' unnamed='1' visible='1'}
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index 4aa008515e..60ed802745 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -336,9 +336,16 @@ def validateSearchResult(expectedCount):
# this function invokes context menu and command from it
def invokeContextMenuItem(editorArea, command1, command2 = None):
- ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
- snooze(1)
- item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000)
+ for _ in range(2):
+ ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
+ snooze(1)
+ try:
+ item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000)
+ break
+ except:
+ test.warning("Context menu item not ready (%s) - trying once more." % command1)
+ type(editorArea, "<Escape>")
+
if command2 and platform.system() == 'Darwin':
mouseMove(item1)
activateItem(item1)
diff --git a/tests/system/suite_tools/tst_codepasting/test.py b/tests/system/suite_tools/tst_codepasting/test.py
index 1275052156..fd389490ea 100644
--- a/tests/system/suite_tools/tst_codepasting/test.py
+++ b/tests/system/suite_tools/tst_codepasting/test.py
@@ -53,6 +53,8 @@ def pasteFile(sourceFile, protocol):
typeLines(editor, "// tst_codepasting %s" % datetime.utcnow())
sourceText = editor.plainText
invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...")
+ pasteView = waitForObject(":Send to Codepaster_CodePaster::PasteView")
+ waitFor("pasteView.isActiveWindow")
selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol)
pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit")
test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor")