Bug 207162

Summary: I can`t save my project. App crash after open kde4 (not native, like in system settings!) save dialog
Product: [Applications] ktuberling Reporter: Chernosov Denis <denis0.ru>
Component: generalAssignee: Ilie Halip <lupuroshu>
Status: RESOLVED FIXED    
Severity: normal CC: afiestas, jazeix, justin.zobel, kde-windows, lucanreisoficial, lupuroshu, schwarzer
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Windows patch

Description Chernosov Denis 2009-09-12 11:10:17 UTC
Version:           0.6.0 (using 4.3.00 (KDE 4.3.0), MS Visual Studio 2008 SP1)
Compiler:          cl.exe
OS:                Microsoft Windows (i686) release 5.1 (XP Home Edition)

Open potato guy, click save, see kde4 save dialog, 1-3 seconds, crash.

Russian Windows XP SP3
Comment 1 Frederik Schwarzer 2010-04-19 17:12:50 UTC
Is this still happening for you?
Comment 2 Chernosov Denis 2010-05-07 11:46:37 UTC
KDE 4.4.0

file saved... but without automatic extension adding. 

And before saving was warnign message "file with this name already exist. Replace|Cancel". Any filename generate such message. After selecting Replace, file was saved. Reopen was fine (except null-extension of file).


File dialog from Dolphin.
Comment 3 Frederik Schwarzer 2010-05-08 15:44:44 UTC
Confirmed with 4.4.1 but only under Windows. Linux (here 4.4.3) is fine.
Since there were no commits in the stable branch, it is likely windows-related.
Comment 4 Ilie Halip 2010-05-08 16:32:53 UTC
Hi. I'd like to do some further work on this bug if it's ok with you.
Comment 5 Ilie Halip 2010-05-09 08:23:42 UTC
Created attachment 43386 [details]
Windows patch

It seems that KFileDialog is a bit broken on Win - if I use KFileDialog::ConfirmOverwrite, it always asks me to overwrite the file (even though it doesn't exist), plus it doesn't add the extension, just like in the last comments.

What I did was check how other games do the saving. So in this patch, I'm using an empty KUrl on Windows which shows the native save dialog, saving the game correctly.
Comment 6 Justin Zobel 2020-11-13 03:08:45 UTC
(In reply to Ilie Halip from comment #5)
> Created attachment 43386 [details]
> Windows patch
> 
> It seems that KFileDialog is a bit broken on Win - if I use
> KFileDialog::ConfirmOverwrite, it always asks me to overwrite the file (even
> though it doesn't exist), plus it doesn't add the extension, just like in
> the last comments.
> 
> What I did was check how other games do the saving. So in this patch, I'm
> using an empty KUrl on Windows which shows the native save dialog, saving
> the game correctly.

Thanks for the patch, can you please submit it on https://invent.kde.org/games/ktuberling/-/merge_requests
Comment 7 Jazeix Johnny 2020-11-28 10:08:53 UTC
(In reply to Justin Zobel from comment #6)
> (In reply to Ilie Halip from comment #5)
> > Created attachment 43386 [details]
> > Windows patch
> > 
> > It seems that KFileDialog is a bit broken on Win - if I use
> > KFileDialog::ConfirmOverwrite, it always asks me to overwrite the file (even
> > though it doesn't exist), plus it doesn't add the extension, just like in
> > the last comments.
> > 
> > What I did was check how other games do the saving. So in this patch, I'm
> > using an empty KUrl on Windows which shows the native save dialog, saving
> > the game correctly.
> 
> Thanks for the patch, can you please submit it on
> https://invent.kde.org/games/ktuberling/-/merge_requests

The patch is 10 years old... It does not apply anymore as the code has moved to QFileDialog (https://invent.kde.org/games/ktuberling/-/blob/master/toplevel.cpp#L380).
I downloaded it from https://binary-factory.kde.org/job/KTuberling_Nightly_win64/ and when I try to save a file, I have the error: "Could not save file."
Comment 8 Jazeix Johnny 2020-11-28 18:59:56 UTC
Git commit 5c6bfedc3e8d55035dc25fdc1ea84b452fac71d2 by Johnny Jazeix.
Committed on 28/11/2020 at 15:48.
Pushed by aacid into branch 'master'.

Fix filename on saving on Windows. path() does not return a valid path.

M  +2    -2    toplevel.cpp

https://invent.kde.org/games/ktuberling/commit/5c6bfedc3e8d55035dc25fdc1ea84b452fac71d2
Comment 9 Albert Astals Cid 2020-11-28 19:00:32 UTC
Git commit af6d123514757649f355b8ecb81102728392f527 by Albert Astals Cid, on behalf of Johnny Jazeix.
Committed on 28/11/2020 at 19:00.
Pushed by aacid into branch 'release/20.12'.

Fix filename on saving on Windows. path() does not return a valid path.

(cherry picked from commit 5c6bfedc3e8d55035dc25fdc1ea84b452fac71d2)

M  +2    -2    toplevel.cpp

https://invent.kde.org/games/ktuberling/commit/af6d123514757649f355b8ecb81102728392f527