Bug 440295 - Windows Log Viewer docker can not Save to the default filename
Summary: Windows Log Viewer docker can not Save to the default filename
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Dockers (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Other Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-26 10:57 UTC by Ahab Greybeard
Modified: 2021-08-28 07:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Log viewer saved to a user named file (405 bytes, text/x-log)
2021-07-26 10:57 UTC, Ahab Greybeard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahab Greybeard 2021-07-26 10:57:41 UTC
Created attachment 140339 [details]
Log viewer saved to a user named file

SUMMARY
This bug does not happen with the Linux appimage.

It happens on Windows 10 with the 4.4.5 installed version and the July 26 5.0.0-prealpha (git 178019461d) portable .zip.

STEPS TO REPRODUCE
1. Save the Log Viewer docker content using its Save icon. Do not change the default suggested file name, press Save.
2. Save the Log Viewer docker content again but change the default suggested filename to 'try-this.log', as an example, then press Save

OBSERVED RESULT
1. The Save operation is not performed and an error message appears in the Log Viewer docker. (See attached log file.)
2. The Save operation is performed.

EXPECTED RESULT
1. The Save operation should be performed (or a different suggested name be used?)

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git 1780194)
 Languages: en_US, en
 Hidpi: false

Qt

  Version (compiled): 5.12.11
  Version (loaded): 5.12.11

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19043
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10
Comment 1 Tiar 2021-08-24 14:52:35 UTC
I'm pretty sure this is the same case as in bug 440311 (cause of not saving: the colon in the default filename (in date)). But it's in a different place, so it's not a duplicate.
I haven't tested it but I believe it happens because of that other bug, hence I'm confirming.
Comment 2 Halla Rempt 2021-08-24 15:10:05 UTC
Yes, it's the same problem, so this can be closed as a duplicate of 440311, and that one was fixed.

*** This bug has been marked as a duplicate of bug 440311 ***
Comment 3 Tiar 2021-08-26 19:57:04 UTC
"Yes, it's the same problem, so this can be closed as a duplicate of 440311, and that one was fixed."

That's not true, I wrote clearly: "But it's in a different place, so it's not a duplicate" - because bug 440311 has only a fix for kis_clipboard_brush_widget file and not for every instance where we try to save a file with a colon in it. Hence, for this bug report, it needs a separate fix. And it would be probably a good idea to go through the files and check if we don't try to use
"QDateTime::currentDateTime().toString()"
or "QDateTime::currentDateTime().toString("yyyy-MM-ddThh:mm")" (or other formats)
in some other places which end up as a filename, too (to prevent more bugs of this type).

Since it still needs a fix, I'm reopening.

(I guess my second part of the comment: "I haven't tested it but I believe it happens because of that other bug, hence I'm confirming." was a bit confusing).
Comment 4 Halla Rempt 2021-08-27 07:56:37 UTC
Okay, please do that.
Comment 5 Tiar 2021-08-28 01:37:18 UTC
Git commit 349cf7c7db5c37b304348cfd11ed38886c0e5ff5 by Agata Cacko.
Committed on 28/08/2021 at 00:39.
Pushed by tymond into branch 'master'.

Fix default filename for Log Viewer not saving on Windows

Before this commit, if the user tried to save the log from the
Log Viewer on Windows, and just clicked "OK" without changing the
default filename, there would be an error of not being able to
save the file.
The reason for that was a colon in the filename, which is not
allowed on Windows.
This commit removes the colon by providing a custom format
for the date that is attached to the log filename.

M  +1    -1    plugins/dockers/logdocker/LogDockerDock.cpp

https://invent.kde.org/graphics/krita/commit/349cf7c7db5c37b304348cfd11ed38886c0e5ff5
Comment 6 Halla Rempt 2021-08-28 07:53:02 UTC
Git commit f13c5a68e9500631cc3cd18c21013a40d0c25d98 by Halla Rempt, on behalf of Agata Cacko.
Committed on 28/08/2021 at 07:52.
Pushed by rempt into branch 'krita/5.0'.

Fix default filename for Log Viewer not saving on Windows

Before this commit, if the user tried to save the log from the
Log Viewer on Windows, and just clicked "OK" without changing the
default filename, there would be an error of not being able to
save the file.
The reason for that was a colon in the filename, which is not
allowed on Windows.
This commit removes the colon by providing a custom format
for the date that is attached to the log filename.
(cherry picked from commit 349cf7c7db5c37b304348cfd11ed38886c0e5ff5)

M  +1    -1    plugins/dockers/logdocker/LogDockerDock.cpp

https://invent.kde.org/graphics/krita/commit/f13c5a68e9500631cc3cd18c21013a40d0c25d98