mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-21 18:51:02 -04:00
refactor: Restructure project into sources/tests layout and dissolve PluginLLMCore
This commit is contained in:
45
sources/settings/PluginUpdater.hpp
Normal file
45
sources/settings/PluginUpdater.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2024-2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QObject>
|
||||
#include <QVersionNumber>
|
||||
|
||||
namespace QodeAssist {
|
||||
|
||||
class PluginUpdater : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
struct UpdateInfo
|
||||
{
|
||||
QString version;
|
||||
QString changeLog;
|
||||
bool isUpdateAvailable = false;
|
||||
};
|
||||
|
||||
explicit PluginUpdater(QObject *parent = nullptr);
|
||||
~PluginUpdater() = default;
|
||||
|
||||
void checkForUpdates();
|
||||
QString currentVersion() const;
|
||||
bool isUpdateAvailable() const;
|
||||
|
||||
signals:
|
||||
void updateCheckFinished(const UpdateInfo &info);
|
||||
|
||||
private:
|
||||
void handleUpdateResponse(QNetworkReply *reply);
|
||||
QString getUpdateUrl() const;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
UpdateInfo m_lastUpdateInfo;
|
||||
bool m_isCheckingUpdate = false;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist
|
||||
Reference in New Issue
Block a user