target.cpp 17.4 KB
Newer Older
Tobias Hunger's avatar
Tobias Hunger committed
1
2
3
4
/**************************************************************************
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
Tobias Hunger's avatar
Tobias Hunger committed
6
**
hjk's avatar
hjk committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
Tobias Hunger's avatar
Tobias Hunger committed
8
9
10
11
**
**
** GNU Lesser General Public License Usage
**
hjk's avatar
hjk committed
12
13
14
15
16
17
** 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.
Tobias Hunger's avatar
Tobias Hunger committed
18
**
con's avatar
con committed
19
** In addition, as a special exception, Nokia gives you certain additional
hjk's avatar
hjk committed
20
** rights. These rights are described in the Nokia Qt LGPL Exception
con's avatar
con committed
21
22
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
23
24
25
26
27
** 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.
**
con's avatar
con committed
28
29
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
Tobias Hunger's avatar
Tobias Hunger committed
30
31
32
33
34
35
**
**************************************************************************/

#include "target.h"

#include "buildconfiguration.h"
Tobias Hunger's avatar
Tobias Hunger committed
36
#include "deployconfiguration.h"
Tobias Hunger's avatar
Tobias Hunger committed
37
#include "project.h"
38
#include "projectexplorerconstants.h"
Tobias Hunger's avatar
Tobias Hunger committed
39
#include "runconfiguration.h"
40
#include "toolchainmanager.h"
Tobias Hunger's avatar
Tobias Hunger committed
41

42
#include <limits>
43
#include <extensionsystem/pluginmanager.h>
Tobias Hunger's avatar
Tobias Hunger committed
44
45
#include <utils/qtcassert.h>

46
#include <QtGui/QIcon>
Tobias Hunger's avatar
Tobias Hunger committed
47
48
49
50
51
52

namespace {
const char * const ACTIVE_BC_KEY("ProjectExplorer.Target.ActiveBuildConfiguration");
const char * const BC_KEY_PREFIX("ProjectExplorer.Target.BuildConfiguration.");
const char * const BC_COUNT_KEY("ProjectExplorer.Target.BuildConfigurationCount");

Tobias Hunger's avatar
Tobias Hunger committed
53
54
55
56
const char * const ACTIVE_DC_KEY("ProjectExplorer.Target.ActiveDeployConfiguration");
const char * const DC_KEY_PREFIX("ProjectExplorer.Target.DeployConfiguration.");
const char * const DC_COUNT_KEY("ProjectExplorer.Target.DeployConfigurationCount");

Tobias Hunger's avatar
Tobias Hunger committed
57
58
59
60
61
62
63
64
65
66
const char * const ACTIVE_RC_KEY("ProjectExplorer.Target.ActiveRunConfiguration");
const char * const RC_KEY_PREFIX("ProjectExplorer.Target.RunConfiguration.");
const char * const RC_COUNT_KEY("ProjectExplorer.Target.RunConfigurationCount");

} // namespace

// -------------------------------------------------------------------------
// Target
// -------------------------------------------------------------------------

67
68
69
70
71
namespace ProjectExplorer {

class TargetPrivate {
public:
    TargetPrivate();
72
73
74

    QList<DeployConfigurationFactory *> deployFactories() const;

75
76
77
78
79
80
81
82
83
84
85
86
87
88
    bool m_isEnabled;
    QIcon m_icon;
    QIcon m_overlayIcon;
    QString m_toolTip;

    QList<BuildConfiguration *> m_buildConfigurations;
    BuildConfiguration *m_activeBuildConfiguration;
    QList<DeployConfiguration *> m_deployConfigurations;
    DeployConfiguration *m_activeDeployConfiguration;
    QList<RunConfiguration *> m_runConfigurations;
    RunConfiguration* m_activeRunConfiguration;
};

TargetPrivate::TargetPrivate() :
Tobias Hunger's avatar
Tobias Hunger committed
89
90
    m_isEnabled(true),
    m_activeBuildConfiguration(0),
Tobias Hunger's avatar
Tobias Hunger committed
91
    m_activeDeployConfiguration(0),
Tobias Hunger's avatar
Tobias Hunger committed
92
93
94
95
    m_activeRunConfiguration(0)
{
}

96
97
98
99
100
QList<DeployConfigurationFactory *> TargetPrivate::deployFactories() const
{
    return ExtensionSystem::PluginManager::instance()->getObjects<DeployConfigurationFactory>();
}

101
102
103
104
105
106

Target::Target(Project *project, const QString &id) :
    ProjectConfiguration(project, id), d(new TargetPrivate)
{
}

Tobias Hunger's avatar
Tobias Hunger committed
107
108
Target::~Target()
{
109
110
    qDeleteAll(d->m_buildConfigurations);
    qDeleteAll(d->m_runConfigurations);
Tobias Hunger's avatar
Tobias Hunger committed
111
112
113
114
115
116
117
118
119
}

void Target::changeEnvironment()
{
    ProjectExplorer::BuildConfiguration *bc(qobject_cast<ProjectExplorer::BuildConfiguration *>(sender()));
    if (bc == activeBuildConfiguration())
        emit environmentChanged();
}

120
121
122
123
124
125
126
void Target::changeBuildConfigurationEnabled()
{
    ProjectExplorer::BuildConfiguration *bc = qobject_cast<ProjectExplorer::BuildConfiguration *>(sender());
    if (bc == activeBuildConfiguration())
        emit buildConfigurationEnabledChanged();
}

Tobias Hunger's avatar
Tobias Hunger committed
127
128
Project *Target::project() const
{
Tobias Hunger's avatar
Tobias Hunger committed
129
    return static_cast<Project *>(parent());
Tobias Hunger's avatar
Tobias Hunger committed
130
131
132
133
}

void Target::addBuildConfiguration(BuildConfiguration *configuration)
{
134
    QTC_ASSERT(configuration && !d->m_buildConfigurations.contains(configuration), return);
Tobias Hunger's avatar
Tobias Hunger committed
135
136
137
138
139
140
141
142
    Q_ASSERT(configuration->target() == this);

    if (!buildConfigurationFactory())
        return;

    // Check that we don't have a configuration with the same displayName
    QString configurationDisplayName = configuration->displayName();
    QStringList displayNames;
143
    foreach (const BuildConfiguration *bc, d->m_buildConfigurations)
Tobias Hunger's avatar
Tobias Hunger committed
144
145
146
147
        displayNames << bc->displayName();
    configurationDisplayName = Project::makeUnique(configurationDisplayName, displayNames);
    configuration->setDisplayName(configurationDisplayName);

148
149
150
151
152
    // Make sure we have a sane tool chain if at all possible
    if (!configuration->toolChain()
            || !possibleToolChains(configuration).contains(configuration->toolChain()))
        configuration->setToolChain(preferredToolChain(configuration));

Tobias Hunger's avatar
Tobias Hunger committed
153
    // add it
154
    d->m_buildConfigurations.push_back(configuration);
Tobias Hunger's avatar
Tobias Hunger committed
155
156
157
158
159
160

    emit addedBuildConfiguration(configuration);

    connect(configuration, SIGNAL(environmentChanged()),
            SLOT(changeEnvironment()));

161
162
163
    connect(configuration, SIGNAL(enabledChanged()),
            this, SLOT(changeBuildConfigurationEnabled()));

Tobias Hunger's avatar
Tobias Hunger committed
164
165
166
167
168
169
170
    if (!activeBuildConfiguration())
        setActiveBuildConfiguration(configuration);
}

void Target::removeBuildConfiguration(BuildConfiguration *configuration)
{
    //todo: this might be error prone
171
    if (!d->m_buildConfigurations.contains(configuration))
Tobias Hunger's avatar
Tobias Hunger committed
172
173
        return;

174
    d->m_buildConfigurations.removeOne(configuration);
Tobias Hunger's avatar
Tobias Hunger committed
175
176
177
178

    emit removedBuildConfiguration(configuration);

    if (activeBuildConfiguration() == configuration) {
179
        if (d->m_buildConfigurations.isEmpty())
Tobias Hunger's avatar
Tobias Hunger committed
180
181
            setActiveBuildConfiguration(0);
        else
182
            setActiveBuildConfiguration(d->m_buildConfigurations.at(0));
Tobias Hunger's avatar
Tobias Hunger committed
183
184
185
186
187
188
189
    }

    delete configuration;
}

QList<BuildConfiguration *> Target::buildConfigurations() const
{
190
    return d->m_buildConfigurations;
Tobias Hunger's avatar
Tobias Hunger committed
191
192
193
194
}

BuildConfiguration *Target::activeBuildConfiguration() const
{
195
    return d->m_activeBuildConfiguration;
Tobias Hunger's avatar
Tobias Hunger committed
196
197
198
199
}

void Target::setActiveBuildConfiguration(BuildConfiguration *configuration)
{
200
201
202
203
204
    if ((!configuration && d->m_buildConfigurations.isEmpty()) ||
        (configuration && d->m_buildConfigurations.contains(configuration) &&
         configuration != d->m_activeBuildConfiguration)) {
        d->m_activeBuildConfiguration = configuration;
        emit activeBuildConfigurationChanged(d->m_activeBuildConfiguration);
Tobias Hunger's avatar
Tobias Hunger committed
205
        emit environmentChanged();
206
        emit buildConfigurationEnabledChanged();
Tobias Hunger's avatar
Tobias Hunger committed
207
208
209
    }
}

Tobias Hunger's avatar
Tobias Hunger committed
210
211
void Target::addDeployConfiguration(DeployConfiguration *dc)
{
212
    QTC_ASSERT(dc && !d->m_deployConfigurations.contains(dc), return);
Tobias Hunger's avatar
Tobias Hunger committed
213
214
    Q_ASSERT(dc->target() == this);

215
    if (d->deployFactories().isEmpty())
Tobias Hunger's avatar
Tobias Hunger committed
216
217
218
219
220
        return;

    // Check that we don't have a configuration with the same displayName
    QString configurationDisplayName = dc->displayName();
    QStringList displayNames;
221
    foreach (const DeployConfiguration *current, d->m_deployConfigurations)
222
        displayNames << current->displayName();
Tobias Hunger's avatar
Tobias Hunger committed
223
224
225
226
    configurationDisplayName = Project::makeUnique(configurationDisplayName, displayNames);
    dc->setDisplayName(configurationDisplayName);

    // add it
227
    d->m_deployConfigurations.push_back(dc);
Tobias Hunger's avatar
Tobias Hunger committed
228
229
230

    emit addedDeployConfiguration(dc);

231
    if (!d->m_activeDeployConfiguration)
Tobias Hunger's avatar
Tobias Hunger committed
232
233
234
235
236
237
238
        setActiveDeployConfiguration(dc);
    Q_ASSERT(activeDeployConfiguration());
}

void Target::removeDeployConfiguration(DeployConfiguration *dc)
{
    //todo: this might be error prone
239
    if (!d->m_deployConfigurations.contains(dc))
Tobias Hunger's avatar
Tobias Hunger committed
240
241
        return;

242
    d->m_deployConfigurations.removeOne(dc);
Tobias Hunger's avatar
Tobias Hunger committed
243
244
245
246

    emit removedDeployConfiguration(dc);

    if (activeDeployConfiguration() == dc) {
247
        if (d->m_deployConfigurations.isEmpty())
Tobias Hunger's avatar
Tobias Hunger committed
248
249
            setActiveDeployConfiguration(0);
        else
250
            setActiveDeployConfiguration(d->m_deployConfigurations.at(0));
Tobias Hunger's avatar
Tobias Hunger committed
251
252
253
254
255
256
257
    }

    delete dc;
}

QList<DeployConfiguration *> Target::deployConfigurations() const
{
258
    return d->m_deployConfigurations;
Tobias Hunger's avatar
Tobias Hunger committed
259
260
261
262
}

DeployConfiguration *Target::activeDeployConfiguration() const
{
263
    return d->m_activeDeployConfiguration;
Tobias Hunger's avatar
Tobias Hunger committed
264
265
266
267
}

void Target::setActiveDeployConfiguration(DeployConfiguration *dc)
{
268
269
270
271
272
    if ((!dc && d->m_deployConfigurations.isEmpty()) ||
        (dc && d->m_deployConfigurations.contains(dc) &&
         dc != d->m_activeDeployConfiguration)) {
        d->m_activeDeployConfiguration = dc;
        emit activeDeployConfigurationChanged(d->m_activeDeployConfiguration);
Tobias Hunger's avatar
Tobias Hunger committed
273
274
275
    }
}

276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
QStringList Target::availableDeployConfigurationIds()
{
    QStringList ids;
    foreach (const DeployConfigurationFactory * const factory, d->deployFactories())
        ids << factory->availableCreationIds(this);
    return ids;
}

QString Target::displayNameForDeployConfigurationId(const QString &id)
{
    foreach (const DeployConfigurationFactory * const factory, d->deployFactories()) {
        if (factory->availableCreationIds(this).contains(id))
            return factory->displayNameForId(id);
    }
    return QString();
}

DeployConfiguration *Target::createDeployConfiguration(const QString &id)
{
    foreach (DeployConfigurationFactory * const factory, d->deployFactories()) {
        if (factory->canCreate(this, id))
            return factory->create(this, id);
    }
    return 0;
}

Tobias Hunger's avatar
Tobias Hunger committed
302
303
QList<RunConfiguration *> Target::runConfigurations() const
{
304
    return d->m_runConfigurations;
Tobias Hunger's avatar
Tobias Hunger committed
305
306
307
308
}

void Target::addRunConfiguration(RunConfiguration* runConfiguration)
{
309
    QTC_ASSERT(runConfiguration && !d->m_runConfigurations.contains(runConfiguration), return);
Tobias Hunger's avatar
Tobias Hunger committed
310
311
    Q_ASSERT(runConfiguration->target() == this);

312
313
314
    // Check that we don't have a configuration with the same displayName
    QString configurationDisplayName = runConfiguration->displayName();
    QStringList displayNames;
315
    foreach (const RunConfiguration *rc, d->m_runConfigurations)
316
317
318
319
        displayNames << rc->displayName();
    configurationDisplayName = Project::makeUnique(configurationDisplayName, displayNames);
    runConfiguration->setDisplayName(configurationDisplayName);

320
    d->m_runConfigurations.push_back(runConfiguration);
Tobias Hunger's avatar
Tobias Hunger committed
321
322
323
324
325
326
327
328
    emit addedRunConfiguration(runConfiguration);

    if (!activeRunConfiguration())
        setActiveRunConfiguration(runConfiguration);
}

void Target::removeRunConfiguration(RunConfiguration* runConfiguration)
{
329
    QTC_ASSERT(runConfiguration && d->m_runConfigurations.contains(runConfiguration), return);
Tobias Hunger's avatar
Tobias Hunger committed
330

331
    d->m_runConfigurations.removeOne(runConfiguration);
Tobias Hunger's avatar
Tobias Hunger committed
332
333

    if (activeRunConfiguration() == runConfiguration) {
334
        if (d->m_runConfigurations.isEmpty())
Tobias Hunger's avatar
Tobias Hunger committed
335
336
            setActiveRunConfiguration(0);
        else
337
            setActiveRunConfiguration(d->m_runConfigurations.at(0));
Tobias Hunger's avatar
Tobias Hunger committed
338
339
340
341
342
343
344
345
    }

    emit removedRunConfiguration(runConfiguration);
    delete runConfiguration;
}

RunConfiguration* Target::activeRunConfiguration() const
{
346
    return d->m_activeRunConfiguration;
Tobias Hunger's avatar
Tobias Hunger committed
347
348
349
350
}

void Target::setActiveRunConfiguration(RunConfiguration* configuration)
{
351
352
353
354
355
    if ((!configuration && d->m_runConfigurations.isEmpty()) ||
        (configuration && d->m_runConfigurations.contains(configuration) &&
         configuration != d->m_activeRunConfiguration)) {
        d->m_activeRunConfiguration = configuration;
        emit activeRunConfigurationChanged(d->m_activeRunConfiguration);
Tobias Hunger's avatar
Tobias Hunger committed
356
357
358
359
360
    }
}

bool Target::isEnabled() const
{
361
    return d->m_isEnabled;
Tobias Hunger's avatar
Tobias Hunger committed
362
363
364
365
}

QIcon Target::icon() const
{
366
    return d->m_icon;
Tobias Hunger's avatar
Tobias Hunger committed
367
368
369
370
}

void Target::setIcon(QIcon icon)
{
371
    d->m_icon = icon;
Tobias Hunger's avatar
Tobias Hunger committed
372
373
374
    emit iconChanged();
}

375
376
QIcon Target::overlayIcon() const
{
377
    return d->m_overlayIcon;
378
379
380
381
}

void Target::setOverlayIcon(QIcon icon)
{
382
    d->m_overlayIcon = icon;
383
384
385
    emit overlayIconChanged();
}

con's avatar
con committed
386
387
QString Target::toolTip() const
{
388
    return d->m_toolTip;
con's avatar
con committed
389
390
391
392
}

void Target::setToolTip(const QString &text)
{
393
    d->m_toolTip = text;
con's avatar
con committed
394
395
396
    emit toolTipChanged();
}

397
398
399
400
401
QList<ToolChain *> Target::possibleToolChains(BuildConfiguration *) const
{
    QList<ToolChain *> tcList = ToolChainManager::instance()->toolChains();
    QList<ToolChain *> result;
    foreach (ToolChain *tc, tcList) {
402
403
        QStringList restricted = tc->restrictedToTargets();
        if (restricted.isEmpty() || restricted.contains(id()))
404
405
406
407
408
409
410
411
412
413
414
415
416
            result.append(tc);
    }
    return result;
}

ToolChain *Target::preferredToolChain(BuildConfiguration *bc) const
{
    QList<ToolChain *> tcs = possibleToolChains(bc);
    if (tcs.isEmpty())
        return 0;
    return tcs.at(0);
}

Tobias Hunger's avatar
Tobias Hunger committed
417
418
419
420
421
QVariantMap Target::toMap() const
{
    const QList<BuildConfiguration *> bcs = buildConfigurations();

    QVariantMap map(ProjectConfiguration::toMap());
422
    map.insert(QLatin1String(ACTIVE_BC_KEY), bcs.indexOf(d->m_activeBuildConfiguration));
Tobias Hunger's avatar
Tobias Hunger committed
423
424
425
426
    map.insert(QLatin1String(BC_COUNT_KEY), bcs.size());
    for (int i = 0; i < bcs.size(); ++i)
        map.insert(QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i), bcs.at(i)->toMap());

Tobias Hunger's avatar
Tobias Hunger committed
427
    const QList<DeployConfiguration *> dcs = deployConfigurations();
428
    map.insert(QLatin1String(ACTIVE_DC_KEY), dcs.indexOf(d->m_activeDeployConfiguration));
Tobias Hunger's avatar
Tobias Hunger committed
429
430
431
432
    map.insert(QLatin1String(DC_COUNT_KEY), dcs.size());
    for (int i = 0; i < dcs.size(); ++i)
        map.insert(QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i), dcs.at(i)->toMap());

Tobias Hunger's avatar
Tobias Hunger committed
433
    const QList<RunConfiguration *> rcs = runConfigurations();
434
    map.insert(QLatin1String(ACTIVE_RC_KEY), rcs.indexOf(d->m_activeRunConfiguration));
Tobias Hunger's avatar
Tobias Hunger committed
435
436
437
438
439
440
441
442
443
    map.insert(QLatin1String(RC_COUNT_KEY), rcs.size());
    for (int i = 0; i < rcs.size(); ++i)
        map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), rcs.at(i)->toMap());

    return map;
}

void Target::setEnabled(bool enabled)
{
444
    if (enabled == d->m_isEnabled)
Tobias Hunger's avatar
Tobias Hunger committed
445
446
        return;

447
448
    d->m_isEnabled = enabled;
    emit targetEnabled(d->m_isEnabled);
Tobias Hunger's avatar
Tobias Hunger committed
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
}

bool Target::fromMap(const QVariantMap &map)
{
    if (!ProjectConfiguration::fromMap(map))
        return false;

    bool ok;
    int bcCount(map.value(QLatin1String(BC_COUNT_KEY), 0).toInt(&ok));
    if (!ok || bcCount < 0)
        bcCount = 0;
    int activeConfiguration(map.value(QLatin1String(ACTIVE_BC_KEY), 0).toInt(&ok));
    if (!ok || activeConfiguration < 0)
        activeConfiguration = 0;
    if (0 > activeConfiguration || bcCount < activeConfiguration)
        activeConfiguration = 0;

    for (int i = 0; i < bcCount; ++i) {
        const QString key(QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i));
        if (!map.contains(key))
            return false;
470
        BuildConfiguration *bc(buildConfigurationFactory()->restore(this, map.value(key).toMap()));
Tobias Hunger's avatar
Tobias Hunger committed
471
472
473
474
475
476
        if (!bc)
            continue;
        addBuildConfiguration(bc);
        if (i == activeConfiguration)
            setActiveBuildConfiguration(bc);
    }
477
    if (buildConfigurations().isEmpty() && buildConfigurationFactory())
Tobias Hunger's avatar
Tobias Hunger committed
478
479
        return false;

Tobias Hunger's avatar
Tobias Hunger committed
480
481
482
483
484
485
486
487
488
489
490
491
492
    int dcCount(map.value(QLatin1String(DC_COUNT_KEY), 0).toInt(&ok));
    if (!ok || dcCount < 0)
        dcCount = 0;
    activeConfiguration = map.value(QLatin1String(ACTIVE_DC_KEY), 0).toInt(&ok);
    if (!ok || activeConfiguration < 0)
        activeConfiguration = 0;
    if (0 > activeConfiguration || dcCount < activeConfiguration)
        activeConfiguration = 0;

    for (int i = 0; i < dcCount; ++i) {
        const QString key(QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i));
        if (!map.contains(key))
            return false;
493
        DeployConfiguration *dc = 0;
494
495
496
497
498
499
500
        foreach (DeployConfigurationFactory * const factory, d->deployFactories()) {
            QVariantMap valueMap = map.value(key).toMap();
            if (factory->canRestore(this, valueMap)) {
                dc = factory->restore(this, valueMap);
                break;
            }
        }
Tobias Hunger's avatar
Tobias Hunger committed
501
502
503
504
505
506
        if (!dc)
            continue;
        addDeployConfiguration(dc);
        if (i == activeConfiguration)
            setActiveDeployConfiguration(dc);
    }
507
    if (deployConfigurations().isEmpty() && d->deployFactories().isEmpty())
Tobias Hunger's avatar
Tobias Hunger committed
508
509
        return false;

Tobias Hunger's avatar
Tobias Hunger committed
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
    int rcCount(map.value(QLatin1String(RC_COUNT_KEY), 0).toInt(&ok));
    if (!ok || rcCount < 0)
        rcCount = 0;
    activeConfiguration = map.value(QLatin1String(ACTIVE_RC_KEY), 0).toInt(&ok);
    if (!ok || activeConfiguration < 0)
        activeConfiguration = 0;
    if (0 > activeConfiguration || rcCount < activeConfiguration)
        activeConfiguration = 0;

    for (int i = 0; i < rcCount; ++i) {
        const QString key(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i));
        if (!map.contains(key))
            return false;

        QVariantMap valueMap(map.value(key).toMap());
        IRunConfigurationFactory *factory(IRunConfigurationFactory::restoreFactory(this, valueMap));
        if (!factory)
            continue; // Skip RCs we do not know about.)

        RunConfiguration *rc(factory->restore(this, valueMap));
        if (!rc)
            continue;
        addRunConfiguration(rc);
        if (i == activeConfiguration)
            setActiveRunConfiguration(rc);
    }
Tobias Hunger's avatar
Tobias Hunger committed
536
    // Ignore missing RCs: We will just populate them using the default ones.
Tobias Hunger's avatar
Tobias Hunger committed
537
538
539
540
541
542
543
544
545
546
547

    return true;
}


// -------------------------------------------------------------------------
// ITargetFactory
// -------------------------------------------------------------------------

ITargetFactory::ITargetFactory(QObject *parent) :
    QObject(parent)
Tobias Hunger's avatar
Tobias Hunger committed
548
{ }
Tobias Hunger's avatar
Tobias Hunger committed
549
550

ITargetFactory::~ITargetFactory()
Tobias Hunger's avatar
Tobias Hunger committed
551
{ }
552
553

} // namespace ProjectExplorer