app: rename "last-run-version" property by simpler "config-version".

Thinking again, this is simply the version of the config files, mapping
to the application version. Even though it's not really a user-visible
string (except in config files themselves), I find this a much more
elegant name than the ugly "last-run-version" (which is not even true
anymore once startup passed; it's only the last-run version info at very
beginning of the startup process).
This commit is contained in:
Jehan 2022-02-22 12:13:46 +01:00
parent 7511c81f31
commit 1f9057d4bf
5 changed files with 26 additions and 20 deletions

View File

@ -325,7 +325,7 @@ app_run (const gchar *full_prog_name,
* next run.
*/
g_object_set (gimp->edit_config,
"last-run-version", GIMP_VERSION,
"config-version", GIMP_VERSION,
NULL);
loop = run_loop = g_main_loop_new (NULL, FALSE);

View File

@ -56,6 +56,7 @@ enum
{
PROP_0,
PROP_LANGUAGE,
PROP_CONFIG_VERSION,
PROP_INTERPOLATION_TYPE,
PROP_DEFAULT_THRESHOLD,
PROP_PLUG_IN_PATH,
@ -125,7 +126,6 @@ enum
PROP_LAST_RELEASE_COMMENT,
PROP_LAST_REVISION,
PROP_LAST_KNOWN_RELEASE,
PROP_LAST_RUN_VERSION,
#ifdef G_OS_WIN32
PROP_WIN32_POINTER_INPUT_API,
#endif
@ -183,6 +183,19 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_RESTART);
/* This is the version of the config files, which must map to the
* version of GIMP. It is used right now only to detect the last run
* version in order to detect an update. It could be used later also
* to have more fine-grained config updates (not just on minor
* versions as we do now, but also on changes in micro versions).
*/
GIMP_CONFIG_PROP_STRING (object_class, PROP_CONFIG_VERSION,
"config-version",
"Version of GIMP config files",
CONFIG_VERSION_BLURB,
NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_ENUM (object_class, PROP_INTERPOLATION_TYPE,
"interpolation-type",
"Interpolation",
@ -662,13 +675,6 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
0, G_MAXINT, 0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_STRING (object_class, PROP_LAST_RUN_VERSION,
"last-run-version",
"Version of GIMP run last",
LAST_RUN_VERSION_BLURB,
NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_SAVE_DOCUMENT_HISTORY,
"save-document-history",
"Save document history",
@ -873,7 +879,7 @@ gimp_core_config_finalize (GObject *object)
g_clear_pointer (&core_config->last_known_release, g_free);
g_clear_pointer (&core_config->last_release_comment, g_free);
g_clear_pointer (&core_config->last_run_version, g_free);
g_clear_pointer (&core_config->config_version, g_free);
g_clear_object (&core_config->default_image);
g_clear_object (&core_config->default_grid);
@ -1098,9 +1104,9 @@ gimp_core_config_set_property (GObject *object,
g_clear_pointer (&core_config->last_known_release, g_free);
core_config->last_known_release = g_value_dup_string (value);
break;
case PROP_LAST_RUN_VERSION:
g_clear_pointer (&core_config->last_run_version, g_free);
core_config->last_run_version = g_value_dup_string (value);
case PROP_CONFIG_VERSION:
g_clear_pointer (&core_config->config_version, g_free);
core_config->config_version = g_value_dup_string (value);
break;
case PROP_SAVE_DOCUMENT_HISTORY:
core_config->save_document_history = g_value_get_boolean (value);
@ -1362,8 +1368,8 @@ gimp_core_config_get_property (GObject *object,
case PROP_LAST_KNOWN_RELEASE:
g_value_set_string (value, core_config->last_known_release);
break;
case PROP_LAST_RUN_VERSION:
g_value_set_string (value, core_config->last_run_version);
case PROP_CONFIG_VERSION:
g_value_set_string (value, core_config->config_version);
break;
case PROP_SAVE_DOCUMENT_HISTORY:
g_value_set_boolean (value, core_config->save_document_history);

View File

@ -116,7 +116,7 @@ struct _GimpCoreConfig
gchar *last_release_comment;
gint last_revision;
gchar *last_run_version;
gchar *config_version;
};
struct _GimpCoreConfigClass

View File

@ -270,8 +270,8 @@ _("Specifies the language to use for the user interface.")
#define LAST_KNOWN_RELEASE_BLURB \
_("The last known release version of GIMP as queried from official website.")
#define LAST_RUN_VERSION_BLURB \
_("The version of GIMP which was last run.")
#define CONFIG_VERSION_BLURB \
_("The version of GIMP config files.")
#define LAST_OPENED_SIZE_BLURB \
_("How many recently opened image filenames to keep on the File menu.")

View File

@ -526,9 +526,9 @@ gimp_update_auto_check (GimpCoreConfig *config,
gint64 prev_update_timestamp;
gint64 current_timestamp;
if (config->last_run_version == NULL ||
if (config->config_version == NULL ||
gimp_version_cmp (GIMP_VERSION,
config->last_run_version) > 0)
config->config_version) > 0)
{
#ifndef GIMP_CONSOLE_COMPILATION
/* GIMP was just updated and this is the first time the new