Bug 352981 - Newline \n does not work with --inputbox
Summary: Newline \n does not work with --inputbox
Status: RESOLVED FIXED
Alias: None
Product: kdialog
Classification: Applications
Component: general (show other bugs)
Version: 1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Brad Hards
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-21 12:42 UTC by Tristan Miller
Modified: 2020-10-12 14:03 UTC (History)
1 user (show)

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


Attachments
Fixes Bug 352981 (901 bytes, patch)
2015-09-27 19:23 UTC, Tristan Miller
Details
Fixes Bug 352981 (520 bytes, patch)
2015-09-27 19:54 UTC, Tristan Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2015-09-21 12:42:43 UTC
As mentioned in the first comment to Bug 148575, the newline escape sequence ("\n") does not work with --inputbox.

The code

kdialog --msgbox "foo\nbar"

works as expected, but

kdialog --inputbox "foo\nbar"

does not. I'm using KDialog 1.0 on KDE 4.14.9.

Reproducible: Always

Steps to Reproduce:
1. kdialog --inputbox "foo\nbar"


Actual Results:  
2. Dialog appears with the following text:

foo\nbar

Expected Results:  
2. Dialog should appear with the following text:

foo
bar
Comment 1 Benedikt Geißler 2015-09-27 16:03:28 UTC
I can confirm this bug with Debian testing/stretch.
The output from kdialog --version is:
Qt: 4.8.7
KDE: 4.14.10
KDialog: 1.0
Comment 2 Tristan Miller 2015-09-27 19:23:35 UTC
Created attachment 94746 [details]
Fixes Bug 352981

The attached patch fixes this bug.
Comment 3 Tristan Miller 2015-09-27 19:54:47 UTC
Created attachment 94749 [details]
Fixes Bug 352981

Please ignore the previous patch; I mistakenly uploaded the wrong file.
Comment 4 Tristan Miller 2020-09-30 07:31:49 UTC
Problem is still reproducible with KDialog 20.08.1.
Comment 5 Tristan Miller 2020-09-30 07:55:36 UTC
The --password and --newpassword dialogs have the same problem.  Possibly further dialogs are also affected.
Comment 6 Tristan Miller 2020-09-30 07:56:26 UTC
Comment on attachment 94749 [details]
Fixes Bug 352981

Patch is now obsolete due to API changes and refactoring/further development of kdialog.cpp.
Comment 7 Tristan Miller 2020-10-12 14:03:40 UTC
Git commit 3a34c761a0ef28d8ae1028caae82ead2059a079b by Tristan Miller.
Committed on 12/10/2020 at 13:59.
Pushed by sitter into branch 'master'.

make \n work with (img)inputbox and (new)password

Note that \n in password prompts are converted to spaces due to
bug#427141.

M  +6    -4    src/kdialog.cpp

https://invent.kde.org/utilities/kdialog/commit/3a34c761a0ef28d8ae1028caae82ead2059a079b