Something went wrong. Try again.
Bring Windows XP themes to your KDE Plasma environment! xplasma.hotsocket.fyi
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// SPDX-License-Identifier: GPL-3.0-or-later#pragma once// Whether a newer XPlasma is out, as XP's Automatic Updates told of// Windows': project.ini's UpdatesUrl names a small JSON file,//// {"version": 2, "page": "https://...", "notes": "What's new, a line or two."}//// -- any host can serve it (a git host's raw file, a static page). Checked// at most once a day, at login (xplasma-edit --check-updates); a newer one// shows XP's globe in the tray. A version the user has said no to isn't// shown again. No URL, no check.#include "app/state.h"
#include <QDateTime>#include <QString>
#include <optional>
namespace xpl::updates {
struct Release{ int version = 0; // its release number (project.ini's Version) QString page; // where to get it QString notes; // what's new, optional};
// Where to look: XPLASMA_UPDATES_URL if set (tests), else project.ini's.QString url();
// The file's contents, read; none with *error if it isn't one.std::optional<Release> parse(const QByteArray &json, QString *error = nullptr);
// Whether a check is due: none in the last day.bool due(const State &state, const QDateTime &now = QDateTime::currentDateTimeUtc());void checked(State &state, const QDateTime &now = QDateTime::currentDateTimeUtc());
// Whether to tell of `release`: a higher number than this XPlasma's, and// not one the user has declined.bool worthTelling(const State &state, const Release &release);void decline(State &state, const Release &release);
// The file fetched (waited for, 15 s at most); none with *error.std::optional<Release> fetch(const QString &url, QString *error = nullptr);
} // namespace xpl::updates