diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-03-08 07:48:55 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@nokia.com> | 2012-03-08 07:48:55 +0100 |
commit | 4b8df15f3d904f39e78b975fb3bedba03dcce9c1 (patch) | |
tree | ca71b9f2ed39590a6b0fd28305cad9c9544e2d36 /src/plugins | |
parent | 3a808b0fd8a2e9d89ff01f51ffa6014f8207979d (diff) | |
parent | 62fd2713d00ed3756cead7072cbbd61e631e6670 (diff) | |
download | qt-creator-4b8df15f3d904f39e78b975fb3bedba03dcce9c1.tar.gz |
Merge remote-tracking branch 'origin/2.5'
Conflicts:
src/plugins/remotelinux/startgdbserverdialog.cpp
Change-Id: I69597e20d5372e9baf12ac09fc20d39406683f9e
Diffstat (limited to 'src/plugins')
194 files changed, 1148 insertions, 898 deletions
diff --git a/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp b/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp index d4afaf47d4..e5dbd37113 100644 --- a/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp +++ b/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp @@ -68,7 +68,7 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget() QHBoxLayout *globalSettingLayout = new QHBoxLayout(globalSetting); globalSettingLayout->setContentsMargins(0, 0, 0, 0); layout->addWidget(globalSetting); - QLabel *label = new QLabel(tr("Analyzer Settings:"), globalSetting); + QLabel *label = new QLabel(tr("Analyzer settings:"), globalSetting); globalSettingLayout->addWidget(label); m_settingsCombo = new QComboBox(globalSetting); m_settingsCombo->addItems(QStringList() diff --git a/src/plugins/bazaar/annotationhighlighter.cpp b/src/plugins/bazaar/annotationhighlighter.cpp index 6dad6c709d..6ea7fd7108 100644 --- a/src/plugins/bazaar/annotationhighlighter.cpp +++ b/src/plugins/bazaar/annotationhighlighter.cpp @@ -37,8 +37,9 @@ using namespace Bazaar::Internal; using namespace Bazaar; BazaarAnnotationHighlighter::BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, + const QColor &bg, QTextDocument *document) - : VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + : VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), m_changeset(QLatin1String(Constants::CHANGESET_ID)) { } diff --git a/src/plugins/bazaar/annotationhighlighter.h b/src/plugins/bazaar/annotationhighlighter.h index bea25e8a56..f97a4a9ae0 100644 --- a/src/plugins/bazaar/annotationhighlighter.h +++ b/src/plugins/bazaar/annotationhighlighter.h @@ -42,7 +42,7 @@ namespace Internal { class BazaarAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { public: - explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/bazaar/bazaareditor.cpp b/src/plugins/bazaar/bazaareditor.cpp index 414a43de7f..b122152244 100644 --- a/src/plugins/bazaar/bazaareditor.cpp +++ b/src/plugins/bazaar/bazaareditor.cpp @@ -101,9 +101,10 @@ VcsBase::DiffHighlighter *BazaarEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(m_diffFileId); } -VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new BazaarAnnotationHighlighter(changes); + return new BazaarAnnotationHighlighter(changes, bg); } QString BazaarEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/bazaar/bazaareditor.h b/src/plugins/bazaar/bazaareditor.h index 3c80e2402b..0c9198509f 100644 --- a/src/plugins/bazaar/bazaareditor.h +++ b/src/plugins/bazaar/bazaareditor.h @@ -51,7 +51,7 @@ private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &cursor) const; virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; - virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const; const QRegExp m_exactChangesetId; diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index eb42b918fa..37c8b58de8 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -194,7 +194,7 @@ public: { m_editor = parent; connect(m_editor, SIGNAL(dataRequested(Core::IEditor*,quint64)), - this, SLOT(provideData(Core::IEditor *, quint64))); + this, SLOT(provideData(Core::IEditor*,quint64))); connect(m_editor, SIGNAL(newRangeRequested(Core::IEditor*,quint64)), this, SLOT(provideNewRange(Core::IEditor*,quint64))); connect(m_editor, SIGNAL(startOfFileRequested(Core::IEditor*)), this, @@ -535,8 +535,8 @@ bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMes Q_UNUSED(arguments) Q_UNUSED(errorMessage) - connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)), - this, SLOT(updateCurrentEditor(Core::IContext *))); + connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext*)), + this, SLOT(updateCurrentEditor(Core::IContext*))); addAutoReleasedObject(new BinEditorFactory(this)); addAutoReleasedObject(new BinEditorWidgetFactory); diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 21b62dee5a..a7b8d7fed7 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -212,8 +212,8 @@ BookmarkView::BookmarkView(QWidget *parent) : { setWindowTitle(tr("Bookmarks")); - connect(this, SIGNAL(clicked(const QModelIndex &)), - this, SLOT(gotoBookmark(const QModelIndex &))); + connect(this, SIGNAL(clicked(QModelIndex)), + this, SLOT(gotoBookmark(QModelIndex))); ICore::addContextObject(m_bookmarkContext); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 3dc2f4897d..b0e9a93b5b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -64,8 +64,8 @@ CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage) : m_settingsPage(cmakeSettingsPage) { ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance(); - connect(projectExplorer, SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*)), - this, SLOT(updateContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*))); + connect(projectExplorer, SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*)), + this, SLOT(updateContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*))); Core::ActionManager *am = Core::ICore::actionManager(); diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index b2f4965b2a..431b6c9dea 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -258,7 +258,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep) updateDetails(); - connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited())); + connect(m_additionalArguments, SIGNAL(textEdited(QString)), this, SLOT(additionalArgumentsEdited())); connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), this, SLOT(updateDetails())); diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.cpp b/src/plugins/coreplugin/actionmanager/commandmappings.cpp index 01f9315af3..0584963e12 100644 --- a/src/plugins/coreplugin/actionmanager/commandmappings.cpp +++ b/src/plugins/coreplugin/actionmanager/commandmappings.cpp @@ -93,8 +93,8 @@ QWidget *CommandMappings::createPage(QWidget *parent) connect(m_page->filterEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); - connect(m_page->commandList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), - this, SLOT(commandChanged(QTreeWidgetItem *))); + connect(m_page->commandList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), + this, SLOT(commandChanged(QTreeWidgetItem*))); connect(m_page->targetEdit, SIGNAL(textChanged(QString)), this, SLOT(targetIdentifierChanged())); diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 1d14cda221..9180a752ab 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -215,16 +215,16 @@ NewDialog::NewDialog(QWidget *parent) : m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); - connect(m_ui->templateCategoryView, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(currentCategoryChanged(const QModelIndex&))); - connect(m_ui->templatesView, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(currentItemChanged(const QModelIndex&))); + connect(m_ui->templateCategoryView, SIGNAL(clicked(QModelIndex)), + this, SLOT(currentCategoryChanged(QModelIndex))); + connect(m_ui->templatesView, SIGNAL(clicked(QModelIndex)), + this, SLOT(currentItemChanged(QModelIndex))); connect(m_ui->templateCategoryView->selectionModel(), - SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), - this, SLOT(currentCategoryChanged(const QModelIndex&))); + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(currentCategoryChanged(QModelIndex))); connect(m_ui->templatesView, - SIGNAL(doubleClicked(const QModelIndex&)), + SIGNAL(doubleClicked(QModelIndex)), this, SLOT(okButtonClicked())); connect(m_okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked())); @@ -409,8 +409,8 @@ void NewDialog::currentCategoryChanged(const QModelIndex &index) m_ui->templatesView->setCurrentIndex(m_ui->templatesView->rootIndex().child(0,0)); connect(m_ui->templatesView->selectionModel(), - SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), - this, SLOT(currentItemChanged(const QModelIndex&))); + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(currentItemChanged(QModelIndex))); } } diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/src/plugins/coreplugin/dialogs/openwithdialog.cpp index 298b565594..d767c80283 100644 --- a/src/plugins/coreplugin/dialogs/openwithdialog.cpp +++ b/src/plugins/coreplugin/dialogs/openwithdialog.cpp @@ -51,7 +51,7 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent) this, SLOT(accept())); connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); - connect(editorListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), + connect(editorListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); connect(editorListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentItemChanged(QListWidgetItem*,QListWidgetItem*))); diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 9ab5362645..c170d248dc 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -293,7 +293,7 @@ void DocumentManager::addDocuments(const QList<IDocument *> &documents, bool add foreach (IDocument *document, documents) { if (document && !d->m_documentsWithoutWatch.contains(document)) { - connect(document, SIGNAL(destroyed(QObject *)), m_instance, SLOT(documentDestroyed(QObject *))); + connect(document, SIGNAL(destroyed(QObject*)), m_instance, SLOT(documentDestroyed(QObject*))); d->m_documentsWithoutWatch.append(document); } } @@ -303,7 +303,7 @@ void DocumentManager::addDocuments(const QList<IDocument *> &documents, bool add foreach (IDocument *document, documents) { if (document && !d->m_documentsWithWatch.contains(document)) { connect(document, SIGNAL(changed()), m_instance, SLOT(checkForNewFileName())); - connect(document, SIGNAL(destroyed(QObject *)), m_instance, SLOT(documentDestroyed(QObject *))); + connect(document, SIGNAL(destroyed(QObject*)), m_instance, SLOT(documentDestroyed(QObject*))); addFileInfo(document); } } @@ -437,7 +437,7 @@ bool DocumentManager::removeDocument(IDocument *document) removeFileInfo(document); disconnect(document, SIGNAL(changed()), m_instance, SLOT(checkForNewFileName())); } - disconnect(document, SIGNAL(destroyed(QObject *)), m_instance, SLOT(documentDestroyed(QObject *))); + disconnect(document, SIGNAL(destroyed(QObject*)), m_instance, SLOT(documentDestroyed(QObject*))); return addWatcher; } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index b875f9ed9e..ca05d2ef09 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -148,8 +148,8 @@ EditorManagerPlaceHolder::EditorManagerPlaceHolder(Core::IMode *mode, QWidget *p { setLayout(new QVBoxLayout); layout()->setMargin(0); - connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode *)), - this, SLOT(currentModeChanged(Core::IMode *))); + connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), + this, SLOT(currentModeChanged(Core::IMode*))); currentModeChanged(ModeManager::currentMode()); } @@ -289,8 +289,8 @@ EditorManager::EditorManager(QWidget *parent) : { m_instance = this; - connect(ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)), - this, SLOT(handleContextChange(Core::IContext *))); + connect(ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext*)), + this, SLOT(handleContextChange(Core::IContext*))); const Context editManagerContext(Constants::C_EDITORMANAGER); // combined context for edit & design modes diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 112f074feb..d2941cce64 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -79,7 +79,7 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) : layout->setMargin(0); layout->addWidget(m_editorList); - connect(m_editorList, SIGNAL(itemClicked(QTreeWidgetItem*, int)), + connect(m_editorList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(editorClicked(QTreeWidgetItem*))); } diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 4c909dd445..73ac585d0d 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -71,8 +71,8 @@ NavigationWidgetPlaceHolder::NavigationWidgetPlaceHolder(Core::IMode *mode, QWid { setLayout(new QVBoxLayout); layout()->setMargin(0); - connect(Core::ModeManager::instance(), SIGNAL(currentModeAboutToChange(Core::IMode *)), - this, SLOT(currentModeAboutToChange(Core::IMode *))); + connect(Core::ModeManager::instance(), SIGNAL(currentModeAboutToChange(Core::IMode*)), + this, SLOT(currentModeAboutToChange(Core::IMode*))); } NavigationWidgetPlaceHolder::~NavigationWidgetPlaceHolder() diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index b22ae99e55..bcbf8b9b80 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -70,8 +70,8 @@ OutputPanePlaceHolder::OutputPanePlaceHolder(Core::IMode *mode, QSplitter* paren sp.setHorizontalStretch(0); setSizePolicy(sp); layout()->setMargin(0); - connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode *)), - this, SLOT(currentModeChanged(Core::IMode *))); + connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), + this, SLOT(currentModeChanged(Core::IMode*))); } OutputPanePlaceHolder::~OutputPanePlaceHolder() diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index 1d4617f2ab..4c29c7c43f 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -57,8 +57,8 @@ RightPanePlaceHolder::RightPanePlaceHolder(Core::IMode *mode, QWidget *parent) { setLayout(new QVBoxLayout); layout()->setMargin(0); - connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode *)), - this, SLOT(currentModeChanged(Core::IMode *))); + connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), + this, SLOT(currentModeChanged(Core::IMode*))); } RightPanePlaceHolder::~RightPanePlaceHolder() diff --git a/src/plugins/cpaster/cpaster.pro b/src/plugins/cpaster/cpaster.pro index 0d5e29929a..407075b1df 100644 --- a/src/plugins/cpaster/cpaster.pro +++ b/src/plugins/cpaster/cpaster.pro @@ -12,7 +12,6 @@ HEADERS += cpasterplugin.h \ cpasterconstants.h \ codepastersettings.h \ pastebindotcomprotocol.h \ - pastebindotcomsettings.h \ pastebindotcaprotocol.h \ settings.h \ pasteselectdialog.h \ @@ -28,7 +27,6 @@ SOURCES += cpasterplugin.cpp \ pasteview.cpp \ codepastersettings.cpp \ pastebindotcomprotocol.cpp \ - pastebindotcomsettings.cpp \ pastebindotcaprotocol.cpp \ settings.cpp \ pasteselectdialog.cpp \ diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index fc6fe11e91..94c943d578 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -54,7 +54,7 @@ #include <coreplugin/messagemanager.h> #include <utils/qtcassert.h> #include <utils/fileutils.h> -#include <texteditor/basetexteditor.h> +#include <texteditor/itexteditor.h> #include <QtPlugin> #include <QDebug> @@ -206,12 +206,12 @@ void CodepasterPlugin::postEditor() { QString data; QString mimeType; - if (const IEditor* editor = EditorManager::instance()->currentEditor()) { - if (const BaseTextEditor *textEditor = qobject_cast<const BaseTextEditor *>(editor)) { + if (IEditor* editor = EditorManager::instance()->currentEditor()) { + if (ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor)) { data = textEditor->selectedText(); if (data.isEmpty()) data = textEditor->contents(); - mimeType = textEditor->editorWidget()->mimeType(); + mimeType = textEditor->document()->mimeType(); } } post(data, mimeType); diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 00ac696025..101cbd79fa 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -42,11 +42,9 @@ #include <QNetworkReply> -enum { debug = 0 }; +enum { debug = 0 }; -static const char hostNameC[]= "paste.kde.org"; static const char hostUrlC[]= "http://paste.kde.org/"; -static const char formatC[]= "xml"; static const char showPhpScriptpC[] = "show.php"; enum { expirySeconds = 86400 }; @@ -77,7 +75,7 @@ bool KdePasteProtocol::checkConfiguration(QString *errorMessage) { if (m_hostChecked) // Check the host once. return true; - const bool ok = httpStatus(QLatin1String(hostNameC), errorMessage); + const bool ok = httpStatus(QLatin1String(hostUrlC), errorMessage); if (ok) m_hostChecked = true; return ok; @@ -89,15 +87,15 @@ static inline QByteArray pasteLanguage(Protocol::ContentType ct) case Protocol::Text: break; case Protocol::C: - return "paste_lang=c++"; - break; + return "paste_lang=c"; + case Protocol::Cpp: + return "paste_lang=cpp-qt"; case Protocol::JavaScript: - return "paste_lang=Javascript"; - break; + return "paste_lang=javascript"; case Protocol::Diff: - return "paste_lang=Diff"; + return "paste_lang=diff"; case Protocol::Xml: - return "paste_lang=XML"; + return "paste_lang=xml"; } return QByteArray("paste_lang=text"); } @@ -105,14 +103,15 @@ static inline QByteArray pasteLanguage(Protocol::ContentType ct) void KdePasteProtocol::paste(const QString &text, ContentType ct, const QString &username, - const QString & /* comment */, - const QString & /* description */) + const QString &comment, + const QString &description) { + Q_UNUSED(comment); + Q_UNUSED(description); QTC_ASSERT(!m_pasteReply, return;) // Format body - QByteArray pasteData = "api_submit=true&mode="; - pasteData += formatC; + QByteArray pasteData = "api_submit=true&mode=xml"; if (!username.isEmpty()) { pasteData += "&paste_user="; pasteData += QUrl::toPercentEncoding(username); @@ -170,9 +169,8 @@ void KdePasteProtocol::fetch(const QString &id) const int lastSlashPos = m_fetchId.lastIndexOf(QLatin1Char('/')); if (lastSlashPos != -1) m_fetchId.remove(0, lastSlashPos + 1); - QString url; - QTextStream(&url) << hostUrlC << showPhpScriptpC - << "?format=" << formatC << "&id=" << m_fetchId; + QString url = QLatin1String(hostUrlC) + QLatin1String(showPhpScriptpC) + + QLatin1String("?format=xml&id=") + m_fetchId; if (debug) qDebug() << "fetch: sending " << url; @@ -203,10 +201,9 @@ void KdePasteProtocol::fetchFinished() void KdePasteProtocol::list() { - QTC_ASSERT(!m_listReply, return;) + QTC_ASSERT(!m_listReply, return); - QString url; - QTextStream(&url) << hostUrlC << "api/" << formatC << "/all?format=" << formatC; + QString url = QLatin1String(hostUrlC) + QLatin1String("api/xml/all"); m_listReply = httpGet(url); connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); if (debug) diff --git a/src/plugins/cpaster/pastebindotcaprotocol.cpp b/src/plugins/cpaster/pastebindotcaprotocol.cpp index 650aed03e1..8448b426dd 100644 --- a/src/plugins/cpaster/pastebindotcaprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcaprotocol.cpp @@ -77,18 +77,36 @@ void PasteBinDotCaProtocol::fetch(const QString &id) m_fetchId = id; } +static QByteArray toTypeId(Protocol::ContentType ct) +{ + if (ct == Protocol::C) + return QByteArray(1, '3'); + if (ct == Protocol::Cpp) + return QByteArray(1, '4'); + if (ct == Protocol::JavaScript) + return QByteArray("27"); + if (ct == Protocol::Diff) + return QByteArray( "34"); + if (ct == Protocol::Xml) + return QByteArray("15"); + return QByteArray(1, '1'); +} + void PasteBinDotCaProtocol::paste(const QString &text, - ContentType /* ct */, + ContentType ct, const QString &username, const QString & /* comment */, const QString &description) { - QTC_ASSERT(!m_pasteReply, return) - QByteArray data = "content="; + QTC_ASSERT(!m_pasteReply, return); + QByteArray data = "api=+xKvWG+1UFXkr2Kn3Td4AnpYtCIjA4qt&"; + data += "content="; data += QUrl::toPercentEncoding(fixNewLines(text)); + data += "&type="; + data += toTypeId(ct); data += "&description="; data += QUrl::toPercentEncoding(description); - data += "&type=1&expiry=1%20day&name="; + data += "expiry=1%20day&name="; data += QUrl::toPercentEncoding(username); // fire request const QString link = QLatin1String(urlC) + QLatin1String("quiet-paste.php"); diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp index 6edaa7c69b..9cd8dc6ed0 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -31,13 +31,13 @@ **************************************************************************/ #include "pastebindotcomprotocol.h" -#include "pastebindotcomsettings.h" #include <coreplugin/icore.h> #include <utils/qtcassert.h> #include <QDebug> +#include <QStringList> #include <QTextStream> #include <QXmlStreamReader> #include <QXmlStreamAttributes> @@ -47,13 +47,16 @@ enum { debug = 0 }; -static const char pastePhpScriptpC[] = "api_public.php"; -static const char fetchPhpScriptpC[] = "raw.php"; +static const char PASTEBIN_BASE[]="http://pastebin.com/"; +static const char PASTEBIN_API[]="api/api_post.php"; +static const char PASTEBIN_RAW[]="raw.php"; +static const char PASTEBIN_ARCHIVE[]="archive"; + +static const char API_KEY[]="api_dev_key=516686fc461fb7f9341fd7cf2af6f829&"; // user: qtcreator_apikey namespace CodePaster { PasteBinDotComProtocol::PasteBinDotComProtocol(const NetworkAccessManagerProxyPtr &nw) : NetworkProtocol(nw), - m_settings(new PasteBinDotComSettings), m_fetchReply(0), m_pasteReply(0), m_listReply(0), @@ -73,82 +76,59 @@ unsigned PasteBinDotComProtocol::capabilities() const return ListCapability; } -bool PasteBinDotComProtocol::checkConfiguration(QString *errorMessage) -{ - if (m_hostChecked) // Check the host once. - return true; - const bool ok = httpStatus(hostName(false), errorMessage); - if (ok) - m_hostChecked = true; - return ok; -} - -QString PasteBinDotComProtocol::hostName(bool withSubDomain) const -{ - - QString rc; - if (withSubDomain) { - rc = m_settings->hostPrefix(); - if (!rc.isEmpty()) - rc.append(QLatin1Char('.')); - } - rc.append(QLatin1String("pastebin.com")); - return rc; -} - static inline QByteArray format(Protocol::ContentType ct) { + QByteArray format = "api_paste_format="; switch (ct) { - case Protocol::Text: - break; case Protocol::C: - return "paste_format=cpp"; + format += 'c'; break; + case Protocol::Cpp: + format += "cpp-qt"; case Protocol::JavaScript: - return "paste_format=javascript"; + format += "javascript"; break; case Protocol::Diff: - return "paste_format=diff"; // v3.X 'dff' -> 'diff' + format += "diff"; break; case Protocol::Xml: - return "paste_format=xml"; + format += "xml"; break; + case Protocol::Text: + // fallthrough! + default: + format += "text"; } - return QByteArray(); + format += '&'; + return format; } void PasteBinDotComProtocol::paste(const QString &text, ContentType ct, const QString &username, - const QString & /* comment */, - const QString & /* description */) + const QString &comment, + const QString &description) { - QTC_ASSERT(!m_pasteReply, return;) + Q_UNUSED(comment); + Q_UNUSED(description); + QTC_ASSERT(!m_pasteReply, return); // Format body - QByteArray pasteData = format(ct); - if (!pasteData.isEmpty()) - pasteData.append('&'); - pasteData += "paste_name="; + QByteArray pasteData = API_KEY; + pasteData += "api_option=paste&"; + pasteData += "api_paste_expire_date=1M&"; + pasteData += format(ct); + pasteData += "api_paste_name="; pasteData += QUrl::toPercentEncoding(username); - const QString subDomain = m_settings->hostPrefix(); - if (!subDomain.isEmpty()) { - pasteData += "&paste_subdomain="; - pasteData += QUrl::toPercentEncoding(subDomain); - } - - pasteData += "&paste_code="; + pasteData += "&api_paste_code="; pasteData += QUrl::toPercentEncoding(fixNewLines(text)); // fire request - QString link; - QTextStream(&link) << "http://" << hostName(false) << '/' << pastePhpScriptpC; - - m_pasteReply = httpPost(link, pasteData); + m_pasteReply = httpPost(QLatin1String(PASTEBIN_BASE) + QLatin1String(PASTEBIN_API), pasteData); connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished())); if (debug) - qDebug() << "paste: sending " << m_pasteReply << link << pasteData; + qDebug() << "paste: sending " << m_pasteReply << pasteData; } void PasteBinDotComProtocol::pasteFinished() @@ -165,21 +145,14 @@ void PasteBinDotComProtocol::pasteFinished() void PasteBinDotComProtocol::fetch(const QString &id) { - const QString httpProtocolPrefix = QLatin1String("http://"); - - QTC_ASSERT(!m_fetchReply, return;) - // Did we get a complete URL or just an id. Insert a call to the php-script - QString link; - if (id.startsWith(httpProtocolPrefix)) { - // Change "http://host/id" -> "http://host/script?i=id". - const int lastSlashPos = id.lastIndexOf(QLatin1Char('/')); - link = id.mid(0, lastSlashPos); - QTextStream(&link) << '/' << fetchPhpScriptpC<< "?i=" << id.mid(lastSlashPos + 1); - } else { - // format "http://host/script?i=id". - QTextStream(&link) << "http://" << hostName(true) << '/' << fetchPhpScriptpC<< "?i=" << id; - } + QString link = QLatin1String(PASTEBIN_BASE) + QLatin1String(PASTEBIN_RAW); + link.append(QLatin1String("?i=")); + + if (id.startsWith(QLatin1String("http://"))) + link.append(id.mid(id.lastIndexOf(QLatin1Char('/')) + 1)); + else + link.append(id); if (debug) qDebug() << "fetch: sending " << link; @@ -226,10 +199,9 @@ void PasteBinDotComProtocol::fetchFinished() void PasteBinDotComProtocol::list() { - QTC_ASSERT(!m_listReply, return;) + QTC_ASSERT(!m_listReply, return); - // fire request - const QString url = QLatin1String("http://") + hostName(true) + QLatin1String("/archive"); + const QString url = QLatin1String(PASTEBIN_BASE) + QLatin1String(PASTEBIN_ARCHIVE); m_listReply = httpGet(url); connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); if (debug) @@ -244,27 +216,20 @@ static inline void padString(QString *s, int len) } /* Quick & dirty: Parse out the 'archive' table as of 16.3.2011: -\code - <table class="maintable" cellspacing="0"> - <tr class="top"> - <th scope="col" align="left">Name / Title</th> - <th scope="col" align="left">Posted</th> - <th scope="col" align="left">Expires</th> - <th scope="col" align="left">Size</th> - <th scope="col" align="left">Syntax</th> - <th scope="col" align="left">User</th> - </tr> - <tr class="g"> - <td class="icon"><a href="/8ZRqkcaP">Untitled</a></td> - <td>2 sec ago</td> - <td>Never</td> - <td>9.41 KB</td> - <td><a href="/archive/text">None</a></td> - <td>a guest</td> - </tr> - <tr> -\endcode */ - + \code +<table class="maintable" cellspacing="0"> + <tr class="top"> + <th scope="col" align="left">Name / Title</th> + <th scope="col" align="left">Posted</th> + <th scope="col" align="right">Syntax</th> + </tr> + <tr> + <td><img src="/i/t.gif" class="i_p0" alt="" border="0" /><a href="/cvWciF4S">Vector 1</a></td> + <td>2 sec ago</td> + <td align="right"><a href="/archive/cpp">C++</a></td> + </tr> + ... +-\endcode */ enum ParseState { OutSideTable, WithinTable, WithinTableRow, WithinTableHeaderElement, @@ -281,7 +246,7 @@ QDebug operator<<(QDebug d, const QXmlStreamAttributes &al) static inline ParseState nextOpeningState(ParseState current, const QXmlStreamReader &reader) { - const QStringRef element = reader.name(); + const QStringRef &element = reader.name(); switch (current) { case OutSideTable: // Trigger on main table only. @@ -300,6 +265,8 @@ static inline ParseState nextOpeningState(ParseState current, const QXmlStreamRe return WithinTableHeaderElement; break; case WithinTableElement: + if (element == QLatin1String("img")) + return WithinTableElement; if (element == QLatin1String("a")) return WithinTableElementAnchor; break; @@ -327,6 +294,8 @@ static inline ParseState nextClosingState(ParseState current, const QStringRef & case WithinTableElement: if (element == QLatin1String("td")) return WithinTableRow; + if (element == QLatin1String("img")) + return WithinTableElement; break; case WithinTableHeaderElement: if (element == QLatin1String("th")) @@ -336,10 +305,10 @@ static inline ParseState nextClosingState(ParseState current, const QStringRef & if (element == QLatin1String("a")) return WithinTableElement; break; - case ParseError: + case ParseError: break; - } - return ParseError; + } + return ParseError; } static inline QStringList parseLists(QIODevice *io) @@ -354,10 +323,9 @@ static inline QStringList parseLists(QIODevice *io) const QString hrefAttribute = QLatin1String("href"); //: Unknown user of paste. - const QString unknownUser = PasteBinDotComProtocol::tr("<Unknown>"); QString link; - QString user; - QString description; + QString title; + QString age; while (!reader.atEnd()) { switch(reader.readNext()) { @@ -392,20 +360,21 @@ static inline QStringList parseLists(QIODevice *io) break; case WithinTable: // User can occasionally be empty. - if (tableRow && !link.isEmpty() && !description.isEmpty()) { + if (tableRow && !link.isEmpty() && !title.isEmpty() && !age.isEmpty()) { QString entry = link; entry += QLatin1Char(' '); - entry += user.isEmpty() ? unknownUser : user; - entry += QLatin1Char(' '); - entry += description; + entry += title; + entry += QLatin1String(" ("); + entry += age; + entry += QLatin1Char(')'); rc.push_back(entry); if (rc.size() >= maxEntries) return rc; } tableRow++; - user.clear(); + age.clear(); link.clear(); - description.clear(); + title.clear(); break; case WithinTableRow: tableColumn++; @@ -420,14 +389,13 @@ static inline QStringList parseLists(QIODevice *io) break; case QXmlStreamReader::Characters: switch (state) { - break; case WithinTableElement: - if (tableColumn == 5) - user = reader.text().toString(); + if (tableColumn == 1) + age = reader.text().toString(); break; case WithinTableElementAnchor: if (tableColumn == 0) - description = reader.text().toString(); + title = reader.text().toString(); break; default: break; @@ -456,8 +424,4 @@ void PasteBinDotComProtocol::listFinished() m_listReply = 0; } -Core::IOptionsPage *PasteBinDotComProtocol::settingsPage() const -{ - return m_settings; -} } // namespace CodePaster diff --git a/src/plugins/cpaster/pastebindotcomprotocol.h b/src/plugins/cpaster/pastebindotcomprotocol.h index d2ec9a6976..6a75f7070d 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.h +++ b/src/plugins/cpaster/pastebindotcomprotocol.h @@ -36,7 +36,6 @@ #include "protocol.h" namespace CodePaster { -class PasteBinDotComSettings; class PasteBinDotComProtocol : public NetworkProtocol { @@ -48,8 +47,6 @@ public: QString name() const { return protocolName(); } virtual unsigned capabilities() const; - bool hasSettings() const { return true; } - Core::IOptionsPage *settingsPage() const; virtual void fetch(const QString &id); virtual void paste(const QString &text, @@ -64,13 +61,7 @@ public slots: void pasteFinished(); void listFinished(); -protected: - virtual bool checkConfiguration(QString *errorMessage = 0); - private: - QString hostName(bool withSubDomain) const; - - PasteBinDotComSettings *m_settings; QNetworkReply *m_fetchReply; QNetworkReply *m_pasteReply; QNetworkReply *m_listReply; diff --git a/src/plugins/cpaster/pastebindotcomsettings.cpp b/src/plugins/cpaster/pastebindotcomsettings.cpp deleted file mode 100644 index f3d47bb782..0000000000 --- a/src/plugins/cpaster/pastebindotcomsettings.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#include "pastebindotcomsettings.h" -#include "cpasterconstants.h" -#include "ui_pastebindotcomsettings.h" - -#include <coreplugin/icore.h> -#include <QSettings> -#include <QCoreApplication> - -static const char groupC[] = "PasteBinDotComSettings"; -static const char prefixKeyC[] = "Prefix"; - -namespace CodePaster { -PasteBinDotComSettings::PasteBinDotComSettings() -{ - m_settings = Core::ICore::settings(); - if (m_settings) { - const QString rootKey = QLatin1String(groupC) + QLatin1Char('/'); - m_hostPrefix = m_settings->value(rootKey + QLatin1String(prefixKeyC), QString()).toString(); - } -} - -QString PasteBinDotComSettings::id() const -{ - return QLatin1String("B.Pastebin.com"); -} - -QString PasteBinDotComSettings::displayName() const -{ - return tr("Pastebin.com"); -} - -QString PasteBinDotComSettings::category() const -{ - return QLatin1String(CodePaster::Constants::CPASTER_SETTINGS_CATEGORY); -} - -QString PasteBinDotComSettings::displayCategory() const -{ - return QCoreApplication::translate("CodePaster", CodePaster::Constants::CPASTER_SETTINGS_TR_CATEGORY); -} - -QIcon PasteBinDotComSettings::categoryIcon() const -{ - return QIcon(); // TODO: Icon for CodePaster -} - -QWidget *PasteBinDotComSettings::createPage(QWidget *parent) -{ - Internal::Ui::PasteBinComSettingsWidget ui; - QWidget *w = new QWidget(parent); - ui.setupUi(w); - ui.lineEdit->setText(hostPrefix()); - connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString))); - return w; -} - -void PasteBinDotComSettings::apply() -{ - if (!m_settings) - return; - - m_settings->beginGroup(QLatin1String(groupC)); - m_settings->setValue(QLatin1String(prefixKeyC), m_hostPrefix); - m_settings->endGroup(); -} - -void PasteBinDotComSettings::serverChanged(const QString &prefix) -{ - m_hostPrefix = prefix; -} - -QString PasteBinDotComSettings::hostPrefix() const -{ - return m_hostPrefix; -} -} //namespace CodePaster diff --git a/src/plugins/cpaster/pastebindotcomsettings.h b/src/plugins/cpaster/pastebindotcomsettings.h deleted file mode 100644 index c66574f4ed..0000000000 --- a/src/plugins/cpaster/pastebindotcomsettings.h +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef PASTEBINDOTCOMSETTINGS_H -#define PASTEBINDOTCOMSETTINGS_H - -#include <coreplugin/dialogs/ioptionspage.h> - -#include <QStringList> -#include <QUrl> -#include <QWidget> - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - -namespace CodePaster { -class PasteBinDotComSettings : public Core::IOptionsPage -{ - Q_OBJECT - -public: - PasteBinDotComSettings(); - - QString id() const; - QString displayName() const; - QString category() const; - QString displayCategory() const; - QIcon categoryIcon() const; - - QWidget *createPage(QWidget *parent); - void apply(); - void finish() { } - - QString hostPrefix() const; -public slots: - void serverChanged(const QString &host); - -private: - QSettings *m_settings; - QString m_hostPrefix; -}; -} // namespace CodePaster -#endif diff --git a/src/plugins/cpaster/pasteview.ui b/src/plugins/cpaster/pasteview.ui index 5bc18658ca..36c19658b0 100644 --- a/src/plugins/cpaster/pasteview.ui +++ b/src/plugins/cpaster/pasteview.ui @@ -90,8 +90,14 @@ p, li { white-space: pre-wrap; } </item> <item> <widget class="QStackedWidget" name="stackedWidget"> + <property name="currentIndex"> + <number>0</number> + </property> <widget class="QWidget" name="diffChunkPage"> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="margin"> + <number>0</number> + </property> <item> <widget class="QGroupBox" name="groupBox"> <property name="sizePolicy"> @@ -161,6 +167,9 @@ p, li { white-space: pre-wrap; } </widget> <widget class="QWidget" name="plainTextPage"> <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="margin"> + <number>0</number> + </property> <item> <widget class="QPlainTextEdit" name="plainTextEdit"/> </item> diff --git a/src/plugins/cpaster/protocol.cpp b/src/plugins/cpaster/protocol.cpp index 462cf4c8ce..2b78e746d0 100644 --- a/src/plugins/cpaster/protocol.cpp +++ b/src/plugins/cpaster/protocol.cpp @@ -34,7 +34,10 @@ #include <utils/networkaccessmanager.h> #include <cpptools/cpptoolsconstants.h> +#include <designer/designerconstants.h> +#include <glsleditor/glsleditorconstants.h> #include <qmljstools/qmljstoolsconstants.h> +#include <resourceeditor/resourceeditorconstants.h> #include <coreplugin/icore.h> #include <coreplugin/dialogs/ioptionspage.h> @@ -83,19 +86,29 @@ void Protocol::list() Protocol::ContentType Protocol::contentType(const QString &mt) { - if (mt == QLatin1String(CppTools::Constants::C_SOURCE_MIMETYPE) + if (mt == QLatin1String(CppTools::Constants::C_SOURCE_MIMETYPE) || mt == QLatin1String(CppTools::Constants::C_HEADER_MIMETYPE) - || mt == QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE) - || mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE) - || mt == QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)) + || mt == QLatin1String(GLSLEditor::Constants::GLSL_MIMETYPE) + || mt == QLatin1String(GLSLEditor::Constants::GLSL_MIMETYPE_VERT) + || mt == QLatin1String(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG) + || mt == QLatin1String(GLSLEditor::Constants::GLSL_MIMETYPE_VERT_ES) + || mt == QLatin1String(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG_ES)) return C; + if (mt == QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE) + || mt == QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE) + || mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE) + || mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE)) + return Cpp; if (mt == QLatin1String(QmlJSTools::Constants::QML_MIMETYPE) || mt == QLatin1String(QmlJSTools::Constants::JS_MIMETYPE) || mt == QLatin1String(QmlJSTools::Constants::JSON_MIMETYPE)) return JavaScript; if (mt == QLatin1String("text/x-patch")) return Diff; - if (mt == QLatin1String("text/xml") || mt == QLatin1String("application/xml")) + if (mt == QLatin1String("text/xml") + || mt == QLatin1String("application/xml") + || mt == QLatin1String(ResourceEditor::Constants::C_RESOURCE_MIMETYPE) + || mt == QLatin1String(Designer::Constants::FORM_MIMETYPE)) return Xml; return Text; } diff --git a/src/plugins/cpaster/protocol.h b/src/plugins/cpaster/protocol.h index b01776fbe6..b036b7370c 100644 --- a/src/plugins/cpaster/protocol.h +++ b/src/plugins/cpaster/protocol.h @@ -55,7 +55,7 @@ class Protocol : public QObject public: enum ContentType { - Text, C, JavaScript, Diff, Xml + Text, C, Cpp, JavaScript, Diff, Xml }; enum Capabilities { diff --git a/src/plugins/cppeditor/cppinsertdecldef.cpp b/src/plugins/cppeditor/cppinsertdecldef.cpp index 47e4e28a00..87cb345dba 100644 --- a/src/plugins/cppeditor/cppinsertdecldef.cpp +++ b/src/plugins/cppeditor/cppinsertdecldef.cpp @@ -533,6 +533,7 @@ QPair<QString, QString> assembleDeclarationData(const QString &specifiers, const CppRefactoringFilePtr &file, const Overview &printer) { + QTC_ASSERT(decltr, return (QPair<QString, QString>())); if (decltr->core_declarator && decltr->core_declarator->asDeclaratorId() && decltr->core_declarator->asDeclaratorId()->name) { @@ -788,14 +789,16 @@ QList<CppQuickFixOperation::Ptr> ExtractFunction::match( it; it = it->next) { ParameterDeclarationAST *paramDecl = it->value->asParameterDeclaration(); - const QString &specifiers = - file->textOf(file->startOf(paramDecl), - file->endOf(paramDecl->type_specifier_list->lastValue())); - const QPair<QString, QString> &p = - assembleDeclarationData(specifiers, paramDecl->declarator, file, printer); - if (!p.first.isEmpty()) { - analyser.m_knownDecls.insert(p.first, p.second); - refFuncParams.insert(p.first); + if (paramDecl->declarator) { + const QString &specifiers = + file->textOf(file->startOf(paramDecl), + file->endOf(paramDecl->type_specifier_list->lastValue())); + const QPair<QString, QString> &p = + assembleDeclarationData(specifiers, paramDecl->declarator, file, printer); + if (!p.first.isEmpty()) { + analyser.m_knownDecls.insert(p.first, p.second); + refFuncParams.insert(p.first); + } } } } diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index d60a759f4e..7f2030fdb7 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -713,8 +713,8 @@ CppModelManager::CppModelManager(QObject *parent) connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, SLOT(onProjectAdded(ProjectExplorer::Project*))); - connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), - this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project *))); + connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)), + this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*))); connect(session, SIGNAL(aboutToUnloadSession(QString)), this, SLOT(onAboutToUnloadSession())); @@ -728,11 +728,11 @@ CppModelManager::CppModelManager(QObject *parent) this, SLOT(onExtraDiagnosticsUpdated(QString))); // Listen for editor closed and opened events so that we can keep track of changing files - connect(Core::ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor *)), - this, SLOT(editorOpened(Core::IEditor *))); + connect(Core::ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + this, SLOT(editorOpened(Core::IEditor*))); - connect(Core::ICore::editorManager(), SIGNAL(editorAboutToClose(Core::IEditor *)), - this, SLOT(editorAboutToClose(Core::IEditor *))); + connect(Core::ICore::editorManager(), SIGNAL(editorAboutToClose(Core::IEditor*)), + this, SLOT(editorAboutToClose(Core::IEditor*))); m_completionFallback = new InternalCompletionAssistProvider; m_completionAssistProvider = m_completionFallback; diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp index 944d471392..578cbaed95 100644 --- a/src/plugins/cpptools/symbolsfindfilter.cpp +++ b/src/plugins/cpptools/symbolsfindfilter.cpp @@ -186,7 +186,7 @@ void SymbolsFindFilter::startSearch(Find::SearchResult *search) connect(watcher, SIGNAL(finished()), this, SLOT(finish())); connect(watcher, SIGNAL(resultsReadyAt(int,int)), - this, SLOT(addResults(int, int))); + this, SLOT(addResults(int,int))); watcher->setFuture(QtConcurrent::run<Find::SearchResultItem, SymbolsFindParameters, CPlusPlus::Snapshot, QSet<QString> >(runSearch, parameters, m_manager->snapshot(), projectFileNames)); diff --git a/src/plugins/cvs/annotationhighlighter.cpp b/src/plugins/cvs/annotationhighlighter.cpp index bbf279df24..9f4b756da4 100644 --- a/src/plugins/cvs/annotationhighlighter.cpp +++ b/src/plugins/cvs/annotationhighlighter.cpp @@ -36,8 +36,9 @@ using namespace Cvs; using namespace Cvs::Internal; CvsAnnotationHighlighter::CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, + const QColor &bg, QTextDocument *document) : - VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/cvs/annotationhighlighter.h b/src/plugins/cvs/annotationhighlighter.h index 8a99b898f1..ee6b874107 100644 --- a/src/plugins/cvs/annotationhighlighter.h +++ b/src/plugins/cvs/annotationhighlighter.h @@ -44,7 +44,7 @@ class CvsAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter Q_OBJECT public: - explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp index b88f40e78d..769df31f50 100644 --- a/src/plugins/cvs/cvseditor.cpp +++ b/src/plugins/cvs/cvseditor.cpp @@ -131,9 +131,10 @@ VcsBase::DiffHighlighter *CvsEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(filePattern); } -VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new CvsAnnotationHighlighter(changes); + return new CvsAnnotationHighlighter(changes, bg); } QString CvsEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/cvs/cvseditor.h b/src/plugins/cvs/cvseditor.h index 7c376d66ec..856871d792 100644 --- a/src/plugins/cvs/cvseditor.h +++ b/src/plugins/cvs/cvseditor.h @@ -52,7 +52,7 @@ private: QSet<QString> annotationChanges() const; QString changeUnderCursor(const QTextCursor &) const; VcsBase::DiffHighlighter *createDiffHighlighter() const; - VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index c5276c5a7a..eac6068952 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -1553,7 +1553,7 @@ void CdbEngine::selectThread(int index) const int newThreadId = threadsHandler()->threads().at(index).id; threadsHandler()->setCurrentThread(index); - const QByteArray cmd = "~" + QByteArray::number(newThreadId) + " s"; + const QByteArray cmd = '~' + QByteArray::number(newThreadId) + " s"; postBuiltinCommand(cmd, 0, &CdbEngine::dummyHandler, CommandListStack); } diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 05cc7d549b..3b9e671181 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -177,6 +177,7 @@ public: m_memoryAgent(engine), m_isStateDebugging(false), m_testsPossible(true), + m_testsRunning(false), m_taskHub(0) { connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation())); @@ -319,6 +320,7 @@ public: void handleAutoTestLine(int line); void reportTestError(const QString &msg, int line); bool m_testsPossible; + bool m_testsRunning; bool m_breakOnError; bool m_foundError; QStringList m_testContents; @@ -865,6 +867,7 @@ void DebuggerEngine::notifyInferiorSetupFailed() { showMessage(_("NOTE: INFERIOR SETUP FAILED")); QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << this << state()); + showStatusMessage(tr("Setup failed.")); setState(InferiorSetupFailed); if (isMasterEngine()) d->queueShutdownEngine(); @@ -900,6 +903,7 @@ void DebuggerEngine::notifyInferiorUnrunnable() d->m_progress.setProgressValue(1000); d->m_progress.reportFinished(); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); + showStatusMessage(tr("Loading finished.")); setState(InferiorUnrunnable); } @@ -910,6 +914,7 @@ void DebuggerEngine::notifyEngineRunFailed() d->m_progress.setProgressValue(900); d->m_progress.reportCanceled(); d->m_progress.reportFinished(); + showStatusMessage(tr("Run failed.")); setState(EngineRunFailed); if (isMasterEngine()) d->queueShutdownEngine(); @@ -961,6 +966,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorRunOk() d->m_progress.setProgressValue(1000); d->m_progress.reportFinished(); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); + showStatusMessage(tr("Running.")); setState(InferiorRunOk); } @@ -970,6 +976,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorStopOk() d->m_progress.setProgressValue(1000); d->m_progress.reportFinished(); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); + showStatusMessage(tr("Stopped.")); setState(InferiorStopOk); } @@ -977,12 +984,14 @@ void DebuggerEngine::notifyInferiorRunRequested() { showMessage(_("NOTE: INFERIOR RUN REQUESTED")); QTC_ASSERT(state() == InferiorStopOk, qDebug() << this << state()); + showStatusMessage(tr("Run requested...")); setState(InferiorRunRequested); } void DebuggerEngine::notifyInferiorRunOk() { showMessage(_("NOTE: INFERIOR RUN OK")); + showStatusMessage(tr("Running.")); // Transition from StopRequested can happen sin remotegdbadapter. QTC_ASSERT(state() == InferiorRunRequested || state() == InferiorStopRequested, qDebug() << this << state()); @@ -1019,6 +1028,7 @@ void DebuggerEngine::notifyInferiorStopOk() return; } QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state()); + showStatusMessage(tr("Stopped.")); setState(InferiorStopOk); } @@ -1026,6 +1036,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop() { showMessage(_("NOTE: INFERIOR SPONTANEOUS STOP")); QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state()); + showStatusMessage(tr("Stopped.")); setState(InferiorStopOk); } @@ -1044,6 +1055,7 @@ void DebuggerEnginePrivate::doInterruptInferior() QTC_ASSERT(state() == InferiorRunOk, qDebug() << m_engine << state()); m_engine->setState(InferiorStopRequested); m_engine->showMessage(_("CALL: INTERRUPT INFERIOR")); + m_engine->showStatusMessage(tr("Attempting to interrupt.")); m_engine->interruptInferior(); } @@ -1802,6 +1814,11 @@ void DebuggerEngine::handleAutoTests() d->handleAutoTests(); } +bool DebuggerEngine::isAutoTestRunning() const +{ + return d->m_testsRunning; +} + void DebuggerEnginePrivate::handleAutoTests() { if (!m_testsPossible) @@ -1826,11 +1843,14 @@ void DebuggerEnginePrivate::handleAutoTests() if (s.startsWith(QLatin1String("#define USE_AUTORUN 1"))) { m_testsPossible = true; m_breakOnError = false; + m_testsRunning = true; } else if (s.startsWith(QLatin1String("#define USE_AUTORUN 2"))) { m_testsPossible = true; + m_testsRunning = true; m_breakOnError = true; } else { m_testsPossible = false; + m_testsRunning = false; m_breakOnError = false; } break; @@ -1856,15 +1876,20 @@ void DebuggerEnginePrivate::handleAutoTestLine(int line) return; s = s.mid(pos + 2).trimmed(); QString cmd = s.section(QLatin1Char(' '), 0, 0); - if (cmd == QLatin1String("Expand")) { - m_engine->showMessage(_("'Expand' found in line %1, but not implemented yet.").arg(line)); + if (cmd == QLatin1String("Skip")) { + m_engine->showMessage(_("Skipping test %1").arg(line)); + handleAutoTestLine(line + 1); + } else if (cmd == QLatin1String("Expand")) { + m_engine->showMessage(_("'Expand' found in line %1, " + "but is not implemented yet.").arg(line)); handleAutoTestLine(line + 1); } else if (cmd == QLatin1String("Check")) { QString name = s.section(QLatin1Char(' '), 1, 1); if (name.isEmpty()) { - reportTestError(_("'Check' needs arguments."), line); - } else if (name.contains(QLatin1Char('.'))) { - m_engine->showMessage(_("variable %1 found in line %2 contains '.', but 'Expand' is not implemented yet.").arg(name).arg(line)); + reportTestError(_("'Check' needs arguments."), line); + } else if (name.count(QLatin1Char('.')) >= 2) { + m_engine->showMessage(_("Variable %1 found in line %2 is nested " + "too deeply for the current implementation.").arg(name).arg(line)); } else { QByteArray iname = "local." + name.toLatin1(); QString found = m_engine->watchHandler()->displayForAutoTest(iname); @@ -1886,9 +1911,10 @@ void DebuggerEnginePrivate::handleAutoTestLine(int line) } else if (cmd == QLatin1String("CheckType")) { QString name = s.section(QLatin1Char(' '), 1, 1); if (name.isEmpty()) { - reportTestError(_("'CheckType' needs arguments."), line); - } else if (name.contains(QLatin1Char('.'))) { - m_engine->showMessage(_("variable %1 found in line %2 contains '.', but 'Expand' is not implemented yet.").arg(name).arg(line)); + reportTestError(_("'CheckType' needs arguments."), line); + } else if (name.count(QLatin1Char('.')) >= 2) { + m_engine->showMessage(_("Variable %1 found in line %2 is nested " + "too deeply for the current implementation.").arg(name).arg(line)); } else { QByteArray iname = "local." + name.toLatin1(); QString found = m_engine->watchHandler()->displayForAutoTest(iname); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 1e559e3e65..f2f133dff1 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -405,6 +405,7 @@ protected: DebuggerState state); virtual void handleAutoTests(); + virtual bool isAutoTestRunning() const; private: // Wrapper engine needs access to state of its subengines. diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d0a31091d5..d072f370ae 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -792,7 +792,7 @@ public slots: void attachToQmlPort(); void startRemoteEngine(); void attachExternalApplication(); - Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc); + Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl*rc); void runScheduled(); void attachCore(); void attachToRemoteServer(const QString &spec); @@ -1842,8 +1842,8 @@ void DebuggerPluginPrivate::editorOpened(IEditor *editor) if (!textEditor) return; connect(textEditor, - SIGNAL(markRequested(TextEditor::ITextEditor*,int, TextEditor::ITextEditor::MarkRequestKind)), - SLOT(requestMark(TextEditor::ITextEditor*,int, TextEditor::ITextEditor::MarkRequestKind))); + SIGNAL(markRequested(TextEditor::ITextEditor*,int,TextEditor::ITextEditor::MarkRequestKind)), + SLOT(requestMark(TextEditor::ITextEditor*,int,TextEditor::ITextEditor::MarkRequestKind))); connect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); @@ -2721,10 +2721,10 @@ static QString formatStartParameters(DebuggerStartParameters &sp) void DebuggerPluginPrivate::runControlStarted(DebuggerEngine *engine) { activateDebugMode(); - const QString message = tr("Starting debugger '%1' for ABI '%2'...") + const QString message = tr("Starting debugger \"%1\" for ABI \"%2\"...") .arg(engine->objectName()) .arg(engine->startParameters().toolChainAbi.toString()); - showMessage(message, StatusBar); + showStatusMessage(message); showMessage(formatStartParameters(engine->startParameters()), LogDebug); showMessage(m_debuggerSettings->dump(), LogDebug); m_snapshotHandler->appendSnapshot(engine); diff --git a/src/plugins/debugger/gdb/codagdbadapter.cpp b/src/plugins/debugger/gdb/codagdbadapter.cpp index 7ffb4e7e96..1cc5135f5e 100644 --- a/src/plugins/debugger/gdb/codagdbadapter.cpp +++ b/src/plugins/debugger/gdb/codagdbadapter.cpp @@ -157,7 +157,7 @@ void CodaGdbAdapter::setupDeviceSignals() this, SLOT(codaLogMessage(QString))); connect(m_codaDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(codaEvent(Coda::CodaEvent))); - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)), + connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), this, SLOT(codaDeviceRemoved(SymbianUtils::SymbianDevice))); } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index e7aab3ddd4..bd8f94d333 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -484,7 +484,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) const int pos1 = ba.indexOf(",original-location"); const int pos2 = ba.indexOf("\":", pos1 + 2); const int pos3 = ba.indexOf('"', pos2 + 2); - ba.replace(pos1, pos3 - pos1 + 1, ""); + ba.remove(pos1, pos3 - pos1 + 1); result = GdbMi(); result.fromString(ba); BreakHandler *handler = breakHandler(); @@ -1023,6 +1023,10 @@ void GdbEngine::handleResultRecord(GdbResponse *response) QTC_CHECK(state() == InferiorRunOk); notifyInferiorSpontaneousStop(); notifyEngineIll(); + } else if (msg.startsWith("Remote connection closed") + || msg.startsWith("Quit")) { + // Can happen when the target exits (gdbserver) + notifyInferiorExited(); } else { // Windows: Some DLL or some function not found. Report // the exception now in a box. @@ -2094,6 +2098,9 @@ void GdbEngine::handleExecuteStep(const GdbResponse &response) if (!m_commandsToRunOnTemporaryBreak.isEmpty()) flushQueuedCommands(); executeStepI(); // Fall back to instruction-wise stepping. + } else if (msg.startsWith("Cannot execute this command while the selected thread is running.")) { + showExecutionError(QString::fromLocal8Bit(msg)); + notifyInferiorRunFailed(); } else { showExecutionError(QString::fromLocal8Bit(msg)); notifyInferiorIll(); @@ -2162,6 +2169,9 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response) notifyInferiorRunFailed(); if (!isDying()) executeNextI(); // Fall back to instruction-wise stepping. + } else if (msg.startsWith("Cannot execute this command while the selected thread is running.")) { + showExecutionError(QString::fromLocal8Bit(msg)); + notifyInferiorRunFailed(); } else { showMessageBox(QMessageBox::Critical, tr("Execution Error"), tr("Cannot continue debugged process:\n") + QString::fromLocal8Bit(msg)); @@ -4618,8 +4628,8 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &settingsIdHint) connect(gdbProc(), SIGNAL(error(QProcess::ProcessError)), SLOT(handleGdbError(QProcess::ProcessError))); - connect(gdbProc(), SIGNAL(finished(int, QProcess::ExitStatus)), - SLOT(handleGdbFinished(int, QProcess::ExitStatus))); + connect(gdbProc(), SIGNAL(finished(int,QProcess::ExitStatus)), + SLOT(handleGdbFinished(int,QProcess::ExitStatus))); connect(gdbProc(), SIGNAL(readyReadStandardOutput()), SLOT(readGdbStandardOutput())); connect(gdbProc(), SIGNAL(readyReadStandardError()), diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index 8d8f294eee..3663e66cdb 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -107,6 +107,8 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) options += "partial,"; if (params.tooltipOnly) options += "tooltiponly,"; + if (isAutoTestRunning()) + options += "autotest,"; options.chop(1); QByteArray resultVar; diff --git a/src/plugins/debugger/lldb/guest/lldbengineguest.cpp b/src/plugins/debugger/lldb/guest/lldbengineguest.cpp index 2651c98eb0..1884512369 100644 --- a/src/plugins/debugger/lldb/guest/lldbengineguest.cpp +++ b/src/plugins/debugger/lldb/guest/lldbengineguest.cpp @@ -95,8 +95,8 @@ LldbEngineGuest::LldbEngineGuest() qRegisterMetaType<lldb::SBEvent *>("lldb::SBEvent *"); m_worker->moveToThread(&m_wThread); - connect(m_worker, SIGNAL(lldbEvent(lldb::SBEvent *)), this, - SLOT(lldbEvent(lldb::SBEvent *)), Qt::BlockingQueuedConnection); + connect(m_worker, SIGNAL(lldbEvent(lldb::SBEvent*)), this, + SLOT(lldbEvent(lldb::SBEvent*)), Qt::BlockingQueuedConnection); m_wThread.start(); setObjectName(QLatin1String("LLDBEngineGuest")); } diff --git a/src/plugins/debugger/lldb/lldbenginehost.cpp b/src/plugins/debugger/lldb/lldbenginehost.cpp index a80854111f..17d4b9be51 100644 --- a/src/plugins/debugger/lldb/lldbenginehost.cpp +++ b/src/plugins/debugger/lldb/lldbenginehost.cpp @@ -70,10 +70,10 @@ SshIODevice::SshIODevice(Utils::SshRemoteProcessRunner *r) { setOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered); connect (runner, SIGNAL(processStarted()), this, SLOT(processStarted())); - connect(runner, SIGNAL(processOutputAvailable(const QByteArray &)), - this, SLOT(outputAvailable(const QByteArray &))); - connect(runner, SIGNAL(processErrorOutputAvailable(const QByteArray &)), - this, SLOT(errorOutputAvailable(const QByteArray &))); + connect(runner, SIGNAL(processOutputAvailable(QByteArray)), + this, SLOT(outputAvailable(QByteArray))); + connect(runner, SIGNAL(processErrorOutputAvailable(QByteArray)), + this, SLOT(errorOutputAvailable(QByteArray))); } SshIODevice::~SshIODevice() @@ -158,8 +158,8 @@ LldbEngineHost::LldbEngineHost(const DebuggerStartParameters &startParameters) } else { m_guestProcess = new QProcess(this); - connect(m_guestProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(finished(int, QProcess::ExitStatus))); + connect(m_guestProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(finished(int,QProcess::ExitStatus))); connect(m_guestProcess, SIGNAL(readyReadStandardError()), this, SLOT(stderrReady())); @@ -189,8 +189,8 @@ LldbEngineHost::~LldbEngineHost() showMessage(QLatin1String("tear down qtcreator-lldb")); if (m_guestProcess) { - disconnect(m_guestProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(finished (int, QProcess::ExitStatus))); + disconnect(m_guestProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(finished(int,QProcess::ExitStatus))); m_guestProcess->terminate(); diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp index 96078d6c90..4f836b2cfc 100644 --- a/src/plugins/debugger/memoryagent.cpp +++ b/src/plugins/debugger/memoryagent.cpp @@ -147,7 +147,7 @@ void MemoryAgent::connectBinEditorWidget(QWidget *w) SIGNAL(startOfFileRequested(Core::IEditor*)), SLOT(handleStartOfFileRequested(Core::IEditor*))); connect(w, - SIGNAL(endOfFileRequested(Core::IEditor *)), + SIGNAL(endOfFileRequested(Core::IEditor*)), SLOT(handleEndOfFileRequested(Core::IEditor*))); connect(w, SIGNAL(dataChanged(Core::IEditor*,quint64,QByteArray)), diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 384f70e3cf..84793fcb37 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -161,8 +161,8 @@ void PdbEngine::setupEngine() connect(&m_pdbProc, SIGNAL(error(QProcess::ProcessError)), SLOT(handlePdbError(QProcess::ProcessError))); - connect(&m_pdbProc, SIGNAL(finished(int, QProcess::ExitStatus)), - SLOT(handlePdbFinished(int, QProcess::ExitStatus))); + connect(&m_pdbProc, SIGNAL(finished(int,QProcess::ExitStatus)), + SLOT(handlePdbFinished(int,QProcess::ExitStatus))); connect(&m_pdbProc, SIGNAL(readyReadStandardOutput()), SLOT(readPdbStandardOutput())); connect(&m_pdbProc, SIGNAL(readyReadStandardError()), diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 2dab1a1f6b..5df56a20e2 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -326,8 +326,8 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters, SIGNAL(processExited(int)), SLOT(disconnected())); connect(&d->m_applicationLauncher, - SIGNAL(appendMessage(QString, Utils::OutputFormat)), - SLOT(appendMessage(QString, Utils::OutputFormat))); + SIGNAL(appendMessage(QString,Utils::OutputFormat)), + SLOT(appendMessage(QString,Utils::OutputFormat))); connect(&d->m_applicationLauncher, SIGNAL(processStarted()), &d->m_noDebugOutputTimer, diff --git a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp index 6af0162e06..7aa0bfa83c 100644 --- a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp +++ b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp @@ -469,7 +469,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data) QString msg = stackFrames.isEmpty() ? tr("<p>An uncaught exception occurred:</p><p>%1</p>") .arg(Qt::escape(error)) - : tr("<p>An uncaught exception occurred in <i>%1</i>:</p><p>%2</p>") + : tr("<p>An uncaught exception occurred in '%1':</p><p>%2</p>") .arg(QLatin1String(stackFrames.value(0).fileUrl), Qt::escape(error)); showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg); } else { diff --git a/src/plugins/debugger/script/scriptengine.cpp b/src/plugins/debugger/script/scriptengine.cpp index fb8731e3bb..3954997f3a 100644 --- a/src/plugins/debugger/script/scriptengine.cpp +++ b/src/plugins/debugger/script/scriptengine.cpp @@ -545,12 +545,12 @@ bool ScriptEngine::setToolTipExpression(const QPoint &mousePos, } if (!hasLetterOrNumber(exp)) { - QToolTip::showText(m_toolTipPos, tr("'%1' contains no identifier").arg(exp)); + QToolTip::showText(m_toolTipPos, tr("'%1' contains no identifier.").arg(exp)); return false; } if (exp.startsWith(QLatin1Char('"')) && exp.endsWith(QLatin1Char('"'))) { - QToolTip::showText(m_toolTipPos, tr("String literal %1").arg(exp)); + QToolTip::showText(m_toolTipPos, tr("String literal %1.").arg(exp)); return false; } @@ -566,7 +566,7 @@ bool ScriptEngine::setToolTipExpression(const QPoint &mousePos, if (hasSideEffects(exp)) { QToolTip::showText(m_toolTipPos, tr("Cowardly refusing to evaluate expression '%1' " - "with potential side effects").arg(exp)); + "with potential side effects.").arg(exp)); return false; } diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index f07be2ace9..439d92fdde 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -202,10 +202,10 @@ FormEditorW::FormEditorW() : m_settingsPages.append(settingsPage); } - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor *)), - this, SLOT(currentEditorChanged(Core::IEditor *))); - connect(m_shortcutMapper, SIGNAL(mapped(QObject *)), - this, SLOT(updateShortcut(QObject *))); + connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + this, SLOT(currentEditorChanged(Core::IEditor*))); + connect(m_shortcutMapper, SIGNAL(mapped(QObject*)), + this, SLOT(updateShortcut(QObject*))); } FormEditorW::~FormEditorW() @@ -606,7 +606,7 @@ void FormEditorW::setupActions() m_actionAboutPlugins->setEnabled(false); // FWM - connect(m_fwm, SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface *)), this, SLOT(activeFormWindowChanged(QDesignerFormWindowInterface *))); + connect(m_fwm, SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), this, SLOT(activeFormWindowChanged(QDesignerFormWindowInterface*))); } QToolBar *FormEditorW::createEditorToolBar() const diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index aa551b6cea..e1ebe0cabd 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -111,8 +111,8 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, F setResourceEditingEnabled(false); setSlotNavigationEnabled(true); #endif - connect(this, SIGNAL(navigateToSlot(QString, QString, QStringList)), - this, SLOT(slotNavigateToSlot(QString, QString, QStringList))); + connect(this, SIGNAL(navigateToSlot(QString,QString,QStringList)), + this, SLOT(slotNavigateToSlot(QString,QString,QStringList))); connect(this, SIGNAL(helpRequested(QString,QString)), this, SLOT(slotDesignerHelpRequested(QString,QString))); slotSyncSettingsToDesigner(); diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index b73a43e0b4..715e355122 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -3323,7 +3323,7 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd) pattern = m_lastSubstitutePattern; replacement = m_lastSubstituteReplacement; count = cmd.args.section(QLatin1Char(' '), 1, 1).toInt(); - } else if (cmd.cmd.startsWith("&")) { + } else if (cmd.cmd.startsWith(QLatin1Char('&'))) { flags = cmd.cmd.mid(1); if (flags.isEmpty()) flags = m_lastSubstituteFlags; diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index 4a3bfa4bcb..c14ef63d7f 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -47,7 +47,7 @@ using namespace Find::Internal; CurrentDocumentFind::CurrentDocumentFind() : m_currentFind(0) { - connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), + connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(updateCandidateFindFilter(QWidget*,QWidget*))); } diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index 17fb484d36..1a7f8eefeb 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -116,7 +116,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen m_ui.findEdit->setPlaceholderText(QString()); m_ui.replaceEdit->setPlaceholderText(QString()); - connect(m_ui.findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(invokeFindIncremental())); + connect(m_ui.findEdit, SIGNAL(textChanged(QString)), this, SLOT(invokeFindIncremental())); connect(m_ui.findEdit, SIGNAL(returnPressed()), this, SLOT(invokeFindEnter())); connect(m_ui.replaceEdit, SIGNAL(returnPressed()), this, SLOT(invokeReplaceEnter())); @@ -414,12 +414,12 @@ QString FindToolBar::getReplaceText() void FindToolBar::setFindText(const QString &text) { - disconnect(m_ui.findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(invokeFindIncremental())); + disconnect(m_ui.findEdit, SIGNAL(textChanged(QString)), this, SLOT(invokeFindIncremental())); if (hasFindFlag(Find::FindRegularExpression)) m_ui.findEdit->setText(QRegExp::escape(text)); else m_ui.findEdit->setText(text); - connect(m_ui.findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(invokeFindIncremental())); + connect(m_ui.findEdit, SIGNAL(textChanged(QString)), this, SLOT(invokeFindIncremental())); } void FindToolBar::selectFindText() diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.cpp b/src/plugins/genericprojectmanager/genericprojectplugin.cpp index d7da6323b1..95bfb05043 100644 --- a/src/plugins/genericprojectmanager/genericprojectplugin.cpp +++ b/src/plugins/genericprojectmanager/genericprojectplugin.cpp @@ -105,8 +105,8 @@ bool GenericProjectPlugin::initialize(const QStringList &, QString *errorMessage connect(m_editFilesAction, SIGNAL(triggered()), this, SLOT(editFiles())); connect(ProjectExplorer::ProjectExplorerPlugin::instance(), - SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*)), - this, SLOT(updateContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*))); + SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*)), + this, SLOT(updateContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*))); return true; } diff --git a/src/plugins/git/annotationhighlighter.cpp b/src/plugins/git/annotationhighlighter.cpp index 67550ca231..28bbcf9267 100644 --- a/src/plugins/git/annotationhighlighter.cpp +++ b/src/plugins/git/annotationhighlighter.cpp @@ -38,8 +38,9 @@ namespace Git { namespace Internal { GitAnnotationHighlighter::GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, - QTextDocument *document) : - VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + const QColor &bg, + QTextDocument *document) : + VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/git/annotationhighlighter.h b/src/plugins/git/annotationhighlighter.h index 03267e555e..8cbbccf1db 100644 --- a/src/plugins/git/annotationhighlighter.h +++ b/src/plugins/git/annotationhighlighter.h @@ -43,7 +43,7 @@ class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { Q_OBJECT public: - explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 79d649f8f1..696560a783 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1732,7 +1732,7 @@ bool GitClient::getCommitData(const QString &workingDirectory, } commitData->files = filteredFiles; - if (commitData->files.isEmpty()) { + if (commitData->files.isEmpty() && !amend) { *errorMessage = msgNoChangedFiles(); return false; } diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index cb5b6ab600..00bad95e53 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -170,6 +170,7 @@ public: QString vcsGetRepositoryURL(const QString &directory); bool synchronousFetch(const QString &workingDirectory, const QString &remote); bool synchronousPull(const QString &workingDirectory); + bool synchronousPull(const QString &workingDirectory, bool rebase); bool synchronousPush(const QString &workingDirectory, const QString &remote = QString()); // git svn support (asynchronous). @@ -282,7 +283,6 @@ private: QString *errorMessage, bool revertStaging); void connectRepositoryChanged(const QString & repository, VcsBase::Command *cmd); - bool synchronousPull(const QString &workingDirectory, bool rebase); void syncAbortPullRebase(const QString &workingDir); bool tryLauchingGitK(const QProcessEnvironment &env, const QString &workingDirectory, diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index aec04d9e5d..8d7d1eec53 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -116,9 +116,10 @@ VcsBase::DiffHighlighter *GitEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(filePattern); } -VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new GitAnnotationHighlighter(changes); + return new GitAnnotationHighlighter(changes, bg); } QString GitEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 4ce7bf84a2..65d237a5c5 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -61,7 +61,7 @@ private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; - virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 3cda779cee..b845f4db34 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -794,12 +794,17 @@ void GitPlugin::pull() { const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); + const bool rebase = m_gitClient->settings()->boolValue(GitSettings::pullRebaseKey); switch (m_gitClient->ensureStash(state.topLevel())) { case GitClient::StashUnchanged: case GitClient::Stashed: + m_gitClient->synchronousPull(state.topLevel(), rebase); + break; case GitClient::NotStashed: - m_gitClient->synchronousPull(state.topLevel()); + if (!rebase) + m_gitClient->synchronousPull(state.topLevel(), false); + break; default: break; } diff --git a/src/plugins/help/filtersettingspage.cpp b/src/plugins/help/filtersettingspage.cpp index b7c5211a5d..8d93c92938 100644 --- a/src/plugins/help/filtersettingspage.cpp +++ b/src/plugins/help/filtersettingspage.cpp @@ -80,10 +80,10 @@ QWidget *FilterSettingsPage::createPage(QWidget *parent) updateFilterPage(); - connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), + connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(updateFilterMap())); connect(m_ui.filterWidget, - SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, + SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateAttributes(QListWidgetItem*))); connect(m_ui.filterAddButton, SIGNAL(clicked()), this, SLOT(addFilter())); connect(m_ui.filterRemoveButton, SIGNAL(clicked()), this, diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a4611bd5ec..df86dc24c8 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -360,7 +360,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) QDesktopServices::setUrlHandler("qthelp", this, "handleHelpRequest"); connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*, - Core::IMode*)), this, SLOT(modeChanged(Core::IMode*, Core::IMode*))); + Core::IMode*)), this, SLOT(modeChanged(Core::IMode*,Core::IMode*))); m_externalWindow = new ExternalHelpWindow; m_mode = new HelpMode; @@ -426,8 +426,8 @@ void HelpPlugin::setupUi() connect(indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, SLOT(setSource(QUrl))); - connect(indexWindow, SIGNAL(linksActivated(QMap<QString, QUrl>, QString)), - m_centralWidget, SLOT(showTopicChooser(QMap<QString, QUrl>, QString))); + connect(indexWindow, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)), + m_centralWidget, SLOT(showTopicChooser(QMap<QString,QUrl>,QString))); QMap<QString, Core::Command*> shortcutMap; QShortcut *shortcut = new QShortcut(m_splitter); diff --git a/src/plugins/imageviewer/imageviewer.cpp b/src/plugins/imageviewer/imageviewer.cpp index da93135a36..0ed79a265e 100644 --- a/src/plugins/imageviewer/imageviewer.cpp +++ b/src/plugins/imageviewer/imageviewer.cpp @@ -121,7 +121,7 @@ bool ImageViewer::createNew(const QString &contents) bool ImageViewer::open(QString *errorString, const QString &fileName, const QString &realFileName) { if (!d->imageView->openFile(realFileName)) { - *errorString = tr("Cannot open image file %1").arg(QDir::toNativeSeparators(realFileName)); + *errorString = tr("Cannot open image file %1.").arg(QDir::toNativeSeparators(realFileName)); return false; } setDisplayName(QFileInfo(fileName).fileName()); diff --git a/src/plugins/locator/executefilter.cpp b/src/plugins/locator/executefilter.cpp index 2a33573b82..4446080aa1 100644 --- a/src/plugins/locator/executefilter.cpp +++ b/src/plugins/locator/executefilter.cpp @@ -49,8 +49,8 @@ ExecuteFilter::ExecuteFilter() m_process = new Utils::QtcProcess(this); m_process->setEnvironment(Utils::Environment::systemEnvironment()); - connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, - SLOT(finished(int, QProcess::ExitStatus))); + connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, + SLOT(finished(int,QProcess::ExitStatus))); connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError())); diff --git a/src/plugins/locator/locatorwidget.cpp b/src/plugins/locator/locatorwidget.cpp index f7ba5f8a12..299469c1eb 100644 --- a/src/plugins/locator/locatorwidget.cpp +++ b/src/plugins/locator/locatorwidget.cpp @@ -338,7 +338,7 @@ LocatorWidget::LocatorWidget(LocatorPlugin *qop) : connect(m_refreshAction, SIGNAL(triggered()), m_locatorPlugin, SLOT(refresh())); connect(m_configureAction, SIGNAL(triggered()), this, SLOT(showConfigureDialog())); - connect(m_fileLineEdit, SIGNAL(textChanged(const QString&)), + connect(m_fileLineEdit, SIGNAL(textChanged(QString)), this, SLOT(showPopup())); connect(m_completionList, SIGNAL(activated(QModelIndex)), this, SLOT(scheduleAcceptCurrentEntry())); diff --git a/src/plugins/locator/settingspage.cpp b/src/plugins/locator/settingspage.cpp index 1b32faccde..5811532695 100644 --- a/src/plugins/locator/settingspage.cpp +++ b/src/plugins/locator/settingspage.cpp @@ -85,8 +85,8 @@ QWidget *SettingsPage::createPage(QWidget *parent) m_ui.setupUi(m_page); connect(m_ui.filterList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateButtonStates())); - connect(m_ui.filterList, SIGNAL(itemActivated(QListWidgetItem *)), - this, SLOT(configureFilter(QListWidgetItem *))); + connect(m_ui.filterList, SIGNAL(itemActivated(QListWidgetItem*)), + this, SLOT(configureFilter(QListWidgetItem*))); connect(m_ui.editButton, SIGNAL(clicked()), this, SLOT(configureFilter())); connect(m_ui.addButton, SIGNAL(clicked()), diff --git a/src/plugins/macros/actionmacrohandler.cpp b/src/plugins/macros/actionmacrohandler.cpp index 61f39fd9b0..f425b8fb85 100644 --- a/src/plugins/macros/actionmacrohandler.cpp +++ b/src/plugins/macros/actionmacrohandler.cpp @@ -61,8 +61,8 @@ static quint8 ACTIONNAME = 0; ActionMacroHandler::ActionMacroHandler(): m_mapper(new QSignalMapper(this)) { - connect(m_mapper, SIGNAL(mapped(const QString &)), - this, SLOT(addActionEvent(const QString &))); + connect(m_mapper, SIGNAL(mapped(QString)), + this, SLOT(addActionEvent(QString))); const Core::ActionManager *am = Core::ICore::actionManager(); connect(am, SIGNAL(commandAdded(QString)), diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp index e907323eea..e30338e3b6 100644 --- a/src/plugins/madde/maemodeploybymountsteps.cpp +++ b/src/plugins/madde/maemodeploybymountsteps.cpp @@ -132,7 +132,7 @@ private: void cancelInstallation(); void handleInstallationSuccess(); - Q_SLOT void handleFileCopied(const RemoteLinux::DeployableFile &deployable); + Q_SLOT void handleFileCopied(const RemoteLinux::DeployableFile&deployable); MaemoRemoteCopyFacility * const m_copyFacility; mutable QList<DeployableFile> m_filesToCopy; diff --git a/src/plugins/madde/maemodeployconfigurationwidget.cpp b/src/plugins/madde/maemodeployconfigurationwidget.cpp index d1cdf6ba1b..061e517828 100644 --- a/src/plugins/madde/maemodeployconfigurationwidget.cpp +++ b/src/plugins/madde/maemodeployconfigurationwidget.cpp @@ -72,8 +72,8 @@ MaemoDeployConfigurationWidget::MaemoDeployConfigurationWidget(QWidget *parent) mainLayout->addStretch(1); connect(m_remoteLinuxWidget, - SIGNAL(currentModelChanged(const RemoteLinux::DeployableFilesPerProFile *)), - SLOT(handleCurrentModelChanged(const RemoteLinux::DeployableFilesPerProFile *))); + SIGNAL(currentModelChanged(const RemoteLinux::DeployableFilesPerProFile*)), + SLOT(handleCurrentModelChanged(const RemoteLinux::DeployableFilesPerProFile*))); handleCurrentModelChanged(m_remoteLinuxWidget->currentModel()); } diff --git a/src/plugins/madde/maemodeviceconfigwizard.cpp b/src/plugins/madde/maemodeviceconfigwizard.cpp index 81a8ee2f84..e9b2c8863b 100644 --- a/src/plugins/madde/maemodeviceconfigwizard.cpp +++ b/src/plugins/madde/maemodeviceconfigwizard.cpp @@ -344,7 +344,7 @@ private: m_ui->keyDirPathChooser->setEnabled(false); m_ui->createKeysButton->setEnabled(false); - m_ui->statusLabel->setText(tr("Creating keys ... ")); + m_ui->statusLabel->setText(tr("Creating keys... ")); SshKeyGenerator keyGenerator; if (!keyGenerator.generateKeys(SshKeyGenerator::Rsa, SshKeyGenerator::Mixed, 1024)) { @@ -456,7 +456,7 @@ private: m_keyDeployer->deployPublicKey(sshParams, m_wizardData.publicKeyFilePath); } - Q_SLOT void handleKeyDeploymentError(const QString &errorMsg) + Q_SLOT void handleKeyDeploymentError(const QString&errorMsg) { QMessageBox::critical(this, tr("Key Deployment Failure"), errorMsg); enableInput(); diff --git a/src/plugins/madde/maemoinstalltosysrootstep.cpp b/src/plugins/madde/maemoinstalltosysrootstep.cpp index efacf68bef..60096b4ee6 100644 --- a/src/plugins/madde/maemoinstalltosysrootstep.cpp +++ b/src/plugins/madde/maemoinstalltosysrootstep.cpp @@ -195,7 +195,7 @@ void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi) connect(m_installerProcess, SIGNAL(readyReadStandardError()), SLOT(handleInstallerStderr())); - emit addOutput(tr("Installing package to sysroot ..."), MessageOutput); + emit addOutput(tr("Installing package to sysroot..."), MessageOutput); const int packageFileSize = QFileInfo(m_packageFilePath).size() / (1024*1024); const QStringList args = madArguments() << m_packageFilePath; MaemoGlobal::callMadAdmin(*m_installerProcess, args, m_qmakeCommand, true); @@ -340,7 +340,7 @@ bool MaemoCopyToSysrootStep::init() void MaemoCopyToSysrootStep::run(QFutureInterface<bool> &fi) { - emit addOutput(tr("Copying files to sysroot ..."), MessageOutput); + emit addOutput(tr("Copying files to sysroot..."), MessageOutput); QDir sysrootDir(m_systemRoot); const QChar sep = QLatin1Char('/'); diff --git a/src/plugins/madde/maemopackagecreationstep.cpp b/src/plugins/madde/maemopackagecreationstep.cpp index 288b63c715..f1d27b0e97 100644 --- a/src/plugins/madde/maemopackagecreationstep.cpp +++ b/src/plugins/madde/maemopackagecreationstep.cpp @@ -121,7 +121,7 @@ void AbstractMaemoPackageCreationStep::run(QFutureInterface<bool> &fi) SLOT(handleBuildOutput())); connect(buildProc, SIGNAL(readyReadStandardError()), this, SLOT(handleBuildOutput())); - emit addOutput(tr("Creating package file ..."), MessageOutput); + emit addOutput(tr("Creating package file..."), MessageOutput); const bool success = createPackage(buildProc, fi); disconnect(buildProc, 0, this, 0); buildProc->deleteLater(); diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp index 7df0fa3bbd..896a138513 100644 --- a/src/plugins/madde/maemopublisherfremantlefree.cpp +++ b/src/plugins/madde/maemopublisherfremantlefree.cpp @@ -127,7 +127,7 @@ void MaemoPublisherFremantleFree::createPackage() m_tmpProjectDir = tmpDirContainer() + QLatin1Char('/') + m_project->displayName(); if (QFileInfo(tmpDirContainer()).exists()) { - emit progressReport(tr("Removing left-over temporary directory ...")); + emit progressReport(tr("Removing left-over temporary directory...")); QString error; if (!Utils::FileUtils::removeRecursively(tmpDirContainer(), &error)) { finishWithFailure(tr("Error removing temporary directory: %1").arg(error), @@ -136,7 +136,7 @@ void MaemoPublisherFremantleFree::createPackage() } } - emit progressReport(tr("Setting up temporary directory ...")); + emit progressReport(tr("Setting up temporary directory...")); if (!QDir::temp().mkdir(QFileInfo(tmpDirContainer()).fileName())) { finishWithFailure(tr("Error: Could not create temporary directory."), tr("Publishing failed: Could not create source package.")); @@ -160,7 +160,7 @@ void MaemoPublisherFremantleFree::createPackage() return; } - emit progressReport(tr("Cleaning up temporary directory ...")); + emit progressReport(tr("Cleaning up temporary directory...")); AbstractMaemoPackageCreationStep::preparePackagingProcess(m_process, m_buildConfig, m_tmpProjectDir); setState(RunningQmake); @@ -398,7 +398,7 @@ void MaemoPublisherFremantleFree::uploadPackage() connect(m_uploader, SIGNAL(processClosed(int)), SLOT(handleUploadJobFinished(int))); connect(m_uploader, SIGNAL(processOutputAvailable(QByteArray)), SLOT(handleScpStdOut(QByteArray))); - emit progressReport(tr("Starting scp ...")); + emit progressReport(tr("Starting scp...")); setState(StartingScp); m_uploader->run("scp -td " + m_remoteDir.toUtf8(), m_sshParams); } @@ -450,7 +450,7 @@ void MaemoPublisherFremantleFree::prepareToSendFile() setState(PreparingToUploadFile); const QString &nextFilePath = m_filesToUpload.first(); - emit progressReport(tr("Uploading file %1 ...") + emit progressReport(tr("Uploading file %1...") .arg(QDir::toNativeSeparators(nextFilePath))); QFileInfo info(nextFilePath); m_uploader->writeDataToProcess("C0644 " + QByteArray::number(info.size()) diff --git a/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp b/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp index 8f12c1babb..00a5b8c5a3 100644 --- a/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp +++ b/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp @@ -57,8 +57,8 @@ void MaemoPublishingResultPageFremantleFree::initializePage() connect(cancelButton(), SIGNAL(clicked()), SLOT(handleCancelRequest())); connect(m_publisher, SIGNAL(finished()), SLOT(handleFinished())); connect(m_publisher, - SIGNAL(progressReport(QString, MaemoPublisherFremantleFree::OutputType)), - SLOT(handleProgress(QString, MaemoPublisherFremantleFree::OutputType))); + SIGNAL(progressReport(QString,MaemoPublisherFremantleFree::OutputType)), + SLOT(handleProgress(QString,MaemoPublisherFremantleFree::OutputType))); m_publisher->publish(); } diff --git a/src/plugins/madde/maemoqemumanager.cpp b/src/plugins/madde/maemoqemumanager.cpp index d9c79c1a24..49d2ee10eb 100644 --- a/src/plugins/madde/maemoqemumanager.cpp +++ b/src/plugins/madde/maemoqemumanager.cpp @@ -108,8 +108,8 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent) m_qemuAction->setVisible(false); // listen to qt version changes to update the start button - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), - this, SLOT(qtVersionsChanged(QList<int>))); + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), + this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>))); // listen to project add, remove and startup changes to udate start button SessionManager *session = ProjectExplorerPlugin::instance()->session(); @@ -122,14 +122,14 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent) connect(m_qemuProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(qemuProcessError(QProcess::ProcessError))); - connect(m_qemuProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, + connect(m_qemuProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(qemuProcessFinished())); connect(m_qemuProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(qemuOutput())); connect(m_qemuProcess, SIGNAL(readyReadStandardError()), this, SLOT(qemuOutput())); - connect(this, SIGNAL(qemuProcessStatus(QemuStatus, QString)), - this, SLOT(qemuStatusChanged(QemuStatus, QString))); + connect(this, SIGNAL(qemuProcessStatus(QemuStatus,QString)), + this, SLOT(qemuStatusChanged(QemuStatus,QString))); } Utils::FileSystemWatcher *MaemoQemuManager::runtimeRootWatcher() @@ -178,8 +178,10 @@ bool MaemoQemuManager::qemuIsRunning() const return m_runningQtId != INT_MIN; } -void MaemoQemuManager::qtVersionsChanged(const QList<int> &uniqueIds) +void MaemoQemuManager::qtVersionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed) { + QList<int> uniqueIds; + uniqueIds << added << removed << changed; QtSupport::QtVersionManager *manager = QtSupport::QtVersionManager::instance(); foreach (int uniqueId, uniqueIds) { if (manager->isValidId(uniqueId)) { @@ -539,7 +541,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target) } if (uniqueId >= 0 && (m_runtimes.isEmpty() || !m_runtimes.contains(uniqueId))) - qtVersionsChanged(QList<int>() << uniqueId); + qtVersionsChanged(QList<int>(), QList<int>(), QList<int>() << uniqueId); bool isRunning = m_qemuProcess->state() != QProcess::NotRunning; if (m_runningQtId == uniqueId) @@ -596,7 +598,7 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target, void MaemoQemuManager::notify(const QList<int> uniqueIds) { - qtVersionsChanged(uniqueIds); + qtVersionsChanged(QList<int>(), QList<int>(), uniqueIds); environmentChanged(); // to toggle the start button } diff --git a/src/plugins/madde/maemoqemumanager.h b/src/plugins/madde/maemoqemumanager.h index 0fa3894ff6..a5c61b7899 100644 --- a/src/plugins/madde/maemoqemumanager.h +++ b/src/plugins/madde/maemoqemumanager.h @@ -82,7 +82,7 @@ signals: void qemuProcessStatus(QemuStatus, const QString &error = QString()); private slots: - void qtVersionsChanged(const QList<int> &uniqueIds); + void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changed); void projectAdded(ProjectExplorer::Project *project); void projectRemoved(ProjectExplorer::Project *project); diff --git a/src/plugins/madde/maemorunconfiguration.cpp b/src/plugins/madde/maemorunconfiguration.cpp index 9db4413023..04d3e15853 100644 --- a/src/plugins/madde/maemorunconfiguration.cpp +++ b/src/plugins/madde/maemorunconfiguration.cpp @@ -71,11 +71,11 @@ MaemoRunConfiguration::MaemoRunConfiguration(AbstractQt4MaemoTarget *parent, void MaemoRunConfiguration::init() { m_remoteMounts = new MaemoRemoteMountsModel(this); - connect(m_remoteMounts, SIGNAL(rowsInserted(QModelIndex, int, int)), this, + connect(m_remoteMounts, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(handleRemoteMountsChanged())); - connect(m_remoteMounts, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + connect(m_remoteMounts, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(handleRemoteMountsChanged())); - connect(m_remoteMounts, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + connect(m_remoteMounts, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(handleRemoteMountsChanged())); connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged())); diff --git a/src/plugins/madde/maemotoolchain.cpp b/src/plugins/madde/maemotoolchain.cpp index e4de7cc401..848198199f 100644 --- a/src/plugins/madde/maemotoolchain.cpp +++ b/src/plugins/madde/maemotoolchain.cpp @@ -241,8 +241,8 @@ QString MaemoToolChainFactory::id() const QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::autoDetect() { QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); - connect(vm, SIGNAL(qtVersionsChanged(QList<int>)), - this, SLOT(handleQtVersionChanges(QList<int>))); + connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), + this, SLOT(handleQtVersionChanges(QList<int>,QList<int>,QList<int>))); QList<int> versionList; foreach (QtSupport::BaseQtVersion *v, vm->versions()) @@ -266,8 +266,10 @@ ProjectExplorer::ToolChain *MaemoToolChainFactory::restore(const QVariantMap &da return 0; } -void MaemoToolChainFactory::handleQtVersionChanges(const QList<int> &changes) +void MaemoToolChainFactory::handleQtVersionChanges(const QList<int> &added, const QList<int> &removed, const QList<int> &changed) { + QList<int> changes; + changes << added << removed << changed; ProjectExplorer::ToolChainManager *tcm = ProjectExplorer::ToolChainManager::instance(); QList<ProjectExplorer::ToolChain *> tcList = createToolChainList(changes); foreach (ProjectExplorer::ToolChain *tc, tcList) diff --git a/src/plugins/madde/maemotoolchain.h b/src/plugins/madde/maemotoolchain.h index e585d35435..845f124294 100644 --- a/src/plugins/madde/maemotoolchain.h +++ b/src/plugins/madde/maemotoolchain.h @@ -117,8 +117,8 @@ public: ProjectExplorer::ToolChain *restore(const QVariantMap &data); private slots: - void handleQtVersionChanges(const QList<int> &); - QList<ProjectExplorer::ToolChain *> createToolChainList(const QList<int> &); + void handleQtVersionChanges(const QList<int> &added, const QList<int> &removed, const QList<int> &changed); + QList<ProjectExplorer::ToolChain *> createToolChainList(const QList<int> &changes); }; } // namespace Internal diff --git a/src/plugins/madde/qt4maemotarget.cpp b/src/plugins/madde/qt4maemotarget.cpp index 964673fe4b..4271fc1de7 100644 --- a/src/plugins/madde/qt4maemotarget.cpp +++ b/src/plugins/madde/qt4maemotarget.cpp @@ -308,7 +308,7 @@ void AbstractQt4MaemoTarget::handleTargetToBeRemoved(ProjectExplorer::Target *ta return; const int answer = QMessageBox::warning(Core::ICore::mainWindow(), - tr("Qt Creator"), tr("Do you want to remove the packaging file(s) " + tr("Qt Creator"), tr("Do you want to remove the packaging files " "associated with the target '%1'?").arg(displayName()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (answer == QMessageBox::No) @@ -765,12 +765,12 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci + AbstractMaemoPackageCreationStep::DefaultVersionNumber); QtSupport::BaseQtVersion *lqt = activeQt4BuildConfiguration()->qtVersion(); if (!lqt) { - raiseError(tr("Unable to create Debian templates: No Qt version set")); + raiseError(tr("Unable to create Debian templates: No Qt version set.")); return ActionFailed; } if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, lqt->qmakeCommand().toString(), true) || !dh_makeProc.waitForStarted()) { - raiseError(tr("Unable to create Debian templates: dh_make failed (%1)") + raiseError(tr("Unable to create Debian templates: dh_make failed (%1).") .arg(dh_makeProc.errorString())); return ActionFailed; } @@ -778,7 +778,7 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci dh_makeProc.waitForFinished(-1); if (dh_makeProc.error() != QProcess::UnknownError || dh_makeProc.exitCode() != 0) { - raiseError(tr("Unable to create debian templates: dh_make failed (%1)") + raiseError(tr("Unable to create debian templates: dh_make failed (%1).") .arg(dh_makeProc.errorString())); return ActionFailed; } diff --git a/src/plugins/madde/qt4maemotargetfactory.cpp b/src/plugins/madde/qt4maemotargetfactory.cpp index 44de7c3158..f2ab143512 100644 --- a/src/plugins/madde/qt4maemotargetfactory.cpp +++ b/src/plugins/madde/qt4maemotargetfactory.cpp @@ -58,7 +58,7 @@ namespace Internal { Qt4MaemoTargetFactory::Qt4MaemoTargetFactory(QObject *parent) : Qt4BaseTargetFactory(parent) { - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SIGNAL(canCreateTargetIdsChanged())); } @@ -179,8 +179,8 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig(); QList<BuildConfigurationInfo> infos; - infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString())); - infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); return create(parent, id, infos); } @@ -208,7 +208,7 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project foreach (const BuildConfigurationInfo &info, infos) target->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), - info.version, info.buildConfig, + info.version(), info.buildConfig, info.additionalArguments, info.directory, info.importing); foreach (const QString &deployConfigId, deployConfigIds) { diff --git a/src/plugins/mercurial/annotationhighlighter.cpp b/src/plugins/mercurial/annotationhighlighter.cpp index 84003f3785..00e0b7257e 100644 --- a/src/plugins/mercurial/annotationhighlighter.cpp +++ b/src/plugins/mercurial/annotationhighlighter.cpp @@ -37,8 +37,9 @@ using namespace Mercurial::Internal; using namespace Mercurial; MercurialAnnotationHighlighter::MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, + const QColor &bg, QTextDocument *document) - : VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + : VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), changeset(QLatin1String(Constants::CHANGESETID12)) { } diff --git a/src/plugins/mercurial/annotationhighlighter.h b/src/plugins/mercurial/annotationhighlighter.h index 6dbbe948cd..92f2dc38b2 100644 --- a/src/plugins/mercurial/annotationhighlighter.h +++ b/src/plugins/mercurial/annotationhighlighter.h @@ -42,7 +42,7 @@ namespace Internal { class MercurialAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { public: - explicit MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp index b47c5b9d0e..af592e85e5 100644 --- a/src/plugins/mercurial/mercurialeditor.cpp +++ b/src/plugins/mercurial/mercurialeditor.cpp @@ -96,9 +96,10 @@ VcsBase::DiffHighlighter *MercurialEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(diffIdentifier); } -VcsBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new MercurialAnnotationHighlighter(changes); + return new MercurialAnnotationHighlighter(changes, bg); } QString MercurialEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/mercurial/mercurialeditor.h b/src/plugins/mercurial/mercurialeditor.h index 3261b17d95..03de664c35 100644 --- a/src/plugins/mercurial/mercurialeditor.h +++ b/src/plugins/mercurial/mercurialeditor.h @@ -50,7 +50,7 @@ private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &cursor) const; virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; - virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const; virtual QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/perforce/annotationhighlighter.cpp b/src/plugins/perforce/annotationhighlighter.cpp index 6e45a57087..26670e5fe8 100644 --- a/src/plugins/perforce/annotationhighlighter.cpp +++ b/src/plugins/perforce/annotationhighlighter.cpp @@ -36,8 +36,9 @@ namespace Perforce { namespace Internal { PerforceAnnotationHighlighter::PerforceAnnotationHighlighter(const ChangeNumbers &changeNumbers, + const QColor &bg, QTextDocument *document) : - VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), m_colon(QLatin1Char(':')) { } diff --git a/src/plugins/perforce/annotationhighlighter.h b/src/plugins/perforce/annotationhighlighter.h index 68c94b8628..70e94c7f30 100644 --- a/src/plugins/perforce/annotationhighlighter.h +++ b/src/plugins/perforce/annotationhighlighter.h @@ -44,6 +44,7 @@ class PerforceAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter Q_OBJECT public: explicit PerforceAnnotationHighlighter(const ChangeNumbers &changeNumbers, + const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index 9aab63c648..707720185a 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -112,9 +112,10 @@ VcsBase::DiffHighlighter *PerforceEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(filePattern); } -VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new PerforceAnnotationHighlighter(changes); + return new PerforceAnnotationHighlighter(changes, bg); } QString PerforceEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/perforce/perforceeditor.h b/src/plugins/perforce/perforceeditor.h index bbe2d1a8d1..801da2fa48 100644 --- a/src/plugins/perforce/perforceeditor.h +++ b/src/plugins/perforce/perforceeditor.h @@ -54,7 +54,7 @@ private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; - virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &v) const; diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index f1baf3158c..4c970aae7f 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -126,8 +126,8 @@ void AbstractProcessStep::setOutputParser(ProjectExplorer::IOutputParser *parser m_outputParserChain = parser; if (m_outputParserChain) { - connect(parser, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)), - this, SLOT(outputAdded(QString, ProjectExplorer::BuildStep::OutputFormat))); + connect(parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), + this, SLOT(outputAdded(QString,ProjectExplorer::BuildStep::OutputFormat))); connect(parser, SIGNAL(addTask(ProjectExplorer::Task)), this, SLOT(taskAdded(ProjectExplorer::Task))); } @@ -204,8 +204,8 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi) this, SLOT(processReadyReadStdError()), Qt::DirectConnection); - connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(slotProcessFinished(int, QProcess::ExitStatus)), + connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(slotProcessFinished(int,QProcess::ExitStatus)), Qt::DirectConnection); m_process->setCommand(m_param.effectiveCommand(), m_param.effectiveArguments()); diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index af094f58d2..9c21a7dcfc 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -105,8 +105,8 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent) this, SLOT(readStandardOutput())); connect(&d->m_guiProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(guiProcessError())); - connect(&d->m_guiProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(processDone(int, QProcess::ExitStatus))); + connect(&d->m_guiProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(processDone(int,QProcess::ExitStatus))); connect(&d->m_guiProcess, SIGNAL(started()), this, SLOT(bringToForeground())); diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 5011acf34e..983d50d0a6 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -132,11 +132,11 @@ BuildManager::BuildManager(ProjectExplorerPlugin *parent) this, SLOT(progressChanged())); connect(&d->m_watcher, SIGNAL(progressTextChanged(QString)), this, SLOT(progressTextChanged())); - connect(&d->m_watcher, SIGNAL(progressRangeChanged(int, int)), + connect(&d->m_watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(progressChanged())); - connect(parent->session(), SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), - this, SLOT(aboutToRemoveProject(ProjectExplorer::Project *))); + connect(parent->session(), SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)), + this, SLOT(aboutToRemoveProject(ProjectExplorer::Project*))); d->m_outputWindow = new Internal::CompileOutputWindow(this); pm->addObject(d->m_outputWindow); @@ -499,8 +499,8 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names) BuildStep *bs = steps.at(i); connect(bs, SIGNAL(addTask(ProjectExplorer::Task)), this, SLOT(addToTaskWindow(ProjectExplorer::Task))); - connect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat, ProjectExplorer::BuildStep::OutputNewlineSetting)), - this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat, ProjectExplorer::BuildStep::OutputNewlineSetting))); + connect(bs, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)), + this, SLOT(addToOutputWindow(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting))); if (bs->enabled()) { init = bs->init(); if (!init) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 7d86700728..86c91f3494 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -136,6 +136,7 @@ BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) : ProjectConfiguration(bsl, bs), m_enabled(bs->m_enabled) { Q_ASSERT(bsl); + setDisplayName(bs->displayName()); } BuildStep::~BuildStep() diff --git a/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp b/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp index dc3c05281f..6a6454dcd1 100644 --- a/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp +++ b/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp @@ -74,7 +74,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE m_workingDirectory->setEnvironment(rc->environment()); layout->addRow(tr("Working directory:"), m_workingDirectory); - m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this); + m_useTerminalCheck = new QCheckBox(tr("Run in &terminal"), this); layout->addRow(QString(), m_useTerminalCheck); QVBoxLayout *vbox = new QVBoxLayout(this); @@ -99,7 +99,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE QWidget *baseEnvironmentWidget = new QWidget; QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this runconfiguration:"), this); + QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); baseEnvironmentLayout->addWidget(label); m_baseEnvironmentComboBox = new QComboBox(this); m_baseEnvironmentComboBox->addItems(QStringList() @@ -122,8 +122,8 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE connect(m_executableChooser, SIGNAL(changed(QString)), this, SLOT(executableEdited())); - connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(argumentsEdited(const QString&))); + connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), + this, SLOT(argumentsEdited(QString))); connect(m_workingDirectory, SIGNAL(changed(QString)), this, SLOT(workingDirectoryEdited())); connect(m_useTerminalCheck, SIGNAL(toggled(bool)), diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index c2e5e242b9..7083002ab5 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -139,7 +139,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails vbox->addWidget(d->m_detailsContainer); - connect(d->m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), + connect(d->m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(updateButtons())); connect(d->m_editButton, SIGNAL(clicked(bool)), diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index b89e3a4274..c4fb459e18 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -164,8 +164,8 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) setLayout(layout); // connections - connect(m_listView, SIGNAL(activated(const QModelIndex&)), - this, SLOT(slotOpenItem(const QModelIndex&))); + connect(m_listView, SIGNAL(activated(QModelIndex)), + this, SLOT(slotOpenItem(QModelIndex))); setAutoSynchronization(true); } diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 87c89f631c..007c90b476 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -82,7 +82,7 @@ RunConfigWidget *LocalApplicationRunControlFactory::createConfigurationWidget(Ru // ApplicationRunControl LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfiguration *rc, RunMode mode) - : RunControl(rc, mode) + : RunControl(rc, mode), m_running(false) { Utils::Environment env = rc->environment(); QString dir = rc->workingDirectory(); @@ -114,6 +114,7 @@ void LocalApplicationRunControl::start() appendMessage(tr("No executable specified.\n"), Utils::ErrorMessageFormat); emit finished(); } else { + m_running = true; m_applicationLauncher.start(m_runMode, m_executable, m_commandLineArguments); setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID())); QString msg = tr("Starting %1...\n").arg(QDir::toNativeSeparators(m_executable)); @@ -129,7 +130,7 @@ LocalApplicationRunControl::StopResult LocalApplicationRunControl::stop() bool LocalApplicationRunControl::isRunning() const { - return m_applicationLauncher.isRunning(); + return m_running; } QIcon LocalApplicationRunControl::icon() const @@ -151,6 +152,7 @@ void LocalApplicationRunControl::processStarted() void LocalApplicationRunControl::processExited(int exitCode) { + m_running = false; setApplicationProcessHandle(ProcessHandle()); QString msg = tr("%1 exited with code %2\n") .arg(QDir::toNativeSeparators(m_executable)).arg(exitCode); diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.h b/src/plugins/projectexplorer/localapplicationruncontrol.h index 3e7960ae39..0e18b2ec13 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.h +++ b/src/plugins/projectexplorer/localapplicationruncontrol.h @@ -74,6 +74,7 @@ private: QString m_commandLineArguments; ProjectExplorer::ApplicationLauncher::Mode m_runMode; ProcessHandle m_applicationProcessHandle; + bool m_running; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 70ea3ab7ea..3044da6c86 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -534,13 +534,13 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi this, SLOT(projectRemoved(ProjectExplorer::Project*))); connect(m_listWidgets[TARGET], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)), - this, SLOT(setActiveTarget(ProjectExplorer::ProjectConfiguration *))); + this, SLOT(setActiveTarget(ProjectExplorer::ProjectConfiguration*))); connect(m_listWidgets[BUILD], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)), - this, SLOT(setActiveBuildConfiguration(ProjectExplorer::ProjectConfiguration *))); + this, SLOT(setActiveBuildConfiguration(ProjectExplorer::ProjectConfiguration*))); connect(m_listWidgets[DEPLOY], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)), - this, SLOT(setActiveDeployConfiguration(ProjectExplorer::ProjectConfiguration *))); + this, SLOT(setActiveDeployConfiguration(ProjectExplorer::ProjectConfiguration*))); connect(m_listWidgets[RUN], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)), - this, SLOT(setActiveRunConfiguration(ProjectExplorer::ProjectConfiguration *))); + this, SLOT(setActiveRunConfiguration(ProjectExplorer::ProjectConfiguration*))); } void MiniProjectTargetSelector::setActiveTarget(ProjectExplorer::ProjectConfiguration *pc) diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index ff6623b31e..98049a2a3a 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -263,7 +263,7 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) connect(m_ui.workingDirectory, SIGNAL(changed(QString)), this, SLOT(workingDirectoryLineEditTextEdited())); - connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(const QString&)), + connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(QString)), this, SLOT(commandArgumentsLineEditTextEdited())); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 68a354792c..9e68aeda44 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -343,17 +343,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er d->m_session = new SessionManager(this); - connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, SIGNAL(fileListChanged())); - connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), - this, SLOT(invalidateProject(ProjectExplorer::Project *))); - connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)), + this, SLOT(invalidateProject(ProjectExplorer::Project*))); + connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), this, SIGNAL(fileListChanged())); connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, SLOT(projectAdded(ProjectExplorer::Project*))); connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), this, SLOT(projectRemoved(ProjectExplorer::Project*))); - connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), this, SLOT(startupProjectChanged())); connect(d->m_session, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)), this, SLOT(updateActions())); @@ -377,8 +377,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(new VcsAnnotateTaskHandler); d->m_buildManager = new BuildManager(this); - connect(d->m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project *)), - this, SLOT(buildStateChanged(ProjectExplorer::Project *))); + connect(d->m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project*)), + this, SLOT(buildStateChanged(ProjectExplorer::Project*))); connect(d->m_buildManager, SIGNAL(buildQueueFinished(bool)), this, SLOT(buildQueueFinished(bool))); @@ -386,7 +386,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er d->m_outputPane = new AppOutputPane; addAutoReleasedObject(d->m_outputPane); - connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), d->m_outputPane, SLOT(projectRemoved())); connect(d->m_outputPane, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)), @@ -517,7 +517,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er d->m_openWithMenu = openWith->menu(); d->m_openWithMenu->setTitle(tr("Open With")); - connect(d->m_openWithMenu, SIGNAL(triggered(QAction *)), + connect(d->m_openWithMenu, SIGNAL(triggered(QAction*)), Core::DocumentManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*))); // @@ -1468,8 +1468,8 @@ void ProjectExplorerPlugin::restoreSession() // update welcome page connect(Core::ModeManager::instance(), - SIGNAL(currentModeChanged(Core::IMode*, Core::IMode*)), - SLOT(currentModeChanged(Core::IMode*, Core::IMode*))); + SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), + SLOT(currentModeChanged(Core::IMode*,Core::IMode*))); connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString))); @@ -2831,7 +2831,7 @@ void ProjectExplorerPlugin::updateSessionMenu() { d->m_sessionMenu->clear(); QActionGroup *ag = new QActionGroup(d->m_sessionMenu); - connect(ag, SIGNAL(triggered(QAction *)), this, SLOT(setSession(QAction *))); + connect(ag, SIGNAL(triggered(QAction*)), this, SLOT(setSession(QAction*))); const QString &activeSession = d->m_session->activeSession(); foreach (const QString &session, d->m_session->sessions()) { QAction *act = ag->addAction(session); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index f7d2b64b93..a7c5758531 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -168,23 +168,23 @@ FlatModel::FlatModel(SessionNode *rootNode, QObject *parent) connect(watcher, SIGNAL(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*)), this, SLOT(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*))); - connect(watcher, SIGNAL(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)), - this, SLOT(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &))); + connect(watcher, SIGNAL(foldersAboutToBeAdded(FolderNode*,QList<FolderNode*>)), + this, SLOT(foldersAboutToBeAdded(FolderNode*,QList<FolderNode*>))); connect(watcher, SIGNAL(foldersAdded()), this, SLOT(foldersAdded())); - connect(watcher, SIGNAL(foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &)), - this, SLOT(foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &))); + connect(watcher, SIGNAL(foldersAboutToBeRemoved(FolderNode*,QList<FolderNode*>)), + this, SLOT(foldersAboutToBeRemoved(FolderNode*,QList<FolderNode*>))); connect(watcher, SIGNAL(foldersRemoved()), this, SLOT(foldersRemoved())); - connect(watcher, SIGNAL(filesAboutToBeAdded(FolderNode *,const QList<FileNode*> &)), - this, SLOT(filesAboutToBeAdded(FolderNode *, const QList<FileNode *> &))); + connect(watcher, SIGNAL(filesAboutToBeAdded(FolderNode*,QList<FileNode*>)), + this, SLOT(filesAboutToBeAdded(FolderNode*,QList<FileNode*>))); connect(watcher, SIGNAL(filesAdded()), this, SLOT(filesAdded())); - connect(watcher, SIGNAL(filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &)), - this, SLOT(filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &))); + connect(watcher, SIGNAL(filesAboutToBeRemoved(FolderNode*,QList<FileNode*>)), + this, SLOT(filesAboutToBeRemoved(FolderNode*,QList<FileNode*>))); connect(watcher, SIGNAL(filesRemoved()), this, SLOT(filesRemoved())); } diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index cc902ebb89..8f5f4932b0 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -300,8 +300,8 @@ void ProjectNode::registerWatcher(NodesWatcher *watcher) { if (!watcher) return; - connect(watcher, SIGNAL(destroyed(QObject *)), - this, SLOT(watcherDestroyed(QObject *))); + connect(watcher, SIGNAL(destroyed(QObject*)), + this, SLOT(watcherDestroyed(QObject*))); m_watchers.append(watcher); foreach (ProjectNode *subProject, m_subProjectNodes) subProject->registerWatcher(watcher); diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 502fa22503..077060147f 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -110,10 +110,10 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) NodesWatcher *watcher = new NodesWatcher(this); m_explorer->session()->sessionNode()->registerWatcher(watcher); - connect(watcher, SIGNAL(foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &)), - this, SLOT(foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &))); - connect(watcher, SIGNAL(filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &)), - this, SLOT(filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &))); + connect(watcher, SIGNAL(foldersAboutToBeRemoved(FolderNode*,QList<FolderNode*>)), + this, SLOT(foldersAboutToBeRemoved(FolderNode*,QList<FolderNode*>))); + connect(watcher, SIGNAL(filesAboutToBeRemoved(FolderNode*,QList<FileNode*>)), + this, SLOT(filesAboutToBeRemoved(FolderNode*,QList<FileNode*>))); m_view = new ProjectTreeView; m_view->setModel(m_model); @@ -138,16 +138,16 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) // connections connect(m_model, SIGNAL(modelReset()), this, SLOT(initView())); - connect(m_view, SIGNAL(activated(const QModelIndex&)), - this, SLOT(openItem(const QModelIndex&))); - connect(m_view->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), - this, SLOT(handleCurrentItemChange(const QModelIndex&))); - connect(m_view, SIGNAL(customContextMenuRequested(const QPoint&)), - this, SLOT(showContextMenu(const QPoint&))); - connect(m_explorer->session(), SIGNAL(singleProjectAdded(ProjectExplorer::Project *)), - this, SLOT(handleProjectAdded(ProjectExplorer::Project *))); - connect(m_explorer->session(), SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), - this, SLOT(startupProjectChanged(ProjectExplorer::Project *))); + connect(m_view, SIGNAL(activated(QModelIndex)), + this, SLOT(openItem(QModelIndex))); + connect(m_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(handleCurrentItemChange(QModelIndex))); + connect(m_view, SIGNAL(customContextMenuRequested(QPoint)), + this, SLOT(showContextMenu(QPoint))); + connect(m_explorer->session(), SIGNAL(singleProjectAdded(ProjectExplorer::Project*)), + this, SLOT(handleProjectAdded(ProjectExplorer::Project*))); + connect(m_explorer->session(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), + this, SLOT(startupProjectChanged(ProjectExplorer::Project*))); connect(m_explorer->session(), SIGNAL(aboutToLoadSession(QString)), this, SLOT(disableAutoExpand())); @@ -260,13 +260,13 @@ void ProjectTreeWidget::setAutoSynchronization(bool sync, bool syncNow) if (debug) qDebug() << (m_autoSync ? "Enabling auto synchronization" : "Disabling auto synchronization"); if (m_autoSync) { - connect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*, ProjectExplorer::Project*)), - this, SLOT(setCurrentItem(ProjectExplorer::Node*, ProjectExplorer::Project*))); + connect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), + this, SLOT(setCurrentItem(ProjectExplorer::Node*,ProjectExplorer::Project*))); if (syncNow) setCurrentItem(m_explorer->currentNode(), ProjectExplorerPlugin::currentProject()); } else { - disconnect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*, ProjectExplorer::Project*)), - this, SLOT(setCurrentItem(ProjectExplorer::Node*, ProjectExplorer::Project*))); + disconnect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), + this, SLOT(setCurrentItem(ProjectExplorer::Node*,ProjectExplorer::Project*))); } } diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 2cbb0f5e5c..5ea53f46c1 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -250,7 +250,7 @@ ProjectWindow::ProjectWindow(QWidget *parent) this, SLOT(deregisterProject(ProjectExplorer::Project*))); connect(session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), - this, SLOT(startupProjectChanged(ProjectExplorer::Project *))); + this, SLOT(startupProjectChanged(ProjectExplorer::Project*))); // Update properties to empty project for now: showProperties(-1, -1); @@ -269,8 +269,8 @@ void ProjectWindow::extensionsInitialized() QList<IProjectPanelFactory *> list = ExtensionSystem::PluginManager::instance()->getObjects<IProjectPanelFactory>(); qSort(list.begin(), list.end(), &IPanelFactory::prioritySort); foreach (IProjectPanelFactory *fac, list) - connect (fac, SIGNAL(projectUpdated(ProjectExplorer::Project *)), - this, SLOT(projectUpdated(ProjectExplorer::Project *))); + connect (fac, SIGNAL(projectUpdated(ProjectExplorer::Project*)), + this, SLOT(projectUpdated(ProjectExplorer::Project*))); } diff --git a/src/plugins/projectexplorer/projectwizardpage.ui b/src/plugins/projectexplorer/projectwizardpage.ui index f1b7e421a6..1be771449d 100644 --- a/src/plugins/projectexplorer/projectwizardpage.ui +++ b/src/plugins/projectexplorer/projectwizardpage.ui @@ -67,7 +67,7 @@ <item row="2" column="2"> <widget class="QPushButton" name="vcsManageButton"> <property name="text"> - <string>Manage ...</string> + <string>Manage...</string> </property> </widget> </item> diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index e121ac0959..103bf494c2 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -100,9 +100,9 @@ SessionManager::SessionManager(QObject *parent) EditorManager *em = ICore::editorManager(); - connect(em, SIGNAL(editorCreated(Core::IEditor *, QString)), - this, SLOT(configureEditor(Core::IEditor *, QString))); - connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project *)), + connect(em, SIGNAL(editorCreated(Core::IEditor*,QString)), + this, SLOT(configureEditor(Core::IEditor*,QString))); + connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project*)), this, SLOT(updateWindowTitle())); connect(em, SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(markSessionFileDirty())); @@ -772,11 +772,11 @@ void SessionManager::restoreEditors(const Utils::PersistentSettingsReader &reade { const QVariant &editorsettings = reader.restoreValue(QLatin1String("EditorSettings")); if (editorsettings.isValid()) { - connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor *)), + connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(sessionLoadingProgress())); ICore::editorManager()->restoreState( QByteArray::fromBase64(editorsettings.toByteArray())); - disconnect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor *)), + disconnect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(sessionLoadingProgress())); } } diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index 384f8a1c9d..fd9a48aa75 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -140,10 +140,10 @@ SessionDialog::SessionDialog(SessionManager *sessionManager, QWidget *parent) connect(m_ui.btSwitch, SIGNAL(clicked()), this, SLOT(switchToSession())); connect(m_ui.btRename, SIGNAL(clicked()), this, SLOT(rename())); - connect(m_ui.sessionList, SIGNAL(itemDoubleClicked (QListWidgetItem *)), + connect(m_ui.sessionList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(switchToSession())); - connect(m_ui.sessionList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), + connect(m_ui.sessionList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateActions())); m_ui.whatsASessionLabel->setOpenExternalLinks(true); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index efb720d7ce..2c3eabbb01 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -817,7 +817,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, QFont f = painter->font(); f.setItalic(true); painter->setFont(f); - lineText = "(" + QString::number(line) + ")"; + lineText = QLatin1Char('(') + QString::number(line) + QLatin1Char(')'); } else if (movedLine != line) { // The line was moved QFont f = painter->font(); diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp index d70b8108ae..3225c04c79 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp @@ -364,7 +364,7 @@ QString DesignDocumentController::simplfiedDisplayName() const return d->componentNode.id(); } - QStringList list = displayName().split("/"); + QStringList list = displayName().split(QLatin1Char('/')); return list.last(); } @@ -424,8 +424,8 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit * d->rewriterView = new RewriterView(RewriterView::Amend, d->masterModel.data()); d->rewriterView->setTextModifier( d->textModifier); - connect(d->rewriterView.data(), SIGNAL(errorsChanged(const QList<RewriterView::Error> &)), - this, SIGNAL(qmlErrorsChanged(const QList<RewriterView::Error> &))); + connect(d->rewriterView.data(), SIGNAL(errorsChanged(QList<RewriterView::Error>)), + this, SIGNAL(qmlErrorsChanged(QList<RewriterView::Error>))); d->masterModel->attachView(d->rewriterView.data()); d->model = d->masterModel; diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontrollerview.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontrollerview.cpp index 3099fc1b4d..7e7b1cc8e7 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontrollerview.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontrollerview.cpp @@ -200,7 +200,7 @@ void DesignDocumentControllerView::fromText(QString text) QPlainTextEdit textEdit; QString imports; foreach (const Import &import, model()->imports()) - imports += import.toString(true, true) + "\n"; + imports += import.toString(true, true) + QLatin1Char('\n'); textEdit.setPlainText(imports + text); NotIndentingTextEditModifier modifier(&textEdit); diff --git a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp index 047c38334c..c56b0260c4 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp @@ -157,7 +157,7 @@ void CustomDragAndDropIcon::paintEvent(QPaintEvent *event) void CustomDragAndDropIcon::enter() { - connect(&m_timeLine, SIGNAL( frameChanged (int)), this, SLOT(animateDrag(int))); + connect(&m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(animateDrag(int))); m_timeLine.setFrameRange(0, 10); m_timeLine.setDuration(10); m_timeLine.setLoopCount(1); @@ -170,7 +170,7 @@ void CustomDragAndDropIcon::enter() void CustomDragAndDropIcon::leave() { - connect(&m_timeLine, SIGNAL( frameChanged (int)), this, SLOT(animateDrag(int))); + connect(&m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(animateDrag(int))); m_timeLine.setFrameRange(0, 10); m_timeLine.setDuration(250); m_timeLine.setLoopCount(1); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarycomponents.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarycomponents.cpp index 263743e066..0adaed1692 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarycomponents.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarycomponents.cpp @@ -95,7 +95,7 @@ ItemLibraryTreeView::ItemLibraryTreeView(QWidget *parent) : setDragEnabled(true); setDragDropMode(QAbstractItemView::DragOnly); setUniformRowHeights(true); - connect(this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(activateItem(const QModelIndex &))); + connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(activateItem(QModelIndex))); setHeaderHidden(true); setIndentation(20); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index 76192b898f..d5dbe61db9 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -831,7 +831,7 @@ public: QComboBoxDeclarativeUI(QObject *parent = 0) : QObject(parent), m_itemsSet(false) { cb = qobject_cast<QComboBox*>(parent); - connect(cb, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(setCurrentText(const QString &))); + connect(cb, SIGNAL(currentIndexChanged(QString)), this, SLOT(setCurrentText(QString))); } QString currentText() const diff --git a/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp index 1b1ab73be0..f7b407190d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp @@ -58,7 +58,7 @@ FileWidget::FileWidget(QWidget *parent) : QWidget(parent), m_filter("(*.*)"), m_ m_pushButton->setText("..."); connect(m_lineEdit, SIGNAL(editingFinished()), this, SLOT(lineEditChanged())); connect(m_pushButton, SIGNAL(pressed()), this, SLOT(buttonPressed())); - connect(m_comboBox, SIGNAL(editTextChanged(const QString &)), this, SLOT(comboBoxChanged())); + connect(m_comboBox, SIGNAL(editTextChanged(QString)), this, SLOT(comboBoxChanged())); m_currentPath = QDir::currentPath(); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index 24059afbac..a4c235aa6b 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -113,7 +113,7 @@ PropertyEditor::NodeType::NodeType(PropertyEditor *propertyEditor) : m_contextObject->setBackendValues(&m_backendValuesPropertyMap); ctxt->setContextObject(m_contextObject.data()); - connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(const QString&, const QVariant&)), propertyEditor, SLOT(changeValue(const QString&))); + connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), propertyEditor, SLOT(changeValue(QString))); } PropertyEditor::NodeType::~NodeType() @@ -127,7 +127,7 @@ void setupPropertyEditorValue(const QString &name, QDeclarativePropertyMap *prop PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName))); if (!valueObject) { valueObject = new PropertyEditorValue(propertyMap); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), propertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), propertyMap, SIGNAL(valueChanged(QString,QVariant))); QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString))); propertyMap->insert(propertyName, QVariant::fromValue(valueObject)); } @@ -146,7 +146,7 @@ void createPropertyEditorValue(const QmlObjectNode &fxObjectNode, const QString PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName))); if (!valueObject) { valueObject = new PropertyEditorValue(propertyMap); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), propertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), propertyMap, SIGNAL(valueChanged(QString,QVariant))); QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString))); propertyMap->insert(propertyName, QVariant::fromValue(valueObject)); } @@ -202,7 +202,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS valueObject->setName("className"); valueObject->setModelNode(fxObjectNode.modelNode()); valueObject->setValue(fxObjectNode.modelNode().simplifiedTypeName()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject)); // id @@ -211,7 +211,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); valueObject->setValue(fxObjectNode.id()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject)); // anchors @@ -253,7 +253,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl valueObject->setName("className"); valueObject->setValue(typeName); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject)); // id @@ -262,7 +262,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); valueObject->setValue("id"); - QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject)); ctxt->setContextProperty("anchorBackend", &m_backendAnchorBinding); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 899f33d9ce..2b276161f8 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -378,12 +378,12 @@ void PropertyEditorNodeWrapper::setup() PropertyEditorValue *valueObject = new PropertyEditorValue(&m_valuesPropertyMap); valueObject->setName(propertyName); valueObject->setValue(fxObjectNode.instanceValue(propertyName)); - connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&))); + connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_valuesPropertyMap.insert(propertyName, QVariant::fromValue(valueObject)); } } } - connect(&m_valuesPropertyMap, SIGNAL(valueChanged(const QString &, const QVariant&)), this, SLOT(changeValue(const QString&))); + connect(&m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), this, SLOT(changeValue(QString))); emit propertiesChanged(); emit existsChanged(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/resetwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/resetwidget.cpp index b35fa09d35..a989e2924f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/resetwidget.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/resetwidget.cpp @@ -110,7 +110,7 @@ void ResetWidget::addPropertyItem(const QString &name, int row) ResetWidgetPushButton *b = new ResetWidgetPushButton(m_tableWidget); b->setName(name); b->setText("reset"); - connect(b, SIGNAL(pressed(const QString &)), this, SLOT(buttonPressed(const QString &))); + connect(b, SIGNAL(pressed(QString)), this, SLOT(buttonPressed(QString))); b->setMaximumHeight(15); b->setMinimumHeight(10); m_tableWidget->setCellWidget(row, 2, b); diff --git a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp index ccef1508fd..23e7fac242 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp @@ -70,7 +70,7 @@ void SiblingComboBox::changeSelection(int i) void SiblingComboBox::setup() { - connect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int))); + connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int))); if (!m_itemNode.isValid()) return; @@ -83,7 +83,7 @@ void SiblingComboBox::setup() if (node.isValid() && (node.instanceParent().modelNode() != m_itemNode.instanceParent().modelNode())) m_itemList.removeAll(node); - disconnect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int))); + disconnect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int))); clear(); foreach (const QmlItemNode &itemNode, m_itemList) { @@ -109,7 +109,7 @@ void SiblingComboBox::setup() insertItem(0, parentString); } setCurrentIndex(m_itemList.indexOf(m_selectedItemNode)); - connect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int))); + connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int))); } diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index f48e75eb36..273865d507 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -114,12 +114,12 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV applicationPath = QCoreApplication::applicationDirPath() + QLatin1String("/../../../../../bin"); } else { applicationPath = macOSBundlePath(applicationPath); - applicationPath += "/" + qmlPuppetApplicationName(); + applicationPath += QLatin1Char('/') + qmlPuppetApplicationName(); if (!QFileInfo(applicationPath).exists()) { //No qmlpuppet in Qt //We have to find out how to give not too intrusive feedback applicationPath = QCoreApplication::applicationDirPath(); applicationPath = macOSBundlePath(applicationPath); - applicationPath += "/" + qmlPuppetApplicationName(); + applicationPath += QLatin1Char('/') + qmlPuppetApplicationName(); } } diff --git a/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp b/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp index 3e94704fd4..77c04a026d 100644 --- a/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp +++ b/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp @@ -41,8 +41,8 @@ ComponentTextModifier::ComponentTextModifier(TextModifier *originalModifier, int { connect(m_originalModifier, SIGNAL(textChanged()), this, SIGNAL(textChanged())); - connect(m_originalModifier, SIGNAL(replaced(int, int, int)), this, SIGNAL(replaced(int, int, int))); - connect(m_originalModifier, SIGNAL(moved(const TextModifier::MoveInfo &)), this, SIGNAL(moved(const TextModifier::MoveInfo &))); + connect(m_originalModifier, SIGNAL(replaced(int,int,int)), this, SIGNAL(replaced(int,int,int))); + connect(m_originalModifier, SIGNAL(moved(TextModifier::MoveInfo)), this, SIGNAL(moved(TextModifier::MoveInfo))); } ComponentTextModifier::~ComponentTextModifier() diff --git a/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.cpp b/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.cpp index 0be27aea3d..dc9793f93e 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.cpp @@ -40,7 +40,7 @@ void ModelNodePositionRecalculator::connectTo(TextModifier *textModifier) { Q_ASSERT(textModifier); - connect(textModifier, SIGNAL(moved(const TextModifier::MoveInfo &)), this, SLOT(moved(const TextModifier::MoveInfo &))); + connect(textModifier, SIGNAL(moved(TextModifier::MoveInfo)), this, SLOT(moved(TextModifier::MoveInfo))); connect(textModifier, SIGNAL(replaced(int,int,int)), this, SLOT(replaced(int,int,int))); } diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index d478cb7a49..005e686be2 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -359,9 +359,9 @@ public: QString fullTypeName; for (UiQualifiedId *iter = astTypeNode; iter; iter = iter->next) if (!iter->name.isEmpty()) - fullTypeName += iter->name.toString() + "."; + fullTypeName += iter->name.toString() + QLatin1Char('.'); - if (fullTypeName.endsWith(".")) + if (fullTypeName.endsWith(QLatin1Char('.'))) fullTypeName.chop(1); majorVersion = ComponentVersion::NoVersion; @@ -373,14 +373,14 @@ public: QString name = importInfo.name(); majorVersion = importInfo.version().majorVersion(); minorVersion = importInfo.version().minorVersion(); - typeName.prepend(name + "."); + typeName.prepend(name + QLatin1Char('.')); } else if (importInfo.isValid() && importInfo.type() == ImportInfo::DirectoryImport) { QString path = importInfo.path(); QDir dir(m_doc->path()); QString relativeDir = dir.relativeFilePath(path); - QString name = relativeDir.replace("/", "."); + QString name = relativeDir.replace(QLatin1Char('/'), QLatin1Char('.')); if (!name.isEmpty()) - typeName.prepend(name + "."); + typeName.prepend(name + QLatin1Char('.')); } } } diff --git a/src/plugins/qmldesigner/qmlcontextpane.cpp b/src/plugins/qmldesigner/qmlcontextpane.cpp index 03f867aae6..92a73b57da 100644 --- a/src/plugins/qmldesigner/qmlcontextpane.cpp +++ b/src/plugins/qmldesigner/qmlcontextpane.cpp @@ -396,7 +396,7 @@ ContextPaneWidget* QmlContextPane::contextWidget() m_widget = new ContextPaneWidget; connect(m_widget.data(), SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(onPropertyChanged(QString,QVariant))); connect(m_widget.data(), SIGNAL(removeProperty(QString)), this, SLOT(onPropertyRemoved(QString))); - connect(m_widget.data(), SIGNAL(removeAndChangeProperty(QString,QString,QVariant, bool)), this, SLOT(onPropertyRemovedAndChange(QString,QString,QVariant, bool))); + connect(m_widget.data(), SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SLOT(onPropertyRemovedAndChange(QString,QString,QVariant,bool))); connect(m_widget.data(), SIGNAL(enabledChanged(bool)), this, SLOT(onEnabledChanged(bool))); connect(m_widget.data(), SIGNAL(pinnedChanged(bool)), this, SLOT(onPinnedChanged(bool))); } diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index 7b98329583..02825d01e4 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -456,7 +456,7 @@ ContextPaneWidget* QuickToolBar::contextWidget() m_widget = new ContextPaneWidget; connect(m_widget.data(), SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(onPropertyChanged(QString,QVariant))); connect(m_widget.data(), SIGNAL(removeProperty(QString)), this, SLOT(onPropertyRemoved(QString))); - connect(m_widget.data(), SIGNAL(removeAndChangeProperty(QString,QString,QVariant, bool)), this, SLOT(onPropertyRemovedAndChange(QString,QString,QVariant, bool))); + connect(m_widget.data(), SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SLOT(onPropertyRemovedAndChange(QString,QString,QVariant,bool))); connect(m_widget.data(), SIGNAL(enabledChanged(bool)), this, SLOT(onEnabledChanged(bool))); connect(m_widget.data(), SIGNAL(pinnedChanged(bool)), this, SLOT(onPinnedChanged(bool))); connect(m_widget.data(), SIGNAL(closed()), this, SIGNAL(closed())); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index a8f06e4e78..76359684c9 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -550,10 +550,10 @@ void QmlProfilerTool::connectToClient() return; if (d->m_connectMode == QmlProfilerToolPrivate::TcpConnection) { - logStatus(QString("QML Profiler: Connecting to %1:%2 ...").arg(d->m_tcpHost, QString::number(d->m_tcpPort))); + logStatus(QString("QML Profiler: Connecting to %1:%2...").arg(d->m_tcpHost, QString::number(d->m_tcpPort))); d->m_client->connectToHost(d->m_tcpHost, d->m_tcpPort); } else { - logStatus(QString("QML Profiler: Connecting to %1 ...").arg(d->m_tcpHost)); + logStatus(QString("QML Profiler: Connecting to %1...").arg(d->m_tcpHost)); d->m_client->connectToOst(d->m_ostDevice); } } diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp index e97a07e7f0..4947d67345 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp @@ -108,8 +108,8 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath) FileFilterBaseItem *fileFilter = qobject_cast<FileFilterBaseItem*>(contentElement); if (fileFilter) { fileFilter->setDefaultDirectory(directoryPath); - connect(fileFilter, SIGNAL(filesChanged(QSet<QString>, QSet<QString>)), - this, SIGNAL(qmlFilesChanged(QSet<QString>, QSet<QString>))); + connect(fileFilter, SIGNAL(filesChanged(QSet<QString>,QSet<QString>)), + this, SIGNAL(qmlFilesChanged(QSet<QString>,QSet<QString>))); } } diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 89efc17182..cce723a264 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -109,8 +109,8 @@ void QmlProject::parseProject(RefreshOptions options) if (component->isReady() && qobject_cast<QmlProjectItem*>(component->create())) { m_projectItem = qobject_cast<QmlProjectItem*>(component->create()); - connect(m_projectItem.data(), SIGNAL(qmlFilesChanged(QSet<QString>, QSet<QString>)), - this, SLOT(refreshFiles(QSet<QString>, QSet<QString>))); + connect(m_projectItem.data(), SIGNAL(qmlFilesChanged(QSet<QString>,QSet<QString>)), + this, SLOT(refreshFiles(QSet<QString>,QSet<QString>))); } else { messageManager->printToOutputPane(tr("Error while loading project file %1.").arg(m_fileName)); messageManager->printToOutputPane(component->errorString(), true); diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 9269d30fbb..3899c87435 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -108,7 +108,7 @@ void QmlProjectRunConfiguration::ctor() this, SLOT(changeCurrentFile(Core::IEditor*))); QtVersionManager *qtVersions = QtVersionManager::instance(); - connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(updateQtVersions())); + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SLOT(updateQtVersions())); setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); } diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp index f3fe0c3276..0813e0868b 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp @@ -114,7 +114,7 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun // QtVersionManager *qtVersions = QtVersionManager::instance(); - connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SLOT(updateQtVersionComboBox())); // diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index 3935404892..316b7cb117 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -69,7 +69,7 @@ QmlProjectRunControl::QmlProjectRunControl(QmlProjectRunConfiguration *runConfig m_mainQmlFile = runConfiguration->mainScript(); connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)), - this, SLOT(slotAppendMessage(QString, Utils::OutputFormat))); + this, SLOT(slotAppendMessage(QString,Utils::OutputFormat))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), diff --git a/src/plugins/qt4projectmanager/buildconfigurationinfo.h b/src/plugins/qt4projectmanager/buildconfigurationinfo.h index c37e5c1a8e..bc0f3a2859 100644 --- a/src/plugins/qt4projectmanager/buildconfigurationinfo.h +++ b/src/plugins/qt4projectmanager/buildconfigurationinfo.h @@ -40,35 +40,44 @@ namespace Qt4ProjectManager { struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo { explicit BuildConfigurationInfo() - : version(0), buildConfig(QtSupport::BaseQtVersion::QmakeBuildConfig(0)), importing(false), temporaryQtVersion(false) + : qtVersionId(-1), buildConfig(QtSupport::BaseQtVersion::QmakeBuildConfig(0)), importing(false), temporaryQtVersion(0) {} - explicit BuildConfigurationInfo(QtSupport::BaseQtVersion *v, QtSupport::BaseQtVersion::QmakeBuildConfigs bc, - const QString &aa, const QString &d, bool importing_ = false, bool temporaryQtVersion_ = false) : - version(v), buildConfig(bc), additionalArguments(aa), directory(d), importing(importing_), temporaryQtVersion(temporaryQtVersion_) + explicit BuildConfigurationInfo(int v, QtSupport::BaseQtVersion::QmakeBuildConfigs bc, + const QString &aa, const QString &d, + bool importing_ = false, + QtSupport::BaseQtVersion *temporaryQtVersion_ = 0, + const QString &makefile_ = QString()) + : qtVersionId(v), buildConfig(bc), + additionalArguments(aa), directory(d), + importing(importing_), temporaryQtVersion(temporaryQtVersion_), + makefile(makefile_) { } bool isValid() const { - return version != 0; + return version() != 0; } bool operator ==(const BuildConfigurationInfo &other) const { - return version == other.version + return qtVersionId == other.qtVersionId && buildConfig == other.buildConfig && additionalArguments == other.additionalArguments && directory == other.directory && importing == other.importing - && temporaryQtVersion == other.temporaryQtVersion; + && temporaryQtVersion == other.temporaryQtVersion + && makefile == other.makefile; } + QtSupport::BaseQtVersion *version() const; - QtSupport::BaseQtVersion *version; + int qtVersionId; QtSupport::BaseQtVersion::QmakeBuildConfigs buildConfig; QString additionalArguments; QString directory; bool importing; - bool temporaryQtVersion; + QtSupport::BaseQtVersion *temporaryQtVersion; + QString makefile; static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath); static QList<BuildConfigurationInfo> checkForBuild(const QString &directory, const QString &proFilePath); diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/classlist.cpp b/src/plugins/qt4projectmanager/customwidgetwizard/classlist.cpp index d60e4181f3..0de80b70c6 100644 --- a/src/plugins/qt4projectmanager/customwidgetwizard/classlist.cpp +++ b/src/plugins/qt4projectmanager/customwidgetwizard/classlist.cpp @@ -100,7 +100,7 @@ ClassList::ClassList(QWidget *parent) : m_model(new ClassModel) { setModel(m_model); - connect(itemDelegate(), SIGNAL(closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)), SLOT(classEdited())); + connect(itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), SLOT(classEdited())); connect(selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(slotCurrentRowChanged(QModelIndex,QModelIndex))); } diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 30bf73e05d..6211c2f5bc 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -523,7 +523,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) updateEffectiveQMakeCall(); updateQmlDebuggingOption(); - connect(m_ui->qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(const QString&)), + connect(m_ui->qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(QString)), this, SLOT(qmakeArgumentsLineEdited())); connect(m_ui->buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(buildConfigurationSelected())); diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp index 3fe2d186f6..7e49cce939 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp @@ -56,7 +56,7 @@ using ProjectExplorer::idFromMap; Qt4DesktopTargetFactory::Qt4DesktopTargetFactory(QObject *parent) : Qt4BaseTargetFactory(parent) { - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SIGNAL(canCreateTargetIdsChanged())); } @@ -158,8 +158,8 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig(); QList<BuildConfigurationInfo> infos; - infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString())); - infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); return create(parent, id, infos); } @@ -183,7 +183,7 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec foreach (const BuildConfigurationInfo &info, infos) t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), - info.version, info.buildConfig, + info.version(), info.buildConfig, info.additionalArguments, info.directory, info.importing); t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID))); diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp index 7764efbb63..185fd3d462 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp @@ -267,7 +267,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run QWidget *baseEnvironmentWidget = new QWidget(this); QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this runconfiguration:"), this); + QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); baseEnvironmentLayout->addWidget(label); m_baseEnvironmentComboBox = new QComboBox(this); m_baseEnvironmentComboBox->addItems(QStringList() @@ -671,7 +671,7 @@ QString Qt4RunConfiguration::defaultDisplayName() if (!m_proFilePath.isEmpty()) defaultName = QFileInfo(m_proFilePath).completeBaseName(); else - defaultName = tr("Qt4 RunConfiguration"); + defaultName = tr("Qt4 Run Configuration"); return defaultName; } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp index d9bb69e41b..0f70c0aa38 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp @@ -56,7 +56,7 @@ using ProjectExplorer::idFromMap; Qt4SimulatorTargetFactory::Qt4SimulatorTargetFactory(QObject *parent) : Qt4BaseTargetFactory(parent) { - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SIGNAL(canCreateTargetIdsChanged())); } @@ -144,8 +144,8 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj QtSupport::BaseQtVersion *qtVersion = knownVersions.first(); QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig(); QList<BuildConfigurationInfo> infos; - infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString())); - infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); return create(parent, id, infos); } @@ -159,7 +159,7 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj Qt4SimulatorTarget *t = new Qt4SimulatorTarget(static_cast<Qt4Project *>(parent), id); foreach (const BuildConfigurationInfo &info, infos) - t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), info.version, info.buildConfig, + t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), info.version(), info.buildConfig, info.additionalArguments, info.directory, info.importing); t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID))); diff --git a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp index 7b433b33c1..89b53ccb7c 100644 --- a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp @@ -130,7 +130,7 @@ bool CodaRunControl::setupLauncher() appendMessage(tr("Could not open serial device: %1\n").arg(m_codaDevice->device()->errorString()), Utils::ErrorMessageFormat); return false; } - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)), + connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice))); m_state = StateConnecting; m_codaDevice->sendSerialPing(false); @@ -183,7 +183,7 @@ void CodaRunControl::slotError(const QString &error) void CodaRunControl::slotCodaLogMessage(const QString &log) { if (debug > 1) - qDebug("CODA log: %s", qPrintable(log.size()>200?log.left(200).append(QLatin1String(" ...")): log)); + qDebug("CODA log: %s", qPrintable(log.size()>200?log.left(200).append(QLatin1String("...")): log)); } void CodaRunControl::slotCodaEvent(const CodaEvent &event) diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp index 003d242f2a..6b7febfb4e 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp @@ -60,7 +60,7 @@ using namespace Qt4ProjectManager::Internal; Qt4SymbianTargetFactory::Qt4SymbianTargetFactory(QObject *parent) : Qt4BaseTargetFactory(parent) { - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SIGNAL(canCreateTargetIdsChanged())); } @@ -203,13 +203,13 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec QList<BuildConfigurationInfo> infos; if (id != QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) { - infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString())); - infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); } else { if (config & QtSupport::BaseQtVersion::DebugBuild) - infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); else - infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); + infos.append(BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); } return create(parent, id, infos); @@ -222,7 +222,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec Qt4SymbianTarget *t = new Qt4SymbianTarget(static_cast<Qt4Project *>(parent), id); foreach (const BuildConfigurationInfo &info, infos) t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), - info.version, info.buildConfig, + info.version(), info.buildConfig, info.additionalArguments, info.directory, info.importing); t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(S60_DEPLOYCONFIGURATION_ID))); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index 123fa418e6..2f5f464225 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -407,8 +407,8 @@ bool S60CreatePackageStep::createOnePackage() this, SLOT(processReadyReadStdError()), Qt::DirectConnection); - connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(packageDone(int, QProcess::ExitStatus)), + connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(packageDone(int,QProcess::ExitStatus)), Qt::DirectConnection); m_process->setWorkingDirectory(wd.absolutePath()); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp index f5ec79b453..dc0b3733a4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp @@ -113,7 +113,7 @@ void S60DeployConfiguration::ctor() setDefaultDisplayName(defaultDisplayName()); // TODO disable S60 Deploy Configuration while parsing // requires keeping track of the parsing state of the project - connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool, bool)), + connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), this, SLOT(slotTargetInformationChanged(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*))); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp index d6fd37d426..1a186a0d07 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp @@ -355,8 +355,8 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon m_executable = runConfiguration->executable(); connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), this, SLOT(slotError(QString))); - connect(&m_applicationLauncher, SIGNAL(appendMessage(QString, Utils::OutputFormat)), - this, SLOT(slotAppendMessage(QString, Utils::OutputFormat))); + connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)), + this, SLOT(slotAppendMessage(QString,Utils::OutputFormat))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(quint64)), diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp index 9af64867fd..7e73d48501 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp @@ -185,8 +185,8 @@ void Qt4BuildConfiguration::ctor() this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); - connect(vm, SIGNAL(qtVersionsChanged(QList<int>)), - this, SLOT(qtVersionsChanged(QList<int>))); + connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), + this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>))); } void Qt4BuildConfiguration::emitBuildDirectoryChanged() @@ -458,11 +458,11 @@ MakeStep *Qt4BuildConfiguration::makeStep() const return 0; } -void Qt4BuildConfiguration::qtVersionsChanged(const QList<int> &changedVersions) +void Qt4BuildConfiguration::qtVersionsChanged(const QList<int> &addedVersions, const QList<int> &removedVersions, const QList<int> &changedVersions) { - if (!changedVersions.contains(m_qtVersionId)) - return; - emit environmentChanged(); // Our qt version changed, that might have changed the environment + Q_UNUSED(addedVersions); + if (removedVersions.contains(m_qtVersionId) || changedVersions.contains(m_qtVersionId)) + emit environmentChanged(); // Our qt version changed, that might have changed the environment } // returns true if both are equal @@ -663,7 +663,7 @@ Qt4BuildConfigurationFactory::Qt4BuildConfigurationFactory(QObject *parent) : update(); QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); - connect(vm, SIGNAL(qtVersionsChanged(QList<int>)), + connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SLOT(update())); } diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.h b/src/plugins/qt4projectmanager/qt4buildconfiguration.h index 7b2dd5a696..17b98abd0e 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.h @@ -144,7 +144,7 @@ signals: void buildDirectoryInitialized(); private slots: - void qtVersionsChanged(const QList<int> &changedVersions); + void qtVersionsChanged(const QList<int> &addedVersions, const QList<int> &removedVersions, const QList<int> &changedVersions); void emitBuildDirectoryChanged(); void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *, bool, bool parseInProgress); diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index fffc3171ea..e935e5cea3 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -390,7 +390,7 @@ bool Qt4Project::fromMap(const QVariantMap &map) onAddedTarget(t); connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), - this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *,bool,bool))); + this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); // Now we emit update once :) m_rootProjectNode->emitProFileUpdatedRecursive(); diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp index 990d134d33..9fa9de7bc4 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp @@ -225,7 +225,7 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc) qtVersionsChanged(); QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); - connect(vm, SIGNAL(qtVersionsChanged(QList<int>)), + connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SLOT(qtVersionsChanged())); bool shadowBuild = m_buildConfiguration->shadowBuild(); diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 9b705c560b..789c069921 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -224,11 +224,11 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * connect(m_cleanSubProjectContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(cleanSubDirContextMenu())); connect(m_projectExplorer, - SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*)), - this, SLOT(updateContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*))); + SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*)), + this, SLOT(updateContextMenu(ProjectExplorer::Project*,ProjectExplorer::Node*))); - connect(m_projectExplorer->buildManager(), SIGNAL(buildStateChanged(ProjectExplorer::Project *)), - this, SLOT(buildStateChanged(ProjectExplorer::Project *))); + connect(m_projectExplorer->buildManager(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), + this, SLOT(buildStateChanged(ProjectExplorer::Project*))); connect(m_projectExplorer->session(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), this, SLOT(startupProjectChanged())); connect(m_projectExplorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index c8b6e484ba..754b886f96 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -139,7 +139,7 @@ QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations if (!version->isValid() || !version->toolChainAvailable(id)) continue; QtSupport::BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig(); - BuildConfigurationInfo info = BuildConfigurationInfo(version, config, QString(), QString(), false, false); + BuildConfigurationInfo info = BuildConfigurationInfo(version->uniqueId(), config, QString(), QString(), false); info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info)); infoList.append(info); @@ -220,7 +220,7 @@ QList<Qt4BaseTargetFactory *> Qt4BaseTargetFactory::qt4BaseTargetFactoriesForIds // Return name of a build configuration. QString Qt4BaseTargetFactory::msgBuildConfigurationName(const BuildConfigurationInfo &info) { - const QString qtVersionName = info.version->displayName(); + const QString qtVersionName = info.version()->displayName(); return (info.buildConfig & QtSupport::BaseQtVersion::DebugBuild) ? //: Name of a debug build configuration to created by a project wizard, %1 being the Qt version name. We recommend not translating it. tr("%1 Debug").arg(qtVersionName) : @@ -436,8 +436,8 @@ void Qt4BaseTarget::onAddedBuildConfiguration(ProjectExplorer::BuildConfiguratio Q_ASSERT(qt4bc); connect(qt4bc, SIGNAL(buildDirectoryInitialized()), this, SIGNAL(buildDirectoryInitialized())); - connect(qt4bc, SIGNAL(proFileEvaluateNeeded(Qt4ProjectManager::Qt4BuildConfiguration *)), - this, SLOT(onProFileEvaluateNeeded(Qt4ProjectManager::Qt4BuildConfiguration *))); + connect(qt4bc, SIGNAL(proFileEvaluateNeeded(Qt4ProjectManager::Qt4BuildConfiguration*)), + this, SLOT(onProFileEvaluateNeeded(Qt4ProjectManager::Qt4BuildConfiguration*))); } void Qt4BaseTarget::onProFileEvaluateNeeded(Qt4ProjectManager::Qt4BuildConfiguration *bc) @@ -560,6 +560,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f m_importLineLayout->addWidget(m_importLineButton); m_importLineStretch = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); m_importLineLayout->addSpacerItem(m_importLineStretch); + m_importLinePath->installEventFilter(this); layout->addWidget(w); m_importLineLabel->setVisible(false); @@ -567,7 +568,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f m_importLineButton->setVisible(m_showImport); m_buildConfigurationLabel = new QLabel; - m_buildConfigurationLabel->setText(tr("Create Build Configurations:")); + m_buildConfigurationLabel->setText(tr("Create build configurations:")); m_buildConfigurationLabel->setVisible(false); m_buildConfigurationComboBox = new QComboBox; @@ -590,14 +591,14 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f layout->addLayout(hbox); m_shadowBuildEnabled = new QCheckBox; - m_shadowBuildEnabled->setText(tr("Use Shadow Building")); + m_shadowBuildEnabled->setText(tr("Shadow build")); m_shadowBuildCheckBoxVisible = shadowBuild == USER; layout->addWidget(m_shadowBuildEnabled); m_shadowBuildEnabled->setVisible(m_shadowBuildCheckBoxVisible); m_versionLabel = new QLabel; - m_versionLabel->setText(tr("Qt Version:")); + m_versionLabel->setText(tr("Qt version:")); m_versionLabel->setVisible(false); m_versionComboBox = new QComboBox; m_versionComboBox->setVisible(false); @@ -640,13 +641,13 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f setupImportWidgets(); - setBuildConfigurationInfos(infos); + setBuildConfigurationInfos(infos, false); int qtVersionId = s->value(QLatin1String("Qt4ProjectManager.TargetSetupPage.QtVersionId"), -1).toInt(); int index = m_versionComboBox->findData(qtVersionId); if (index != -1) m_versionComboBox->setCurrentIndex(index); - qtVersionChanged(); + updateOneQtVisible(); if (!m_importInfos.isEmpty()) m_detailsWidget->setState(Utils::DetailsWidget::Expanded); @@ -661,7 +662,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f connect(m_buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(buildConfigurationComboBoxChanged())); connect(m_versionComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(qtVersionChanged())); + this, SLOT(updateOneQtVisible())); } Qt4DefaultTargetSetupWidget::~Qt4DefaultTargetSetupWidget() @@ -691,6 +692,11 @@ void Qt4DefaultTargetSetupWidget::setTargetSelected(bool b) m_detailsWidget->setState(Utils::DetailsWidget::Expanded); } +void Qt4DefaultTargetSetupWidget::updateBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos) +{ + setBuildConfigurationInfos(infos, false); +} + void Qt4DefaultTargetSetupWidget::targetCheckBoxToggled(bool b) { if (m_ignoreChange) @@ -718,7 +724,7 @@ QString Qt4DefaultTargetSetupWidget::displayNameFrom(const BuildConfigurationInf //: release build buildType = tr("release"); } - return info.version->displayName() + QLatin1Char(' ') + buildType; + return info.version()->displayName() + QLatin1Char(' ') + buildType; } void Qt4DefaultTargetSetupWidget::setProFilePath(const QString &proFilePath) @@ -730,7 +736,7 @@ void Qt4DefaultTargetSetupWidget::setProFilePath(const QString &proFilePath) m_minimumQtVersion, m_maximumQtVersion, m_requiredFeatures), - false); + true); } void Qt4DefaultTargetSetupWidget::setBuildConfiguraionComboBoxVisible(bool b) @@ -779,6 +785,21 @@ void Qt4DefaultTargetSetupWidget::storeSettings() const s->setValue(QLatin1String("Qt4ProjectManager.TargetSetupPage.BuildTemplate"), m_buildConfigurationComboBox->currentIndex()); } +bool Qt4DefaultTargetSetupWidget::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == m_importLinePath) { + if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast<QKeyEvent *>(event); + if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) { + if (event->type() == QEvent::KeyPress) + addImportClicked(); + return true; + } + } + } + return false; +} + QList<BuildConfigurationInfo> Qt4DefaultTargetSetupWidget::buildConfigurationInfos() const { QList<BuildConfigurationInfo> infos; @@ -798,7 +819,7 @@ QList<BuildConfigurationInfo> Qt4DefaultTargetSetupWidget::buildConfigurationInf QString sourceDir = QFileInfo(m_proFilePath).absolutePath(); int size = m_infos.size(); for (int i=0; i < size; ++i) { - if (state == PERQT || (m_enabled.at(i) && (state == MANUALLY || (state == ONEQT && m_infos.at(i).version->uniqueId() == qtVersionId)))) { + if (state == PERQT || (m_enabled.at(i) && (state == MANUALLY || (state == ONEQT && m_infos.at(i).version()->uniqueId() == qtVersionId)))) { BuildConfigurationInfo info = m_infos.at(i); if (!m_shadowBuildEnabled->isChecked()) info.directory = sourceDir; @@ -822,7 +843,7 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::checkForBuild(m_importLinePath->path(), m_proFilePath); if (infos.isEmpty()) { QMessageBox::critical(this, - tr("No build found"), + tr("No Build Found"), tr("No build found in %1 matching project %2.").arg(m_importLinePath->path()).arg(m_proFilePath)); return; } @@ -830,7 +851,7 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() QList<BuildConfigurationInfo> filterdInfos; bool filtered = false; foreach (const BuildConfigurationInfo &info, infos) { - if (info.version->supportsTargetId(m_id)) + if (info.version()->supportsTargetId(m_id)) filterdInfos << info; else filtered = true; @@ -839,8 +860,8 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() if (filtered) { if (filterdInfos.isEmpty()) { QMessageBox::critical(this, - tr("Incompatible build found"), - tr("The build found in %1 is incompatible with this target").arg(m_importLinePath->path())); + tr("Incompatible Build Found"), + tr("The build found in %1 is incompatible with this target.").arg(m_importLinePath->path())); return; } // show something if we found incompatible builds? @@ -863,8 +884,8 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() if (filterdInfos.isEmpty() && !infos.isEmpty()) { QMessageBox::critical(this, - tr("Already imported build"), - tr("The build found in %1 is already imported").arg(m_importLinePath->path())); + tr("Already Imported Build"), + tr("The build found in %1 is already imported.").arg(m_importLinePath->path())); return; } @@ -884,70 +905,173 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() emit selectedToggled(); } -QList<BuildConfigurationInfo> Qt4DefaultTargetSetupWidget::usedImportInfos() +QList<QtSupport::BaseQtVersion *> Qt4DefaultTargetSetupWidget::usedTemporaryQtVersions() { - QList<BuildConfigurationInfo> infos; + QList<QtSupport::BaseQtVersion *> versions; for (int i = 0; i < m_importInfos.size(); ++i) { - if (m_importEnabled.at(i)) - infos << m_importInfos.at(i); + if (m_importEnabled.at(i) && m_importInfos.at(i).temporaryQtVersion) + versions << m_importInfos.at(i).temporaryQtVersion; } - return infos; + return versions; } -void Qt4DefaultTargetSetupWidget::setBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, bool resetEnabled) +void Qt4DefaultTargetSetupWidget::replaceQtVersionWithQtVersion(int oldId, int newId) { - m_infos = infos; - if (resetEnabled || m_infos.size() != m_enabled.size()) { - m_enabled.clear(); - m_selected = 0; - QStringList existingBuilds; - for (int i = 0; i < m_importInfos.size(); ++i) { - const BuildConfigurationInfo &info = m_importInfos.at(i); - existingBuilds << info.directory; - if (m_importEnabled.at(i)) - ++m_selected; + QList<BuildConfigurationInfo>::iterator it, end; + it = m_importInfos.begin(); + end = m_importInfos.end(); + for ( ; it != end; ++it) { + BuildConfigurationInfo &info = *it; + if (info.qtVersionId == oldId) { + info.qtVersionId = newId; } + } +} + +void Qt4DefaultTargetSetupWidget::replaceTemporaryQtVersionWithQtVersion(QtSupport::BaseQtVersion *version, int id) +{ + QList<BuildConfigurationInfo>::iterator it, end; + it = m_importInfos.begin(); + end = m_importInfos.end(); + for ( ; it != end; ++it) { + BuildConfigurationInfo &info = *it; + if (info.temporaryQtVersion == version) { + info.temporaryQtVersion = 0; + info.qtVersionId = id; + } + } +} + +void Qt4DefaultTargetSetupWidget::replaceQtVersionWithTemporaryQtVersion(int id, QtSupport::BaseQtVersion *version) +{ + QList<BuildConfigurationInfo>::iterator it, end; + it = m_importInfos.begin(); + end = m_importInfos.end(); + for ( ; it != end; ++it) { + BuildConfigurationInfo &info = *it; + if (info.qtVersionId == id) { + info.temporaryQtVersion = version; + info.qtVersionId = -1; + } + } +} + +namespace { +bool equal(const BuildConfigurationInfo &a, const BuildConfigurationInfo &b) +{ + return a.qtVersionId == b.qtVersionId + && a.buildConfig == b.buildConfig + && a.additionalArguments == b.additionalArguments; +} + +bool less(const BuildConfigurationInfo &a, const BuildConfigurationInfo &b) +{ + if (a.qtVersionId < b.qtVersionId) + return true; + if (a.qtVersionId > b.qtVersionId) + return false; + if (a.buildConfig < b.buildConfig) + return true; + if (a.buildConfig > b.buildConfig) + return false; + if (a.additionalArguments < b.additionalArguments) + return true; + if (a.additionalArguments > b.additionalArguments) + return false; + // Other cases can't happen! + qDebug() << "could not order buildconfiguration infos"; + return false; +} +} - // Default to importing existing builds and disable - // builds that would overwrite imports - for (int i=0; i < m_infos.size(); ++i) { - if (existingBuilds.contains(m_infos.at(i).directory) || m_hasInSourceBuild) { - m_enabled << false; +void Qt4DefaultTargetSetupWidget::setBuildConfigurationInfos(QList<BuildConfigurationInfo> infos, bool resetDirectories) +{ + // This is somewhat ugly in that we used to sort the buildconfigurations in the order + // that the default for that qt version is first + qSort(infos.begin(), infos.end(), less); + + // Existing builds, to figure out which newly added + // buildconfigurations should be en/disabled + QStringList existingBuilds; + for (int i = 0; i < m_importInfos.size(); ++i) { + const BuildConfigurationInfo &info = m_importInfos.at(i); + existingBuilds << info.directory; + } + + // Iterate over old/new infos to get the correct + // m_selected and m_enabled state + QList<BuildConfigurationInfo>::const_iterator oldit, oend; + oldit = m_infos.constBegin(); + oend = m_infos.constEnd(); + + QList<BuildConfigurationInfo>::iterator newit, nend; + newit = infos.begin(); + nend = infos.end(); + + QList<bool>::const_iterator enabledIt = m_enabled.constBegin(); + QList<bool> enabled; + while (oldit != oend && newit != nend) { + if (equal(*oldit, *newit)) { + if (!resetDirectories) + newit->directory = oldit->directory; + enabled << *enabledIt; + + ++oldit; + ++enabledIt; + ++newit; + } else if (less(*oldit, *newit)) { + // Deleted qt version + if (*enabledIt) + --m_selected; + ++oldit; + ++enabledIt; + } else { + // new info, check if we have a import build for that directory already + // then disable this build + if (existingBuilds.contains(newit->directory) || m_hasInSourceBuild) { + enabled << false; } else { - m_enabled << true; + enabled << true; ++m_selected; } + + ++newit; } + } - clearWidgets(); - setupWidgets(); - } else { - bool foundIssues = false; - m_ignoreChange = true; - QString sourceDir = QFileInfo(m_proFilePath).absolutePath(); - for (int i=0; i < m_checkboxes.size(); ++i) { - const BuildConfigurationInfo &info = m_infos.at(i); - - m_checkboxes[i]->setText(displayNameFrom(info)); - if (m_shadowBuildEnabled->isChecked()) - m_pathChoosers[i]->setPath(info.directory); - else - m_pathChoosers[i]->setPath(sourceDir); - foundIssues |= reportIssues(i); + while (oldit != oend) { + if (*enabledIt) + --m_selected; + ++oldit; + ++enabledIt; + } + + while (newit != nend) { + if (existingBuilds.contains(newit->directory) || m_hasInSourceBuild) { + enabled << false; + } else { + enabled << true; + ++m_selected; } - m_ignoreChange = false; - if (foundIssues && isTargetSelected()) - m_detailsWidget->setState(Utils::DetailsWidget::Expanded); + + ++newit; } + m_infos = infos; + m_enabled = enabled; + + // Recreate widgets + clearWidgets(); + setupWidgets(); + // update version combobox int oldQtVersionId = -1; if (m_versionComboBox->currentIndex() != -1) oldQtVersionId = m_versionComboBox->itemData(m_versionComboBox->currentIndex()).toInt(); QList<QtSupport::BaseQtVersion *> list; foreach (const BuildConfigurationInfo &info, m_infos) { - if (!list.contains(info.version)) - list << info.version; + if (!list.contains(info.version())) + list << info.version(); } m_ignoreChange = true; m_versionComboBox->clear(); @@ -958,6 +1082,8 @@ void Qt4DefaultTargetSetupWidget::setBuildConfigurationInfos(const QList<BuildCo } m_ignoreChange = false; updateWidgetVisibility(); + + emit selectedToggled(); } void Qt4DefaultTargetSetupWidget::setupImportWidgets() @@ -969,10 +1095,10 @@ void Qt4DefaultTargetSetupWidget::setupImportWidgets() void Qt4DefaultTargetSetupWidget::createImportWidget(const BuildConfigurationInfo &info, int pos) { QCheckBox *checkBox = new QCheckBox; - checkBox->setText(tr("Import build from %1").arg(QDir::toNativeSeparators(info.directory))); + checkBox->setText(tr("Import build from %1.").arg(QDir::toNativeSeparators(info.directory))); checkBox->setChecked(m_importEnabled.at(pos)); - if (info.version) - checkBox->setToolTip(info.version->toHtml(false)); + if (info.version()) + checkBox->setToolTip(info.version()->toHtml(false)); m_importLayout->addWidget(checkBox, pos, 0, 1, 2); connect(checkBox, SIGNAL(toggled(bool)), @@ -992,8 +1118,8 @@ void Qt4DefaultTargetSetupWidget::setupWidgets() checkbox->setText(displayNameFrom(info)); checkbox->setChecked(m_enabled.at(i)); checkbox->setAttribute(Qt::WA_LayoutUsesWidgetRect); - if (info.version) - checkbox->setToolTip(info.version->toHtml(false)); + if (info.version()) + checkbox->setToolTip(info.version()->toHtml(false)); m_newBuildsLayout->addWidget(checkbox, i * 2, 0); Utils::PathChooser *pathChooser = new Utils::PathChooser(); @@ -1133,13 +1259,13 @@ void Qt4DefaultTargetSetupWidget::updateWidgetVisibility() } else if (state == ONEQT) { m_versionLabel->setVisible(true); m_versionComboBox->setVisible(true); - qtVersionChanged(); + updateOneQtVisible(); } m_shadowBuildEnabled->setVisible(m_shadowBuildCheckBoxVisible && (state != NONE)); emit selectedToggled(); } -void Qt4DefaultTargetSetupWidget::qtVersionChanged() +void Qt4DefaultTargetSetupWidget::updateOneQtVisible() { if (m_ignoreChange) return; @@ -1149,7 +1275,7 @@ void Qt4DefaultTargetSetupWidget::qtVersionChanged() if (buildConfigurationTemplate() != ONEQT) return; for (int i = 0; i < m_infos.size(); ++i) { - bool visible = m_infos.at(i).version->uniqueId() == id; + bool visible = m_infos.at(i).version()->uniqueId() == id; m_checkboxes.at(i)->setVisible(visible); m_pathChoosers.at(i)->setVisible(visible); m_reportIssuesLabels.at(i)->setVisible(m_issues.at(i)); @@ -1175,7 +1301,7 @@ QPair<ProjectExplorer::Task::TaskType, QString> Qt4DefaultTargetSetupWidget::fin QString buildDir = info.directory; if (!m_shadowBuildEnabled->isChecked()) buildDir = QFileInfo(m_proFilePath).absolutePath(); - QtSupport::BaseQtVersion *version = info.version; + QtSupport::BaseQtVersion *version = info.version(); QList<ProjectExplorer::Task> issues = version->reportIssues(m_proFilePath, buildDir); @@ -1209,7 +1335,7 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationIn { QList<BuildConfigurationInfo> result; foreach (const BuildConfigurationInfo &info, infos) - if (info.version->supportsTargetId(id)) + if (info.version()->supportsTargetId(id)) result.append(info); return result; } @@ -1221,7 +1347,7 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationIn return infos; QList<BuildConfigurationInfo> result; foreach (const BuildConfigurationInfo &info, infos) - if (info.version->supportsPlatform(platform)) + if (info.version()->supportsPlatform(platform)) result.append(info); return result; } @@ -1230,11 +1356,19 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationIn { QList<BuildConfigurationInfo> result; foreach (const BuildConfigurationInfo &info, infos) - if (info.version->availableFeatures().contains(features)) + if (info.version()->availableFeatures().contains(features)) result.append(info); return result; } +QtSupport::BaseQtVersion *BuildConfigurationInfo::version() const +{ + if (temporaryQtVersion) + return temporaryQtVersion; + QtSupport::QtVersionManager *manager = QtSupport::QtVersionManager::instance(); + return manager->version(qtVersionId); +} + QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(const QString &proFilePath) { QList<BuildConfigurationInfo> result; @@ -1306,12 +1440,13 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::checkForBuild(const QStrin } Utils::QtcProcess::addArgs(&specArgument, additionalArguments); - BuildConfigurationInfo info = BuildConfigurationInfo(version, + BuildConfigurationInfo info = BuildConfigurationInfo(version->uniqueId(), makefileBuildConfig.first, specArgument, directory, true, - temporaryQtVersion); + temporaryQtVersion ? version : 0, + file); infos.append(info); } return infos; diff --git a/src/plugins/qt4projectmanager/qt4target.h b/src/plugins/qt4projectmanager/qt4target.h index d11e389907..1c3af0e94c 100644 --- a/src/plugins/qt4projectmanager/qt4target.h +++ b/src/plugins/qt4projectmanager/qt4target.h @@ -111,6 +111,14 @@ private slots: void emitProFileEvaluateNeeded(); }; +// TODO handle the user deleting/creating qt versions correctly +// Update list of buildconfigurations on adding/removing +// Do advanced magic for importing cases: +// - If the qt version that would be imported was created in the mean time +// delete the temporary qt version and set the versionId to the newly created version +// - If the qt version that a import configuration uses was deleted from the qt versions +// create a new temporary qt version and use that +// For greatness! class Qt4DefaultTargetSetupWidget : public Qt4TargetSetupWidget { Q_OBJECT @@ -129,7 +137,12 @@ public: ~Qt4DefaultTargetSetupWidget(); bool isTargetSelected() const; void setTargetSelected(bool b); - QList<BuildConfigurationInfo> usedImportInfos(); + + void updateBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos); + QList<QtSupport::BaseQtVersion *> usedTemporaryQtVersions(); + void replaceQtVersionWithQtVersion(int oldId, int newId); + void replaceTemporaryQtVersionWithQtVersion(QtSupport::BaseQtVersion *version, int id); + void replaceQtVersionWithTemporaryQtVersion(int id, QtSupport::BaseQtVersion *version); QList<BuildConfigurationInfo> buildConfigurationInfos() const; void setProFilePath(const QString &proFilePath); @@ -144,6 +157,8 @@ public: void setBuildConfigurationTemplate(BuildConfigurationTemplate value); void storeSettings() const; +protected: + bool eventFilter(QObject *, QEvent *); private slots: void addImportClicked(); void checkBoxToggled(bool b); @@ -151,12 +166,12 @@ private slots: void pathChanged(); void shadowBuildingToggled(); void buildConfigurationComboBoxChanged(); - void qtVersionChanged(); + void updateOneQtVisible(); void targetCheckBoxToggled(bool b); private: void updateWidgetVisibility(); - void setBuildConfigurationInfos(const QList<BuildConfigurationInfo> &list, bool resetEnabled = true); + void setBuildConfigurationInfos(QList<BuildConfigurationInfo> list, bool resetDirectories); bool reportIssues(int index); QPair<ProjectExplorer::Task::TaskType, QString> findIssues(const BuildConfigurationInfo &info); void createImportWidget(const BuildConfigurationInfo &info, int pos); diff --git a/src/plugins/qt4projectmanager/qt4targetsetupwidget.h b/src/plugins/qt4projectmanager/qt4targetsetupwidget.h index a3f19c830e..be1679928e 100644 --- a/src/plugins/qt4projectmanager/qt4targetsetupwidget.h +++ b/src/plugins/qt4projectmanager/qt4targetsetupwidget.h @@ -37,6 +37,10 @@ #include <QWidget> +namespace QtSupport { +class BaseQtVersion; +} + namespace Qt4ProjectManager { struct BuildConfigurationInfo; @@ -49,7 +53,13 @@ public: virtual bool isTargetSelected() const = 0; virtual void setTargetSelected(bool b) = 0; virtual void setProFilePath(const QString &proFilePath) = 0; - virtual QList<BuildConfigurationInfo> usedImportInfos() = 0; + + virtual void updateBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos) = 0; + + virtual QList<QtSupport::BaseQtVersion *> usedTemporaryQtVersions() = 0; + virtual void replaceQtVersionWithQtVersion(int oldId, int newId) = 0; + virtual void replaceTemporaryQtVersionWithQtVersion(QtSupport::BaseQtVersion *version, int id) = 0; + virtual void replaceQtVersionWithTemporaryQtVersion(int id, QtSupport::BaseQtVersion *version) = 0; signals: void selectedToggled() const; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index 1e3594d90f..1cfb964739 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -241,8 +241,8 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent, wdlg->m_maemoOptionsPage->setPngIcon(app()->pngIcon64()); wdlg->m_harmattanOptionsPage->setPngIcon(app()->pngIcon80()); wdlg->m_harmattanOptionsPage->setBoosterOptionEnabled(app()->canSupportMeegoBooster()); - connect(wdlg, SIGNAL(projectParametersChanged(QString, QString)), - SLOT(useProjectPath(QString, QString))); + connect(wdlg, SIGNAL(projectParametersChanged(QString,QString)), + SLOT(useProjectPath(QString,QString))); wdlg->addExtensionPages(wizardDialogParameters.extensionPages()); return wdlg; diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp index 2a82b8325e..6d55fb8202 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp @@ -141,13 +141,13 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) "both QML and C++ code and includes a QDeclarativeView.\n\n"); Core::FeatureSet basicFeatures; - basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1_1); + basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1); parameter = base; parameter.setDisplayName(tr("Qt Quick Application (Built-in elements)")); parameter.setDescription(basicDescription + tr("The built-in elements in the QtQuick namespace allow " "you to write cross-platform applications with " - "a custom look and feel.\n\nRequires <b>Qt 4.7.4</b> or newer.")); + "a custom look and feel.\n\nRequires <b>Qt 4.7.0</b> or newer.")); parameter.setRequiredFeatures(basicFeatures); list << parameter; @@ -158,7 +158,8 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) "native appearance for the Symbian platform.\n\nRequires " "<b>Qt 4.7.4</b> or newer, and the component set installed for " "your Qt version.")); - parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN)); + parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN) + | QtSupport::Constants::FEATURE_QT_QUICK_1_1); list << parameter; parameter = base; @@ -168,7 +169,8 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) "with specific native appearance for the MeeGo/Harmattan " "platform.\n\nRequires <b>Qt 4.7.4</b> or newer, and the " "component set installed for your Qt version.")); - parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO)); + parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO) + | QtSupport::Constants::FEATURE_QT_QUICK_1_1); list << parameter; parameter = base; @@ -178,7 +180,7 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) "reside in the same directory as the main QML file " "are deployed. You can modify the contents of the " "directory any time before deploying.\n\nRequires <b>Qt 4.7.0</b> or newer.")); - parameter.setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK)); + parameter.setRequiredFeatures(basicFeatures); list << parameter; QList<QtQuickAppWizard*> wizardList = Core::createMultipleBaseFileWizardInstances<QtQuickAppWizard>(list, plugin); diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index fe37d6b9e3..865ef95473 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -60,6 +60,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : m_useScrollArea(true), m_maximumQtVersionNumber(INT_MAX, INT_MAX, INT_MAX), m_spacer(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)), + m_ignoreQtVersionChange(false), m_ui(new Internal::Ui::TargetSetupPage) { m_ui->setupUi(this); @@ -73,6 +74,9 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : connect(m_ui->descriptionLabel, SIGNAL(linkActivated(QString)), this, SIGNAL(noteTextLinkActivated())); + + connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), + this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>))); } void TargetSetupPage::initializePage() @@ -260,10 +264,20 @@ void TargetSetupPage::setupImportInfos() void TargetSetupPage::cleanupImportInfos() { + // The same qt version can be twice in the list, for the following case + // A Project with two import build using the same already existing qt version + // If that qt version is deleted, it is replaced by ONE temporary qt version + // So two entries in m_importInfos refer to the same qt version + QSet<QtSupport::BaseQtVersion *> alreadyDeleted; foreach (const BuildConfigurationInfo &info, m_importInfos) { - if (info.temporaryQtVersion) - delete info.version; + if (info.temporaryQtVersion) { + if (!alreadyDeleted.contains(info.temporaryQtVersion)) { + alreadyDeleted << info.temporaryQtVersion; + delete info.temporaryQtVersion; + } + } } + m_importInfos.clear(); } void TargetSetupPage::newImportBuildConfiguration(const BuildConfigurationInfo &info) @@ -271,26 +285,122 @@ void TargetSetupPage::newImportBuildConfiguration(const BuildConfigurationInfo & m_importInfos.append(info); } -bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project) +void TargetSetupPage::qtVersionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed) { - QMap<QString, Qt4TargetSetupWidget *>::const_iterator it, end; - end = m_widgets.constEnd(); - it = m_widgets.constBegin(); + Q_UNUSED(added) + if (m_ignoreQtVersionChange) + return; + QMap<QString, Qt4TargetSetupWidget *>::iterator it, end; + end = m_widgets.end(); + it = m_widgets.begin(); for ( ; it != end; ++it) { Qt4BaseTargetFactory *factory = m_factories.value(it.value()); + it.value()->updateBuildConfigurationInfos(factory->availableBuildConfigurations(it.key(), + m_proFilePath, + m_minimumQtVersionNumber, + m_maximumQtVersionNumber, + m_requiredQtFeatures)); + } - foreach (const BuildConfigurationInfo &info, it.value()->usedImportInfos()) { - QtSupport::BaseQtVersion *version = info.version; - for (int i=0; i < m_importInfos.size(); ++i) { - if (m_importInfos.at(i).version == version) { - if (m_importInfos[i].temporaryQtVersion) { - QtSupport::QtVersionManager::instance()->addVersion(m_importInfos[i].version); - m_importInfos[i].temporaryQtVersion = false; - } + QtSupport::QtVersionManager *mgr = QtSupport::QtVersionManager::instance(); + for (int i = 0; i < m_importInfos.size(); ++i) { + if (QtSupport::BaseQtVersion *tmpVersion = m_importInfos[i].temporaryQtVersion) { + // Check whether we have a qt version now + QtSupport::BaseQtVersion *version = + mgr->qtVersionForQMakeBinary(tmpVersion->qmakeCommand()); + if (version) + replaceTemporaryQtVersion(tmpVersion, version->uniqueId()); + } else { + // Check whether we need to replace the qt version id + int oldId = m_importInfos[i].qtVersionId; + if (removed.contains(oldId) || changed.contains(oldId)) { + QString makefile = m_importInfos[i].directory + QLatin1Char('/') + m_importInfos[i].makefile; + Utils::FileName qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile); + QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary); + if (version) { + replaceQtVersionWithQtVersion(oldId, version->uniqueId()); + } else { + version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary); + replaceQtVersionWithTemporaryQtVersion(oldId, version); } } } + } +} +void TargetSetupPage::replaceQtVersionWithQtVersion(int oldId, int newId) +{ + for (int i = 0; i < m_importInfos.size(); ++i) { + if (m_importInfos[i].qtVersionId == oldId) { + m_importInfos[i].qtVersionId = newId; + } + } + QMap<QString, Qt4TargetSetupWidget *>::const_iterator it, end; + it = m_widgets.constBegin(); + end = m_widgets.constEnd(); + for ( ; it != end; ++it) + (*it)->replaceQtVersionWithQtVersion(oldId, newId); +} + +void TargetSetupPage::replaceQtVersionWithTemporaryQtVersion(int id, QtSupport::BaseQtVersion *version) +{ + for (int i = 0; i < m_importInfos.size(); ++i) { + if (m_importInfos[i].qtVersionId == id) { + m_importInfos[i].temporaryQtVersion = version; + m_importInfos[i].qtVersionId = -1; + } + } + QMap<QString, Qt4TargetSetupWidget *>::const_iterator it, end; + it = m_widgets.constBegin(); + end = m_widgets.constEnd(); + for ( ; it != end; ++it) + (*it)->replaceQtVersionWithTemporaryQtVersion(id, version); +} + +void TargetSetupPage::replaceTemporaryQtVersion(QtSupport::BaseQtVersion *version, int id) +{ + for (int i = 0; i < m_importInfos.size(); ++i) { + if (m_importInfos[i].temporaryQtVersion == version) { + m_importInfos[i].temporaryQtVersion = 0; + m_importInfos[i].qtVersionId = id; + } + } + QMap<QString, Qt4TargetSetupWidget *>::const_iterator it, end; + it = m_widgets.constBegin(); + end = m_widgets.constEnd(); + for ( ; it != end; ++it) + (*it)->replaceTemporaryQtVersionWithQtVersion(version, id); +} + +bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project) +{ + m_ignoreQtVersionChange = true; + QtSupport::QtVersionManager *mgr = QtSupport::QtVersionManager::instance(); + QMap<QString, Qt4TargetSetupWidget *>::const_iterator it, end; + end = m_widgets.constEnd(); + it = m_widgets.constBegin(); + + QSet<QtSupport::BaseQtVersion *> temporaryQtVersions; + for ( ; it != end; ++it) + foreach (QtSupport::BaseQtVersion *tempVersion, it.value()->usedTemporaryQtVersions()) + temporaryQtVersions.insert(tempVersion); + + foreach (QtSupport::BaseQtVersion *tempVersion, temporaryQtVersions) { + QtSupport::BaseQtVersion *version = mgr->qtVersionForQMakeBinary(tempVersion->qmakeCommand()); + if (version) { + replaceTemporaryQtVersion(tempVersion, version->uniqueId()); + delete tempVersion; + } else { + mgr->addVersion(tempVersion); + replaceTemporaryQtVersion(tempVersion, tempVersion->uniqueId()); + } + } + + m_ignoreQtVersionChange = false; + + it = m_widgets.constBegin(); + for ( ; it != end; ++it) { + Qt4BaseTargetFactory *factory = m_factories.value(it.value()); if (ProjectExplorer::Target *target = factory->create(project, it.key(), it.value())) project->addTarget(target); } diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h index 0c32e5ebad..a37735bdf5 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h @@ -111,10 +111,14 @@ signals: private slots: void newImportBuildConfiguration(const BuildConfigurationInfo &info); + void qtVersionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed); private: void setupImportInfos(); void cleanupImportInfos(); + void replaceQtVersionWithQtVersion(int oldId, int newId); + void replaceTemporaryQtVersion(QtSupport::BaseQtVersion *version, int id); + void replaceQtVersionWithTemporaryQtVersion(int id, QtSupport::BaseQtVersion *version); void setupWidgets(); void deleteWidgets(); @@ -132,8 +136,9 @@ private: QHash<Qt4TargetSetupWidget *, Qt4BaseTargetFactory *> m_factories; QSpacerItem *m_spacer; + bool m_ignoreQtVersionChange; Internal::Ui::TargetSetupPage *m_ui; - QList<BuildConfigurationInfo> m_importInfos; + QList<BuildConfigurationInfo> m_importInfos; // This owns the temporary qt versions }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index fc3296605d..3769089ff8 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -552,7 +552,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const ensureMkSpecParsed(); switch (binary) { case QmlViewer: - baseDir = m_mkspecValues.value(QLatin1String("QT.declarative.bins")); + baseDir = m_mkspecValues.value(QLatin1String("QT.qml.bins")); break; case Designer: case Linguist: @@ -712,7 +712,7 @@ void BaseQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const m_defaultConfigIsDebugAndRelease = true; } const QString designerBins = QLatin1String("QT.designer.bins"); - const QString declarativeBins = QLatin1String("QT.declarative.bins"); + const QString declarativeBins = QLatin1String("QT.qml.bins"); m_mkspecValues.insert(designerBins, evaluator->value(designerBins)); m_mkspecValues.insert(declarativeBins, evaluator->value(declarativeBins)); } diff --git a/src/plugins/qtsupport/debugginghelper.ui b/src/plugins/qtsupport/debugginghelper.ui index cc14c11b8f..a982d81ac2 100644 --- a/src/plugins/qtsupport/debugginghelper.ui +++ b/src/plugins/qtsupport/debugginghelper.ui @@ -140,7 +140,7 @@ <item> <widget class="QLabel" name="toolChainLabel"> <property name="text"> - <string>Tool Chain:</string> + <string>Tool chain:</string> </property> </widget> </item> diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp index 1752d9edf6..0884933b52 100644 --- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp +++ b/src/plugins/qtsupport/debugginghelperbuildtask.cpp @@ -92,7 +92,7 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, toolChain->addToEnvironment(m_environment); - log(QCoreApplication::translate("QtVersion", "Building helper(s) with toolchain '%1' ...\n" + log(QCoreApplication::translate("QtVersion", "Building helper(s) with toolchain '%1'...\n" ).arg(toolChain->displayName()), QString()); if (toolChain->targetAbi().os() == Abi::LinuxOS diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 27b6339458..c3ea5d3e7d 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -77,7 +77,7 @@ ExamplesListModel::ExamplesListModel(QObject *parent) : connect(Core::HelpManager::instance(), SIGNAL(setupFinished()), SLOT(helpInitialized())); - connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)), + connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), this, SLOT(handleQtVersionsChanged())); } diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index a86bd49b25..a87ee0b8c8 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -182,7 +182,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *> } m_ui->qtdirList->expandAll(); - connect(m_versionUi->nameEdit, SIGNAL(textEdited(const QString &)), + connect(m_versionUi->nameEdit, SIGNAL(textEdited(QString)), this, SLOT(updateCurrentQtName())); connect(m_versionUi->editPathPushButton, SIGNAL(clicked()), @@ -193,8 +193,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *> connect(m_ui->delButton, SIGNAL(clicked()), this, SLOT(removeQtDir())); - connect(m_ui->qtdirList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), - this, SLOT(versionChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_ui->qtdirList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), + this, SLOT(versionChanged(QTreeWidgetItem*,QTreeWidgetItem*))); connect(m_debuggingHelperUi->rebuildButton, SIGNAL(clicked()), this, SLOT(buildDebuggingHelper())); diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index aa83869a28..185023e851 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -449,7 +449,7 @@ void QtVersionManager::addVersion(BaseQtVersion *version) int uniqueId = version->uniqueId(); m_versions.insert(uniqueId, version); - emit qtVersionsChanged(QList<int>() << uniqueId); + emit qtVersionsChanged(QList<int>() << uniqueId, QList<int>(), QList<int>()); saveQtVersions(); } @@ -457,7 +457,7 @@ void QtVersionManager::removeVersion(BaseQtVersion *version) { QTC_ASSERT(version != 0, return); m_versions.remove(version->uniqueId()); - emit qtVersionsChanged(QList<int>() << version->uniqueId()); + emit qtVersionsChanged(QList<int>(), QList<int>() << version->uniqueId(), QList<int>()); saveQtVersions(); delete version; } @@ -623,6 +623,8 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions) SortByUniqueId sortByUniqueId; qSort(sortedNewVersions.begin(), sortedNewVersions.end(), sortByUniqueId); + QList<int> addedVersions; + QList<int> removedVersions; QList<int> changedVersions; // So we trying to find the minimal set of changed versions, // iterate over both sorted list @@ -639,10 +641,10 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions) int nid = (*nit)->uniqueId(); int oid = (*oit)->uniqueId(); if (nid < oid) { - changedVersions.push_back(nid); + addedVersions.push_back(nid); ++nit; } else if (oid < nid) { - changedVersions.push_back(oid); + removedVersions.push_back(oid); ++oit; } else { if (!equals(*oit, *nit)) @@ -653,12 +655,12 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions) } while (nit != nend) { - changedVersions.push_back((*nit)->uniqueId()); + addedVersions.push_back((*nit)->uniqueId()); ++nit; } while (oit != oend) { - changedVersions.push_back((*oit)->uniqueId()); + removedVersions.push_back((*oit)->uniqueId()); ++oit; } @@ -667,13 +669,13 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions) foreach (BaseQtVersion *v, sortedNewVersions) m_versions.insert(v->uniqueId(), v); - if (!changedVersions.isEmpty()) + if (!changedVersions.isEmpty() || !addedVersions.isEmpty() || !removedVersions.isEmpty()) updateDocumentation(); saveQtVersions(); - if (!changedVersions.isEmpty()) - emit qtVersionsChanged(changedVersions); + if (!changedVersions.isEmpty() || !addedVersions.isEmpty() || !removedVersions.isEmpty()) + emit qtVersionsChanged(addedVersions, removedVersions, changedVersions); } // Returns the version that was used to build the project in that directory diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index cccb8f3be6..d192212256 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -108,7 +108,7 @@ public: signals: // content of BaseQtVersion objects with qmake path might have changed void dumpUpdatedFor(const Utils::FileName &qmakeCommand); - void qtVersionsChanged(const QList<int> &uniqueIds); + void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds); public slots: void updateDumpFor(const Utils::FileName &qmakeCommand); diff --git a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp index 07b1894f2d..7a9b05c92f 100644 --- a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp +++ b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp @@ -139,8 +139,8 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Pro QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig(); QList<Qt4ProjectManager::BuildConfigurationInfo> infos; - infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion, config, QString(), QString())); - infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion, + infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion->uniqueId(), config, QString(), QString())); + infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion->uniqueId(), config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString())); @@ -158,7 +158,7 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Pro foreach (const Qt4ProjectManager::BuildConfigurationInfo &info, infos) t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), - info.version, info.buildConfig, + info.version(), info.buildConfig, info.additionalArguments, info.directory, info.importing); t->addDeployConfiguration( diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index acd43b91d9..7a6254b997 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -131,7 +131,7 @@ void GenericDirectUploadService::handleSftpInitialized() } Q_ASSERT(!d->filesToUpload.isEmpty()); - connect(d->uploader.data(), SIGNAL(finished(Utils::SftpJobId, QString)), + connect(d->uploader.data(), SIGNAL(finished(Utils::SftpJobId,QString)), SLOT(handleUploadFinished(Utils::SftpJobId,QString))); d->state = Uploading; uploadNextFile(); diff --git a/src/plugins/remotelinux/packageuploader.cpp b/src/plugins/remotelinux/packageuploader.cpp index f958bf931a..4e17ad1104 100644 --- a/src/plugins/remotelinux/packageuploader.cpp +++ b/src/plugins/remotelinux/packageuploader.cpp @@ -68,8 +68,8 @@ void PackageUploader::uploadPackage(const SshConnection::Ptr &connection, SLOT(handleSftpChannelInitialized())); connect(m_uploader.data(), SIGNAL(initializationFailed(QString)), this, SLOT(handleSftpChannelInitializationFailed(QString))); - connect(m_uploader.data(), SIGNAL(finished(Utils::SftpJobId, QString)), - this, SLOT(handleSftpJobFinished(Utils::SftpJobId, QString))); + connect(m_uploader.data(), SIGNAL(finished(Utils::SftpJobId,QString)), + this, SLOT(handleSftpJobFinished(Utils::SftpJobId,QString))); m_uploader->initialize(); } diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index ee8b948e7b..73344d11bc 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -159,7 +159,7 @@ void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested() QTC_ASSERT(d->state == Inactive, return); d->state = StartingRunner; - showMessage(tr("Preparing remote side ...\n"), AppStuff); + showMessage(tr("Preparing remote side...\n"), AppStuff); disconnect(runner(), 0, this, 0); connect(runner(), SIGNAL(error(QString)), this, SLOT(handleSshError(QString))); connect(runner(), SIGNAL(readyForExecution()), this, SLOT(startExecution())); diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.cpp b/src/plugins/remotelinux/remotelinuxruncontrol.cpp index c296eab903..cc7ab97734 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrol.cpp @@ -90,7 +90,7 @@ void AbstractRemoteLinuxRunControl::handleSshError(const QString &error) void AbstractRemoteLinuxRunControl::startExecution() { - appendMessage(tr("Starting remote process ...\n"), Utils::NormalMessageFormat); + appendMessage(tr("Starting remote process...\n"), Utils::NormalMessageFormat); runner()->startExecution(QString::fromLatin1("%1 %2 %3") .arg(runner()->commandPrefix()) .arg(runner()->remoteExecutable()) diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index cdd3af193d..150a4a3ce8 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -96,8 +96,8 @@ ResourceEditorW::ResourceEditorW(const Core::Context &context, Qt::QueuedConnection); connect(m_resourceEditor, SIGNAL(dirtyChanged(bool)), this, SLOT(dirtyChanged(bool))); - connect(m_resourceEditor, SIGNAL(undoStackChanged(bool, bool)), - this, SLOT(onUndoStackChanged(bool, bool))); + connect(m_resourceEditor, SIGNAL(undoStackChanged(bool,bool)), + this, SLOT(onUndoStackChanged(bool,bool))); connect(m_resourceEditor, SIGNAL(showContextMenu(QPoint,QString)), this, SLOT(showContextMenu(QPoint,QString))); connect(m_resourceEditor->commandHistory(), SIGNAL(indexChanged(int)), diff --git a/src/plugins/subversion/annotationhighlighter.cpp b/src/plugins/subversion/annotationhighlighter.cpp index a994739c15..16a9a30c55 100644 --- a/src/plugins/subversion/annotationhighlighter.cpp +++ b/src/plugins/subversion/annotationhighlighter.cpp @@ -36,8 +36,9 @@ using namespace Subversion; using namespace Subversion::Internal; SubversionAnnotationHighlighter::SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers, - QTextDocument *document) : - VcsBase::BaseAnnotationHighlighter(changeNumbers, document), + const QColor &bg, + QTextDocument *document) : + VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/subversion/annotationhighlighter.h b/src/plugins/subversion/annotationhighlighter.h index fcaeb9c2cc..bd43e548cb 100644 --- a/src/plugins/subversion/annotationhighlighter.h +++ b/src/plugins/subversion/annotationhighlighter.h @@ -43,7 +43,7 @@ class SubversionAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighte { Q_OBJECT public: - explicit SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); private: diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index 10a5ef2185..692d273df5 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -117,9 +117,10 @@ VcsBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const return new VcsBase::DiffHighlighter(filePattern); } -VcsBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const { - return new SubversionAnnotationHighlighter(changes); + return new SubversionAnnotationHighlighter(changes, bg); } QString SubversionEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h index 1fc930329f..74f413f2f9 100644 --- a/src/plugins/subversion/subversioneditor.h +++ b/src/plugins/subversion/subversioneditor.h @@ -52,7 +52,7 @@ private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; - virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &) const; diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index ff9c8ada74..d0e448433e 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -51,8 +51,8 @@ using namespace Core; BaseHoverHandler::BaseHoverHandler(QObject *parent) : QObject(parent), m_diagnosticTooltip(false) { // Listen for editor opened events in order to connect to tooltip/helpid requests - connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor *)), - this, SLOT(editorOpened(Core::IEditor *))); + connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + this, SLOT(editorOpened(Core::IEditor*))); } BaseHoverHandler::~BaseHoverHandler() @@ -63,11 +63,11 @@ void BaseHoverHandler::editorOpened(Core::IEditor *editor) if (acceptEditor(editor)) { BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(editor); if (textEditor) { - connect(textEditor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*, QPoint, int)), - this, SLOT(showToolTip(TextEditor::ITextEditor*, QPoint, int))); + connect(textEditor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)), + this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int))); - connect(textEditor, SIGNAL(contextHelpIdRequested(TextEditor::ITextEditor*, int)), - this, SLOT(updateContextHelpId(TextEditor::ITextEditor*, int))); + connect(textEditor, SIGNAL(contextHelpIdRequested(TextEditor::ITextEditor*,int)), + this, SLOT(updateContextHelpId(TextEditor::ITextEditor*,int))); } } } diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 53788c861c..9f8540965c 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -247,7 +247,7 @@ BaseTextEditorWidget::BaseTextEditorWidget(QWidget *parent) connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(slotUpdateExtraAreaWidth())); connect(this, SIGNAL(modificationChanged(bool)), this, SLOT(slotModificationChanged(bool))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorPositionChanged())); - connect(this, SIGNAL(updateRequest(QRect, int)), this, SLOT(slotUpdateRequest(QRect, int))); + connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(slotUpdateRequest(QRect,int))); connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); // (void) new QShortcut(tr("CTRL+L"), this, SLOT(centerCursor()), 0, Qt::WidgetShortcut); @@ -2544,7 +2544,7 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals(BaseTextDocument *documen QObject::connect(doc, SIGNAL(contentsChange(int,int,int)), q, SLOT(editorContentsChange(int,int,int)), Qt::DirectConnection); QObject::connect(document, SIGNAL(changed()), q, SIGNAL(changed())); - QObject::connect(document, SIGNAL(titleChanged(QString)), q, SLOT(setDisplayName(const QString &))); + QObject::connect(document, SIGNAL(titleChanged(QString)), q, SLOT(setDisplayName(QString))); QObject::connect(document, SIGNAL(aboutToReload()), q, SLOT(documentAboutToBeReloaded())); QObject::connect(document, SIGNAL(reloaded()), q, SLOT(documentReloaded())); q->slotUpdateExtraAreaWidth(); diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 6247838e02..9737314651 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -45,8 +45,8 @@ BaseTextMarkRegistry::BaseTextMarkRegistry(QObject *parent) : QObject(parent) { Core::EditorManager *em = Core::EditorManager::instance(); - connect(em, SIGNAL(editorOpened(Core::IEditor *)), - SLOT(editorOpened(Core::IEditor *))); + connect(em, SIGNAL(editorOpened(Core::IEditor*)), + SLOT(editorOpened(Core::IEditor*))); } void BaseTextMarkRegistry::add(BaseTextMark *mark) diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index d2773135e5..0ff81ee3a0 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -14,6 +14,12 @@ <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item row="0" column="0"> <widget class="TextEditor::BehaviorSettingsWidget" name="behaviorWidget" native="true"/> </item> diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 4d954544ed..9bd9b8c4c7 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -97,16 +97,16 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) this, SLOT(slotBehaviorSettingsChanged())); connect(d->m_ui.scrollWheelZooming, SIGNAL(clicked(bool)), this, SLOT(slotBehaviorSettingsChanged())); - connect(d->m_ui.constrainTooltips, SIGNAL(clicked()), - this, SLOT(slotBehaviorSettingsChanged())); connect(d->m_ui.camelCaseNavigation, SIGNAL(clicked()), this, SLOT(slotBehaviorSettingsChanged())); - connect(d->m_ui.keyboardTooltips, SIGNAL(clicked()), - this, SLOT(slotBehaviorSettingsChanged())); connect(d->m_ui.utf8BomBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotExtraEncodingChanged())); connect(d->m_ui.encodingBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotEncodingBoxChanged(int))); + connect(d->m_ui.constrainTooltipsBox, SIGNAL(currentIndexChanged(int)), + this, SLOT(slotBehaviorSettingsChanged())); + connect(d->m_ui.keyboardTooltips, SIGNAL(clicked()), + this, SLOT(slotBehaviorSettingsChanged())); } BehaviorSettingsWidget::~BehaviorSettingsWidget() @@ -175,20 +175,29 @@ void BehaviorSettingsWidget::assignedStorageSettings(StorageSettings *storageSet storageSettings->m_addFinalNewLine = d->m_ui.addFinalNewLine->isChecked(); } +void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const +{ + if (d->m_ui.constrainTooltipsBox->currentIndex() == 0) + d->m_ui.constrainTooltipsBox->setToolTip("Display context-sensitive help or type information on mouseover."); + else + d->m_ui.constrainTooltipsBox->setToolTip("Display context-sensitive help or type information on Shift+Mouseover."); +} + void BehaviorSettingsWidget::setAssignedBehaviorSettings(const BehaviorSettings &behaviorSettings) { d->m_ui.mouseNavigation->setChecked(behaviorSettings.m_mouseNavigation); d->m_ui.scrollWheelZooming->setChecked(behaviorSettings.m_scrollWheelZooming); - d->m_ui.constrainTooltips->setChecked(behaviorSettings.m_constrainHoverTooltips); + d->m_ui.constrainTooltipsBox->setCurrentIndex(behaviorSettings.m_constrainHoverTooltips ? 1 : 0); d->m_ui.camelCaseNavigation->setChecked(behaviorSettings.m_camelCaseNavigation); d->m_ui.keyboardTooltips->setChecked(behaviorSettings.m_keyboardTooltips); + updateConstrainTooltipsBoxTooltip(); } void BehaviorSettingsWidget::assignedBehaviorSettings(BehaviorSettings *behaviorSettings) const { behaviorSettings->m_mouseNavigation = d->m_ui.mouseNavigation->isChecked(); behaviorSettings->m_scrollWheelZooming = d->m_ui.scrollWheelZooming->isChecked(); - behaviorSettings->m_constrainHoverTooltips = d->m_ui.constrainTooltips->isChecked(); + behaviorSettings->m_constrainHoverTooltips = (d->m_ui.constrainTooltipsBox->currentIndex() == 1); behaviorSettings->m_camelCaseNavigation = d->m_ui.camelCaseNavigation->isChecked(); behaviorSettings->m_keyboardTooltips = d->m_ui.keyboardTooltips->isChecked(); } @@ -223,7 +232,9 @@ QString BehaviorSettingsWidget::collectUiKeywords() const << sep << d->m_ui.utf8BomLabel->text() << sep << d->m_ui.mouseNavigation->text() << sep << d->m_ui.scrollWheelZooming->text() - << sep << d->m_ui.constrainTooltips->text() + << sep << d->m_ui.helpTooltipsLabel->text() + << sep << d->m_ui.constrainTooltipsBox->itemText(0) + << sep << d->m_ui.constrainTooltipsBox->itemText(1) << sep << d->m_ui.camelCaseNavigation->text() << sep << d->m_ui.keyboardTooltips->text() << sep << d->m_ui.groupBoxStorageSettings->title() @@ -251,6 +262,7 @@ void BehaviorSettingsWidget::slotBehaviorSettingsChanged() { BehaviorSettings settings; assignedBehaviorSettings(&settings); + updateConstrainTooltipsBoxTooltip(); emit behaviorSettingsChanged(settings); } diff --git a/src/plugins/texteditor/behaviorsettingswidget.h b/src/plugins/texteditor/behaviorsettingswidget.h index 486a22b7c6..53c30fd0c2 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.h +++ b/src/plugins/texteditor/behaviorsettingswidget.h @@ -95,6 +95,8 @@ private slots: void slotEncodingBoxChanged(int index); private: + void updateConstrainTooltipsBoxTooltip() const; + BehaviorSettingsWidgetPrivate *d; }; diff --git a/src/plugins/texteditor/behaviorsettingswidget.ui b/src/plugins/texteditor/behaviorsettingswidget.ui index 7cdbc4f39e..60ea6a35cd 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.ui +++ b/src/plugins/texteditor/behaviorsettingswidget.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>802</width> - <height>441</height> + <height>416</height> </rect> </property> <layout class="QHBoxLayout" name="horizontalLayout"> @@ -276,13 +276,6 @@ Specifies how backspace interacts with indentation. </property> </spacer> </item> - <item row="1" column="0"> - <widget class="QLabel" name="utf8BomLabel"> - <property name="text"> - <string>UTF-8 BOM:</string> - </property> - </widget> - </item> <item row="1" column="1"> <widget class="QComboBox" name="utf8BomBox"> <property name="toolTip"> @@ -311,6 +304,13 @@ Specifies how backspace interacts with indentation. </item> </widget> </item> + <item row="1" column="0"> + <widget class="QLabel" name="utf8BomLabel"> + <property name="text"> + <string>UTF-8 BOM:</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -335,26 +335,60 @@ Specifies how backspace interacts with indentation. </widget> </item> <item> - <widget class="QCheckBox" name="constrainTooltips"> - <property name="text"> - <string>Enable hover &tooltips only when Shift key is down</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="keyboardTooltips"> - <property name="text"> - <string>Enable &keyboard tooltips when pressing and releasing the Alt key</string> - </property> - </widget> - </item> - <item> <widget class="QCheckBox" name="camelCaseNavigation"> <property name="text"> <string>Enable built-in camel case &navigation</string> </property> </widget> </item> + <item> + <layout class="QGridLayout" name="gridLayout_4"> + <item row="0" column="0"> + <widget class="QLabel" name="helpTooltipsLabel"> + <property name="text"> + <string>Show help tooltips:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="constrainTooltipsBox"> + <item> + <property name="text"> + <string>On Mouseover</string> + </property> + </item> + <item> + <property name="text"> + <string>On Shift+Mouseover</string> + </property> + </item> + </widget> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="keyboardTooltips"> + <property name="toolTip"> + <string>Press Alt to display context-sensitive help or type information as tooltips.</string> + </property> + <property name="text"> + <string>Using keyboard shortcut (Alt)</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> @@ -366,7 +400,7 @@ Specifies how backspace interacts with indentation. <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>10</height> + <height>40</height> </size> </property> </spacer> diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 8f0f444214..51e8225208 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -192,8 +192,8 @@ void ICodeStylePreferences::setCurrentDelegate(ICodeStylePreferences *delegate) this, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings))); disconnect(d->m_currentDelegate, SIGNAL(currentValueChanged(QVariant)), this, SIGNAL(currentValueChanged(QVariant))); - disconnect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *)), - this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *))); + disconnect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), + this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*))); } d->m_currentDelegate = delegate; if (d->m_currentDelegate) { @@ -201,8 +201,8 @@ void ICodeStylePreferences::setCurrentDelegate(ICodeStylePreferences *delegate) this, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings))); connect(d->m_currentDelegate, SIGNAL(currentValueChanged(QVariant)), this, SIGNAL(currentValueChanged(QVariant))); - connect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *)), - this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *))); + connect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), + this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*))); } emit currentDelegateChanged(d->m_currentDelegate); emit currentPreferencesChanged(currentPreferences()); diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 6e719a4ea5..40eebb44d0 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -360,15 +360,15 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w) loadSettings(); loadSnippetGroup(m_ui.groupCombo->currentIndex()); - connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(selectSnippet(QModelIndex,int))); - connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(markSnippetsCollection())); - connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(markSnippetsCollection())); - connect(m_model, SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)), + connect(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(selectMovedSnippet(QModelIndex,int,int,QModelIndex,int))); - connect(m_model, SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)), + connect(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(markSnippetsCollection())); connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(markSnippetsCollection())); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index e430a23b5a..7d0f18dbac 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -577,8 +577,8 @@ IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameter { CallgrindEngine *engine = new CallgrindEngine(q, sp, runConfiguration); - connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)), - SLOT(takeParserData(CallgrindEngine *))); + connect(engine, SIGNAL(parserDataReady(CallgrindEngine*)), + SLOT(takeParserData(CallgrindEngine*))); connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)), SLOT(engineStarting(const Analyzer::IAnalyzerEngine*))); connect(engine, SIGNAL(finished()), diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 8609909f65..4ea3b451ee 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -257,7 +257,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged() m_settings = settings; QTC_ASSERT(m_settings, return); - connect(m_settings, SIGNAL(destroyed(QObject *)), SLOT(settingsDestroyed(QObject *))); + connect(m_settings, SIGNAL(destroyed(QObject*)), SLOT(settingsDestroyed(QObject*))); ValgrindBaseSettings *memcheckSettings = m_settings->subConfig<ValgrindBaseSettings>(); QTC_ASSERT(memcheckSettings, return); @@ -443,7 +443,7 @@ QWidget *MemcheckTool::createWidgets() m_filterMenu->addSeparator(); m_filterMenu->addAction(m_filterProjectAction); m_filterMenu->addAction(m_suppressionSeparator); - connect(m_filterMenu, SIGNAL(triggered(QAction *)), SLOT(updateErrorFilter())); + connect(m_filterMenu, SIGNAL(triggered(QAction*)), SLOT(updateErrorFilter())); filterButton->setMenu(m_filterMenu); layout->addWidget(filterButton); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index c07420fd71..d7f35b68ce 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -112,8 +112,8 @@ bool ValgrindEngine::start() connect(runner(), SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat)), SLOT(receiveProcessOutput(QByteArray,Utils::OutputFormat))); - connect(runner(), SIGNAL(processErrorReceived(QString, QProcess::ProcessError)), - SLOT(receiveProcessError(QString, QProcess::ProcessError))); + connect(runner(), SIGNAL(processErrorReceived(QString,QProcess::ProcessError)), + SLOT(receiveProcessError(QString,QProcess::ProcessError))); connect(runner(), SIGNAL(finished()), SLOT(runnerFinished())); diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp index 8ae5bc20a8..b85a720487 100644 --- a/src/plugins/valgrind/valgrindprocess.cpp +++ b/src/plugins/valgrind/valgrindprocess.cpp @@ -56,8 +56,8 @@ ValgrindProcess::ValgrindProcess(QObject *parent) LocalValgrindProcess::LocalValgrindProcess(QObject *parent) : ValgrindProcess(parent) { - connect(&m_process, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SIGNAL(finished(int, QProcess::ExitStatus))); + connect(&m_process, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SIGNAL(finished(int,QProcess::ExitStatus))); connect(&m_process, SIGNAL(started()), this, SIGNAL(started())); connect(&m_process, SIGNAL(error(QProcess::ProcessError)), diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 26f4f219d9..25a0c8aad0 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -104,8 +104,8 @@ void ValgrindRunner::Private::run(ValgrindProcess *_process) q, SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat))); QObject::connect(process, SIGNAL(started()), q, SLOT(processStarted())); - QObject::connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), - q, SLOT(processFinished(int, QProcess::ExitStatus))); + QObject::connect(process, SIGNAL(finished(int,QProcess::ExitStatus)), + q, SLOT(processFinished(int,QProcess::ExitStatus))); QObject::connect(process, SIGNAL(error(QProcess::ProcessError)), q, SLOT(processError(QProcess::ProcessError))); diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index 4d5acf855b..489f7e8ce0 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -119,11 +119,11 @@ void ThreadedParser::parse(QIODevice *device) connect(parser, SIGNAL(internalError(QString)), SLOT(slotInternalError(QString)), Qt::QueuedConnection); - connect(parser, SIGNAL(errorCount(qint64, qint64)), - SIGNAL(errorCount(qint64, qint64)), + connect(parser, SIGNAL(errorCount(qint64,qint64)), + SIGNAL(errorCount(qint64,qint64)), Qt::QueuedConnection); - connect(parser, SIGNAL(suppressionCount(QString, qint64)), - SIGNAL(suppressionCount(QString, qint64)), + connect(parser, SIGNAL(suppressionCount(QString,qint64)), + SIGNAL(suppressionCount(QString,qint64)), Qt::QueuedConnection); connect(parser, SIGNAL(finished()), SIGNAL(finished()), Qt::QueuedConnection); diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp index 08c8831955..6cd06fda20 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.cpp +++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp @@ -62,15 +62,18 @@ class BaseAnnotationHighlighterPrivate { public: ChangeNumberFormatMap m_changeNumberMap; + QColor m_background; }; } // namespace Internal BaseAnnotationHighlighter::BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, - QTextDocument *document) : + const QColor &bg, + QTextDocument *document) : TextEditor::SyntaxHighlighter(document), d(new Internal::BaseAnnotationHighlighterPrivate) { + d->m_background = bg; setChangeNumbers(changeNumbers); } @@ -81,6 +84,7 @@ BaseAnnotationHighlighter::~BaseAnnotationHighlighter() void BaseAnnotationHighlighter::setChangeNumbers(const ChangeNumbers &changeNumbers) { + QColor bg = d->m_background; d->m_changeNumberMap.clear(); if (!changeNumbers.isEmpty()) { // Assign a color gradient to annotation change numbers. Give @@ -89,10 +93,16 @@ void BaseAnnotationHighlighter::setChangeNumbers(const ChangeNumbers &changeNumb const int step = qRound(ceil(pow(double(changeNumbers.count()), oneThird))); QList<QColor> colors; const int factor = 255 / step; - for (int i=0; i<step; ++i) - for (int j=0; j<step; ++j) - for (int k=0; k<step; ++k) - colors.append(QColor(i*factor, j*factor, k*factor)); + int half = factor / 2; + for (int i=0; i<=step; ++i) + for (int j=0; j<=step; ++j) + for (int k=0; k<=step; ++k) { + QColor c(i*factor, j*factor, k*factor); + if ((bg.red() - half > c.red() ||bg.red() + half <= c.red()) + && (bg.green() - half > c.green() || bg.green() + half <= c.green()) + && (bg.blue() - half > c.blue() || bg.blue() + half <= c.blue())) + colors.prepend(c); + } int m = 0; const int cstep = colors.count() / changeNumbers.count(); @@ -116,4 +126,10 @@ void BaseAnnotationHighlighter::highlightBlock(const QString &text) setFormat(0, text.length(), it.value()); } +void BaseAnnotationHighlighter::setBackgroundColor(const QColor &color) +{ + d->m_background = color; + setChangeNumbers(d->m_changeNumberMap.keys().toSet()); +} + } // namespace VcsBase diff --git a/src/plugins/vcsbase/baseannotationhighlighter.h b/src/plugins/vcsbase/baseannotationhighlighter.h index 47785aeb1e..fadb8d8e16 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.h +++ b/src/plugins/vcsbase/baseannotationhighlighter.h @@ -48,7 +48,7 @@ class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighli public: typedef QSet<QString> ChangeNumbers; - explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, + explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg, QTextDocument *document = 0); virtual ~BaseAnnotationHighlighter(); @@ -56,6 +56,8 @@ public: virtual void highlightBlock(const QString &text); + void setBackgroundColor(const QColor &color); + private: // Implement this to return the change number of a line virtual QString changeNumber(const QString &block) const = 0; diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index e5dfe8f4fe..07d9df8a9e 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -507,7 +507,7 @@ void UrlTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType type) { Q_UNUSED(type); menu->addSeparator(); - menu->addAction(createOpenUrlAction(tr("Open URL in browser ..."))); + menu->addAction(createOpenUrlAction(tr("Open URL in browser..."))); menu->addAction(createCopyUrlAction(tr("Copy URL location"))); } @@ -572,7 +572,7 @@ void EmailTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType type { Q_UNUSED(type); menu->addSeparator(); - menu->addAction(createOpenUrlAction(tr("Send email to ..."))); + menu->addAction(createOpenUrlAction(tr("Send email to..."))); menu->addAction(createCopyUrlAction(tr("Copy email address"))); } @@ -605,6 +605,8 @@ public: bool m_revertChunkEnabled; bool m_mouseDragging; QList<AbstractTextCursorHandler *> m_textCursorHandlers; + + QColor m_backgroundColor; }; VcsBaseEditorWidgetPrivate::VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget *editorWidget, @@ -686,6 +688,8 @@ void VcsBaseEditorWidget::init() break; } TextEditor::TextEditorSettings::instance()->initializeEditor(this); + // override revisions display (green or red bar on the left, marking changes): + setRevisionsVisible(false); } VcsBaseEditorWidget::~VcsBaseEditorWidget() @@ -1017,7 +1021,7 @@ void VcsBaseEditorWidget::slotActivateAnnotation() ah->setChangeNumbers(changes); ah->rehighlight(); } else { - baseTextDocument()->setSyntaxHighlighter(createAnnotationHighlighter(changes)); + baseTextDocument()->setSyntaxHighlighter(createAnnotationHighlighter(changes, d->m_backgroundColor)); } } @@ -1149,6 +1153,9 @@ void VcsBaseEditorWidget::setPlainTextData(const QByteArray &data) void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) { TextEditor::BaseTextEditorWidget::setFontSettings(fs); + d->m_backgroundColor = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_TEXT)) + .brushProperty(QTextFormat::BackgroundBrush).color(); + if (d->m_parameters->type == DiffOutput) { if (DiffHighlighter *highlighter = qobject_cast<DiffHighlighter*>(baseTextDocument()->syntaxHighlighter())) { static QVector<QString> categories; @@ -1162,6 +1169,11 @@ void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) highlighter->setFormats(fs.toTextCharFormats(categories)); highlighter->rehighlight(); } + } else if (d->m_parameters->type == AnnotateOutput) { + if (BaseAnnotationHighlighter *highlighter = qobject_cast<BaseAnnotationHighlighter *>(baseTextDocument()->syntaxHighlighter())) { + highlighter->setBackgroundColor(d->m_backgroundColor); + highlighter->rehighlight(); + } } } diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index 6744c57cc5..7107a580bb 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -102,7 +102,7 @@ protected: // Initialization requires calling init() (which in turns calls // virtual functions). explicit VcsBaseEditorWidget(const VcsBaseEditorParameters *type, - QWidget *parent); + QWidget *parent); public: void init(); @@ -249,7 +249,8 @@ private: virtual QString changeUnderCursor(const QTextCursor &) const = 0; // Factory functions for highlighters virtual DiffHighlighter *createDiffHighlighter() const = 0; - virtual BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const = 0; + virtual BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, + const QColor &bg) const = 0; // Implement to return a local file name from the diff file specification // (text cursor at position above change hunk) virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const = 0; diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 8ba89add11..e0298938d5 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -547,7 +547,7 @@ void VcsBasePlugin::initializeVcs(Core::IVersionControl *vc) if (!VcsBasePluginPrivate::m_listener) VcsBasePluginPrivate::m_listener = new Internal::StateListener(plugin); connect(VcsBasePluginPrivate::m_listener, - SIGNAL(stateChanged(VcsBase::Internal::State, Core::IVersionControl*)), + SIGNAL(stateChanged(VcsBase::Internal::State,Core::IVersionControl*)), this, SLOT(slotStateChanged(VcsBase::Internal::State,Core::IVersionControl*))); } |