[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-29 Thread Ahmad Samir
https://bugs.kde.org/show_bug.cgi?id=297003

Ahmad Samir  changed:

   What|Removed |Added

  Latest Commit||https://invent.kde.org/fram
   ||eworks/kio/commit/da65b36c7
   ||8644ce39fcb8c2db1b02461644e
   ||b81d
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #20 from Ahmad Samir  ---
Git commit da65b36c78644ce39fcb8c2db1b02461644eb81d by Ahmad Samir, on behalf
of Alain Laporte.
Committed on 29/06/2022 at 11:17.
Pushed by ahmadsamir into branch 'master'.

Add template for empty file

A  +0-0src/new_file_templates/EmptyFile
A  +10   -0src/new_file_templates/EmptyFile.desktop
M  +2-0src/new_file_templates/templates.qrc

https://invent.kde.org/frameworks/kio/commit/da65b36c78644ce39fcb8c2db1b02461644eb81d

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-19 Thread Alain Laporte
https://bugs.kde.org/show_bug.cgi?id=297003

--- Comment #19 from Alain Laporte  ---
I have modified my MR on KIO to also have ability to add an empty file without
extension (https://invent.kde.org/frameworks/kio/-/merge_requests/866). This
file can be created when MIME type application/octet-stream is passed to
KDirOperator::setNewFileMenuSupportedMimeTypes.

I have also submitted an MR on Kate to replace to create a text file by an
empty file (https://invent.kde.org/utilities/kate/-/merge_requests/765)

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-19 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=297003

Bug Janitor Service  changed:

   What|Removed |Added

 Status|CONFIRMED   |ASSIGNED

--- Comment #18 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/utilities/kate/-/merge_requests/765

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-18 Thread Alain Laporte
https://bugs.kde.org/show_bug.cgi?id=297003

Alain Laporte  changed:

   What|Removed |Added

 CC||alain@laporte.paris

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-14 Thread EnzoR
https://bugs.kde.org/show_bug.cgi?id=297003

--- Comment #17 from EnzoR  ---
A "new text file" should be an empty (0-sized) file with a .txt or a .text
extension.
The user's intention is hers and should not be subject to any assumption or
whatsoever.
The aim of that thing is (should be?) to help the user create some new
user-generated text file.
With no assumption in mind, that file needs to be empty (0-sized). Actually
also the so-called "file extension" choice should be left to the user, as this
is Linux, not DOS (or even worse...).

If that was a "new executable file" (which is machine generated/machine
readable) then I could agree that an empty (0-sized) files is not a proper
"executable".
But you would not use Kate of the context menu to create, wouldn't you?
"New HTML file" puts 168 bytes of pre-indented HTML code. But this is still
machine-readable stuff. I can understand the reasoning while still totally
disagreeing. A user that wants to "create a new HTML file" is lilely willing to
enter all of its content by hand.
What about a shell script? Would you put "#!/bin/bash", "#!/bin/sh",
"#!/usr/bin/env ..." or what ? I wouldn't personally even put the "#!".
But text file is an agnostic thing. Making assumptions there sounds like
forcing someone else's decision.

Finally, a user should use templates to adapt the behavior to her will, to to
bring things back to the basics.

This is my opinion: no facts to support it. Just simplicity considerations.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-14 Thread Mario Aichinger
https://bugs.kde.org/show_bug.cgi?id=297003

--- Comment #16 from Mario Aichinger  ---
Thanks for the hint with the Templates directory!

> The default template should cater to the typical use case, i.e. a user who 
> wants to create a simple text file.

I tend to disagree with the premise that the typical use case is creating a
"simple text file". But I wouldn't have any data to disprove it. From all the
files which are created with this action I don't know how many will have a .txt
suffix as opposed to a .py, .xml, .ini or what ever else suffix... It just
seams improbable to me that in most cases the extension will be .txt. And than
again how often will a user on purpose create a file with no extension and
expect it to be a "text file", I don't know. Still you might be right!

That all said, would you oppose a MR which adds a "File" .desktop file and
template to KIO which always creates an empty file regardless of the suffix?
The "Text File" entry would stay and there just would be an extra entry which
would just be called "File" since it would not create a new "text file" but a
file in the most generic sense of the word, just an empty file with a extension
chosen by the user. Could this be a compromise which would not change the
existing option but improve the current situation to seemingly at least some
users?

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-14 Thread Ahmad Samir
https://bugs.kde.org/show_bug.cgi?id=297003

--- Comment #15 from Ahmad Samir  ---
- Changing the contents of the new text file template based on the extension
would make the code more complex
- The experience would be a bit confusing, you create a "new file" and
sometimes it has a " \n" and sometimes not
- A file without an extension and 0 size has mimetype application/x-zerosize,
and a blank icon

The default template should cater to the typical use case, i.e. a user who
wants to create a simple text file.

Note that you can customize the behaviour:
- Copy
https://invent.kde.org/frameworks/kio/-/blob/master/src/new_file_templates/TextFile.desktop
to the templates dir (by default it's ~/Templates)
- create a dir ~/Templates/.source/, and inside it create a "Text File.txt"
file, put whatever text you want there or make it blank ...etc.

KNewFileMenu will pick that ~/Templates/TextFile.desktop over the one baked
into KIO (as a QResource).

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-13 Thread Ahmad Samir
https://bugs.kde.org/show_bug.cgi?id=297003

Ahmad Samir  changed:

   What|Removed |Added

 CC||vincenzo.rom...@notorand.it

--- Comment #14 from Ahmad Samir  ---
*** Bug 446019 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-04 Thread Mario Aichinger
https://bugs.kde.org/show_bug.cgi?id=297003

Mario Aichinger  changed:

   What|Removed |Added

 CC||aichi...@gmail.com

--- Comment #13 from Mario Aichinger  ---
Oh I see, my quirky brain always assumed "Text File" in this context meant
something like "Generic File". Turns out I'm just using it wrong :'D

So to sum up:

Suffix '.txt' + content ' \n' is a text file
Suffix '.txt' + content 'Some Content' is a text file
Suffix '.txt' + content '' is a text file

Suffix '' + content ' \n' is a text file
Suffix '' + content 'Some Content' is a text file
Suffix '' + content '' is NOT a text file

Suffix '.py' + content ' \n' is a python script
Suffix '.py' + content 'Some Content' is a python script
Suffix '.py' + content '' is a python script

The only combination between suffix and content which falls out of line seams
to be the empty-empty one. 

I think there are a few options to improve the situation:
- Turn the existing "Text file" option in to something more generic which only
copies the template if file name does not contain a '.' (probably not a good
idea since it would require a lot of changes in KNewFileMenu)
- Ignore the special case since the UI already proposes a '.txt' suffix in the
dialog (if someone removes the suffix they might know what they are doing)
- Add a "File" .desktop file and template to KIO which creates always an empty
file regardless of the suffix. 
- Make the mime hint more visible to reduce the feeling that the user is
experiencing a bug (e.g. "Text File Content"). This might also educate the user
that this is really a feature to create "text files" and not generic files (the
opposite of directories).

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-06-04 Thread Ahmad Samir
https://bugs.kde.org/show_bug.cgi?id=297003

Ahmad Samir  changed:

   What|Removed |Added

 CC||a.samir...@gmail.com

--- Comment #12 from Ahmad Samir  ---
The original commit that introduced that change[1] mentions the file mimetype,
which is still true; what's happening here is that QMimeDatabase can identify
mimetypes based on the file extension, so a .txt file gets a proper icon. But
if you remove the file extension, you'd end up with a file with a blank icon. 

Also:
$ file 'Text File.txt'
Text File.txt: ASCII text

Removing the space and new line from the file:
$ file 'Text File.txt'
Text File.txt: empty

so making the file empty would mess with the mimetype of the file. 

[1]
https://invent.kde.org/unmaintained/kde-baseapps/-/commit/d04a9df14daa636cc75666529e3fb01a93f2f508

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2022-04-30 Thread Kishore Gopalakrishnan
https://bugs.kde.org/show_bug.cgi?id=297003

Kishore Gopalakrishnan  changed:

   What|Removed |Added

 CC||kishor...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2018-07-12 Thread David
https://bugs.kde.org/show_bug.cgi?id=297003

David  changed:

   What|Removed |Added

 CC||david.cortes.rivera@gmail.c
   ||om

--- Comment #11 from David  ---
Can confirm the bug is still present with Dolphin 18.04 and frameworks 5.47.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2018-04-21 Thread Dr . Chapatin
https://bugs.kde.org/show_bug.cgi?id=297003

Dr. Chapatin  changed:

   What|Removed |Added

 CC||bugsefor...@gmx.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2018-04-14 Thread Glut
https://bugs.kde.org/show_bug.cgi?id=297003

Glut  changed:

   What|Removed |Added

 CC||glutbugrepo...@gmail.com

--- Comment #10 from Glut  ---
I can confirm this on Dolphin 17.12.3 / Kubuntu 18.04 bionic beaver.

Manually editing the template file, as recommended in #c3 works perfectly for
me.

I don't want to sound entitled, but this seems like such a simple thing to fix
that I'm wondering why after 6 years nobody has bothered to remove those
additional characters from the text file? Is this a conscious design decision?
I could imagine that this is a papercut that is bothering a lot of users.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdelibs] [Bug 297003] Newly created text files are not empty

2016-10-09 Thread Werner Loureiro via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=297003

Werner Loureiro  changed:

   What|Removed |Added

 CC|werne...@gmail.com  |

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdelibs] [Bug 297003] Newly created text files are not empty

2016-10-09 Thread Roman via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=297003

Roman  changed:

   What|Removed |Added

 CC||subd...@gmail.com

--- Comment #9 from Roman  ---
Still here 2016.

-- 
You are receiving this mail because:
You are watching all bug changes.