Пример #1
0
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;
}
Пример #2
0
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;
}