mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-30 01:59:11 -04:00
fix: Merging tool result
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user