Bug 295490 - Dolphin appends .desktop to any new Text File created with an extension
Summary: Dolphin appends .desktop to any new Text File created with an extension
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.8
Platform: Chakra Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: regression, reproducible
: 295553 295752 295754 295951 296448 296607 296729 296752 297001 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-07 21:10 UTC by Adrián Chaves (Gallaecio)
Modified: 2012-03-29 07:43 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrián Chaves (Gallaecio) 2012-03-07 21:10:04 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34
Build Identifier: 

If I right-click on Dolphin, and go to New > Text File… (or similar, second row anyway), if I enter a file extension for the name of the file on the next, a file will be created as “FilenameIChosedWithMy.extension.desktop”. That is, if I enter “file.txt”, a “file.txt.desktop” file will be created instead.

Same things happens using other extensions on the dialog to choose the name of the new file, I tried with .jpg also. Yet, entering an extensionless name works like a charm. That is: If I enter "file", I get a "file.txt" file (automatic corrent extension).

IIRC, in the past Dolphin would just detect I already passed it the .txt extension on the name, so when passing "file.txt" as name it would create a "file.txt" file, same as when passing just "file" as name,

Reproducible: Always

Steps to Reproduce:
1. Right-click on Dolphin (on the folder view).
2. Go to New > Text File… (text might be slightly different on actual English version)
3. Enter "file.txt" as name for the new file.
Actual Results:  
A file named “file.txt.desktop” is created.

Expected Results:  
A file named "file.txt" should be created instead.
Comment 1 S. Christian Collins 2012-03-08 18:50:45 UTC
I can confirm this bug on KDE 4.8.1 under Kubuntu 11.10.  It doesn't just affect .txt files, but also affects my other templates (e.g. LibreOffice) as well.
Comment 2 Peter Penz 2012-03-08 20:07:43 UTC
*** Bug 295553 has been marked as a duplicate of this bug. ***
Comment 3 Martin Corley 2012-03-09 12:03:54 UTC
I can confirm this with KDE SC 4.8.1, Arch Linux
Comment 4 David Faure 2012-03-09 21:11:45 UTC
I see. This is the fix for bug 224142 affecting other kinds of files too.

I'm writing a unittest, then I'll fix the bug. Hold on ;)
Comment 5 David Faure 2012-03-09 22:58:17 UTC
Git commit 1775292fbd429a9e07dc9d612f2ea0b0afcc2541 by David Faure.
Committed on 09/03/2012 at 23:53.
Pushed by dfaure into branch 'KDE/4.8'.

New File menu: fix regression due to overzealous name-fixup code.

The fix for bug 224142 ended up affecting other file types than desktop
files, and appending ".desktop" to these.
Fixed by making the extension-appending code more generic, which fixes
the similar issue with normal files too: e.g. naming a text file
"foo.jpg" will end up creating a file named "foo.jpg.txt"

With unittest so that this won't happen again :)
Related: bug 224142
FIXED-IN: 4.8.2

M  +15   -9    kfile/knewfilemenu.cpp
M  +1    -0    kfile/tests/CMakeLists.txt
A  +115  -0    kfile/tests/knewfilemenutest.cpp     [License: LGPL (v2/3+eV)]

http://commits.kde.org/kdelibs/1775292fbd429a9e07dc9d612f2ea0b0afcc2541
Comment 6 Jekyll Wu 2012-03-11 11:51:52 UTC
*** Bug 295752 has been marked as a duplicate of this bug. ***
Comment 7 Jekyll Wu 2012-03-11 11:52:03 UTC
*** Bug 295754 has been marked as a duplicate of this bug. ***
Comment 8 Peter Penz 2012-03-13 19:08:27 UTC
*** Bug 295951 has been marked as a duplicate of this bug. ***
Comment 9 Peter Penz 2012-03-20 18:03:49 UTC
*** Bug 296448 has been marked as a duplicate of this bug. ***
Comment 10 Peter Penz 2012-03-23 10:00:47 UTC
*** Bug 296607 has been marked as a duplicate of this bug. ***
Comment 11 Peter Penz 2012-03-25 10:24:35 UTC
*** Bug 296729 has been marked as a duplicate of this bug. ***
Comment 12 Alex 2012-03-25 10:32:36 UTC
Where is unsub function here? I receive only notifications about dublicate bugs.
Comment 13 Peter Penz 2012-03-25 10:49:36 UTC
(In reply to comment #12)
> Where is unsub function here? I receive only notifications about dublicate
> bugs.

Please click on "edit" on CC: List (top-right) and remove your e-mail.
Comment 14 Peter Penz 2012-03-25 16:21:02 UTC
*** Bug 296752 has been marked as a duplicate of this bug. ***
Comment 15 Jekyll Wu 2012-03-29 07:43:28 UTC
*** Bug 297001 has been marked as a duplicate of this bug. ***