Merge remote-tracking branch 'origin/4.2'

Conflicts:
	src/shared/qbs

Change-Id: Ic39fd1c411632f56312fae31c0c88ebc1098b5a4
This commit is contained in:
Eike Ziller
2017-01-30 10:55:40 +01:00
10 changed files with 56 additions and 29 deletions

View File

@@ -149,6 +149,8 @@
#include <QTreeWidget>
#include <QVBoxLayout>
#include <QVariant>
#include <QJsonDocument>
#include <QJsonObject>
#include <QtPlugin>
#ifdef WITH_TESTS
@@ -2151,6 +2153,29 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
createAndScheduleRun(rp, kit);
}
void DebuggerPlugin::getEnginesState(QByteArray *json) const
{
QTC_ASSERT(json, return);
QVariantMap result {
{ "version", 1 }
};
QVariantMap states;
for (int i = 0; i < dd->m_snapshotHandler->size(); ++i) {
const DebuggerEngine *engine = dd->m_snapshotHandler->at(i);
states[QString::number(i)] = QVariantMap({
{ "current", dd->m_snapshotHandler->currentIndex() == i },
{ "pid", engine->inferiorPid() },
{ "state", engine->state() }
});
}
if (!states.isEmpty())
result["states"] = states;
*json = QJsonDocument(QJsonObject::fromVariantMap(result)).toJson();
}
void DebuggerPluginPrivate::attachToQmlPort()
{
DebuggerRunParameters rp;

View File

@@ -56,6 +56,9 @@ private:
// Called from AppOutputPane::attachToRunControl().
Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc);
// Called from GammaRayIntegration
Q_SLOT void getEnginesState(QByteArray *json) const;
QList<QObject *> createTestObjects() const override;
};

View File

@@ -1062,10 +1062,12 @@ bool GitPlugin::submitEditorAboutToClose()
m_gitClient->interactiveRebase(m_submitRepository, amendSHA1, true);
} else {
m_gitClient->continueCommandIfNeeded(m_submitRepository);
if (editor->panelData().pushAction == NormalPush)
if (editor->panelData().pushAction == NormalPush) {
m_gitClient->push(m_submitRepository);
else if (editor->panelData().pushAction == PushToGerrit)
connect(editor, &QObject::destroyed, this, &GitPlugin::delayedPushToGerrit);
} else if (editor->panelData().pushAction == PushToGerrit) {
connect(editor, &QObject::destroyed, this, &GitPlugin::delayedPushToGerrit,
Qt::QueuedConnection);
}
}
return true;

View File

@@ -2582,6 +2582,16 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc,
emit m_instance->updateRunActions();
}
QList<QPair<Runnable, ProcessHandle>> ProjectExplorerPlugin::runningRunControlProcesses()
{
QList<QPair<Runnable, ProcessHandle>> processes;
foreach (RunControl *rc, dd->m_outputPane->allRunControls()) {
if (rc->isRunning())
processes << qMakePair(rc->runnable(), rc->applicationProcessHandle());
}
return processes;
}
void ProjectExplorerPluginPrivate::projectAdded(Project *pro)
{
if (m_projectsMode)

View File

@@ -52,6 +52,7 @@ class Project;
class Node;
class FolderNode;
class FileNode;
class ProcessHandle;
namespace Internal { class ProjectExplorerSettings; }
@@ -139,6 +140,7 @@ public:
static void runStartupProject(Core::Id runMode, bool forceSkipDeploy = false);
static void runRunConfiguration(RunConfiguration *rc, Core::Id runMode,
const bool forceSkipDeploy = false);
static QList<QPair<Runnable, ProcessHandle>> runningRunControlProcesses();
static void addExistingFiles(FolderNode *folderNode, const QStringList &filePaths);