[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] File extension not added--common "save" dialog in msw11

From: Vadim Zeitlin
Subject: Re: [lmi] File extension not added--common "save" dialog in msw11
Date: Wed, 8 Feb 2023 15:34:01 +0100

On Wed, 8 Feb 2023 03:25:47 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> To reproduce, load lmi, then:
GC>   File | New | Census
GC>   File | Save
GC>     replace "unnamed1" with:
GC>       '1st Sample Bank - Tier 1 - FUW - $1.25M - PRELIMINARY'
GC>     omitting the single quotes
GC>   OK
GC> Result expected: '1st Sample Bank - Tier 1 - FUW - $1.25M - PRELIMINARY.cns'
GC> file created. Instead, the file that gets created has no '.cns' extension.

 I haven't checked this yet, but I'm almost sure that it's due to the
period in the middle of "$1.25M" being interpreted as the start of an
existing extension and the code intentionally doesn't add an extension if
there is already one as many people, me including, find the alternative
behaviour of always appending it pretty aggravating, as it would result in
e.g. "README.md" being saved as "README.md.txt" if the default filter uses
"*.txt" for example.

 Of course, other people do think that the extension should always be
appended, see the latest (but not the only) discussion of this in
https://github.com/wxWidgets/wxWidgets/issues/23193 which, as you can
hopefully see even without having a GitHub account, was closed by me
because I think it's better to not append the extension and let users
append it themselves than always append it leaving them without any simple
way to prevent this from happening.

 However, there are still some questions and possible improvements:

GC> This seems to occur only with windows-11, not with windows-10, and not with
GC> 'wine'. File names that are "simpler" (e.g., "example.cns") do not seem to
GC> trigger the anomaly.

 First of all, I'm not sure at all why does this happen only under 11 and
not 10, the code I'm speaking about is in wxWidgets itself. I'd have to
debug this but the problem is that I don't have a functional Windows 11 VM
yet, my attempts to install it the last time ran into multiple problems and
I just abandoned it. I'll try it again as perhaps KVM has better support
for it by now, but I'll need some time for this.

 Second, it's clearly stupid to think that "25M - PRELIMINARY" can be an
extension and we don't need to integrate an advanced AI in wxWidgets to
avoid it, we could just add for a space after the period, as spaces can
never be part of an extension. We could be a bit more aggressive and also
consider that anything longer than a few (5?) characters is not an
extension neither, although this might result in some false positives if
anybody uses e.g. ".census" as an extension. But we probably could live
with this.

 I'll make these changes before the next wx update, and hopefully this
should help a lot in practice -- even if it's not going to solve the
problem completely. Please let me know if you disagree. And, also, ideally
I'd still like to debug this under Windows 11 to see what exactly is
different there.


Attachment: pgpoi_gu9x8Jo.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]