Skip to content

Commit 204ddaa

Browse files
committed
app: fix #14312 on first run copies settings from 2.10 instead of 3.0
I noticed when running 3.1.2 for the first time it copied settings from 2.10 instead of 3.0 as I would expect. Investigation shows that the major version number is hardcoded to 2, so let's change that to major. In addition to that, the outer loop continues running even when we found a migration path if there is a lower major version number available. Let's change this so we stop when migrate is TRUE. Also fix some issues that could hit us in the future: - Change the value of `major` in the for loop from a hardcoded value to using `GIMP_MAJOR_VERSION`. - The flatpak specific testing is for version 2.10 but only tested the minor version. Change that to make sure major is 2.
1 parent 4b549c6 commit 204ddaa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/core/gimp-user-install.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ user_install_detect_old (GimpUserInstall *install,
297297
gint major;
298298
gint minor;
299299

300-
for (major = 3; major >= 2; major--)
300+
for (major = GIMP_MAJOR_VERSION; major >= 2; major--)
301301
{
302302
gint max_minor;
303303

@@ -324,14 +324,14 @@ user_install_detect_old (GimpUserInstall *install,
324324

325325
if (migrate)
326326
{
327-
install->old_major = 2;
327+
install->old_major = major;
328328
install->old_minor = minor;
329329

330330
break;
331331
}
332332

333333
#ifdef G_OS_UNIX
334-
if (minor == 10)
334+
if (major == 2 && minor == 10)
335335
{
336336
/* This is special-casing for GIMP 2.10 as flatpak where
337337
* we had this weird inconsistency: depending on whether a
@@ -381,6 +381,8 @@ user_install_detect_old (GimpUserInstall *install,
381381
}
382382
#endif
383383
}
384+
if (migrate)
385+
break;
384386
}
385387
}
386388

0 commit comments

Comments
 (0)