genericproject.cpp 17 KB
Newer Older
Roberto Raggi's avatar
Roberto Raggi committed
1 2 3 4
/**************************************************************************
**
** This file is part of Qt Creator
**
hjk's avatar
hjk committed
5
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
Roberto Raggi's avatar
Roberto Raggi committed
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
Roberto Raggi's avatar
Roberto Raggi committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
Roberto Raggi's avatar
Roberto Raggi committed
27 28 29 30
**
**************************************************************************/

#include "genericproject.h"
Tobias Hunger's avatar
Tobias Hunger committed
31

dt's avatar
dt committed
32
#include "genericbuildconfiguration.h"
Tobias Hunger's avatar
Tobias Hunger committed
33 34
#include "genericprojectconstants.h"
#include "generictarget.h"
Roberto Raggi's avatar
Roberto Raggi committed
35

36
#include <projectexplorer/buildenvironmentwidget.h>
37
#include <projectexplorer/toolchain.h>
Roberto Raggi's avatar
Roberto Raggi committed
38 39 40
#include <projectexplorer/projectexplorerconstants.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <extensionsystem/pluginmanager.h>
41
#include <utils/pathchooser.h>
Roberto Raggi's avatar
Roberto Raggi committed
42 43
#include <coreplugin/icore.h>

44
#include <QtCore/QDir>
45
#include <QtCore/QProcessEnvironment>
Roberto Raggi's avatar
Roberto Raggi committed
46

47 48 49
#include <QtGui/QFormLayout>
#include <QtGui/QMainWindow>
#include <QtGui/QComboBox>
Roberto Raggi's avatar
Roberto Raggi committed
50 51 52

using namespace GenericProjectManager;
using namespace GenericProjectManager::Internal;
53
using namespace ProjectExplorer;
Roberto Raggi's avatar
Roberto Raggi committed
54

55
namespace {
56
const char * const TOOLCHAIN_KEY("GenericProjectManager.GenericProject.Toolchain");
57 58
} // end of anonymous namespace

59 60 61 62
////////////////////////////////////////////////////////////////////////////////////
// GenericProject
////////////////////////////////////////////////////////////////////////////////////

Roberto Raggi's avatar
Roberto Raggi committed
63
GenericProject::GenericProject(Manager *manager, const QString &fileName)
64 65
    : m_manager(manager),
      m_fileName(fileName),
Tobias Hunger's avatar
Tobias Hunger committed
66
      m_targetFactory(new GenericTargetFactory(this)),
67
      m_toolChain(0)
Roberto Raggi's avatar
Roberto Raggi committed
68
{
69
    QFileInfo fileInfo(m_fileName);
70 71
    QDir dir = fileInfo.dir();

72
    m_projectName      = fileInfo.completeBaseName();
73 74 75
    m_filesFileName    = QFileInfo(dir, m_projectName + QLatin1String(".files")).absoluteFilePath();
    m_includesFileName = QFileInfo(dir, m_projectName + QLatin1String(".includes")).absoluteFilePath();
    m_configFileName   = QFileInfo(dir, m_projectName + QLatin1String(".config")).absoluteFilePath();
76

77 78
    m_file = new GenericProjectFile(this, fileName);
    m_rootNode = new GenericProjectNode(this, m_file);
79

80
    m_manager->registerProject(this);
Roberto Raggi's avatar
Roberto Raggi committed
81 82 83 84
}

GenericProject::~GenericProject()
{
85
    m_codeModelFuture.cancel();
86
    m_manager->unregisterProject(this);
87

88 89
    delete m_rootNode;
    delete m_toolChain;
Roberto Raggi's avatar
Roberto Raggi committed
90 91
}

Tobias Hunger's avatar
Tobias Hunger committed
92 93 94 95 96 97
GenericTargetFactory *GenericProject::targetFactory() const
{
    return m_targetFactory;
}

GenericTarget *GenericProject::activeTarget() const
98
{
Tobias Hunger's avatar
Tobias Hunger committed
99
    return static_cast<GenericTarget *>(Project::activeTarget());
100 101
}

102
QString GenericProject::filesFileName() const
103
{ return m_filesFileName; }
104 105

QString GenericProject::includesFileName() const
106
{ return m_includesFileName; }
107 108

QString GenericProject::configFileName() const
109
{ return m_configFileName; }
110

111
static QStringList readLines(const QString &absoluteFileName)
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
{
    QStringList lines;

    QFile file(absoluteFileName);
    if (file.open(QFile::ReadOnly)) {
        QTextStream stream(&file);

        forever {
            QString line = stream.readLine();
            if (line.isNull())
                break;

            lines.append(line);
        }
    }

    return lines;
}

131
bool GenericProject::saveRawFileList(const QStringList &rawFileList)
132
{
133
    // Make sure we can open the file for writing
134
    QFile file(filesFileName());
135 136 137 138
    if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
        return false;

    QTextStream stream(&file);
139 140
    foreach (const QString &filePath, rawFileList)
        stream << filePath << QLatin1Char('\n');
141 142 143 144

    file.close();
    refresh(GenericProject::Files);
    return true;
145
}
146

147 148
bool GenericProject::addFiles(const QStringList &filePaths)
{
149 150 151 152 153
    QStringList newList = m_rawFileList;

    QDir baseDir(QFileInfo(m_fileName).dir());
    foreach (const QString &filePath, filePaths)
        newList.append(baseDir.relativeFilePath(filePath));
154

155
    return saveRawFileList(newList);
156 157 158 159
}

bool GenericProject::removeFiles(const QStringList &filePaths)
{
160
    QStringList newList = m_rawFileList;
161

162 163 164 165
    foreach (const QString &filePath, filePaths) {
        QHash<QString, QString>::iterator i = m_rawListEntries.find(filePath);
        if (i != m_rawListEntries.end())
            newList.removeOne(i.value());
166
    }
167

168
    return saveRawFileList(newList);
169 170
}

171
void GenericProject::parseProject(RefreshOptions options)
Roberto Raggi's avatar
Roberto Raggi committed
172
{
173 174 175
    if (options & Files) {
        m_rawListEntries.clear();
        m_rawFileList = readLines(filesFileName());
176
        m_files = processEntries(m_rawFileList, &m_rawListEntries);
177
    }
178

179
    if (options & Configuration) {
180
        m_projectIncludePaths = processEntries(readLines(includesFileName()));
181

182 183
        // TODO: Possibly load some configuration from the project file
        //QSettings projectInfo(m_fileName, QSettings::IniFormat);
Roberto Raggi's avatar
Roberto Raggi committed
184

185
        m_defines.clear();
Roberto Raggi's avatar
Roberto Raggi committed
186

187 188 189 190
        QFile configFile(configFileName());
        if (configFile.open(QFile::ReadOnly))
            m_defines = configFile.readAll();
    }
191

192 193
    if (options & Files)
        emit fileListChanged();
Roberto Raggi's avatar
Roberto Raggi committed
194 195
}

196
void GenericProject::refresh(RefreshOptions options)
Roberto Raggi's avatar
Roberto Raggi committed
197
{
198 199 200
    QSet<QString> oldFileList;
    if (!(options & Configuration))
        oldFileList = m_files.toSet();
201

202 203 204 205
    parseProject(options);

    if (options & Files)
        m_rootNode->refresh();
Roberto Raggi's avatar
Roberto Raggi committed
206 207 208 209

    CppTools::CppModelManagerInterface *modelManager =
        ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();

210 211
    if (m_toolChain && modelManager) {
        const QByteArray predefinedMacros = m_toolChain->predefinedMacros();
Roberto Raggi's avatar
Roberto Raggi committed
212 213 214

        CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
        pinfo.defines = predefinedMacros;
Roberto Raggi's avatar
Roberto Raggi committed
215
        pinfo.defines += '\n';
216
        pinfo.defines += m_defines;
Roberto Raggi's avatar
Roberto Raggi committed
217

218 219
        QStringList allIncludePaths;
        QStringList allFrameworkPaths;
Roberto Raggi's avatar
Roberto Raggi committed
220

221
        foreach (const ProjectExplorer::HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) {
Roberto Raggi's avatar
Roberto Raggi committed
222 223 224 225 226 227
            if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath)
                allFrameworkPaths.append(headerPath.path());
            else
                allIncludePaths.append(headerPath.path());
        }

Roberto Raggi's avatar
Roberto Raggi committed
228
        allIncludePaths += this->allIncludePaths();
Roberto Raggi's avatar
Roberto Raggi committed
229 230 231 232 233

        pinfo.frameworkPaths = allFrameworkPaths;
        pinfo.includePaths = allIncludePaths;

        // ### add _defines.
Roberto Raggi's avatar
Roberto Raggi committed
234 235
        pinfo.sourceFiles = files();
        pinfo.sourceFiles += generated();
Roberto Raggi's avatar
Roberto Raggi committed
236

237 238 239 240 241
        QStringList filesToUpdate;

        if (options & Configuration) {
            filesToUpdate = pinfo.sourceFiles;
            filesToUpdate.append(QLatin1String("<configuration>")); // XXX don't hardcode configuration file name
242 243
            // Full update, if there's a code model update, cancel it
            m_codeModelFuture.cancel();
244 245 246 247 248 249
        } else if (options & Files) {
            // Only update files that got added to the list
            QSet<QString> newFileList = m_files.toSet();
            newFileList.subtract(oldFileList);
            filesToUpdate.append(newFileList.toList());
        }
250

Roberto Raggi's avatar
Roberto Raggi committed
251
        modelManager->updateProjectInfo(pinfo);
252
        m_codeModelFuture = modelManager->updateSourceFiles(filesToUpdate);
Roberto Raggi's avatar
Roberto Raggi committed
253 254 255
    }
}

256
/**
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
 * Expands environment variables in the given \a string when they are written
 * like $$(VARIABLE).
 */
static void expandEnvironmentVariables(const QProcessEnvironment &env, QString &string)
{
    const static QRegExp candidate(QLatin1String("\\$\\$\\((.+)\\)"));

    int index = candidate.indexIn(string);
    while (index != -1) {
        const QString value = env.value(candidate.cap(1));

        string.replace(index, candidate.matchedLength(), value);
        index += value.length();

        index = candidate.indexIn(string, index);
    }
}

/**
 * Expands environment variables and converts the path from relative to the
 * project to an absolute path.
 *
279
 * The \a map variable is an optional argument that will map the returned
280
 * absolute paths back to their original \a entries.
281
 */
282 283
QStringList GenericProject::processEntries(const QStringList &paths,
                                           QHash<QString, QString> *map) const
Roberto Raggi's avatar
Roberto Raggi committed
284
{
285
    const QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
286
    const QDir projectDir(QFileInfo(m_fileName).dir());
287

Roberto Raggi's avatar
Roberto Raggi committed
288
    QStringList absolutePaths;
289
    foreach (const QString &path, paths) {
290 291
        QString trimmedPath = path.trimmed();
        if (trimmedPath.isEmpty())
292 293
            continue;

294 295 296
        expandEnvironmentVariables(env, trimmedPath);

        const QString absPath = QFileInfo(projectDir, trimmedPath).absoluteFilePath();
297 298
        absolutePaths.append(absPath);
        if (map)
299
            map->insert(absPath, trimmedPath);
Roberto Raggi's avatar
Roberto Raggi committed
300 301 302 303 304
    }
    absolutePaths.removeDuplicates();
    return absolutePaths;
}

Roberto Raggi's avatar
Roberto Raggi committed
305 306 307
QStringList GenericProject::allIncludePaths() const
{
    QStringList paths;
308 309
    paths += m_includePaths;
    paths += m_projectIncludePaths;
Roberto Raggi's avatar
Roberto Raggi committed
310 311 312 313 314
    paths.removeDuplicates();
    return paths;
}

QStringList GenericProject::projectIncludePaths() const
315
{ return m_projectIncludePaths; }
Roberto Raggi's avatar
Roberto Raggi committed
316

Roberto Raggi's avatar
Roberto Raggi committed
317
QStringList GenericProject::files() const
318
{ return m_files; }
Roberto Raggi's avatar
Roberto Raggi committed
319 320

QStringList GenericProject::generated() const
321
{ return m_generated; }
Roberto Raggi's avatar
Roberto Raggi committed
322 323

QStringList GenericProject::includePaths() const
324
{ return m_includePaths; }
Roberto Raggi's avatar
Roberto Raggi committed
325 326

void GenericProject::setIncludePaths(const QStringList &includePaths)
327
{ m_includePaths = includePaths; }
Roberto Raggi's avatar
Roberto Raggi committed
328

Roberto Raggi's avatar
Roberto Raggi committed
329
QByteArray GenericProject::defines() const
330
{ return m_defines; }
Roberto Raggi's avatar
Roberto Raggi committed
331

332
void GenericProject::setToolChainType(ProjectExplorer::ToolChain::ToolChainType type)
Roberto Raggi's avatar
Roberto Raggi committed
333 334 335
{
    using namespace ProjectExplorer;

336
    m_toolChainType = type;
337

338 339
    delete m_toolChain;
    m_toolChain = 0;
Roberto Raggi's avatar
Roberto Raggi committed
340

341
    if (type == ToolChain::MinGW) {
Roberto Raggi's avatar
Roberto Raggi committed
342 343 344
        const QLatin1String qmake_cxx("g++"); // ### FIXME
        const QString mingwDirectory; // ### FIXME

345
        m_toolChain = ToolChain::createMinGWToolChain(qmake_cxx, mingwDirectory);
Roberto Raggi's avatar
Roberto Raggi committed
346

347
    } else if (type == ToolChain::MSVC) {
Roberto Raggi's avatar
Roberto Raggi committed
348
        const QString msvcVersion; // ### FIXME
349
        m_toolChain = ToolChain::createMSVCToolChain(msvcVersion, false);
Roberto Raggi's avatar
Roberto Raggi committed
350

351
    } else if (type == ToolChain::WINCE) {
Roberto Raggi's avatar
Roberto Raggi committed
352
        const QString msvcVersion, wincePlatform; // ### FIXME
353
        m_toolChain = ToolChain::createWinCEToolChain(msvcVersion, wincePlatform);
dt's avatar
dt committed
354
    } else if (type == ToolChain::GCC) {
Roberto Raggi's avatar
Roberto Raggi committed
355
        const QLatin1String qmake_cxx("g++"); // ### FIXME
356
        m_toolChain = ToolChain::createGccToolChain(qmake_cxx);
dt's avatar
dt committed
357 358
    } else if (type == ToolChain::LINUX_ICC) {
        m_toolChain = ToolChain::createLinuxIccToolChain();
Roberto Raggi's avatar
Roberto Raggi committed
359 360 361
    }
}

362 363 364 365 366
ProjectExplorer::ToolChain *GenericProject::toolChain() const
{
    return m_toolChain;
}

367 368
ProjectExplorer::ToolChain::ToolChainType GenericProject::toolChainType() const
{ return m_toolChainType; }
369

370
QString GenericProject::displayName() const
Roberto Raggi's avatar
Roberto Raggi committed
371
{
372
    return m_projectName;
Roberto Raggi's avatar
Roberto Raggi committed
373 374
}

Tobias Hunger's avatar
Tobias Hunger committed
375 376 377 378 379
QString GenericProject::id() const
{
    return QLatin1String("GenericProjectManager.GenericProject");
}

Roberto Raggi's avatar
Roberto Raggi committed
380 381
Core::IFile *GenericProject::file() const
{
382
    return m_file;
Roberto Raggi's avatar
Roberto Raggi committed
383 384 385 386
}

ProjectExplorer::IProjectManager *GenericProject::projectManager() const
{
387
    return m_manager;
Roberto Raggi's avatar
Roberto Raggi committed
388 389 390 391 392 393 394
}

QList<ProjectExplorer::Project *> GenericProject::dependsOn()
{
    return QList<Project *>();
}

dt's avatar
dt committed
395
ProjectExplorer::BuildConfigWidget *GenericProject::createConfigWidget()
Roberto Raggi's avatar
Roberto Raggi committed
396 397 398 399
{
    return new GenericBuildSettingsWidget(this);
}

dt's avatar
dt committed
400
QList<ProjectExplorer::BuildConfigWidget*> GenericProject::subConfigWidgets()
Roberto Raggi's avatar
Roberto Raggi committed
401
{
402 403 404
    QList<ProjectExplorer::BuildConfigWidget*> list;
    list << new BuildEnvironmentWidget;
    return list;
Roberto Raggi's avatar
Roberto Raggi committed
405 406
}

407
GenericProjectNode *GenericProject::rootProjectNode() const
Roberto Raggi's avatar
Roberto Raggi committed
408
{
409
    return m_rootNode;
Roberto Raggi's avatar
Roberto Raggi committed
410 411 412 413
}

QStringList GenericProject::files(FilesMode fileMode) const
{
414
    Q_UNUSED(fileMode)
415
    return m_files; // ### TODO: handle generated files here.
Roberto Raggi's avatar
Roberto Raggi committed
416 417
}

Tobias Hunger's avatar
Tobias Hunger committed
418
QStringList GenericProject::buildTargets() const
Roberto Raggi's avatar
Roberto Raggi committed
419 420 421 422 423 424 425
{
    QStringList targets;
    targets.append(QLatin1String("all"));
    targets.append(QLatin1String("clean"));
    return targets;
}

426
QVariantMap GenericProject::toMap() const
Roberto Raggi's avatar
Roberto Raggi committed
427
{
428 429 430 431 432 433 434 435 436
    QVariantMap map(Project::toMap());
    map.insert(QLatin1String(TOOLCHAIN_KEY), static_cast<int>(m_toolChainType));
    return map;
}

bool GenericProject::fromMap(const QVariantMap &map)
{
    if (!Project::fromMap(map))
        return false;
Roberto Raggi's avatar
Roberto Raggi committed
437

438
    // Add default BC:
Tobias Hunger's avatar
Tobias Hunger committed
439 440
    if (targets().isEmpty())
        addTarget(targetFactory()->create(this, QLatin1String(GENERIC_DESKTOP_TARGET_ID)));
441

442 443 444
    ToolChain::ToolChainType type =
            static_cast<ProjectExplorer::ToolChain::ToolChainType>
            (map.value(QLatin1String(TOOLCHAIN_KEY), 0).toInt());
Roberto Raggi's avatar
Roberto Raggi committed
445

446
    setToolChainType(type);
Roberto Raggi's avatar
Roberto Raggi committed
447 448

    setIncludePaths(allIncludePaths());
449

450
    refresh(Everything);
dt's avatar
dt committed
451
    return true;
452 453
}

Roberto Raggi's avatar
Roberto Raggi committed
454 455 456
////////////////////////////////////////////////////////////////////////////////////
// GenericBuildSettingsWidget
////////////////////////////////////////////////////////////////////////////////////
457

Roberto Raggi's avatar
Roberto Raggi committed
458
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
dt's avatar
dt committed
459
    : m_project(project), m_buildConfiguration(0)
Roberto Raggi's avatar
Roberto Raggi committed
460 461
{
    QFormLayout *fl = new QFormLayout(this);
462 463
    fl->setContentsMargins(0, -1, 0, -1);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
464

465
    // Configuration name
466
    m_nameLineEdit = new QLineEdit;
467 468 469 470 471
    fl->addRow(tr("Configuration Name:"), m_nameLineEdit);

    connect(m_nameLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(configNameEdited(QString)));

472
    // build directory
473
    m_pathChooser = new Utils::PathChooser(this);
474 475
    m_pathChooser->setEnabled(true);
    fl->addRow(tr("Build directory:"), m_pathChooser);
con's avatar
con committed
476
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
477

478
    // tool chain
479
    QComboBox *toolChainChooser = new QComboBox;
480
    toolChainChooser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
481
    using namespace ProjectExplorer;
482 483
    int index = 0;
    int selectedIndex = -1;
484
    foreach (ToolChain::ToolChainType tc, ToolChain::supportedToolChains()) {
485 486 487 488
        toolChainChooser->addItem(ToolChain::toolChainName(tc), QVariant::fromValue<ToolChain::ToolChainType>(tc));
        if (m_project->toolChainType() == tc)
            selectedIndex = index;
        ++index;
489 490
    }

491
    toolChainChooser->setCurrentIndex(selectedIndex);
492
    fl->addRow(tr("Tool Chain:"), toolChainChooser);
493
    connect(toolChainChooser, SIGNAL(activated(int)), this, SLOT(toolChainSelected(int)));
Roberto Raggi's avatar
Roberto Raggi committed
494 495 496 497 498 499 500 501
}

GenericBuildSettingsWidget::~GenericBuildSettingsWidget()
{ }

QString GenericBuildSettingsWidget::displayName() const
{ return tr("Generic Manager"); }

dt's avatar
dt committed
502
void GenericBuildSettingsWidget::init(BuildConfiguration *bc)
Roberto Raggi's avatar
Roberto Raggi committed
503
{
504
    m_buildConfiguration = static_cast<GenericBuildConfiguration *>(bc);
505
    m_nameLineEdit->setText(m_buildConfiguration->displayName());
506
    m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory());
Roberto Raggi's avatar
Roberto Raggi committed
507 508
}

509
void GenericBuildSettingsWidget::configNameEdited(const QString &name)
510 511 512 513
{
    m_buildConfiguration->setDisplayName(name);
}

Roberto Raggi's avatar
Roberto Raggi committed
514 515
void GenericBuildSettingsWidget::buildDirectoryChanged()
{
516
    m_buildConfiguration->setBuildDirectory(m_pathChooser->path());
Roberto Raggi's avatar
Roberto Raggi committed
517 518
}

519 520 521 522 523 524 525 526 527
void GenericBuildSettingsWidget::toolChainSelected(int index)
{
    using namespace ProjectExplorer;

    QComboBox *toolChainChooser = qobject_cast<QComboBox*>(sender());
    ToolChain::ToolChainType type = toolChainChooser->itemData(index).value<ToolChain::ToolChainType>();
    m_project->setToolChainType(type);
}

Roberto Raggi's avatar
Roberto Raggi committed
528 529 530
////////////////////////////////////////////////////////////////////////////////////
// GenericProjectFile
////////////////////////////////////////////////////////////////////////////////////
531

Roberto Raggi's avatar
Roberto Raggi committed
532 533
GenericProjectFile::GenericProjectFile(GenericProject *parent, QString fileName)
    : Core::IFile(parent),
534 535
      m_project(parent),
      m_fileName(fileName)
Roberto Raggi's avatar
Roberto Raggi committed
536 537 538 539 540 541 542 543 544 545 546 547
{ }

GenericProjectFile::~GenericProjectFile()
{ }

bool GenericProjectFile::save(const QString &)
{
    return false;
}

QString GenericProjectFile::fileName() const
{
548
    return m_fileName;
Roberto Raggi's avatar
Roberto Raggi committed
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580
}

QString GenericProjectFile::defaultPath() const
{
    return QString();
}

QString GenericProjectFile::suggestedFileName() const
{
    return QString();
}

QString GenericProjectFile::mimeType() const
{
    return Constants::GENERICMIMETYPE;
}

bool GenericProjectFile::isModified() const
{
    return false;
}

bool GenericProjectFile::isReadOnly() const
{
    return true;
}

bool GenericProjectFile::isSaveAsAllowed() const
{
    return false;
}

581
Core::IFile::ReloadBehavior GenericProjectFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
Roberto Raggi's avatar
Roberto Raggi committed
582
{
583 584 585 586 587 588 589 590 591
    Q_UNUSED(state)
    Q_UNUSED(type)
    return BehaviorSilent;
}

void GenericProjectFile::reload(ReloadFlag flag, ChangeType type)
{
    Q_UNUSED(flag)
    Q_UNUSED(type)
Roberto Raggi's avatar
Roberto Raggi committed
592
}