From 112f375ec175e5aedfb58a3a3bf76535cc959575 Mon Sep 17 00:00:00 2001 From: Weinan Li Date: Wed, 10 Sep 2025 15:19:36 +0800 Subject: informationpanel: use QTextEdit for filename display to avoid newlines in copied text QLabel does not support line wrapping at arbitrary positions. The original code achieved word wrap by manually adding newline characters to the text, which resulted in these newlines being included when the filename was selected and copied. This patch replaces QLabel with QTextEdit for filename display, leveraging QTextEdit's built-in word wrap functionality that handles line breaks purely for display without modifying the underlying text. This ensures copied filenames remain free of unintended newlines. BUG: 493279 --- src/panels/information/informationpanelcontent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/panels/information/informationpanelcontent.h') diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h index 333b26608..58adfb9c0 100644 --- a/src/panels/information/informationpanelcontent.h +++ b/src/panels/information/informationpanelcontent.h @@ -13,6 +13,7 @@ #include #include #include +#include class KFileItemList; class MediaWidget; @@ -146,7 +147,7 @@ private: PixmapViewer *m_preview; MediaWidget *m_mediaWidget; - QLabel *m_nameLabel; + QTextEdit *m_nameLabel; Baloo::FileMetaDataWidget *m_metaDataWidget; QScrollArea *m_metaDataArea; QLabel *m_configureLabel; -- cgit v1.3