kitmanager.cpp 16.6 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
Tobias Hunger's avatar
Tobias Hunger committed
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
Tobias Hunger's avatar
Tobias Hunger committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
Tobias Hunger's avatar
Tobias Hunger committed
7
**
hjk's avatar
hjk committed
8
9
10
11
12
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
Eike Ziller's avatar
Eike Ziller committed
13
14
** conditions see http://www.qt.io/licensing.  For further information
** use the contact form at http://www.qt.io/contact-us.
Tobias Hunger's avatar
Tobias Hunger committed
15
16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17
** Alternatively, this file may be used under the terms of the GNU Lesser
Eike Ziller's avatar
Eike Ziller committed
18
19
20
21
22
23
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file.  Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
hjk's avatar
hjk committed
24
25
26
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
Tobias Hunger's avatar
Tobias Hunger committed
27
28
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
29
****************************************************************************/
Tobias Hunger's avatar
Tobias Hunger committed
30
31
32
33

#include "kitmanager.h"

#include "kit.h"
34
#include "kitfeatureprovider.h"
Tobias Hunger's avatar
Tobias Hunger committed
35
36
#include "kitmanagerconfigwidget.h"
#include "project.h"
37
#include "task.h"
Tobias Hunger's avatar
Tobias Hunger committed
38
39
40
41
42
43

#include <coreplugin/icore.h>

#include <extensionsystem/pluginmanager.h>

#include <utils/persistentsettings.h>
44
#include <utils/qtcassert.h>
45
#include <utils/stringutils.h>
46
#include <utils/environment.h>
47
#include <utils/algorithm.h>
Tobias Hunger's avatar
Tobias Hunger committed
48
49
50

#include <QSettings>

51
52
53
using namespace Core;
using namespace Utils;
using namespace ProjectExplorer::Internal;
Tobias Hunger's avatar
Tobias Hunger committed
54

55
56
57
58
59
60
61
62
namespace ProjectExplorer {
namespace Internal {

const char KIT_DATA_KEY[] = "Profile.";
const char KIT_COUNT_KEY[] = "Profile.Count";
const char KIT_FILE_VERSION_KEY[] = "Version";
const char KIT_DEFAULT_KEY[] = "Profile.Default";
const char KIT_FILENAME[] = "/qtcreator/profiles.xml";
Tobias Hunger's avatar
Tobias Hunger committed
63

64
static FileName settingsFileName()
Tobias Hunger's avatar
Tobias Hunger committed
65
{
66
67
    QFileInfo settingsLocation(ICore::settings()->fileName());
    return FileName::fromString(settingsLocation.absolutePath() + QLatin1String(KIT_FILENAME));
Tobias Hunger's avatar
Tobias Hunger committed
68
69
70
71
72
73
74
75
76
77
78
79
}

// --------------------------------------------------------------------------
// KitManagerPrivate:
// --------------------------------------------------------------------------

class KitManagerPrivate
{
public:
    KitManagerPrivate();
    ~KitManagerPrivate();

Tobias Hunger's avatar
Tobias Hunger committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
    void insertKit(Kit *k)
    {
        // Keep list of kits sorted by displayname:
        int i =0;
        for (; i < m_kitList.count(); ++i)
            if (m_kitList.at(i)->displayName() > k->displayName())
                break;
        m_kitList.insert(i, k);
    }

    void moveKit(int pos)
    {
        if (pos < 0 || pos >= m_kitList.count())
            return;

        Kit *current = m_kitList.at(pos);
        int prev = pos - 1;
        int next = pos + 1;

        if (prev >= 0
                && m_kitList.at(prev)->displayName() > current->displayName()) {
            std::swap(m_kitList[prev], m_kitList[pos]);
            moveKit(prev);
        } else if (next < m_kitList.count()
                   && m_kitList.at(next)->displayName() < current->displayName()) {
            std::swap(m_kitList[pos], m_kitList[next]);
            moveKit(next);
        }
    }

Tobias Hunger's avatar
Tobias Hunger committed
110
111
112
113
    Kit *m_defaultKit;
    bool m_initialized;
    QList<KitInformation *> m_informationList;
    QList<Kit *> m_kitList;
114
    PersistentSettingsWriter *m_writer;
Tobias Hunger's avatar
Tobias Hunger committed
115
116
};

117
KitManagerPrivate::KitManagerPrivate() :
118
    m_defaultKit(0), m_initialized(false), m_writer(0)
Tobias Hunger's avatar
Tobias Hunger committed
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{ }

KitManagerPrivate::~KitManagerPrivate()
{
    qDeleteAll(m_informationList);
    delete m_writer;
}

} // namespace Internal

// --------------------------------------------------------------------------
// KitManager:
// --------------------------------------------------------------------------

133
134
135
static Internal::KitManagerPrivate *d;
static KitManager *m_instance;

136
KitManager *KitManager::instance()
Tobias Hunger's avatar
Tobias Hunger committed
137
138
139
140
141
{
    return m_instance;
}

KitManager::KitManager(QObject *parent) :
142
    QObject(parent)
Tobias Hunger's avatar
Tobias Hunger committed
143
{
144
    d = new KitManagerPrivate;
Tobias Hunger's avatar
Tobias Hunger committed
145
    QTC_CHECK(!m_instance);
Tobias Hunger's avatar
Tobias Hunger committed
146
147
    m_instance = this;

148
149
    connect(ICore::instance(), &ICore::saveSettingsRequested,
            this, &KitManager::saveKits);
Tobias Hunger's avatar
Tobias Hunger committed
150

151
152
153
    connect(this, &KitManager::kitAdded, this, &KitManager::kitsChanged);
    connect(this, &KitManager::kitRemoved, this, &KitManager::kitsChanged);
    connect(this, &KitManager::kitUpdated, this, &KitManager::kitsChanged);
Tobias Hunger's avatar
Tobias Hunger committed
154
155
156
157
}

void KitManager::restoreKits()
{
158
159
160
161
162
163
164
165
166
    QTC_ASSERT(!d->m_initialized, return);
    static bool initializing = false;

    if (initializing) // kits will call kits() to check their display names, which will trigger another
                      // call to restoreKits, which ...
        return;

    initializing = true;

Tobias Hunger's avatar
Tobias Hunger committed
167
    QList<Kit *> kitsToRegister;
168
    QList<Kit *> kitsToValidate;
Tobias Hunger's avatar
Tobias Hunger committed
169
170
171
    QList<Kit *> kitsToCheck;

    // read all kits from SDK
172
    QFileInfo systemSettingsFile(ICore::settings(QSettings::SystemScope)->fileName());
173
    QFileInfo kitFile(systemSettingsFile.absolutePath() + QLatin1String(KIT_FILENAME));
174
    if (kitFile.exists()) {
175
        KitList system = restoreKits(FileName(kitFile));
176
177
        // make sure we mark these as autodetected and run additional setup logic
        foreach (Kit *k, system.kits) {
178
            k->setAutoDetected(true);
Daniel Teske's avatar
Daniel Teske committed
179
            k->setSdkProvided(true);
180
            k->makeSticky();
181
182
            k->setup();
        }
183

184
185
186
        // SDK kits are always considered to be up for validation since they might have been
        // extended with additional information by creator in the meantime:
        kitsToValidate = system.kits;
187
    }
Tobias Hunger's avatar
Tobias Hunger committed
188

189
    // read all kits from user file
190
    KitList userKits;
191
    FileName userSettingsFile(settingsFileName());
192
193
    if (userSettingsFile.toFileInfo().exists())
        userKits = restoreKits(userSettingsFile);
194
    foreach (Kit *k, userKits.kits) {
Daniel Teske's avatar
Daniel Teske committed
195
        if (k->isSdkProvided())
196
            kitsToCheck.append(k);
Tobias Hunger's avatar
Tobias Hunger committed
197
        else
198
            kitsToRegister.append(k);
Tobias Hunger's avatar
Tobias Hunger committed
199
200
201
    }

    Kit *toStore = 0;
202
203
    foreach (Kit *current, kitsToValidate) {
        toStore = current;
Tobias Hunger's avatar
Tobias Hunger committed
204

205
        // Check whether we had this kit stored and prefer the stored one:
Tobias Hunger's avatar
Tobias Hunger committed
206
        for (int i = 0; i < kitsToCheck.count(); ++i) {
207
            if (kitsToCheck.at(i)->id() == current->id()) {
Tobias Hunger's avatar
Tobias Hunger committed
208
209
                toStore = kitsToCheck.at(i);
                kitsToCheck.removeAt(i);
210
211
212

                // Overwrite settings that the SDK sets to those values:
                foreach (const KitInformation *ki, kitInformation()) {
213
                    // Copy sticky settings over:
214
215
216
                    if (current->isSticky(ki->id())) {
                        toStore->setValue(ki->id(), current->value(ki->id()));
                        toStore->setSticky(ki->id(), true);
217
                    }
218
219
                }

220
                delete current;
Tobias Hunger's avatar
Tobias Hunger committed
221
222
223
224
225
226
227
                break;
            }
        }
        addKit(toStore);
    }

    // Delete all loaded autodetected kits that were not rediscovered:
228
229
230
    foreach (Kit *k, kitsToCheck)
        delete k;
    kitsToCheck.clear();
Tobias Hunger's avatar
Tobias Hunger committed
231
232

    // Store manual kits
233
234
    foreach (Kit *k, kitsToRegister)
        addKit(k);
Tobias Hunger's avatar
Tobias Hunger committed
235
236
237

    if (kits().isEmpty()) {
        Kit *defaultKit = new Kit; // One kit using default values
238
        defaultKit->setUnexpandedDisplayName(tr("Desktop"));
Daniel Teske's avatar
Daniel Teske committed
239
        defaultKit->setSdkProvided(false);
Tobias Hunger's avatar
Tobias Hunger committed
240
        defaultKit->setAutoDetected(false);
241
        defaultKit->setIconPath(FileName::fromLatin1(":///DESKTOP///"));
Tobias Hunger's avatar
Tobias Hunger committed
242

243
244
        defaultKit->setup();

Tobias Hunger's avatar
Tobias Hunger committed
245
        addKit(defaultKit);
246
        setDefaultKit(defaultKit);
Tobias Hunger's avatar
Tobias Hunger committed
247
248
    }

249
    Kit *k = find(userKits.defaultKit);
250
    if (k) {
251
        setDefaultKit(k);
252
    } else if (!defaultKit()) {
253
        k = Utils::findOr(kitsToRegister, 0, [](Kit *k) { return k->isValid(); });
254
255
256
        if (k)
            setDefaultKit(k);
    }
257

258
    d->m_writer = new PersistentSettingsWriter(settingsFileName(), QLatin1String("QtCreatorProfiles"));
259
    d->m_initialized = true;
260
    emit kitsLoaded();
Tobias Hunger's avatar
Tobias Hunger committed
261
    emit kitsChanged();
Tobias Hunger's avatar
Tobias Hunger committed
262
263
264
265
}

KitManager::~KitManager()
{
266
267
268
    foreach (Kit *k, d->m_kitList)
        delete k;
    d->m_kitList.clear();
Tobias Hunger's avatar
Tobias Hunger committed
269
270
271
272
273
274
    delete d;
    m_instance = 0;
}

void KitManager::saveKits()
{
275
    if (!d->m_writer) // ignore save requests while we are not initialized.
Tobias Hunger's avatar
Tobias Hunger committed
276
277
278
279
280
281
        return;

    QVariantMap data;
    data.insert(QLatin1String(KIT_FILE_VERSION_KEY), 1);

    int count = 0;
282
283
    foreach (Kit *k, kits()) {
        QVariantMap tmp = k->toMap();
Tobias Hunger's avatar
Tobias Hunger committed
284
285
286
287
288
289
290
291
        if (tmp.isEmpty())
            continue;
        data.insert(QString::fromLatin1(KIT_DATA_KEY) + QString::number(count), tmp);
        ++count;
    }
    data.insert(QLatin1String(KIT_COUNT_KEY), count);
    data.insert(QLatin1String(KIT_DEFAULT_KEY),
                d->m_defaultKit ? QString::fromLatin1(d->m_defaultKit->id().name()) : QString());
292
    d->m_writer->save(data, ICore::mainWindow());
Tobias Hunger's avatar
Tobias Hunger committed
293
294
}

295
296
297
298
299
static bool isLoaded()
{
    return d->m_initialized;
}

Tobias Hunger's avatar
Tobias Hunger committed
300
301
302
303
304
305
306
bool greaterPriority(KitInformation *a, KitInformation *b)
{
    return a->priority() > b->priority();
}

void KitManager::registerKitInformation(KitInformation *ki)
{
307
308
    QTC_CHECK(!isLoaded());
    QTC_ASSERT(!d->m_informationList.contains(ki), return);
309

Tobias Hunger's avatar
Tobias Hunger committed
310
    QList<KitInformation *>::iterator it
311
312
313
            = qLowerBound(d->m_informationList.begin(),
                          d->m_informationList.end(), ki, greaterPriority);
    d->m_informationList.insert(it, ki);
Tobias Hunger's avatar
Tobias Hunger committed
314

315
    if (!isLoaded())
Tobias Hunger's avatar
Tobias Hunger committed
316
317
        return;

318
    foreach (Kit *k, kits()) {
319
320
        if (!k->hasValue(ki->id()))
            k->setValue(ki->id(), ki->defaultValue(k));
321
322
        else
            ki->fix(k);
Tobias Hunger's avatar
Tobias Hunger committed
323
324
325
326
327
328
329
    }

    return;
}

void KitManager::deregisterKitInformation(KitInformation *ki)
{
330
331
    QTC_CHECK(d->m_informationList.contains(ki));
    d->m_informationList.removeOne(ki);
Tobias Hunger's avatar
Tobias Hunger committed
332
333
334
    delete ki;
}

335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
QSet<QString> KitManager::availablePlatforms()
{
    QSet<QString> platforms;
    foreach (const Kit *k, kits())
        platforms.unite(k->availablePlatforms());
    return platforms;
}

QString KitManager::displayNameForPlatform(const QString &platform)
{
    foreach (const Kit *k, kits()) {
        const QString displayName = k->displayNameForPlatform(platform);
        if (!displayName.isEmpty())
            return displayName;
    }
    return QString();
}

353
FeatureSet KitManager::availableFeatures(const QString &platform)
354
{
355
    FeatureSet features;
356
357
358
359
360
361
362
363
    foreach (const Kit *k, kits()) {
        QSet<QString> kitPlatforms = k->availablePlatforms();
        if (kitPlatforms.isEmpty() || kitPlatforms.contains(platform))
            features |= k->availableFeatures();
    }
    return features;
}

364
KitManager::KitList KitManager::restoreKits(const FileName &fileName)
Tobias Hunger's avatar
Tobias Hunger committed
365
366
367
368
{
    KitList result;

    PersistentSettingsReader reader;
369
    if (!reader.load(fileName)) {
Robert Loehning's avatar
Robert Loehning committed
370
        qWarning("Warning: Failed to read \"%s\", cannot restore kits!", qPrintable(fileName.toUserOutput()));
Tobias Hunger's avatar
Tobias Hunger committed
371
        return result;
372
    }
Tobias Hunger's avatar
Tobias Hunger committed
373
374
375
376
    QVariantMap data = reader.restoreValues();

    // Check version:
    int version = data.value(QLatin1String(KIT_FILE_VERSION_KEY), 0).toInt();
377
    if (version < 1) {
Robert Loehning's avatar
Robert Loehning committed
378
        qWarning("Warning: Kit file version %d not supported, cannot restore kits!", version);
Tobias Hunger's avatar
Tobias Hunger committed
379
        return result;
380
    }
Tobias Hunger's avatar
Tobias Hunger committed
381
382
383
384
385
386
387
388
389

    const int count = data.value(QLatin1String(KIT_COUNT_KEY), 0).toInt();
    for (int i = 0; i < count; ++i) {
        const QString key = QString::fromLatin1(KIT_DATA_KEY) + QString::number(i);
        if (!data.contains(key))
            break;

        const QVariantMap stMap = data.value(key).toMap();

390
391
        Kit *k = new Kit(stMap);
        if (k->id().isValid()) {
392
            result.kits.append(k);
Tobias Hunger's avatar
Tobias Hunger committed
393
        } else {
394
            // If the Id is broken, then do not trust the rest of the data either.
395
            delete k;
Tobias Hunger's avatar
Tobias Hunger committed
396
397
398
399
            qWarning("Warning: Unable to restore kits stored in %s at position %d.",
                     qPrintable(fileName.toUserOutput()), i);
        }
    }
400
    const Id id = Id::fromSetting(data.value(QLatin1String(KIT_DEFAULT_KEY)));
401
    if (!id.isValid())
Tobias Hunger's avatar
Tobias Hunger committed
402
403
        return result;

404
405
    foreach (Kit *k, result.kits) {
        if (k->id() == id) {
Tobias Hunger's avatar
Tobias Hunger committed
406
407
408
409
410
411
412
            result.defaultKit = id;
            break;
        }
    }
    return result;
}

413
414
415
416
417
418
QList<Kit *> KitManager::kits()
{
    return d->m_kitList;
}

QList<Kit *> KitManager::matchingKits(const KitMatcher &matcher)
Tobias Hunger's avatar
Tobias Hunger committed
419
420
{
    QList<Kit *> result;
421
422
    foreach (Kit *k, d->m_kitList)
        if (matcher.matches(k))
423
            result.append(k);
Tobias Hunger's avatar
Tobias Hunger committed
424
425
426
    return result;
}

427
Kit *KitManager::find(Id id)
Tobias Hunger's avatar
Tobias Hunger committed
428
429
430
431
{
    if (!id.isValid())
        return 0;

432
    return Utils::findOrDefault(kits(), Utils::equal(&Kit::id, id));
Tobias Hunger's avatar
Tobias Hunger committed
433
434
}

435
Kit *KitManager::find(const KitMatcher &matcher)
Tobias Hunger's avatar
Tobias Hunger committed
436
{
437
438
439
    return Utils::findOrDefault(d->m_kitList, [&matcher](Kit *k) {
        return matcher.matches(k);
    });
Tobias Hunger's avatar
Tobias Hunger committed
440
441
}

442
Kit *KitManager::defaultKit()
Tobias Hunger's avatar
Tobias Hunger committed
443
{
444
    return d->m_defaultKit;
Tobias Hunger's avatar
Tobias Hunger committed
445
446
}

447
QList<KitInformation *> KitManager::kitInformation()
Tobias Hunger's avatar
Tobias Hunger committed
448
{
449
    return d->m_informationList;
Tobias Hunger's avatar
Tobias Hunger committed
450
451
}

452
KitManagerConfigWidget *KitManager::createConfigWidget(Kit *k)
Tobias Hunger's avatar
Tobias Hunger committed
453
{
454
    KitManagerConfigWidget *result = new KitManagerConfigWidget(k);
455
    foreach (KitInformation *ki, kitInformation())
Tobias Hunger's avatar
Tobias Hunger committed
456
        result->addConfigWidget(ki->createConfigWidget(result->workingCopy()));
Tobias Hunger's avatar
Tobias Hunger committed
457

458
459
    result->updateVisibility();

Tobias Hunger's avatar
Tobias Hunger committed
460
461
462
    return result;
}

463
464
void KitManager::deleteKit(Kit *k)
{
465
    QTC_ASSERT(!KitManager::kits().contains(k), return);
466
467
468
    delete k;
}

469
void KitManager::notifyAboutUpdate(Kit *k)
470
{
471
    if (!k || !isLoaded())
472
473
        return;

474
    if (d->m_kitList.contains(k))
475
        emit m_instance->kitUpdated(k);
476
    else
477
        emit m_instance->unmanagedKitUpdated(k);
Tobias Hunger's avatar
Tobias Hunger committed
478
479
}

480
bool KitManager::registerKit(Kit *k)
Tobias Hunger's avatar
Tobias Hunger committed
481
{
482
    QTC_ASSERT(isLoaded(), return false);
483

Tobias Hunger's avatar
Tobias Hunger committed
484
485
    if (!k)
        return true;
486
487
488

    QTC_ASSERT(k->id().isValid(), return false);

489
490
    if (kits().contains(k))
        return false;
Tobias Hunger's avatar
Tobias Hunger committed
491
492

    // make sure we have all the information in our kits:
493
    m_instance->addKit(k);
494
495
496
497
498

    if (!d->m_defaultKit ||
            (!d->m_defaultKit->isValid() && k->isValid()))
        setDefaultKit(k);

499
    emit m_instance->kitAdded(k);
Tobias Hunger's avatar
Tobias Hunger committed
500
501
502
503
504
505
506
    return true;
}

void KitManager::deregisterKit(Kit *k)
{
    if (!k || !kits().contains(k))
        return;
507
    d->m_kitList.removeOne(k);
508
    if (defaultKit() == k) {
Tobias Hunger's avatar
Tobias Hunger committed
509
510
511
512
513
514
515
516
517
518
        QList<Kit *> stList = kits();
        Kit *newDefault = 0;
        foreach (Kit *cur, stList) {
            if (cur->isValid()) {
                newDefault = cur;
                break;
            }
        }
        setDefaultKit(newDefault);
    }
519
    emit m_instance->kitRemoved(k);
Tobias Hunger's avatar
Tobias Hunger committed
520
521
522
523
524
    delete k;
}

void KitManager::setDefaultKit(Kit *k)
{
525
    if (defaultKit() == k)
Tobias Hunger's avatar
Tobias Hunger committed
526
527
528
        return;
    if (k && !kits().contains(k))
        return;
529
    d->m_defaultKit = k;
530
    emit m_instance->defaultkitChanged();
Tobias Hunger's avatar
Tobias Hunger committed
531
532
533
534
535
536
}

void KitManager::addKit(Kit *k)
{
    if (!k)
        return;
537

Aurindam Jana's avatar
Aurindam Jana committed
538
539
540
    {
        KitGuard g(k);
        foreach (KitInformation *ki, d->m_informationList) {
541
542
            if (!k->hasValue(ki->id()))
                k->setValue(ki->id(), ki->defaultValue(k));
Aurindam Jana's avatar
Aurindam Jana committed
543
544
545
            else
                ki->fix(k);
        }
546
547
    }

Tobias Hunger's avatar
Tobias Hunger committed
548
    d->insertKit(k);
Tobias Hunger's avatar
Tobias Hunger committed
549
550
}

551
void KitInformation::addToEnvironment(const Kit *k, Environment &env) const
Tobias Hunger's avatar
Tobias Hunger committed
552
553
554
555
556
{
    Q_UNUSED(k);
    Q_UNUSED(env);
}

557
558
559
560
561
562
IOutputParser *KitInformation::createOutputParser(const Kit *k) const
{
    Q_UNUSED(k);
    return 0;
}

Tobias Hunger's avatar
Tobias Hunger committed
563
564
565
566
567
568
QString KitInformation::displayNamePostfix(const Kit *k) const
{
    Q_UNUSED(k);
    return QString();
}

569
570
571
572
573
574
575
576
577
578
579
580
581
QSet<QString> KitInformation::availablePlatforms(const Kit *k) const
{
    Q_UNUSED(k);
    return QSet<QString>();
}

QString KitInformation::displayNameForPlatform(const Kit *k, const QString &platform) const
{
    Q_UNUSED(k);
    Q_UNUSED(platform);
    return QString();
}

582
FeatureSet KitInformation::availableFeatures(const Kit *k) const
583
584
{
    Q_UNUSED(k);
585
    return FeatureSet();
586
587
}

588
589
590
591
592
593
594
595
bool KitInformation::resolveMacro(const Kit *kit, const QString &name, QString *ret) const
{
    Q_UNUSED(kit);
    Q_UNUSED(name);
    Q_UNUSED(ret);
    return false;
}

596
597
void KitInformation::notifyAboutUpdate(Kit *k)
{
598
599
    if (k)
        k->kitUpdated();
600
601
}

602
603
604
605
// --------------------------------------------------------------------
// KitFeatureProvider:
// --------------------------------------------------------------------

606
FeatureSet KitFeatureProvider::availableFeatures(const QString &platform) const
607
608
609
610
{
    return KitManager::availableFeatures(platform);
}

611
QStringList KitFeatureProvider::availablePlatforms() const
612
613
614
615
{
    return KitManager::availablePlatforms().toList();
}

616
QString KitFeatureProvider::displayNameForPlatform(const QString &string) const
617
618
619
620
{
    return KitManager::displayNameForPlatform(string);
}

Tobias Hunger's avatar
Tobias Hunger committed
621
} // namespace ProjectExplorer