Bug 409765 - Filename is cut when "saving as" file with multiple dots in name
Summary: Filename is cut when "saving as" file with multiple dots in name
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Tile manager (show other bugs)
Version: 4.2.2
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-13 10:27 UTC by Marcin Gurtowski
Modified: 2019-07-17 09:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Gurtowski 2019-07-13 10:27:22 UTC
SUMMARY


STEPS TO REPRODUCE
1. Open file named "file.with.dots.jpg"
2. Menu -> save as

OBSERVED RESULT
Suggested file name is "file.jpg"

EXPECTED RESULT
Suggested file name is the same as input file


SOFTWARE/OS VERSIONS
Linux: 4.15.0-52-generic
KDE Plasma Version: 5.12.8
KDE Frameworks Version: 
Qt Version: 5.9.5
Comment 1 Halla Rempt 2019-07-13 10:56:00 UTC
Git commit 14adaa3b3fcf8699ee096662e0e179f9dea3201f by Boudewijn Rempt.
Committed on 13/07/2019 at 10:49.
Pushed by rempt into branch 'master'.

Use QFileInfo::completeBaseName instead of baseName

This makes it possible for users to use dots in their filenames.
Not that that is a good idea, everything after the first dot is
technically an extensions, as in bla.tar.gz, but Krita doesn't
handle any file formats where that actually happens, so we can
be a bit less technically correct when handling filenames and
only check the extension after the last dot.

M  +1    -1    libs/brush/kis_png_brush.cpp
M  +1    -1    libs/brush/kis_svg_brush.cpp
M  +1    -1    libs/flake/svg/SvgSavingContext.cpp
M  +4    -4    libs/pigment/resources/KoColorSet.cpp
M  +6    -6    libs/ui/KisMainWindow.cpp
M  +1    -1    libs/ui/KisResourceBundle.cpp
M  +1    -1    libs/ui/KisTemplateTree.cpp
M  +1    -1    libs/ui/dialogs/kis_dlg_layer_style.cpp
M  +3    -3    libs/ui/kis_layer_manager.cc
M  +2    -2    libs/ui/thememanager.cpp
M  +3    -3    libs/widgets/KoResourceServer.h
M  +1    -1    libs/widgetutils/KoFileDialog.cpp
M  +1    -1    libs/widgetutils/config/kcolorschememanager.cpp
M  +1    -1    plugins/dockers/compositiondocker/compositiondocker_dock.cpp
M  +2    -2    plugins/extensions/resourcemanager/resourcemanager.cpp
M  +1    -1    plugins/impex/brush/kis_brush_export.cpp
M  +1    -1    plugins/impex/qml/qml_converter.cc
M  +1    -1    plugins/impex/spriter/kis_spriter_export.cpp
M  +1    -1    plugins/paintops/libpaintop/kis_embedded_pattern_manager.cpp
M  +1    -1    plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp

https://invent.kde.org/kde/krita/commit/14adaa3b3fcf8699ee096662e0e179f9dea3201f
Comment 2 Halla Rempt 2019-07-17 09:13:47 UTC
Git commit 803818f665bd963f0ae6a2c3188a7e971c11df2a by Boudewijn Rempt.
Committed on 17/07/2019 at 09:13.
Pushed by rempt into branch 'krita/4.2'.

Use QFileInfo::completeBaseName instead of baseName

This makes it possible for users to use dots in their filenames.
Not that that is a good idea, everything after the first dot is
technically an extensions, as in bla.tar.gz, but Krita doesn't
handle any file formats where that actually happens, so we can
be a bit less technically correct when handling filenames and
only check the extension after the last dot.

M  +1    -1    libs/brush/kis_png_brush.cpp
M  +1    -1    libs/brush/kis_svg_brush.cpp
M  +1    -1    libs/flake/svg/SvgSavingContext.cpp
M  +4    -4    libs/pigment/resources/KoColorSet.cpp
M  +6    -6    libs/ui/KisMainWindow.cpp
M  +1    -1    libs/ui/KisResourceBundle.cpp
M  +1    -1    libs/ui/KisTemplateTree.cpp
M  +1    -1    libs/ui/dialogs/kis_dlg_layer_style.cpp
M  +3    -3    libs/ui/kis_layer_manager.cc
M  +2    -2    libs/ui/thememanager.cpp
M  +3    -3    libs/widgets/KoResourceServer.h
M  +1    -1    libs/widgetutils/KoFileDialog.cpp
M  +1    -1    libs/widgetutils/config/kcolorschememanager.cpp
M  +1    -1    plugins/dockers/compositiondocker/compositiondocker_dock.cpp
M  +2    -2    plugins/extensions/resourcemanager/resourcemanager.cpp
M  +1    -1    plugins/impex/qml/qml_converter.cc
M  +1    -1    plugins/impex/spriter/kis_spriter_export.cpp
M  +1    -1    plugins/paintops/libpaintop/kis_embedded_pattern_manager.cpp
M  +1    -1    plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp

https://invent.kde.org/kde/krita/commit/803818f665bd963f0ae6a2c3188a7e971c11df2a