forked from qt-creator/qt-creator
CMake: Fix cmake preloadCache file support
* Make it work at all again for cmake configurations without a preloadCache file * Fix the KitInformation to provide the getters/setters like all the other KitInformation do * Use those setters consistently * Remove useless conversion from QString to QByteArray and back Change-Id: I8fc43b3531da2c04034c89b29915a29c331fe064 Reviewed-by: Cristian Adam <cristian.adam@gmail.com> Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -78,8 +78,7 @@ void CMakePreloadCacheKitInformation::fix(Kit *k)
|
||||
|
||||
KitInformation::ItemList CMakePreloadCacheKitInformation::toUserOutput(const Kit *k) const
|
||||
{
|
||||
return ItemList()
|
||||
<< qMakePair(tr("CMake Preload"), k->value(id()).toString());
|
||||
return ItemList() << qMakePair(tr("CMake Preload"), k->value(id()).toString());
|
||||
}
|
||||
|
||||
KitConfigWidget *CMakePreloadCacheKitInformation::createConfigWidget(Kit *k) const
|
||||
@@ -87,4 +86,18 @@ KitConfigWidget *CMakePreloadCacheKitInformation::createConfigWidget(Kit *k) con
|
||||
return new Internal::CMakePreloadCacheKitConfigWidget(k, this);
|
||||
}
|
||||
|
||||
void CMakePreloadCacheKitInformation::setPreloadCacheFile(Kit *k, const QString &preload)
|
||||
{
|
||||
if (!k)
|
||||
return;
|
||||
k->setValue(CMakePreloadCacheKitInformation::id(), preload);
|
||||
}
|
||||
|
||||
QString CMakePreloadCacheKitInformation::preloadCacheFile(const Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return QString();
|
||||
return k->value(CMakePreloadCacheKitInformation::id()).toString();
|
||||
}
|
||||
|
||||
} // namespace CMakeProjectManager
|
||||
|
||||
Reference in New Issue
Block a user