Beispiel #1
0
void TestProject::runTests(CustomRunConfiguration *configuration) const
{
  Q_ASSERT (configuration != NULL);
  ProjectExplorerPlugin* plugin = ProjectExplorerPlugin::instance ();
  plugin->runRunConfiguration (configuration, ProjectExplorer::Constants::NORMAL_RUN_MODE, true);
  configuration->deleteLater ();
}
void StateMachine::updateActionsAvailability()
{
    using namespace ProjectExplorer;
    ProjectExplorerPlugin *projectExplorerPlugin = ProjectExplorerPlugin::instance();
    Project *project = projectExplorerPlugin->startupProject();
    const bool isProjectCanRun = projectExplorerPlugin->canRun(project, NormalRunMode);

    currentState->updateActionsAvailability(isProjectCanRun);
}
Core::IDocument *ProjectFileFactory::open(const QString &fileName)
{
    ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
    QString errorMessage;
    pe->openProject(fileName, &errorMessage);
    if (!errorMessage.isEmpty())
        QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage);
    return 0;
}
Beispiel #4
0
void ProjectWelcomePage::facilitateQml(QDeclarativeEngine *engine)
{
    ProjectExplorerPlugin *pePlugin = ProjectExplorer::ProjectExplorerPlugin::instance();
    m_sessionModel = new SessionModel(pePlugin->session(), this);
    m_projectModel = new ProjectModel(pePlugin, this);

    QDeclarativeContext *ctx = engine->rootContext();
    ctx->setContextProperty("sessionList", m_sessionModel);
    ctx->setContextProperty("projectList", m_projectModel);
    ctx->setContextProperty("projectWelcomePage", this);
}
Beispiel #5
0
void QmlProfilerTool::startTool(StartMode mode)
{
    Q_UNUSED(mode);

    using namespace ProjectExplorer;

    // Make sure mode is shown.
    AnalyzerManager::showMode();

    ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
    // ### not sure if we're supposed to check if the RunConFiguration isEnabled
    Project *pro = pe->startupProject();
    pe->runProject(pro, id());
}
Core::IFile *ProjectFileFactory::open(const QString &fileName)
{
    Core::IFile *fIFace = 0;

    ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
    if (!pe->openProject(fileName)) {
        Core::ICore::instance()->messageManager()->printToOutputPane(tr("Could not open the following project: '%1'").arg(fileName));
    } else if (pe->session()) {
        SessionManager *session = pe->session();
        if (session->projects().count() == 1)
            fIFace = session->projects().first()->file();
        else if (session->projects().count() > 1)
            fIFace = session->file();  // TODO: Why return session file interface here ???
    }
    return fIFace;
}
void CleanExecutor::execute()
{
    using namespace ProjectExplorer;

    ProjectExplorerPlugin *projectExplorerPlugin = ProjectExplorerPlugin::instance();
    Project *project = projectExplorerPlugin->startupProject();

    ProjectNode *rootProjectNode = project->rootProjectNode();
    const QString &activeRunConfigurationDir = getRunConfigurationPath(rootProjectNode, project->activeTarget()->activeRunConfiguration());

    const QString &buildDir = activeRunConfigurationDir.mid(0, activeRunConfigurationDir.lastIndexOf('/'));
    const QString &objectFilesDir = getObjectFilesDir(buildDir);

    const QString program = "lcov";
    const QStringList arguments = {
        "-z",
        "-d",
        objectFilesDir
    };

    process->start(program, arguments);
}