2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2020 Alexis Jeandet.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2020-05-01 18:20:56 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-10-29 10:20:14 +01:00
|
|
|
#include "exewrappers/mesontools.h"
|
2020-05-01 18:20:56 +02:00
|
|
|
|
|
|
|
|
#include <utils/treemodel.h>
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
#include <QQueue>
|
|
|
|
|
|
|
|
|
|
namespace MesonProjectManager {
|
|
|
|
|
namespace Internal {
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
class ToolTreeItem;
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
class ToolsModel final : public Utils::TreeModel<Utils::TreeItem, Utils::TreeItem, ToolTreeItem>
|
|
|
|
|
{
|
|
|
|
|
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolsSettingsPage)
|
|
|
|
|
public:
|
|
|
|
|
ToolsModel();
|
|
|
|
|
ToolTreeItem *mesoneToolTreeItem(const QModelIndex &index) const;
|
2020-06-26 13:59:38 +02:00
|
|
|
void updateItem(const Utils::Id &itemId, const QString &name, const Utils::FilePath &exe);
|
2020-05-01 18:20:56 +02:00
|
|
|
void addMesonTool();
|
|
|
|
|
void removeMesonTool(ToolTreeItem *item);
|
|
|
|
|
ToolTreeItem *cloneMesonTool(ToolTreeItem *item);
|
|
|
|
|
void apply();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void addMesonTool(const MesonTools::Tool_t &);
|
|
|
|
|
QString uniqueName(const QString &baseName);
|
|
|
|
|
Utils::TreeItem *autoDetectedGroup() const;
|
|
|
|
|
Utils::TreeItem *manualGroup() const;
|
2020-06-26 13:59:38 +02:00
|
|
|
QQueue<Utils::Id> m_itemsToRemove;
|
2020-05-01 18:20:56 +02:00
|
|
|
};
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace MesonProjectManager
|