![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "config.h"#include "common/updates.h"#include "common/conf.h"#include "common/logging.h"#include <curl/curl.h>#include <json-glib/json-glib.h>#include <string.h>#include <time.h>
Include dependency graph for updates.c:Go to the source code of this file.
Data Structures | |
| struct | _found_t |
Macros | |
| #define | DT_UPDATES_ENABLED_KEY "updates/enabled" |
| #define | DT_UPDATES_LAST_CHECK_KEY "updates/last_check" |
| #define | DT_UPDATES_MANIFEST_KEY "updates/manifest_url" |
| #define | DT_UPDATES_INTERVAL (24 * 60 * 60) |
| #define | DT_UPDATES_MAX_BODY (1 << 20) |
Typedefs | |
| typedef struct _found_t | _found_t |
Functions | |
| const char * | dt_updates_runtime_format (void) |
| const char * | dt_updates_get_download_url (void) |
| const char * | dt_updates_get_available_version (void) |
| static size_t | _write_cb (char *data, size_t size, size_t nmemb, void *user) |
| static gboolean | _announce (gpointer data) |
| static _found_t * | _evaluate (const char *body, gsize len) |
| static gpointer | _updates_worker (gpointer data) |
| void | dt_updates_init (const gboolean have_gui, dt_updates_notify_fn notify) |
| void | dt_updates_shutdown (void) |
Variables | |
| static GThread * | _worker = NULL |
| static gint | _shutting_down = 0 |
| static dt_updates_notify_fn | _notify = NULL |
| static char * | _download_url = NULL |
| static char * | _available_version = NULL |
|
static |
Definition at line 89 of file updates.c.
References _available_version, _download_url, _notify, _shutting_down, _found_t::url, and _found_t::version.
Referenced by _updates_worker().
|
static |
Definition at line 108 of file updates.c.
References darktable_commit_hash, DT_DEBUG_CONTROL, dt_print(), dt_updates_runtime_format(), top, _found_t::url, and _found_t::version.
Referenced by _updates_worker().
|
static |
Definition at line 150 of file updates.c.
References _announce(), _evaluate(), _shutting_down, _write_cb(), darktable_package_version, DT_BUILD_CHANNEL, dt_conf_get_string_const(), DT_DEBUG_CONTROL, dt_print(), DT_UPDATES_MANIFEST_KEY, res, status, TRUE, _found_t::url, and _found_t::version.
Referenced by dt_updates_init().
|
static |
Definition at line 73 of file updates.c.
References DT_UPDATES_MAX_BODY, n, and size.
Referenced by _updates_worker().
| const char * dt_updates_get_available_version | ( | void | ) |
The version string of the newer build found by the last check, or NULL.
Definition at line 68 of file updates.c.
References _available_version.
| const char * dt_updates_get_download_url | ( | void | ) |
The download URL of the newer build found by the last check, or NULL when none was found (or the check did not run). The string is owned by the module.
Definition at line 63 of file updates.c.
References _download_url.
Referenced by update_nightly_callback().
| void dt_updates_init | ( | const gboolean | have_gui, |
| dt_updates_notify_fn | notify | ||
| ) |
Start the check if it is due. Returns immediately; the fetch runs on its own thread. notify may be NULL, in which case a result is only queryable through the getters.
Definition at line 199 of file updates.c.
References _notify, _shutting_down, _updates_worker(), _worker, DT_BUILD_CHANNEL, dt_conf_get_bool(), dt_conf_get_int64(), dt_conf_set_int64(), DT_DEBUG_CONTROL, dt_print(), DT_UPDATES_ENABLED_KEY, DT_UPDATES_INTERVAL, DT_UPDATES_LAST_CHECK_KEY, and dt_updates_runtime_format().
Referenced by dt_init().
| const char * dt_updates_runtime_format | ( | void | ) |
Where the running binary came from, as a key of the manifest's "formats" object ("appimage", "flatpak", "dmg-arm64", "dmg-i386", "exe"), or NULL when it cannot tell. Exposed for the consent dialog and for diagnostics.
Definition at line 44 of file updates.c.
Referenced by _evaluate(), and dt_updates_init().
Stop the worker. Bounded by the request timeout.
Definition at line 223 of file updates.c.
References _available_version, _download_url, _shutting_down, and _worker.
Referenced by dt_cleanup().
|
static |
Definition at line 42 of file updates.c.
Referenced by _announce(), dt_updates_get_available_version(), and dt_updates_shutdown().
|
static |
Definition at line 41 of file updates.c.
Referenced by _announce(), dt_updates_get_download_url(), and dt_updates_shutdown().
|
static |
Definition at line 40 of file updates.c.
Referenced by _announce(), and dt_updates_init().
|
static |
Definition at line 39 of file updates.c.
Referenced by _announce(), _updates_worker(), dt_updates_init(), and dt_updates_shutdown().
|
static |
Definition at line 38 of file updates.c.
Referenced by dt_updates_init(), and dt_updates_shutdown().