forked from qt-creator/qt-creator
CMake: Remove "Prefer Ninja" checkbox on CMake Tool page
This is no longer needed now that the generator is a property of the Kit. Change-Id: Ife35fd9207c805a4ead1e067603df1bfc77e6855 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -126,11 +126,6 @@ QString CMakeManager::mimeType() const
|
||||
return QLatin1String(Constants::CMAKEPROJECTMIMETYPE);
|
||||
}
|
||||
|
||||
bool CMakeManager::preferNinja()
|
||||
{
|
||||
return CMakeToolManager::preferNinja();
|
||||
}
|
||||
|
||||
// need to refactor this out
|
||||
// we probably want the process instead of this function
|
||||
// cmakeproject then could even run the cmake process in the background, adding the files afterwards
|
||||
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
static void createXmlFile(Utils::QtcProcess *process, const QString &executable,
|
||||
const QString &arguments, const QString &sourceDirectory,
|
||||
const QDir &buildDirectory, const Utils::Environment &env);
|
||||
static bool preferNinja();
|
||||
static QString findCbpFile(const QDir &);
|
||||
|
||||
private:
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include <QTreeView>
|
||||
#include <QWidget>
|
||||
#include <QUuid>
|
||||
#include <QCheckBox>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -390,9 +389,6 @@ public:
|
||||
m_makeDefButton->setEnabled(false);
|
||||
m_makeDefButton->setToolTip(tr("Set as the default CMake Tool to use when creating a new kit or when no value is set."));
|
||||
|
||||
m_preferNinjaCheckBox = new QCheckBox(tr("Prefer Ninja generator (CMake 2.8.9 or higher required)"));
|
||||
m_preferNinjaCheckBox->setChecked(CMakeToolManager::preferNinja());
|
||||
|
||||
m_container = new DetailsWidget(this);
|
||||
m_container->setState(DetailsWidget::NoSummary);
|
||||
m_container->setVisible(false);
|
||||
@@ -421,7 +417,6 @@ public:
|
||||
QVBoxLayout *verticalLayout = new QVBoxLayout();
|
||||
verticalLayout->addWidget(m_cmakeToolsView);
|
||||
verticalLayout->addWidget(m_container);
|
||||
verticalLayout->addWidget(m_preferNinjaCheckBox);
|
||||
|
||||
QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
|
||||
horizontalLayout->addLayout(verticalLayout);
|
||||
@@ -456,7 +451,6 @@ public:
|
||||
QPushButton *m_cloneButton;
|
||||
QPushButton *m_delButton;
|
||||
QPushButton *m_makeDefButton;
|
||||
QCheckBox *m_preferNinjaCheckBox;
|
||||
DetailsWidget *m_container;
|
||||
CMakeToolItemConfigWidget *m_itemConfigWidget;
|
||||
CMakeToolTreeItem *m_currentItem;
|
||||
@@ -465,7 +459,6 @@ public:
|
||||
void CMakeToolConfigWidget::apply()
|
||||
{
|
||||
m_model.apply();
|
||||
CMakeToolManager::setPreferNinja(m_preferNinjaCheckBox->checkState() == Qt::Checked);
|
||||
}
|
||||
|
||||
void CMakeToolConfigWidget::cloneCMakeTool()
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace CMakeProjectManager {
|
||||
|
||||
const char CMAKETOOL_COUNT_KEY[] = "CMakeTools.Count";
|
||||
const char CMAKETOOL_DEFAULT_KEY[] = "CMakeTools.Default";
|
||||
const char CMAKETOOL_PREFER_NINJA_KEY[] = "CMakeTools.PreferNinja";
|
||||
const char CMAKETOOL_DATA_KEY[] = "CMakeTools.";
|
||||
const char CMAKETOOL_FILE_VERSION_KEY[] = "Version";
|
||||
const char CMAKETOOL_FILENAME[] = "/qtcreator/cmaketools.xml";
|
||||
@@ -52,16 +51,12 @@ const char CMAKETOOL_FILENAME[] = "/qtcreator/cmaketools.xml";
|
||||
class CMakeToolManagerPrivate
|
||||
{
|
||||
public:
|
||||
CMakeToolManagerPrivate() : m_preferNinja(false), m_writer(0)
|
||||
{ }
|
||||
|
||||
bool m_preferNinja;
|
||||
Id m_defaultCMake;
|
||||
QList<CMakeTool *> m_cmakeTools;
|
||||
PersistentSettingsWriter *m_writer;
|
||||
PersistentSettingsWriter *m_writer = nullptr;
|
||||
QList<CMakeToolManager::AutodetectionHelper> m_autoDetectionHelpers;
|
||||
};
|
||||
static CMakeToolManagerPrivate *d = 0;
|
||||
static CMakeToolManagerPrivate *d = nullptr;
|
||||
|
||||
static void addCMakeTool(CMakeTool *item)
|
||||
{
|
||||
@@ -116,7 +111,6 @@ static QList<CMakeTool *> readCMakeTools(const FileName &fileName, Core::Id *def
|
||||
}
|
||||
|
||||
*defaultId = Id::fromSetting(data.value(QLatin1String(CMAKETOOL_DEFAULT_KEY), defaultId->toSetting()));
|
||||
d->m_preferNinja= data.value(QLatin1String(CMAKETOOL_PREFER_NINJA_KEY), d->m_preferNinja).toBool();
|
||||
|
||||
return loaded;
|
||||
}
|
||||
@@ -137,7 +131,7 @@ static void readAndDeleteLegacyCMakeSettings ()
|
||||
|
||||
if (!CMakeToolManager::registerCMakeTool(item)) {
|
||||
delete item;
|
||||
item = 0;
|
||||
item = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,9 +140,6 @@ static void readAndDeleteLegacyCMakeSettings ()
|
||||
d->m_defaultCMake = item->id();
|
||||
}
|
||||
|
||||
//read the legacy ninja setting, if its not available use the current value
|
||||
d->m_preferNinja = settings->value(QLatin1String("preferNinja"), d->m_preferNinja).toBool();
|
||||
|
||||
settings->remove(QString());
|
||||
settings->endGroup();
|
||||
}
|
||||
@@ -196,7 +187,7 @@ static QList<CMakeTool *> autoDetectCMakeTools()
|
||||
return found;
|
||||
}
|
||||
|
||||
CMakeToolManager *CMakeToolManager::m_instance = 0;
|
||||
CMakeToolManager *CMakeToolManager::m_instance = nullptr;
|
||||
|
||||
CMakeToolManager::CMakeToolManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
@@ -218,7 +209,6 @@ CMakeToolManager::~CMakeToolManager()
|
||||
delete d->m_writer;
|
||||
qDeleteAll(d->m_cmakeTools);
|
||||
delete d;
|
||||
d = 0;
|
||||
}
|
||||
|
||||
CMakeToolManager *CMakeToolManager::instance()
|
||||
@@ -231,16 +221,6 @@ QList<CMakeTool *> CMakeToolManager::cmakeTools()
|
||||
return d->m_cmakeTools;
|
||||
}
|
||||
|
||||
void CMakeToolManager::setPreferNinja(bool set)
|
||||
{
|
||||
d->m_preferNinja = set;
|
||||
}
|
||||
|
||||
bool CMakeToolManager::preferNinja()
|
||||
{
|
||||
return d->m_preferNinja;
|
||||
}
|
||||
|
||||
Id CMakeToolManager::registerOrFindCMakeTool(const FileName &command)
|
||||
{
|
||||
CMakeTool *cmake = findByCommand(command);
|
||||
@@ -416,7 +396,6 @@ void CMakeToolManager::saveCMakeTools()
|
||||
QVariantMap data;
|
||||
data.insert(QLatin1String(CMAKETOOL_FILE_VERSION_KEY), 1);
|
||||
data.insert(QLatin1String(CMAKETOOL_DEFAULT_KEY), d->m_defaultCMake.toSetting());
|
||||
data.insert(QLatin1String(CMAKETOOL_PREFER_NINJA_KEY), d->m_preferNinja);
|
||||
|
||||
int count = 0;
|
||||
foreach (CMakeTool *item, d->m_cmakeTools) {
|
||||
|
||||
@@ -48,8 +48,6 @@ public:
|
||||
static CMakeToolManager *instance();
|
||||
|
||||
static QList<CMakeTool *> cmakeTools();
|
||||
static void setPreferNinja(bool set);
|
||||
static bool preferNinja();
|
||||
|
||||
static Core::Id registerOrFindCMakeTool(const Utils::FileName &command);
|
||||
static bool registerCMakeTool(CMakeTool *tool);
|
||||
|
||||
Reference in New Issue
Block a user