From d6fa81cd95391d456b7151f0bdfa9326569ca11c Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 27 Oct 2011 18:32:31 +0200 Subject: Do not try to evaluate examples or demos for Qt 5. There is no good plan on how to expose examples and demos of Qt 5 other than using XML manifests. Thus, it's best to disable the fallback mechanism, as it can only break (see e.g. QTCREATORBUG-5472). Change-Id: I4cc1fa875297c3d368ae261f5404fa61301f172f Reviewed-by: Eike Ziller --- src/plugins/qtsupport/exampleslistmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index ee143ea0b7..4a19d0d06d 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -275,6 +275,9 @@ QStringList ExamplesListModel::exampleSources() const // Try to get dir from first Qt Version QtVersionManager *versionManager = QtVersionManager::instance(); foreach (BaseQtVersion *version, versionManager->validVersions()) { + // There is no good solution for Qt 5 yet + if (version->qtVersion().majorVersion != 4) + continue; QDir examplesDir(version->examplesPath()); if (examplesDir.exists()) { -- cgit v1.2.1 From fb6d940485771a7e61508d2860e840f20daa062f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 28 Oct 2011 09:41:32 +0200 Subject: Harmattan: Use "mad" wrapper to call dh_clean. Change-Id: Iddfc6de1e34ce08bbc5fe6601195b3206b120c27 Reviewed-by: Christian Kandeler --- src/plugins/madde/maemopackagecreationstep.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/madde/maemopackagecreationstep.cpp b/src/plugins/madde/maemopackagecreationstep.cpp index 44248631b2..b6e15b5b9d 100644 --- a/src/plugins/madde/maemopackagecreationstep.cpp +++ b/src/plugins/madde/maemopackagecreationstep.cpp @@ -307,11 +307,8 @@ bool MaemoDebianPackageCreationStep::createPackage(QProcess *buildProc, } } - if (inSourceBuild) { - buildProc->start(packagingCommand(qt4BuildConfiguration(), QLatin1String("dh_clean"))); - buildProc->waitForFinished(); - buildProc->terminate(); - } + if (inSourceBuild) + callPackagingCommand(buildProc, QStringList() << QLatin1String("dh_clean")); return true; } -- cgit v1.2.1 From 49e56cdd2c554bbe19508ad39a300f633839d9f2 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 28 Oct 2011 10:36:02 +0200 Subject: debugger: re-enable sorting of source files, modules, and thread views Change-Id: I5610be7e78593d345c1f79fff6b2a61b105f8fbc Reviewed-by: Eike Ziller --- src/plugins/debugger/moduleswindow.cpp | 1 + src/plugins/debugger/sourcefileswindow.cpp | 1 + src/plugins/debugger/threadswindow.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index 900cc28e0b..b089b2aa25 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -61,6 +61,7 @@ ModulesWindow::ModulesWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Modules")); + setSortingEnabled(true); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustModulesColumnWidths)); connect(this, SIGNAL(activated(QModelIndex)), diff --git a/src/plugins/debugger/sourcefileswindow.cpp b/src/plugins/debugger/sourcefileswindow.cpp index ffbc5abf69..fc3a67436e 100644 --- a/src/plugins/debugger/sourcefileswindow.cpp +++ b/src/plugins/debugger/sourcefileswindow.cpp @@ -60,6 +60,7 @@ SourceFilesWindow::SourceFilesWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Source Files")); + setSortingEnabled(true); } void SourceFilesWindow::rowActivated(const QModelIndex &index) diff --git a/src/plugins/debugger/threadswindow.cpp b/src/plugins/debugger/threadswindow.cpp index 55924f6ea0..7be6b8b14b 100644 --- a/src/plugins/debugger/threadswindow.cpp +++ b/src/plugins/debugger/threadswindow.cpp @@ -52,6 +52,7 @@ ThreadsWindow::ThreadsWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Thread")); + setSortingEnabled(true); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths)); setObjectName(QLatin1String("ThreadsWindow")); } -- cgit v1.2.1 From c9ea9ad58b724b5f093509b25f8815c825e46b92 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 26 Oct 2011 10:03:56 +0200 Subject: Code style selector improvements Change layout in code style selector. Make it possible to see the values of built-in code style without a need to copy it. Built-in code style can be also modified after being copied inside code style editor. Task-number: QTCREATORBUG-6341 Change-Id: Ifcbf807d5730ccf9026e86572710d0cc0ccf9f1a Reviewed-by: Leandro T. C. Melo Reviewed-by: Christian Kamm --- src/plugins/texteditor/codestyleeditor.cpp | 3 + src/plugins/texteditor/codestyleselectorwidget.cpp | 163 +++++++++++++-------- src/plugins/texteditor/codestyleselectorwidget.h | 15 +- src/plugins/texteditor/codestyleselectorwidget.ui | 87 +++++++++++ src/plugins/texteditor/texteditor.pro | 4 +- 5 files changed, 200 insertions(+), 72 deletions(-) create mode 100644 src/plugins/texteditor/codestyleselectorwidget.ui (limited to 'src') diff --git a/src/plugins/texteditor/codestyleeditor.cpp b/src/plugins/texteditor/codestyleeditor.cpp index bdad029b47..976eef229d 100644 --- a/src/plugins/texteditor/codestyleeditor.cpp +++ b/src/plugins/texteditor/codestyleeditor.cpp @@ -69,6 +69,9 @@ CodeStyleEditor::CodeStyleEditor(ICodeStylePreferencesFactory *factory, tr("Edit preview contents to see how the current settings " "are applied to custom code snippets. Changes in the preview " "do not affect the current settings."), this); + QFont font = label->font(); + font.setItalic(true); + label->setFont(font); label->setWordWrap(true); m_layout->addWidget(selector); m_layout->addWidget(m_preview); diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index b291e4e2a4..b76d4f4025 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -31,6 +31,7 @@ **************************************************************************/ #include "codestyleselectorwidget.h" +#include "ui_codestyleselectorwidget.h" #include "icodestylepreferences.h" #include "icodestylepreferencesfactory.h" #include "codestylepool.h" @@ -67,15 +68,23 @@ public: ICodeStylePreferences *codeStyle, QWidget *parent = 0); ~CodeStyleDialog(); ICodeStylePreferences *codeStyle() const; - QString displayName() const; +private slots: + void slotCopyClicked(); + void slotDisplayNameChanged(); private: ICodeStylePreferences *m_codeStyle; QLineEdit *m_lineEdit; + QDialogButtonBox *m_buttons; + QLabel *m_warningLabel; + QPushButton *m_copyButton; + QString m_originalDisplayName; }; CodeStyleDialog::CodeStyleDialog(ICodeStylePreferencesFactory *factory, ICodeStylePreferences *codeStyle, QWidget *parent) - : QDialog(parent) + : QDialog(parent), + m_warningLabel(0), + m_copyButton(0) { setWindowTitle(tr("Edit Code Style")); QVBoxLayout *layout = new QVBoxLayout(this); @@ -85,17 +94,46 @@ CodeStyleDialog::CodeStyleDialog(ICodeStylePreferencesFactory *factory, nameLayout->addWidget(label); nameLayout->addWidget(m_lineEdit); layout->addLayout(nameLayout); + + if (codeStyle->isReadOnly()) { + QHBoxLayout *warningLayout = new QHBoxLayout(); + m_warningLabel = new QLabel( + tr("You cannot save changes to a built-in code style. " + "Copy it first to create your own version."), this); + QFont font = m_warningLabel->font(); + font.setItalic(true); + m_warningLabel->setFont(font); + m_warningLabel->setWordWrap(true); + m_copyButton = new QPushButton(tr("Copy Built-in Code Style"), this); + m_copyButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + connect(m_copyButton, SIGNAL(clicked()), + this, SLOT(slotCopyClicked())); + warningLayout->addWidget(m_warningLabel); + warningLayout->addWidget(m_copyButton); + layout->addLayout(warningLayout); + } + + m_originalDisplayName = codeStyle->displayName(); m_codeStyle = factory->createCodeStyle(); m_codeStyle->setTabSettings(codeStyle->tabSettings()); m_codeStyle->setValue(codeStyle->value()); + m_codeStyle->setDisplayName(m_originalDisplayName); QWidget *editor = factory->createEditor(m_codeStyle, this); - QDialogButtonBox *buttons = new QDialogButtonBox( + + m_buttons = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); + if (codeStyle->isReadOnly()) { + QPushButton *okButton = m_buttons->button(QDialogButtonBox::Ok); + okButton->setEnabled(false); + } + if (editor) layout->addWidget(editor); - layout->addWidget(buttons); - connect(buttons, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); + layout->addWidget(m_buttons); + + connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotDisplayNameChanged())); + connect(m_buttons, SIGNAL(accepted()), this, SLOT(accept())); + connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject())); } ICodeStylePreferences *CodeStyleDialog::codeStyle() const @@ -103,9 +141,22 @@ ICodeStylePreferences *CodeStyleDialog::codeStyle() const return m_codeStyle; } -QString CodeStyleDialog::displayName() const +void CodeStyleDialog::slotCopyClicked() +{ + if (m_warningLabel) + m_warningLabel->hide(); + if (m_copyButton) + m_copyButton->hide(); + QPushButton *okButton = m_buttons->button(QDialogButtonBox::Ok); + okButton->setEnabled(true); + if (m_lineEdit->text() == m_originalDisplayName) + m_lineEdit->setText(tr("%1 (Copy)").arg(m_lineEdit->text())); + m_lineEdit->selectAll(); +} + +void CodeStyleDialog::slotDisplayNameChanged() { - return m_lineEdit->text(); + m_codeStyle->setDisplayName(m_lineEdit->text()); } CodeStyleDialog::~CodeStyleDialog() @@ -120,48 +171,32 @@ CodeStyleSelectorWidget::CodeStyleSelectorWidget(ICodeStylePreferencesFactory *f QWidget(parent), m_factory(factory), m_codeStyle(0), - m_layout(0), - m_comboBox(0), - m_comboBoxLabel(0), + m_ui(new Ui::CodeStyleSelectorWidget), m_ignoreGuiSignals(false) { - m_layout = new QHBoxLayout(this); - m_layout->setContentsMargins(QMargins()); - m_copyButton = new QPushButton(tr("Copy..."), this); - m_editButton = new QPushButton(tr("Edit..."), this); - m_removeButton = new QPushButton(tr("Remove"), this); - m_importButton = new QPushButton(tr("Import..."), this); - m_exportButton = new QPushButton(tr("Export..."), this); - m_importButton->setEnabled(false); - m_exportButton->setEnabled(false); - - m_comboBoxLabel = new QLabel(tr("Current settings:"), this); - m_comboBoxLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - m_layout->addWidget(m_comboBoxLabel); - m_comboBox = new QComboBox(this); - m_comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - m_layout->addWidget(m_comboBox); - connect(m_comboBox, SIGNAL(activated(int)), - this, SLOT(slotComboBoxActivated(int))); - - m_layout->addWidget(m_copyButton); - m_layout->addWidget(m_editButton); - m_layout->addWidget(m_removeButton); - m_layout->addWidget(m_importButton); - m_layout->addWidget(m_exportButton); + m_ui->setupUi(this); + m_ui->importButton->setEnabled(false); + m_ui->exportButton->setEnabled(false); - connect(m_copyButton, SIGNAL(clicked()), + connect(m_ui->delegateComboBox, SIGNAL(activated(int)), + this, SLOT(slotComboBoxActivated(int))); + connect(m_ui->copyButton, SIGNAL(clicked()), this, SLOT(slotCopyClicked())); - connect(m_editButton, SIGNAL(clicked()), + connect(m_ui->editButton, SIGNAL(clicked()), this, SLOT(slotEditClicked())); - connect(m_removeButton, SIGNAL(clicked()), + connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked())); - connect(m_importButton, SIGNAL(clicked()), + connect(m_ui->importButton, SIGNAL(clicked()), this, SLOT(slotImportClicked())); - connect(m_exportButton, SIGNAL(clicked()), + connect(m_ui->exportButton, SIGNAL(clicked()), this, SLOT(slotExportClicked())); } +CodeStyleSelectorWidget::~CodeStyleSelectorWidget() +{ + delete m_ui; +} + void CodeStyleSelectorWidget::setCodeStyle(TextEditor::ICodeStylePreferences *codeStyle) { if (m_codeStyle == codeStyle) @@ -179,9 +214,9 @@ void CodeStyleSelectorWidget::setCodeStyle(TextEditor::ICodeStylePreferences *co disconnect(m_codeStyle, SIGNAL(currentDelegateChanged(ICodeStylePreferences*)), this, SLOT(slotCurrentDelegateChanged(ICodeStylePreferences*))); - m_exportButton->setEnabled(false); - m_importButton->setEnabled(false); - m_comboBox->clear(); + m_ui->exportButton->setEnabled(false); + m_ui->importButton->setEnabled(false); + m_ui->delegateComboBox->clear(); } m_codeStyle = codeStyle; // fillup new @@ -195,8 +230,8 @@ void CodeStyleSelectorWidget::setCodeStyle(TextEditor::ICodeStylePreferences *co this, SLOT(slotCodeStyleAdded(ICodeStylePreferences*))); connect(codeStylePool, SIGNAL(codeStyleRemoved(ICodeStylePreferences*)), this, SLOT(slotCodeStyleRemoved(ICodeStylePreferences*))); - m_exportButton->setEnabled(true); - m_importButton->setEnabled(true); + m_ui->exportButton->setEnabled(true); + m_ui->importButton->setEnabled(true); } for (int i = 0; i < delegates.count(); i++) @@ -214,10 +249,10 @@ void CodeStyleSelectorWidget::slotComboBoxActivated(int index) if (m_ignoreGuiSignals) return; - if (!m_comboBox || index < 0 || index >= m_comboBox->count()) + if (index < 0 || index >= m_ui->delegateComboBox->count()) return; TextEditor::ICodeStylePreferences *delegate = - m_comboBox->itemData(index).value(); + m_ui->delegateComboBox->itemData(index).value(); const bool wasBlocked = blockSignals(true); m_codeStyle->setCurrentDelegate(delegate); @@ -227,15 +262,12 @@ void CodeStyleSelectorWidget::slotComboBoxActivated(int index) void CodeStyleSelectorWidget::slotCurrentDelegateChanged(TextEditor::ICodeStylePreferences *delegate) { m_ignoreGuiSignals = true; - if (m_comboBox) { - m_comboBox->setCurrentIndex(m_comboBox->findData(QVariant::fromValue(delegate))); - m_comboBox->setToolTip(m_comboBox->currentText()); - } + m_ui->delegateComboBox->setCurrentIndex(m_ui->delegateComboBox->findData(QVariant::fromValue(delegate))); + m_ui->delegateComboBox->setToolTip(m_ui->delegateComboBox->currentText()); m_ignoreGuiSignals = false; - const bool enableEdit = delegate && !delegate->isReadOnly() && !delegate->currentDelegate(); - m_editButton->setEnabled(enableEdit); - m_removeButton->setEnabled(enableEdit); + const bool removeEnabled = delegate && !delegate->isReadOnly() && !delegate->currentDelegate(); + m_ui->removeButton->setEnabled(removeEnabled); } void CodeStyleSelectorWidget::slotCopyClicked() @@ -271,9 +303,16 @@ void CodeStyleSelectorWidget::slotEditClicked() Internal::CodeStyleDialog dialog(m_factory, codeStyle, this); if (dialog.exec() == QDialog::Accepted) { ICodeStylePreferences *dialogCodeStyle = dialog.codeStyle(); + if (codeStyle->isReadOnly()) { + CodeStylePool *codeStylePool = m_codeStyle->delegatingPool(); + codeStyle = codeStylePool->cloneCodeStyle(dialogCodeStyle); + if (codeStyle) + m_codeStyle->setCurrentDelegate(codeStyle); + return; + } codeStyle->setTabSettings(dialogCodeStyle->tabSettings()); codeStyle->setValue(dialogCodeStyle->value()); - codeStyle->setDisplayName(dialog.displayName()); + codeStyle->setDisplayName(dialogCodeStyle->displayName()); } } @@ -337,8 +376,8 @@ void CodeStyleSelectorWidget::slotCodeStyleAdded(ICodeStylePreferences *codeStyl const QVariant data = QVariant::fromValue(codeStylePreferences); const QString name = displayName(codeStylePreferences); - m_comboBox->addItem(name, data); - m_comboBox->setItemData(m_comboBox->count() - 1, name, Qt::ToolTipRole); + m_ui->delegateComboBox->addItem(name, data); + m_ui->delegateComboBox->setItemData(m_ui->delegateComboBox->count() - 1, name, Qt::ToolTipRole); connect(codeStylePreferences, SIGNAL(displayNameChanged(QString)), this, SLOT(slotUpdateName())); if (codeStylePreferences->delegatingPool()) { @@ -350,7 +389,7 @@ void CodeStyleSelectorWidget::slotCodeStyleAdded(ICodeStylePreferences *codeStyl void CodeStyleSelectorWidget::slotCodeStyleRemoved(ICodeStylePreferences *codeStylePreferences) { m_ignoreGuiSignals = true; - m_comboBox->removeItem(m_comboBox->findData(QVariant::fromValue(codeStylePreferences))); + m_ui->delegateComboBox->removeItem(m_ui->delegateComboBox->findData(QVariant::fromValue(codeStylePreferences))); disconnect(codeStylePreferences, SIGNAL(displayNameChanged(QString)), this, SLOT(slotUpdateName())); if (codeStylePreferences->delegatingPool()) { @@ -375,18 +414,18 @@ void CodeStyleSelectorWidget::slotUpdateName() updateName(codeStyle); } - m_comboBox->setToolTip(m_comboBox->currentText()); + m_ui->delegateComboBox->setToolTip(m_ui->delegateComboBox->currentText()); } void CodeStyleSelectorWidget::updateName(ICodeStylePreferences *codeStyle) { - const int idx = m_comboBox->findData(QVariant::fromValue(codeStyle)); + const int idx = m_ui->delegateComboBox->findData(QVariant::fromValue(codeStyle)); if (idx < 0) return; const QString name = displayName(codeStyle); - m_comboBox->setItemText(idx, name); - m_comboBox->setItemData(idx, name, Qt::ToolTipRole); + m_ui->delegateComboBox->setItemText(idx, name); + m_ui->delegateComboBox->setItemData(idx, name, Qt::ToolTipRole); } QString CodeStyleSelectorWidget::displayName(ICodeStylePreferences *codeStyle) const diff --git a/src/plugins/texteditor/codestyleselectorwidget.h b/src/plugins/texteditor/codestyleselectorwidget.h index a8cd5fa421..0759a916b4 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.h +++ b/src/plugins/texteditor/codestyleselectorwidget.h @@ -50,11 +50,16 @@ namespace TextEditor { class ICodeStylePreferences; class ICodeStylePreferencesFactory; +namespace Ui { +class CodeStyleSelectorWidget; +} + class TEXTEDITOR_EXPORT CodeStyleSelectorWidget : public QWidget { Q_OBJECT public: explicit CodeStyleSelectorWidget(ICodeStylePreferencesFactory *factory, QWidget *parent = 0); + ~CodeStyleSelectorWidget(); void setCodeStyle(TextEditor::ICodeStylePreferences *codeStyle); QString searchKeywords() const; @@ -80,15 +85,7 @@ private: QString displayName(ICodeStylePreferences *codeStyle) const; - QHBoxLayout *m_layout; - - QComboBox *m_comboBox; - QLabel *m_comboBoxLabel; - QPushButton *m_copyButton; - QPushButton *m_editButton; - QPushButton *m_removeButton; - QPushButton *m_importButton; - QPushButton *m_exportButton; + Ui::CodeStyleSelectorWidget *m_ui; bool m_ignoreGuiSignals; }; diff --git a/src/plugins/texteditor/codestyleselectorwidget.ui b/src/plugins/texteditor/codestyleselectorwidget.ui new file mode 100644 index 0000000000..462062cd94 --- /dev/null +++ b/src/plugins/texteditor/codestyleselectorwidget.ui @@ -0,0 +1,87 @@ + + + TextEditor::CodeStyleSelectorWidget + + + + 0 + 0 + 523 + 58 + + + + Form + + + + 0 + + + + + + + Current settings: + + + + + + + + 0 + 0 + + + + + + + + + + Copy... + + + + + + + Edit... + + + + + + + Remove + + + + + + + Export... + + + + + + + Import... + + + + + + + delegateComboBox + copyButton + editButton + removeButton + exportButton + + + + diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index d5b418533f..afe8095614 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -234,7 +234,8 @@ FORMS += \ snippets/snippetssettingspage.ui \ behaviorsettingswidget.ui \ behaviorsettingspage.ui \ - tabsettingswidget.ui + tabsettingswidget.ui \ + codestyleselectorwidget.ui RESOURCES += texteditor.qrc OTHER_FILES += TextEditor.mimetypes.xml @@ -246,3 +247,4 @@ OTHER_FILES += TextEditor.mimetypes.xml + -- cgit v1.2.1 From 082243fd96ddec2f461d13f9947bbe2e29aea501 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 28 Oct 2011 13:22:45 +0200 Subject: Fix memory leaks (lacking destructors for uis) Change-Id: I07c2708d727d59286b0d625a4c0c318f18b03b93 Reviewed-by: Tobias Hunger Reviewed-by: hjk --- src/plugins/debugger/debuggerdialogs.cpp | 1 + src/plugins/git/remotedialog.cpp | 5 +++++ src/plugins/git/remotedialog.h | 1 + src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp | 5 +++++ src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h | 1 + src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp | 5 +++++ src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h | 1 + src/plugins/valgrind/suppressiondialog.cpp | 5 +++++ src/plugins/valgrind/suppressiondialog.h | 1 + 9 files changed, 25 insertions(+) (limited to 'src') diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index e13502c351..8915590bc8 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -1040,6 +1040,7 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent) : StartRemoteEngineDialog::~StartRemoteEngineDialog() { + delete m_ui; } QString StartRemoteEngineDialog::host() const diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index 1c388305f7..06d02cb500 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -60,6 +60,11 @@ RemoteAdditionDialog::RemoteAdditionDialog(QWidget *parent) : setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); } +RemoteAdditionDialog::~RemoteAdditionDialog() +{ + delete m_ui; +} + QString RemoteAdditionDialog::remoteName() const { return m_ui->nameEdit->text(); diff --git a/src/plugins/git/remotedialog.h b/src/plugins/git/remotedialog.h index 4458bf544c..12e367b9bc 100644 --- a/src/plugins/git/remotedialog.h +++ b/src/plugins/git/remotedialog.h @@ -56,6 +56,7 @@ class RemoteAdditionDialog : public QDialog public: explicit RemoteAdditionDialog(QWidget *parent = 0); + ~RemoteAdditionDialog(); QString remoteName() const; QString remoteUrl() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp index 52083b859c..60468138dc 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp @@ -409,6 +409,11 @@ RvctToolChainConfigWidget::RvctToolChainConfigWidget(RvctToolChain *tc) : setFromToolChain(); } +RvctToolChainConfigWidget::~RvctToolChainConfigWidget() +{ + delete m_ui; +} + void RvctToolChainConfigWidget::apply() { RvctToolChain *tc = static_cast(toolChain()); diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h index 6580afe5d4..b134f721d4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h @@ -143,6 +143,7 @@ class RvctToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget public: RvctToolChainConfigWidget(RvctToolChain *tc); + ~RvctToolChainConfigWidget(); void apply(); void discard() { setFromToolChain(); } diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp index 367d6f52c0..0d93c8a4ac 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp @@ -319,6 +319,11 @@ WinscwToolChainConfigWidget::WinscwToolChainConfigWidget(WinscwToolChain *tc) : discard(); } +WinscwToolChainConfigWidget::~WinscwToolChainConfigWidget() +{ + delete m_ui; +} + void WinscwToolChainConfigWidget::apply() { WinscwToolChain *tc = static_cast(toolChain()); diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h index 198b36bacf..aa8c13818a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h @@ -105,6 +105,7 @@ class WinscwToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidge public: WinscwToolChainConfigWidget(WinscwToolChain *); + ~WinscwToolChainConfigWidget(); void apply(); void discard(); diff --git a/src/plugins/valgrind/suppressiondialog.cpp b/src/plugins/valgrind/suppressiondialog.cpp index e5e3470534..cdd78e45e6 100644 --- a/src/plugins/valgrind/suppressiondialog.cpp +++ b/src/plugins/valgrind/suppressiondialog.cpp @@ -170,6 +170,11 @@ SuppressionDialog::SuppressionDialog(MemcheckErrorView *view) setWindowTitle(tr("Save Suppression")); } +SuppressionDialog::~SuppressionDialog() +{ + delete m_ui; +} + bool SuppressionDialog::shouldShow() const { return !m_errors.isEmpty(); diff --git a/src/plugins/valgrind/suppressiondialog.h b/src/plugins/valgrind/suppressiondialog.h index 3dc6ff7013..f5d65c0584 100644 --- a/src/plugins/valgrind/suppressiondialog.h +++ b/src/plugins/valgrind/suppressiondialog.h @@ -58,6 +58,7 @@ class SuppressionDialog : public QDialog public: SuppressionDialog(MemcheckErrorView *view); + ~SuppressionDialog(); virtual void accept(); virtual void reject(); -- cgit v1.2.1 From c4f6ad856d6d96dcc639338368076fdf7041af0a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 25 Oct 2011 16:51:43 +0200 Subject: Remove unnecessary code. Change-Id: I07a382696c57f5451645e854e55aa30e9e81326c Reviewed-by: Christian Kamm Reviewed-by: Thomas Hartmann --- src/plugins/qmljseditor/qmljseditorfactory.cpp | 85 -------------------------- src/plugins/qmljseditor/qmljseditorfactory.h | 4 -- 2 files changed, 89 deletions(-) (limited to 'src') diff --git a/src/plugins/qmljseditor/qmljseditorfactory.cpp b/src/plugins/qmljseditor/qmljseditorfactory.cpp index 8dca17d3f7..a828e46464 100644 --- a/src/plugins/qmljseditor/qmljseditorfactory.cpp +++ b/src/plugins/qmljseditor/qmljseditorfactory.cpp @@ -51,37 +51,6 @@ #include #include -namespace { - const char * const QMLDESIGNER_INFO_BAR = "QmlJSEditor.QmlDesignerInfoBar"; - const char * const KEY_QMLGROUP = "QML"; - const char * const KEY_NAGABOUTDESIGNER = "AskAboutVisualDesigner"; - - bool isQmlDesignerExperimentallyDisabled() - { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - foreach (const ExtensionSystem::PluginSpec *spec, pm->plugins()) { - if (spec->name() == QLatin1String("QmlDesigner")) { - if (spec->isExperimental() && !spec->isEnabled()) - return true; - return false; - } - } - return false; - } - - bool isNaggingAboutExperimentalDesignerEnabled() - { - if (!isQmlDesignerExperimentallyDisabled()) { - return false; - } - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(QLatin1String(KEY_QMLGROUP)); - bool nag = settings->value(QLatin1String(KEY_NAGABOUTDESIGNER), true).toBool(); - settings->endGroup(); - return nag; - } -} - using namespace QmlJSEditor; using namespace QmlJSEditor::Internal; using namespace QmlJSEditor::Constants; @@ -120,13 +89,6 @@ Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent) { QmlJSEditor::QmlJSTextEditorWidget *rc = new QmlJSEditor::QmlJSTextEditorWidget(parent); QmlJSEditorPlugin::instance()->initializeEditor(rc); - if (isNaggingAboutExperimentalDesignerEnabled()) { - Core::InfoBarEntry info(QMLDESIGNER_INFO_BAR, - tr("Do you want to enable the experimental Qt Quick Designer?")); - info.setCustomButtonInfo(tr("Enable Qt Quick Designer"), this, SLOT(activateQmlDesigner())); - info.setCancelButtonInfo(this, SLOT(neverAskAgainAboutQmlDesigner())); - rc->file()->infoBar()->addInfo(info); - } return rc->editor(); } @@ -134,50 +96,3 @@ QStringList QmlJSEditorFactory::mimeTypes() const { return m_mimeTypes; } - -void QmlJSEditorFactory::activateQmlDesigner() -{ - QString menu; -#ifdef Q_WS_MAC - menu = tr("Qt Creator -> About Plugins..."); -#else - menu = tr("Help -> About Plugins..."); -#endif - QMessageBox message(Core::ICore::instance()->mainWindow()); - message.setWindowTitle(tr("Enable experimental Qt Quick Designer?")); - message.setText(tr("Do you want to enable the experimental Qt Quick Designer? " - "After enabling it, you can access the visual design capabilities by switching to Design Mode. " - "This can affect the overall stability of Qt Creator. " - "To disable Qt Quick Designer again, visit the menu '%1' and disable 'QmlDesigner'.").arg(menu)); - message.setIcon(QMessageBox::Question); - QPushButton *enable = message.addButton(tr("Enable Qt Quick Designer"), QMessageBox::AcceptRole); - message.addButton(tr("Cancel"), QMessageBox::RejectRole); - message.exec(); - if (message.clickedButton() == enable) { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - foreach (ExtensionSystem::PluginSpec *spec, pm->plugins()) { - if (spec->name() == QLatin1String("QmlDesigner")) { - spec->setEnabled(true); - pm->writeSettings(); - QMessageBox::information(Core::ICore::instance()->mainWindow(), tr("Please restart Qt Creator"), - tr("Please restart Qt Creator to make the change effective.")); - foreach (Core::IEditor *editor, Core::EditorManager::instance()->openedEditors()) - if (qobject_cast(editor)) - editor->file()->infoBar()->removeInfo(QMLDESIGNER_INFO_BAR); - neverAskAgainAboutQmlDesigner(); - return; - } - } - } -} - -void QmlJSEditorFactory::neverAskAgainAboutQmlDesigner() -{ - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(QLatin1String(KEY_QMLGROUP)); - settings->setValue(QLatin1String(KEY_NAGABOUTDESIGNER), false); - settings->endGroup(); - settings->sync(); - disconnect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), - this, SLOT(updateEditorInfoBar(Core::IEditor*))); -} diff --git a/src/plugins/qmljseditor/qmljseditorfactory.h b/src/plugins/qmljseditor/qmljseditorfactory.h index ee9047e7a2..adbea9ab47 100644 --- a/src/plugins/qmljseditor/qmljseditorfactory.h +++ b/src/plugins/qmljseditor/qmljseditorfactory.h @@ -54,10 +54,6 @@ public: Core::IFile *open(const QString &fileName); Core::IEditor *createEditor(QWidget *parent); -private slots: - void activateQmlDesigner(); - void neverAskAgainAboutQmlDesigner(); - private: QStringList m_mimeTypes; }; -- cgit v1.2.1 From f3774d0a6f8fc71c806a84d6b207bde29d967ff4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 27 Oct 2011 14:25:18 +0200 Subject: Limit the length of shown search result line. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This e.g. avoids "lines" of several MB if file search hits a binary file. Task-number: QTCREATORBUG-6116 Change-Id: Ibf89a332bc82ddbdb2aeb83c4b3886e784dab4b8 Reviewed-by: Ralf Neubersch Reviewed-by: Robert Löhning --- src/libs/utils/filesearch.cpp | 15 +++++++++++++-- src/plugins/find/searchresulttreeitemdelegate.cpp | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 98386def46..d43fe8d0a1 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -70,6 +70,15 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu namespace { +const int MAX_LINE_SIZE = 400; + +QString clippedText(const QString &text, int maxLength) +{ + if (text.length() > maxLength) + return text.left(maxLength) + QChar(0x2026); // '...' + return text; +} + void runFileSearch(QFutureInterface &future, QString searchTerm, FileIterator *files, @@ -123,6 +132,7 @@ void runFileSearch(QFutureInterface &future, while (!stream.atEnd()) { ++lineNr; const QString chunk = stream.readLine(); + const QString resultItemText = clippedText(chunk, MAX_LINE_SIZE); int chunkLength = chunk.length(); const QChar *chunkPtr = chunk.constData(); const QChar *chunkEnd = chunkPtr + chunkLength - 1; @@ -166,7 +176,7 @@ void runFileSearch(QFutureInterface &future, } } if (equal) { - results << FileSearchResult(s, lineNr, chunk, + results << FileSearchResult(s, lineNr, resultItemText, regionPtr - chunkPtr, termLength, QStringList()); ++numMatches; @@ -244,10 +254,11 @@ void runFileSearchRegExp(QFutureInterface &future, QString line; while (!stream.atEnd()) { line = stream.readLine(); + const QString resultItemText = clippedText(line, MAX_LINE_SIZE); int lengthOfLine = line.size(); int pos = 0; while ((pos = expression.indexIn(line, pos)) != -1) { - results << FileSearchResult(s, lineNr, line, + results << FileSearchResult(s, lineNr, resultItemText, pos, expression.matchedLength(), expression.capturedTexts()); ++numMatches; diff --git a/src/plugins/find/searchresulttreeitemdelegate.cpp b/src/plugins/find/searchresulttreeitemdelegate.cpp index 4e9780c841..7560f1d8fa 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.cpp +++ b/src/plugins/find/searchresulttreeitemdelegate.cpp @@ -162,8 +162,10 @@ void SearchResultTreeItemDelegate::drawMarker(QPainter *painter, const QModelInd { int searchTermStart = index.model()->data(index, ItemDataRoles::SearchTermStartRole).toInt(); int searchTermLength = index.model()->data(index, ItemDataRoles::SearchTermLengthRole).toInt(); - if (searchTermStart < 0 || searchTermLength < 1) + if (searchTermStart < 0 || searchTermStart >= text.length() || searchTermLength < 1) return; + // clip searchTermLength to end of line + searchTermLength = qMin(searchTermLength, text.length() - searchTermStart); const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1; int searchTermStartPixels = painter->fontMetrics().width(text.left(searchTermStart)); int searchTermLengthPixels = painter->fontMetrics().width(text.mid(searchTermStart, searchTermLength)); -- cgit v1.2.1 From a9553c494ef6012cc4c34bd469ff0f20ee2e2671 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 24 Oct 2011 12:29:54 +0200 Subject: QmlJS indenter: Never touch indent of multi-line strings. Task-number: QTCREATORBUG-6368 Change-Id: Iae68427e429e625214bc0729aaaf313dc3371570 Reviewed-by: Fawzi Mohamed --- src/libs/qmljs/qmljscodeformatter.cpp | 9 +++++---- src/libs/qmljs/qmljscodeformatter.h | 2 +- src/plugins/qmljstools/qmljsindenter.cpp | 2 ++ src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp | 10 +++++++--- src/plugins/qmljstools/qmljsqtstylecodeformatter.h | 2 +- src/plugins/qmljstools/qmljsrefactoringchanges.cpp | 4 +++- 6 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/libs/qmljs/qmljscodeformatter.cpp b/src/libs/qmljs/qmljscodeformatter.cpp index c884e56d5b..f4ddddb89b 100644 --- a/src/libs/qmljs/qmljscodeformatter.cpp +++ b/src/libs/qmljs/qmljscodeformatter.cpp @@ -517,10 +517,10 @@ int CodeFormatter::indentForNewLineAfter(const QTextBlock &block) { restoreCurrentState(block); - int lexerState = loadLexerState(block); m_tokens.clear(); m_currentLine.clear(); - adjustIndent(m_tokens, lexerState, &m_indentDepth); + const int startLexerState = loadLexerState(block.previous()); + adjustIndent(m_tokens, startLexerState, &m_indentDepth); return m_indentDepth; } @@ -665,10 +665,11 @@ void CodeFormatter::leave(bool statementDone) void CodeFormatter::correctIndentation(const QTextBlock &block) { - const int lexerState = tokenizeBlock(block); + tokenizeBlock(block); Q_ASSERT(m_currentState.size() >= 1); - adjustIndent(m_tokens, lexerState, &m_indentDepth); + const int startLexerState = loadLexerState(block.previous()); + adjustIndent(m_tokens, startLexerState, &m_indentDepth); } bool CodeFormatter::tryInsideExpression(bool alsoExpression) diff --git a/src/libs/qmljs/qmljscodeformatter.h b/src/libs/qmljs/qmljscodeformatter.h index 7af62d5485..fdd3a46f36 100644 --- a/src/libs/qmljs/qmljscodeformatter.h +++ b/src/libs/qmljs/qmljscodeformatter.h @@ -71,7 +71,7 @@ public: protected: virtual void onEnter(int newState, int *indentDepth, int *savedIndentDepth) const = 0; - virtual void adjustIndent(const QList &tokens, int lexerState, int *indentDepth) const = 0; + virtual void adjustIndent(const QList &tokens, int startLexerState, int *indentDepth) const = 0; struct State; class QMLJS_EXPORT BlockData diff --git a/src/plugins/qmljstools/qmljsindenter.cpp b/src/plugins/qmljstools/qmljsindenter.cpp index 13ffc9621a..b16ae56889 100644 --- a/src/plugins/qmljstools/qmljsindenter.cpp +++ b/src/plugins/qmljstools/qmljsindenter.cpp @@ -70,6 +70,8 @@ void Indenter::indentBlock(QTextDocument *doc, codeFormatter.updateStateUntil(block); const int depth = codeFormatter.indentFor(block); + if (depth == -1) + return; if (isElectricCharacter(typedChar)) { // only reindent the current line when typing electric characters if the diff --git a/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp b/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp index 176c016b42..3b775f7e26 100644 --- a/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp +++ b/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp @@ -289,10 +289,8 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd } } -void QtStyleCodeFormatter::adjustIndent(const QList &tokens, int lexerState, int *indentDepth) const +void QtStyleCodeFormatter::adjustIndent(const QList &tokens, int startLexerState, int *indentDepth) const { - Q_UNUSED(lexerState) - State topState = state(); State previousState = state(1); @@ -304,6 +302,12 @@ void QtStyleCodeFormatter::adjustIndent(const QList &tokens, int lexerSta return; } } + // don't touch multi-line strings at all + if ((startLexerState & Scanner::MultiLineMask) == Scanner::MultiLineStringDQuote + || (startLexerState & Scanner::MultiLineMask) == Scanner::MultiLineStringSQuote) { + *indentDepth = -1; + return; + } const int kind = extendedTokenKind(tokenAt(0)); switch (kind) { diff --git a/src/plugins/qmljstools/qmljsqtstylecodeformatter.h b/src/plugins/qmljstools/qmljsqtstylecodeformatter.h index 9668c498c9..b5f1d25f3c 100644 --- a/src/plugins/qmljstools/qmljsqtstylecodeformatter.h +++ b/src/plugins/qmljstools/qmljsqtstylecodeformatter.h @@ -54,7 +54,7 @@ public: protected: virtual void onEnter(int newState, int *indentDepth, int *savedIndentDepth) const; - virtual void adjustIndent(const QList &tokens, int lexerState, int *indentDepth) const; + virtual void adjustIndent(const QList &tokens, int startLexerState, int *indentDepth) const; virtual void saveBlockData(QTextBlock *block, const BlockData &data) const; virtual bool loadBlockData(const QTextBlock &block, BlockData *data) const; diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp index 56b9d8486b..0af657472a 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp @@ -69,7 +69,9 @@ public: codeFormatter.updateStateUntil(block); do { - tabSettings.indentLine(block, codeFormatter.indentFor(block)); + const int depth = codeFormatter.indentFor(block); + if (depth != -1) + tabSettings.indentLine(block, depth); codeFormatter.updateLineStateChange(block); block = block.next(); } while (block.isValid() && block != end); -- cgit v1.2.1 From 4521be25cd6888f9412c0a6350171dd0383ede0a Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 25 Oct 2011 10:23:01 +0200 Subject: QmlJS: Avoid an infinite loop if a qmltypes file has a cycle. The qmltypes files shipped with libraries shouldn't, but could define components that form a prototype cycle. Use of the new QmlObjectValue::prototypes() function avoids the code model getting stuck in an infinite loop for these cases. For plain ObjectValues this is already solved by using PrototypeIterator. Change-Id: I0f562672ab99b454bc3a0121c7a1b9eca43476bb Reviewed-by: Fawzi Mohamed --- src/libs/qmljs/qmljsinterpreter.cpp | 32 ++++++++++++++++++++++++-------- src/libs/qmljs/qmljsinterpreter.h | 1 + 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 581f240b0b..529b66e3a2 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -338,6 +338,22 @@ const QmlObjectValue *QmlObjectValue::prototype() const return static_cast(_prototype); } +/*! + \returns a list started by this object and followed by all its prototypes + + Prefer to use this over calling prototype() in a loop, as it avoids cycles. +*/ +QList QmlObjectValue::prototypes() const +{ + QList protos; + for (const QmlObjectValue *it = this; it; it = it->prototype()) { + if (protos.contains(it)) + break; + protos += it; + } + return protos; +} + const QmlObjectValue *QmlObjectValue::attachedType() const { return _attachedType; @@ -367,7 +383,7 @@ QString QmlObjectValue::defaultPropertyName() const QString QmlObjectValue::propertyType(const QString &propertyName) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; int propIdx = iter->propertyIndex(propertyName); if (propIdx != -1) { @@ -379,7 +395,7 @@ QString QmlObjectValue::propertyType(const QString &propertyName) const bool QmlObjectValue::isListProperty(const QString &propertyName) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; int propIdx = iter->propertyIndex(propertyName); if (propIdx != -1) { @@ -391,7 +407,7 @@ bool QmlObjectValue::isListProperty(const QString &propertyName) const FakeMetaEnum QmlObjectValue::getEnum(const QString &typeName, const QmlObjectValue **foundInScope) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; const int index = iter->enumeratorIndex(typeName); if (index != -1) { @@ -407,7 +423,7 @@ FakeMetaEnum QmlObjectValue::getEnum(const QString &typeName, const QmlObjectVal const QmlEnumValue *QmlObjectValue::getEnumValue(const QString &typeName, const QmlObjectValue **foundInScope) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { if (const QmlEnumValue *e = it->_enums.value(typeName)) { if (foundInScope) *foundInScope = it; @@ -421,7 +437,7 @@ const QmlEnumValue *QmlObjectValue::getEnumValue(const QString &typeName, const bool QmlObjectValue::isWritable(const QString &propertyName) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; int propIdx = iter->propertyIndex(propertyName); if (propIdx != -1) { @@ -433,7 +449,7 @@ bool QmlObjectValue::isWritable(const QString &propertyName) const bool QmlObjectValue::isPointer(const QString &propertyName) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; int propIdx = iter->propertyIndex(propertyName); if (propIdx != -1) { @@ -453,7 +469,7 @@ bool QmlObjectValue::hasLocalProperty(const QString &typeName) const bool QmlObjectValue::hasProperty(const QString &propertyName) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; int propIdx = iter->propertyIndex(propertyName); if (propIdx != -1) { @@ -465,7 +481,7 @@ bool QmlObjectValue::hasProperty(const QString &propertyName) const bool QmlObjectValue::isDerivedFrom(FakeMetaObject::ConstPtr base) const { - for (const QmlObjectValue *it = this; it; it = it->prototype()) { + foreach (const QmlObjectValue *it, prototypes()) { FakeMetaObject::ConstPtr iter = it->_metaObject; if (iter == base) return true; diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index 8f9ec41da6..aa484598f0 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -428,6 +428,7 @@ public: using ObjectValue::prototype; const QmlObjectValue *prototype() const; + QList prototypes() const; const QmlObjectValue *attachedType() const; void setAttachedType(QmlObjectValue *value); -- cgit v1.2.1 From 5cd2123862da2217237eb8644523672c398e8d9a Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 31 Oct 2011 11:37:51 +0100 Subject: C++: Fix findMatchingDeclaration for functions not in a class. That fixes navigation and the 'function signature update' quickfix for global functions and functions in namespaces. Task-number: QTCREATORBUG-6413 Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086 Reviewed-by: Leandro T. C. Melo --- src/libs/cplusplus/CppDocument.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 0df7704e09..f8ff42ca9c 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -918,11 +918,11 @@ void CPlusPlus::findMatchingDeclaration(const LookupContext &context, return; foreach (Symbol *s, binding->symbols()) { - Class *matchingClass = s->asClass(); - if (!matchingClass) + Scope *scope = s->asScope(); + if (!scope) continue; - for (Symbol *s = matchingClass->find(funcId); s; s = s->next()) { + for (Symbol *s = scope->find(funcId); s; s = s->next()) { if (! s->name()) continue; else if (! funcId->isEqualTo(s->identifier())) -- cgit v1.2.1 From a9103d92fe46ea709fd397cdd0aaa3b19fbe1d39 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 31 Oct 2011 09:52:18 +0000 Subject: GCC: Autodetect old GCC versions needed for macx-g++XY mkspecs Change-Id: If35b1ef2c0eba424cbdf70e0405243c14d413bab Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/gcctoolchain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 1b8364bec1..01f5df32b9 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -582,7 +582,13 @@ QList Internal::GccToolChainFactory::autoDetect() // Fixme Prefer lldb once it is implemented: debuggers.push_back(QLatin1String("lldb")); #endif debuggers.push_back(QLatin1String("gdb")); - return autoDetectToolchains(QLatin1String("g++"), debuggers, Abi::hostAbi()); + QList tcs = autoDetectToolchains(QLatin1String("g++"), debuggers, Abi::hostAbi()); + + // Old mac compilers needed to support macx-gccXY mkspecs: + tcs.append(autoDetectToolchains(QLatin1String("g++-4.0"), debuggers, Abi::hostAbi())); + tcs.append(autoDetectToolchains(QLatin1String("g++-4.2"), debuggers, Abi::hostAbi())); + + return tcs; } // Used by the ToolChainManager to restore user-generated tool chains -- cgit v1.2.1 From 2fb8e135297aa061b362d407d5c0a3bcd7f8b71d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 31 Oct 2011 09:52:52 +0000 Subject: Qt: Pick tool chain that works with the default mkspec Pick a tool chain that suggests the same mkspec as the Qt version was build with if possible. This should help with the case of us choosing the wrong tool chain on mac. Change-Id: I206658fd36f2f3c2223392a2c69cf264b5b6a54e Reviewed-by: Daniel Teske --- src/plugins/qt4projectmanager/qt4target.cpp | 14 ++++++++++++++ src/plugins/qt4projectmanager/qt4target.h | 1 + 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index 014887462d..1cb563bf55 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -292,6 +292,20 @@ QList Qt4BaseTarget::possibleToolChains(ProjectExp return result; } +ProjectExplorer::ToolChain *Qt4BaseTarget::preferredToolChain(ProjectExplorer::BuildConfiguration *bc) const +{ + Qt4BuildConfiguration *qtBc = qobject_cast(bc); + if (!qtBc || !qtBc->qtVersion()) + return Target::preferredToolChain(bc); + + QList tcs = possibleToolChains(bc); + const QString mkspec = qtBc->qtVersion()->mkspec(); + foreach (ProjectExplorer::ToolChain *tc, tcs) + if (tc->mkspec() == mkspec) + return tc; + return tcs.isEmpty() ? 0 : tcs.at(0); +} + void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations() { if (runConfigurations().count()) { diff --git a/src/plugins/qt4projectmanager/qt4target.h b/src/plugins/qt4projectmanager/qt4target.h index f9325e2230..5e3824a89d 100644 --- a/src/plugins/qt4projectmanager/qt4target.h +++ b/src/plugins/qt4projectmanager/qt4target.h @@ -90,6 +90,7 @@ public: virtual QList runConfigurationsForNode(ProjectExplorer::Node *n) = 0; QList possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const; + ProjectExplorer::ToolChain *preferredToolChain(ProjectExplorer::BuildConfiguration *) const; signals: void buildDirectoryInitialized(); -- cgit v1.2.1 From e202e4b8e0c891c362c29905e2f310ff9ee02279 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 24 Oct 2011 13:10:38 +0000 Subject: Fix various crashes Task-Number: QTCREATORBUG-6365 Change-Id: I19a200e3c811eef83d591f6eacca3e48eb0fba8f Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/buildmanager.cpp | 77 ++++++++++++++++------ src/plugins/projectexplorer/buildmanager.h | 6 +- .../buildsettingspropertiespage.cpp | 25 +++++++ src/plugins/projectexplorer/buildstep.cpp | 10 +++ src/plugins/projectexplorer/buildstep.h | 2 + src/plugins/projectexplorer/project.cpp | 11 +++- src/plugins/projectexplorer/project.h | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 14 ++++ .../projectexplorer/runsettingspropertiespage.cpp | 32 +++++++-- src/plugins/projectexplorer/target.cpp | 22 +++++-- src/plugins/projectexplorer/target.h | 4 +- .../projectexplorer/targetsettingspanel.cpp | 37 +++++++++-- 12 files changed, 196 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index c66c3d0f7e..ecf2c05439 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -89,6 +89,8 @@ struct BuildManagerPrivate { QString m_currentConfiguration; // used to decide if we are building a project to decide when to emit buildStateChanged(Project *) QHash m_activeBuildSteps; + QHash m_activeBuildStepsPerTarget; + QHash m_activeBuildStepsPerProjectConfiguration; Project *m_previousBuildStepProject; // is set to true while canceling, so that nextBuildStep knows that the BuildStep finished because of canceling bool m_canceling; @@ -221,7 +223,7 @@ void BuildManager::cancel() QTimer::singleShot(0, this, SLOT(emitCancelMessage())); disconnectOutput(d->m_currentBuildStep); - decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project()); + decrementActiveBuildSteps(d->m_currentBuildStep); d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Build canceled")); //TODO NBS fix in qtconcurrent clearBuildQueue(); @@ -256,7 +258,7 @@ void BuildManager::emitCancelMessage() void BuildManager::clearBuildQueue() { foreach (BuildStep *bs, d->m_buildQueue) { - decrementActiveBuildSteps(bs->buildConfiguration()->target()->project()); + decrementActiveBuildSteps(bs); disconnectOutput(bs); } @@ -382,7 +384,7 @@ void BuildManager::nextBuildQueue() disconnectOutput(d->m_currentBuildStep); ++d->m_progress; d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress)); - decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project()); + decrementActiveBuildSteps(d->m_currentBuildStep); bool result = d->m_watcher.result(); if (!result) { @@ -491,7 +493,7 @@ bool BuildManager::buildQueueAppend(QList steps) for (i = 0; i < count; ++i) { ++d->m_maxProgress; d->m_buildQueue.append(steps.at(i)); - incrementActiveBuildSteps(steps.at(i)->buildConfiguration()->target()->project()); + incrementActiveBuildSteps(steps.at(i)); } return true; } @@ -531,14 +533,29 @@ void BuildManager::appendStep(BuildStep *step) startBuildQueue(); } +template +int count(const QHash &hash, T *key) +{ + typename QHash::const_iterator it = hash.find(key); + typename QHash::const_iterator end = hash.end(); + if (it != end) + return *it; + return 0; +} + bool BuildManager::isBuilding(Project *pro) { - QHash::iterator it = d->m_activeBuildSteps.find(pro); - QHash::iterator end = d->m_activeBuildSteps.end(); - if (it == end || *it == 0) - return false; - else - return true; + return count(d->m_activeBuildSteps, pro) > 0; +} + +bool BuildManager::isBuilding(Target *t) +{ + return count(d->m_activeBuildStepsPerTarget, t) > 0; +} + +bool BuildManager::isBuilding(ProjectConfiguration *p) +{ + return count(d->m_activeBuildStepsPerProjectConfiguration, p) > 0; } bool BuildManager::isBuilding(BuildStep *step) @@ -546,33 +563,51 @@ bool BuildManager::isBuilding(BuildStep *step) return (d->m_currentBuildStep == step) || d->m_buildQueue.contains(step); } -void BuildManager::incrementActiveBuildSteps(Project *pro) +template bool increment(QHash &hash, T *key) { - QHash::iterator it = d->m_activeBuildSteps.find(pro); - QHash::iterator end = d->m_activeBuildSteps.end(); + typename QHash::iterator it = hash.find(key); + typename QHash::iterator end = hash.end(); if (it == end) { - d->m_activeBuildSteps.insert(pro, 1); - emit buildStateChanged(pro); + hash.insert(key, 1); + return true; } else if (*it == 0) { ++*it; - emit buildStateChanged(pro); + return true; } else { ++*it; } + return false; } -void BuildManager::decrementActiveBuildSteps(Project *pro) +template bool decrement(QHash &hash, T *key) { - QHash::iterator it = d->m_activeBuildSteps.find(pro); - QHash::iterator end = d->m_activeBuildSteps.end(); + typename QHash::iterator it = hash.find(key); + typename QHash::iterator end = hash.end(); if (it == end) { - Q_ASSERT(false && "BuildManager d->m_activeBuildSteps says project is not building, but apparently a build step was still in the queue."); + // Can't happen } else if (*it == 1) { --*it; - emit buildStateChanged(pro); + return true; } else { --*it; } + return false; +} + +void BuildManager::incrementActiveBuildSteps(BuildStep *bs) +{ + increment(d->m_activeBuildStepsPerProjectConfiguration, bs->projectConfiguration()); + increment(d->m_activeBuildStepsPerTarget, bs->target()); + if (increment(d->m_activeBuildSteps, bs->project())) + emit buildStateChanged(bs->project()); +} + +void BuildManager::decrementActiveBuildSteps(BuildStep *bs) +{ + decrement(d->m_activeBuildStepsPerProjectConfiguration, bs->projectConfiguration()); + decrement(d->m_activeBuildStepsPerTarget, bs->target()); + if (decrement(d->m_activeBuildSteps, bs->project())) + emit buildStateChanged(bs->project()); } void BuildManager::disconnectOutput(BuildStep *bs) diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index 03b01f72be..753fed0f83 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -63,6 +63,8 @@ public: bool buildLists(QList bsls); bool buildList(BuildStepList *bsl); bool isBuilding(Project *p); + bool isBuilding(Target *t); + bool isBuilding(ProjectConfiguration *p); bool isBuilding(BuildStep *step); // Append any build step to the list of build steps (currently only used to add the QMakeStep) @@ -102,8 +104,8 @@ private: void nextStep(); void clearBuildQueue(); bool buildQueueAppend(QList steps); - void incrementActiveBuildSteps(Project *pro); - void decrementActiveBuildSteps(Project *pro); + void incrementActiveBuildSteps(BuildStep *bs); + void decrementActiveBuildSteps(BuildStep *bs); void disconnectOutput(BuildStep *bs); BuildManagerPrivate *d; diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index 74db6361c5..917033174f 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -370,6 +372,29 @@ void BuildSettingsWidget::deleteConfiguration(BuildConfiguration *deleteConfigur m_target->buildConfigurations().size() <= 1) return; + ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(deleteConfiguration)) { + QMessageBox box; + QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Build Configuration"), QMessageBox::AcceptRole); + QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole); + box.setDefaultButton(cancelClose); + box.setWindowTitle(tr("Remove Build Configuration %1?").arg(deleteConfiguration->displayName())); + box.setText(tr("The build configuration %1 is currently being built.").arg(deleteConfiguration->displayName())); + box.setInformativeText(tr("Do you want to cancel the build process and remove the Build Configuration anyway?")); + box.exec(); + if (box.clickedButton() != closeAnyway) + return; + bm->cancel(); + } else { + QMessageBox msgBox(QMessageBox::Question, tr("Remove Build Configuration?"), + tr("Do you really want to delete build configuration %1?").arg(deleteConfiguration->displayName()), + QMessageBox::Yes|QMessageBox::No, this); + msgBox.setDefaultButton(QMessageBox::No); + msgBox.setEscapeButton(QMessageBox::No); + if (msgBox.exec() == QMessageBox::No) + return; + } + m_target->removeBuildConfiguration(deleteConfiguration); updateBuildSettings(); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 2a5ddaa961..9fe11189a1 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -156,11 +156,21 @@ DeployConfiguration *BuildStep::deployConfiguration() const return dc; } +ProjectConfiguration *BuildStep::projectConfiguration() const +{ + return static_cast(parent()->parent()); +} + Target *BuildStep::target() const { return qobject_cast(parent()->parent()->parent()); } +Project *BuildStep::project() const +{ + return target()->project(); +} + bool BuildStep::immutable() const { return false; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index a9b98a7ee2..b43ef00510 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -72,7 +72,9 @@ public: BuildConfiguration *buildConfiguration() const; DeployConfiguration *deployConfiguration() const; + ProjectConfiguration *projectConfiguration() const; Target *target() const; + Project *project() const; enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput }; enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline }; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 7677381796..28f42d6cdc 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -166,9 +167,15 @@ void Project::addTarget(Target *t) setActiveTarget(t); } -void Project::removeTarget(Target *target) +bool Project::removeTarget(Target *target) { - QTC_ASSERT(target && d->m_targets.contains(target), return); + if (!target || !d->m_targets.contains(target)) + return false; + + ProjectExplorer::BuildManager *bm = + ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(target)) + return false; emit aboutToRemoveTarget(target); diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index cf3d67f354..b87d96f6f1 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -83,7 +83,7 @@ public: // Target: void addTarget(Target *target); - void removeTarget(Target *target); + bool removeTarget(Target *target); QList targets() const; // Note: activeTarget can be 0 (if no targets are defined). diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 9a2979f284..1773509e23 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1031,6 +1031,20 @@ void ProjectExplorerPlugin::unloadProject() if (debug) qDebug() << "ProjectExplorerPlugin::unloadProject"; + if (buildManager()->isBuilding(d->m_currentProject)) { + QMessageBox box; + QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Unload"), QMessageBox::AcceptRole); + QPushButton *cancelClose = box.addButton(tr("Do Not Unload"), QMessageBox::RejectRole); + box.setDefaultButton(cancelClose); + box.setWindowTitle(tr("Unload Project %1?").arg(d->m_currentProject->displayName())); + box.setText(tr("The project %1 is currently being built.").arg(d->m_currentProject->displayName())); + box.setInformativeText(tr("Do you want to cancel the build process and unload the project anyway?")); + box.exec(); + if (box.clickedButton() != closeAnyway) + return; + buildManager()->cancel(); + } + Core::IFile *fi = d->m_currentProject->file(); if (!fi || fi->fileName().isEmpty()) //nothing to save? diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index e1016ca460..e0497ca72e 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -42,6 +42,8 @@ #include #include +#include +#include #include #include @@ -389,15 +391,31 @@ void RunSettingsWidget::addDeployConfiguration() void RunSettingsWidget::removeDeployConfiguration() { DeployConfiguration *dc = m_target->activeDeployConfiguration(); - QMessageBox msgBox(QMessageBox::Question, tr("Remove Deploy Configuration?"), - tr("Do you really want to delete deploy configuration %1?").arg(dc->displayName()), - QMessageBox::Yes|QMessageBox::No, this); - msgBox.setDefaultButton(QMessageBox::No); - msgBox.setEscapeButton(QMessageBox::No); - if (msgBox.exec() == QMessageBox::No) - return; + ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(dc)) { + QMessageBox box; + QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Deploy Configuration"), QMessageBox::AcceptRole); + QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole); + box.setDefaultButton(cancelClose); + box.setWindowTitle(tr("Remove Deploy Configuration %1?").arg(dc->displayName())); + box.setText(tr("The deploy configuration %1 is currently being built.").arg(dc->displayName())); + box.setInformativeText(tr("Do you want to cancel the build process and remove the Deploy Configuration anyway?")); + box.exec(); + if (box.clickedButton() != closeAnyway) + return; + bm->cancel(); + } else { + QMessageBox msgBox(QMessageBox::Question, tr("Remove Deploy Configuration?"), + tr("Do you really want to delete deploy configuration %1?").arg(dc->displayName()), + QMessageBox::Yes|QMessageBox::No, this); + msgBox.setDefaultButton(QMessageBox::No); + msgBox.setEscapeButton(QMessageBox::No); + if (msgBox.exec() == QMessageBox::No) + return; + } m_target->removeDeployConfiguration(dc); + m_removeDeployToolButton->setEnabled(m_target->deployConfigurations().size() > 1); } diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index ec5c57b39d..54f194606f 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -42,6 +42,8 @@ #include #include +#include +#include #include #include @@ -174,11 +176,16 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration) setActiveBuildConfiguration(configuration); } -void Target::removeBuildConfiguration(BuildConfiguration *configuration) +bool Target::removeBuildConfiguration(BuildConfiguration *configuration) { //todo: this might be error prone if (!d->m_buildConfigurations.contains(configuration)) - return; + return false; + + ProjectExplorer::BuildManager *bm = + ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(configuration)) + return false; d->m_buildConfigurations.removeOne(configuration); @@ -192,6 +199,7 @@ void Target::removeBuildConfiguration(BuildConfiguration *configuration) } delete configuration; + return true; } QList Target::buildConfigurations() const @@ -242,11 +250,16 @@ void Target::addDeployConfiguration(DeployConfiguration *dc) Q_ASSERT(activeDeployConfiguration()); } -void Target::removeDeployConfiguration(DeployConfiguration *dc) +bool Target::removeDeployConfiguration(DeployConfiguration *dc) { //todo: this might be error prone if (!d->m_deployConfigurations.contains(dc)) - return; + return false; + + ProjectExplorer::BuildManager *bm = + ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(dc)) + return false; d->m_deployConfigurations.removeOne(dc); @@ -260,6 +273,7 @@ void Target::removeDeployConfiguration(DeployConfiguration *dc) } delete dc; + return true; } QList Target::deployConfigurations() const diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index cb224985b8..03b286e117 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -67,7 +67,7 @@ public: // Build configuration void addBuildConfiguration(BuildConfiguration *configuration); - void removeBuildConfiguration(BuildConfiguration *configuration); + bool removeBuildConfiguration(BuildConfiguration *configuration); QList buildConfigurations() const; virtual BuildConfiguration *activeBuildConfiguration() const; @@ -77,7 +77,7 @@ public: // DeployConfiguration void addDeployConfiguration(DeployConfiguration *dc); - void removeDeployConfiguration(DeployConfiguration *dc); + bool removeDeployConfiguration(DeployConfiguration *dc); QList deployConfigurations() const; virtual DeployConfiguration *activeDeployConfiguration() const; diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 3a68ffa1c2..d7e2fc63e6 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -40,6 +40,8 @@ #include "targetsettingswidget.h" #include +#include +#include #include #include @@ -47,6 +49,7 @@ #include #include #include +#include using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -230,13 +233,33 @@ void TargetSettingsPanelWidget::removeTarget() { int index = m_selector->currentIndex(); Target *t = m_targets.at(index); - int ret = QMessageBox::warning(this, tr("Qt Creator"), - tr("Do you really want to remove the\n" - "\"%1\" target?").arg(t->displayName()), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); - if (ret == QMessageBox::Yes) - m_project->removeTarget(t); + + ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager(); + if (bm->isBuilding(t)) { + QMessageBox box; + QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Target"), QMessageBox::AcceptRole); + QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole); + box.setDefaultButton(cancelClose); + box.setWindowTitle(tr("Remove Target %1?").arg(t->displayName())); + box.setText(tr("The target %1 is currently being built.").arg(t->displayName())); + box.setInformativeText(tr("Do you want to cancel the build process and remove the Target anyway?")); + box.exec(); + if (box.clickedButton() != closeAnyway) + return; + bm->cancel(); + } else { + // We don't show the generic message box on removing the target, if we showed the still building one + int ret = QMessageBox::warning(this, tr("Qt Creator"), + tr("Do you really want to remove the\n" + "\"%1\" target?").arg(t->displayName()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No); + if (ret != QMessageBox::Yes) + return; + } + + m_project->removeTarget(t); + } void TargetSettingsPanelWidget::targetAdded(ProjectExplorer::Target *target) -- cgit v1.2.1 From 0021c4c3eea6582d01d25a7fd674129b7c9fcadf Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 31 Oct 2011 12:09:27 +0100 Subject: C++ insert def: Fix bug when minimizing name. Constructors would not get the correct name before. Now rewriting the function's name is not done by going through the 'rewrite type' func- tionality but rather by minimizing the symbol's name directly. Task-number: QTCREATORBUG-6223 Change-Id: I3c25e414337937f5dd0f54570c899ca2ca21d2ef Reviewed-by: Leandro T. C. Melo --- src/libs/cplusplus/CppRewriter.cpp | 33 +-------------- src/libs/cplusplus/LookupContext.cpp | 64 +++++++++++++----------------- src/libs/cplusplus/LookupContext.h | 3 +- src/plugins/cppeditor/cppinsertdecldef.cpp | 8 +--- 4 files changed, 30 insertions(+), 78 deletions(-) (limited to 'src') diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp index 8948b9297e..432f6bcbe4 100644 --- a/src/libs/cplusplus/CppRewriter.cpp +++ b/src/libs/cplusplus/CppRewriter.cpp @@ -387,18 +387,6 @@ UseMinimalNames::~UseMinimalNames() } -static bool symbolIdentical(Symbol *s1, Symbol *s2) -{ - if (!s1 || !s2) - return false; - if (s1->line() != s2->line()) - return false; - if (s1->column() != s2->column()) - return false; - - return QByteArray(s1->fileName()) == QByteArray(s2->fileName()); -} - FullySpecifiedType UseMinimalNames::apply(const Name *name, Rewrite *rewrite) const { SubstitutionEnvironment *env = rewrite->env; @@ -416,26 +404,7 @@ FullySpecifiedType UseMinimalNames::apply(const Name *name, Rewrite *rewrite) co const QList results = context.lookup(name, scope); foreach (const LookupItem &r, results) { if (Symbol *d = r.declaration()) { - const Name *n = 0; - QList names = LookupContext::fullyQualifiedName(d); - for (int i = names.size() - 1; i >= 0; --i) { - if (! n) - n = names.at(i); - else - n = control->qualifiedNameId(names.at(i), n); - if (_target) { - // minimize the qualifications - const QList tresults = _target->lookup(n); - foreach (const LookupItem &tr, tresults) { - if (symbolIdentical(tr.declaration(), d)) { - i = 0; // break outer - break; - } - } - } - } - - return control->namedType(n); + return control->namedType(LookupContext::minimalName(d, _target, control)); } return r.type(); diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index f4089d1bec..88110c5da2 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -157,50 +157,40 @@ QList LookupContext::path(Symbol *symbol) return names; } - -const Name *LookupContext::minimalName(const Name *name, - Scope *scope, - ClassOrNamespace *target) const +static bool symbolIdentical(Symbol *s1, Symbol *s2) { - Q_UNUSED(name); - Q_UNUSED(scope); - Q_UNUSED(target); - - qWarning() << "TODO:" << Q_FUNC_INFO; - return name; + if (!s1 || !s2) + return false; + if (s1->line() != s2->line()) + return false; + if (s1->column() != s2->column()) + return false; -#if 0 - Q_ASSERT(name); - Q_ASSERT(source); - Q_ASSERT(target); + return QByteArray(s1->fileName()) == QByteArray(s2->fileName()); +} - QList symbols = lookup(name, source); - if (symbols.isEmpty()) - return 0; +const Name *LookupContext::minimalName(Symbol *symbol, ClassOrNamespace *target, Control *control) +{ + const Name *n = 0; + QList names = LookupContext::fullyQualifiedName(symbol); - Symbol *canonicalSymbol = symbols.first(); - std::vector fqNames = fullyQualifiedName(canonicalSymbol).toVector().toStdVector(); - if (const QualifiedNameId *qId = name->asQualifiedNameId()) - fqNames.push_back(qId->name()); - else - fqNames.push_back(name); - - const QualifiedNameId *lastWorking = 0; - for (unsigned i = 0; i < fqNames.size(); ++i) { - const QualifiedNameId *newName = control()->qualifiedNameId(&fqNames[i], - fqNames.size() - i); - QList candidates = target->lookup(newName); - if (candidates.contains(canonicalSymbol)) - lastWorking = newName; + for (int i = names.size() - 1; i >= 0; --i) { + if (! n) + n = names.at(i); else - break; + n = control->qualifiedNameId(names.at(i), n); + + // once we're qualified enough to get the same symbol, break + if (target) { + const QList tresults = target->lookup(n); + foreach (const LookupItem &tr, tresults) { + if (symbolIdentical(tr.declaration(), symbol)) + return n; + } + } } - if (lastWorking && lastWorking->nameCount() == 1) - return lastWorking->nameAt(0); - else - return lastWorking; -#endif + return n; } diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h index 578e19b094..2fa9655cd5 100644 --- a/src/libs/cplusplus/LookupContext.h +++ b/src/libs/cplusplus/LookupContext.h @@ -235,8 +235,7 @@ public: static QList fullyQualifiedName(Symbol *symbol); static QList path(Symbol *symbol); - const Name *minimalName(const Name *name, Scope *source, - ClassOrNamespace *target) const; + static const Name *minimalName(Symbol *symbol, ClassOrNamespace *target, Control *control); private: // The current expression. diff --git a/src/plugins/cppeditor/cppinsertdecldef.cpp b/src/plugins/cppeditor/cppinsertdecldef.cpp index 5ea7e3e696..6847a4d672 100644 --- a/src/plugins/cppeditor/cppinsertdecldef.cpp +++ b/src/plugins/cppeditor/cppinsertdecldef.cpp @@ -261,13 +261,7 @@ public: FullySpecifiedType tn = rewriteType(m_decl->type(), &env, control); // rewrite the function name - QString name; - const FullySpecifiedType nametype = rewriteType(control->namedType(m_decl->name()), &env, control); - if (NamedType *nt = nametype.type()->asNamedType()) { - name = oo(nt->name()); - } else { - name = oo(LookupContext::fullyQualifiedName(m_decl)); - } + QString name = oo(LookupContext::minimalName(m_decl, targetCoN, control)); QString defText = oo.prettyType(tn, name) + "\n{\n}"; -- cgit v1.2.1 From 24fc61857cd7ef94de90ae97eb98b44d56ef2679 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Mon, 31 Oct 2011 13:37:23 +0100 Subject: Editor: Support floating point values for tab stop Task-number: QTCREATORBUG-833 Change-Id: I76a4b69d6e9402f045a98712531475aff5e8d0ac Reviewed-by: Eike Ziller --- src/plugins/texteditor/basetexteditor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 5733278104..23661a796f 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5482,8 +5482,13 @@ void BaseTextEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) void BaseTextEditorWidget::setTabSettings(const TabSettings &ts) { d->m_document->setTabSettings(ts); - int charWidth = QFontMetrics(font()).width(QChar(' ')); - setTabStopWidth(charWidth * ts.m_tabSize); + + // Although the tab stop is stored as qreal the API from QPlainTextEdit only allows it + // to be set as an int. A work around is to access directly the QTextOption. + qreal charWidth = QFontMetricsF(font()).width(QChar(' ')); + QTextOption option = document()->defaultTextOption(); + option.setTabStop(charWidth * ts.m_tabSize); + document()->setDefaultTextOption(option); } void BaseTextEditorWidget::setDisplaySettings(const DisplaySettings &ds) -- cgit v1.2.1 From 6fb602061e91f0af519608cff750e70460d70d70 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 30 Oct 2011 15:47:16 +0200 Subject: BuildManager: Display times for build messages Task-number: QTCREATORBUG-6426 Change-Id: I253b005c1e0af093342a5b8315086c007138b764 Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/buildmanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index ecf2c05439..bde1a9894f 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -52,6 +52,7 @@ #include #include +#include #include #include #include @@ -355,7 +356,12 @@ void BuildManager::addToTaskWindow(const ProjectExplorer::Task &task) void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFormat format, BuildStep::OutputNewlineSetting newLineSetting) { - QString stringToWrite = string; + QString stringToWrite; + if (format == BuildStep::MessageOutput || format == BuildStep::ErrorMessageOutput) { + stringToWrite = QTime::currentTime().toString(); + stringToWrite += QLatin1String(": "); + } + stringToWrite += string; if (newLineSetting == BuildStep::DoAppendNewline) stringToWrite += QLatin1Char('\n'); d->m_outputWindow->appendText(stringToWrite, format); -- cgit v1.2.1 From 91b79844221e511cf2e0d1c1d5296f3b4dccff7d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 31 Oct 2011 11:09:15 +0100 Subject: QmlDesigner.documentController: bugfix for crumblebar This fixes a crash bug. Change-Id: Ibfe5c30910fed8b5e3132a05bc6a2eec39d4d308 Reviewed-by: Marco Bubke --- .../components/integration/designdocumentcontroller.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp index a24210b0d1..57a23677fa 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp @@ -448,9 +448,10 @@ void DesignDocumentController::changeCurrentModelTo(const ModelNode &node) if (Internal::DesignModeWidget::instance()->currentDesignDocumentController() != this) return; DesignDocumentControllerPrivate::clearCrumblePath = false; - while (!d->formEditorView->crumblePath()->dataForLastIndex().value().modelNode.isRootNode()) + while (d->formEditorView->crumblePath()->dataForLastIndex().value().modelNode.isValid() && + !d->formEditorView->crumblePath()->dataForLastIndex().value().modelNode.isRootNode()) d->formEditorView->crumblePath()->popElement(); - if (node.isRootNode()) + if (node.isRootNode() && d->formEditorView->crumblePath()->dataForLastIndex().isValid()) d->formEditorView->crumblePath()->popElement(); changeToSubComponent(node); DesignDocumentControllerPrivate::clearCrumblePath = true; @@ -537,8 +538,10 @@ void DesignDocumentController::goIntoComponent() if (d->formEditorView) selectedNodes = d->formEditorView->selectedModelNodes(); + DesignDocumentControllerPrivate::clearCrumblePath = false; if (selectedNodes.count() == 1) ModelNodeAction::goIntoComponent(selectedNodes.first()); + DesignDocumentControllerPrivate::clearCrumblePath = true; } void DesignDocumentController::loadCurrentModel() -- cgit v1.2.1 From 3cb6c233345616e2d1af4ede9e71471931f117f1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 31 Oct 2011 15:58:21 +0100 Subject: Fix showing of "Debugging Helper Missing" warning. It was only showing up if one had a helper library that was outdated. Change-Id: I8d0ffcd16434dc6cfeadd408a2bdb59aa3ec73ba Reviewed-by: Daniel Teske Reviewed-by: hjk --- src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 2 +- .../projectexplorer/customexecutablerunconfiguration.cpp | 2 +- src/plugins/projectexplorer/debugginghelper.cpp | 12 ------------ src/plugins/projectexplorer/debugginghelper.h | 4 +--- src/plugins/qtsupport/baseqtversion.cpp | 2 +- 6 files changed, 5 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 485ce0652d..dac370a6e6 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -251,7 +251,7 @@ QStringList CMakeRunConfiguration::dumperLibraryLocations() const { QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - return ProjectExplorer::DebuggingHelperLibrary::locationsByInstallData(qtInstallData); + return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); } Utils::Environment CMakeRunConfiguration::baseEnvironment() const diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index ff5edc942c..739dd37888 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2483,7 +2483,7 @@ void DebuggerPluginPrivate::showMessage(const QString &msg, int channel, int tim void DebuggerPluginPrivate::showQtDumperLibraryWarning(const QString &details) { QMessageBox dialog(mainWindow()); - QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"), + QPushButton *qtPref = dialog.addButton(tr("Open Qt Options"), QMessageBox::ActionRole); QPushButton *helperOff = dialog.addButton(tr("Turn off Helper Usage"), QMessageBox::ActionRole); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 345f3ffa7c..a470539075 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -332,7 +332,7 @@ QStringList CustomExecutableRunConfiguration::dumperLibraryLocations() const { QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - return ProjectExplorer::DebuggingHelperLibrary::locationsByInstallData(qtInstallData); + return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); } ProjectExplorer::Abi CustomExecutableRunConfiguration::abi() const diff --git a/src/plugins/projectexplorer/debugginghelper.cpp b/src/plugins/projectexplorer/debugginghelper.cpp index f7cd47b072..7b0561145c 100644 --- a/src/plugins/projectexplorer/debugginghelper.cpp +++ b/src/plugins/projectexplorer/debugginghelper.cpp @@ -68,18 +68,6 @@ QStringList DebuggingHelperLibrary::debuggingHelperLibraryDirectories(const QStr return directories; } -QStringList DebuggingHelperLibrary::locationsByInstallData(const QString &qtInstallData) -{ - QStringList result; - QFileInfo fileInfo; - const QStringList binFilenames = validBinaryFilenames(); - foreach(const QString &directory, debuggingHelperLibraryDirectories(qtInstallData)) { - if (getHelperFileInfoFor(binFilenames, directory, &fileInfo)) - result << fileInfo.filePath(); - } - return result; -} - static QString sourcePath() { return Core::ICore::instance()->resourcePath() + QLatin1String("/dumper/"); diff --git a/src/plugins/projectexplorer/debugginghelper.h b/src/plugins/projectexplorer/debugginghelper.h index 2f5f764978..94edb1d4e5 100644 --- a/src/plugins/projectexplorer/debugginghelper.h +++ b/src/plugins/projectexplorer/debugginghelper.h @@ -47,7 +47,7 @@ class PROJECTEXPLORER_EXPORT DebuggingHelperLibrary : public Utils::BuildableHel { public: static QString debuggingHelperLibraryByInstallData(const QString &qtInstallData); - static QStringList locationsByInstallData(const QString &qtInstallData); + static QStringList debuggingHelperLibraryDirectories(const QString &qtInstallData); // Build the helpers and return the output log/errormessage. static bool build(BuildHelperArguments arguments, QString *log, QString *errorMessage); @@ -55,8 +55,6 @@ public: // Copy the source files to a target location and return the chosen target location. static QString copy(const QString &qtInstallData, QString *errorMessage); -private: - static QStringList debuggingHelperLibraryDirectories(const QString &qtInstallData); }; } // namespace ProjectExplorer diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 43fcaa0613..3d140fcaeb 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -955,7 +955,7 @@ QStringList BaseQtVersion::debuggingHelperLibraryLocations() const QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); if (qtInstallData.isEmpty()) return QStringList(); - return ProjectExplorer::DebuggingHelperLibrary::locationsByInstallData(qtInstallData); + return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); } bool BaseQtVersion::supportsBinaryDebuggingHelper() const -- cgit v1.2.1 From f73dc6f44414610074a2ab064e07c4249991174a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 1 Nov 2011 10:28:19 +0100 Subject: fakevim: fix replacement of '\&' Task-number: QTCREATORBUG-6434 Change-Id: Ic6ec34288733c4aa46cee353acf3920f3b4cf9ce Reviewed-by: Eike Ziller --- src/plugins/fakevim/fakevimhandler.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 96d7d87859..0b99e1c527 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -3296,6 +3296,7 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd) i += caps.at(0).size(); } } + repl.replace("\\&", "&"); text = text.left(pos) + repl + text.mid(pos + matched.size()); pos += repl.size(); if (!global) -- cgit v1.2.1 From a0cf8d2bd9840ec79b27101c36ad31c122f634e3 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 1 Nov 2011 10:44:39 +0100 Subject: QmlProfiler: Make sure standalone tool is shipped on Mac OS X Change-Id: Icbe52a5198b670fb7a0bbe2ddb12fc0bbdb2dd17 Reviewed-by: Eike Ziller --- src/tools/qmlprofilertool/qmlprofilertool.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/qmlprofilertool/qmlprofilertool.pro b/src/tools/qmlprofilertool/qmlprofilertool.pro index 4e9b4abaae..615ce066d5 100644 --- a/src/tools/qmlprofilertool/qmlprofilertool.pro +++ b/src/tools/qmlprofilertool/qmlprofilertool.pro @@ -2,7 +2,7 @@ include(../../../qtcreator.pri) TEMPLATE = app TARGET = qmlprofiler -DESTDIR = $$IDE_APP_PATH +DESTDIR = $$IDE_BIN_PATH QT = core CONFIG += console -- cgit v1.2.1 From 1d97b604c076c41a0b111922b0046690096a9562 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 1 Nov 2011 11:46:22 +0100 Subject: Set text editor font also for new search panels. Task-number: QTCREATORBUG-6432 Change-Id: I67b6a92faccc65f92cc612abf210c0a2eca4860b Reviewed-by: Leandro T. C. Melo --- src/plugins/find/searchresultwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index 9e3aa9c962..45c7b692ee 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -74,6 +74,7 @@ namespace Internal { QStackedWidget *m_widget; QList m_searchResults; int m_currentIndex; + QFont m_font; public slots: void setCurrentIndex(int index); @@ -317,6 +318,7 @@ SearchResult *SearchResultWindow::startNewSearch(const QString &label, d->m_searchResultWidgets.prepend(widget); d->m_widget->insertWidget(1, widget); connect(widget, SIGNAL(navigateStateChanged()), this, SLOT(navigateStateChanged())); + widget->setTextEditorFont(d->m_font); widget->setShowReplaceUI(searchOrSearchAndReplace != SearchOnly); widget->setAutoExpandResults(d->m_expandCollapseAction->isChecked()); widget->setInfo(label, toolTip, searchTerm); @@ -390,6 +392,7 @@ void SearchResultWindow::setFocus() */ void SearchResultWindow::setTextEditorFont(const QFont &font) { + d->m_font = font; foreach (Internal::SearchResultWidget *widget, d->m_searchResultWidgets) widget->setTextEditorFont(font); } -- cgit v1.2.1