Bug 391973

Summary: When I use a default template, at next start a different template will be selected
Product: [Applications] krita Reporter: mvowada <freebox64>
Component: GeneralAssignee: Halla Rempt <halla>
Status: RESOLVED FIXED    
Severity: normal CC: griffinvalley, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: (Video)

Description mvowada 2018-03-17 18:09:47 UTC
(Krita Version: 4.1.0-pre-alpha (git 97015cd) - Ubuntu 14.04)

When I use a "default" template, at next start I'm presented with a different template to use.

    1) create a new document using a default template
    2) restart
    3) go to create a new document

Actual Results: a different template is selected.
Expected Results: select the just used template.

(it happens in Krita 3.3.3 as well)
Comment 1 wolthera 2018-03-17 18:11:31 UTC
I think default template hasn't worked since the move to Multiple Documents in 2.9. Where do you see this 'default template'?
Comment 2 mvowada 2018-03-17 18:16:32 UTC
(In reply to wolthera from comment #1)
> I think default template hasn't worked since the move to Multiple Documents
> in 2.9. Where do you see this 'default template'?

In my case, it always defaults to the "Texture 1024x1024" template (it might be a different one for you).

It doesn't happen after using a custom template, only after using a default one.
Comment 3 mvowada 2018-03-17 18:27:08 UTC
Created attachment 111467 [details]
(Video)
Comment 4 Halla Rempt 2018-03-18 12:09:26 UTC
I wonder whether it's dependent on the template chosen. If I choose, for instance, the Manga template, then that template will be pre-selected next time I start Krita.

The last used template is stored in the kritarc:

[TemplateChooserDialog]
AlwaysUseTemplate=
DetailsPaneSplitterSizes=241,358
FullTemplateName[$e]=$HOME/dev/i-3.3/share/krita/templates/comics/.source/Manga-JpTemplate.kra
LastReturnType=Template


So I wonder what that section says in your case?
Comment 5 mvowada 2018-03-18 19:25:13 UTC
(In reply to Boudewijn Rempt from comment #4) 
> So I wonder what that section says in your case?

Hi Boudewijn, thanks for the hint, could be that it's an appimage?

The issue happens even using the Manga template. Once closed Krita (btw, appimage), the "kritarc" file says:

[TemplateChooserDialog]
AlwaysUseTemplate=
DetailsPaneSplitterSizes=249,347
FullTemplateName[$e]=/tmp/.mount_krita-ic5XWA/usr/share/krita/templates/comics/.source/Manga-JpTemplate.kra
LastReturnType=Template

however, at the next start, the highlighted template is again Texture 1024x1024.

(Using a "custom" template it gets correctly highlighted at next start...)
Comment 6 Halla Rempt 2018-03-28 14:34:39 UTC
Yes, it probably is the appimage, which has the temp mount path inside.
Comment 7 Halla Rempt 2018-04-03 08:12:21 UTC
Git commit 999be7396d64a2b6a769d8c871d583a700980992 by Boudewijn Rempt.
Committed on 03/04/2018 at 08:11.
Pushed by rempt into branch 'master'.

Try to restore to the last used template

If we're running from an appimage, the full path to a default
provided template will include the mount point, which changes
from run to run. So, if we cannot find the last used template,
compare by filename as well.

M  +17   -2    libs/ui/KisTemplatesPane.cpp

https://commits.kde.org/krita/999be7396d64a2b6a769d8c871d583a700980992
Comment 8 Halla Rempt 2018-04-03 11:45:42 UTC
Git commit 93409598a0ac59e1d9e8561ed54355963c644f3f by Boudewijn Rempt.
Committed on 03/04/2018 at 11:21.
Pushed by rempt into branch 'krita/4.0'.

Try to restore to the last used template

If we're running from an appimage, the full path to a default
provided template will include the mount point, which changes
from run to run. So, if we cannot find the last used template,
compare by filename as well.
(cherry picked from commit 999be7396d64a2b6a769d8c871d583a700980992)

M  +17   -2    libs/ui/KisTemplatesPane.cpp

https://commits.kde.org/krita/93409598a0ac59e1d9e8561ed54355963c644f3f