fix: Merging tool result

This commit is contained in:
Petr Mironychev
2026-06-29 13:28:26 +02:00
parent 86c537477d
commit d66c714a28
11 changed files with 93 additions and 27 deletions

View File

@@ -15,7 +15,7 @@ class Pill : public QLabel
{
Q_OBJECT
public:
enum Kind { Neutral, Accent, On, Off, User, Tag, Active, Match };
enum Kind : int { Neutral, Accent, On, Off, User, Tag, Active, Match };
explicit Pill(Kind kind, const QString &text = {}, QWidget *parent = nullptr);

View File

@@ -6,6 +6,7 @@
#include <coreplugin/icore.h>
#include <QDateTime>
#include <QDir>
#include <QFile>
#include <QFileInfo>
@@ -203,6 +204,23 @@ PipelinesLoadResult PipelinesConfig::load()
return result;
}
PipelinesLoadResult PipelinesConfig::loadCached()
{
static PipelinesLoadResult cached;
static QDateTime cachedMTime;
static bool valid = false;
const QFileInfo info(filePath());
const QDateTime mtime = info.exists() ? info.lastModified() : QDateTime();
if (valid && mtime == cachedMTime)
return cached;
cached = load();
cachedMTime = mtime;
valid = true;
return cached;
}
bool PipelinesConfig::save(const PipelineRosters &rosters, QString *errorOut)
{
const QString path = filePath();

View File

@@ -44,6 +44,8 @@ public:
[[nodiscard]] static PipelinesLoadResult load();
[[nodiscard]] static PipelinesLoadResult loadCached();
[[nodiscard]] static bool save(const PipelineRosters &rosters, QString *errorOut = nullptr);
[[nodiscard]] static bool validate(