<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>452994</bug_id>
          
          <creation_ts>2022-04-25 15:52:00 +0000</creation_ts>
          <short_desc>Name field doesn&apos;t seem to have any history; cannot undo or redo any text changes with Ctrl+Z or Shift+Ctrl+Z</short_desc>
          <delta_ts>2023-05-15 19:49:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kio</product>
          <component>Open/save dialogs</component>
          <version>5.93.0</version>
          <rep_platform>Fedora RPMs</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>usability</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>redashesyellowflowers</reporter>
          <assigned_to name="KIO Bugs">kio-bugs-null</assigned_to>
          <cc>a.samirh78</cc>
    
    <cc>kdelibs-bugs-null</cc>
    
    <cc>nate</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kio/commit/42395623a8fb577a70188b7db6d2b5c42386867c</cf_commitlink>
          <cf_versionfixedin>5.97</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2119254</commentid>
    <comment_count>0</comment_count>
    <who name="">redashesyellowflowers</who>
    <bug_when>2022-04-25 15:52:00 +0000</bug_when>
    <thetext>SUMMARY
***
KDialog&apos;s Name field doesn&apos;t seem to have any history. Cannot undo or redo any text changes with Ctrl+Z or Shift+Ctrl+Z. I&apos;m not sure if this is a bug or a feature request as I&apos;m not sure if KDialog has this feature but it&apos;s turned off for some reason.
***

STEPS TO REPRODUCE
1. Open a browser, and try to save an element. KDialog opens. 
2. Type some text into the Name field.
3. Try to use Ctrl+Z or Shift+Ctrl+Z to undo or redo the changes.

OBSERVED RESULT

There doesn&apos;t seem to be any text history saved, so you can&apos;t undo or redo the changes.


EXPECTED RESULT

The problem is that if I spend 30 seconds typing some text to customize my file name just as I want it, and accidentally select a file in the Directory Contents view, I lose everything I typed. Or if I copy and paste text into the field and accidently overwrite existing text, I lose all my previous text. This happens annoyingly often. 

A dialog manager needs a text history feature.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE Neon 20.04; Fedora 35

[Fedora KDE 35 Version Numbers Below]
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121179</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2022-05-04 15:19:57 +0000</bug_when>
    <thetext>https://invent.kde.org/frameworks/kio/-/merge_requests/808</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136753</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2022-07-03 19:52:38 +0000</bug_when>
    <thetext>Git commit 331aad501acea58013a7cf89e18919f945394396 by Ahmad Samir.
Committed on 03/07/2022 at 19:26.
Pushed by ahmadsamir into branch &apos;master&apos;.

KFileWidget: remove location history dummy-entry related code

This code was used in m_locationEdit (&quot;Name&quot; combobox).

The issue with this code is that it ultimately invokes QLineEdit::setText(),
which resets the undo/redo steps for the text in the lineedit at index -1,
with every key press event.

So we lose one functionality, showing the corresponding icon for the url in
the lineedit, but gain the undo/redo functionality, the latter being a
functionality that is available/expectted in all Qt/KDE lineedits.

0x00007ffff6b9aa40 in QLineEdit::setText(QString const&amp;)@plt () from /lib64/libQt5Widgets.so.5
0x00007ffff6cb8a83 in QComboBoxPrivate::_q_dataChanged (this=0x5555558f9560, topLeft=..., bottomRight=...)

0x00007ffff5e23235 in QAbstractItemModel::dataChanged (this=this@entry=0x5555558f9800, _t1=..., _t2=..., _t3=...)
0x00007ffff66d7780 in QStandardItemModelPrivate::itemChanged (this=&lt;optimized out&gt;, item=item@entry=0x555555d8cfe0, roles=...)
0x00007ffff66d7ff8 in QStandardItem::setData (this=0x555555d8cfe0, value=..., role=&lt;optimized out&gt;)
0x00007ffff66db16c in QStandardItemModel::setData (role=1, value=..., index=..., this=0x5555558f9800)
QStandardItemModel::setData (this=this@entry=0x5555558f9800, index=..., value=..., role=role@entry=1)
0x00007ffff6cb369f in QComboBox::setItemIcon (this=&lt;optimized out&gt;, index=index@entry=0, icon=...)
0x00007ffff7f30501 in KFileWidgetPrivate::setDummyHistoryEntry (this=this@entry=0x5555556ddbb0, text=..., icon=...,
  usePreviousPixmapIfNull=usePreviousPixmapIfNull@entry=true)

M  +11   -107  src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/commit/331aad501acea58013a7cf89e18919f945394396</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2230551</commentid>
    <comment_count>3</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2023-05-15 19:49:14 +0000</bug_when>
    <thetext>Git commit 42395623a8fb577a70188b7db6d2b5c42386867c by Christoph Cullmann, on behalf of Ahmad Samir.
Committed on 15/05/2023 at 19:48.
Pushed by cullmann into branch &apos;master&apos;.

KFileWidget: remove location history dummy-entry related code

This code was used in m_locationEdit (&quot;Name&quot; combobox).

The issue with this code is that it ultimately invokes QLineEdit::setText(),
which resets the undo/redo steps for the text in the lineedit at index -1,
with every key press event.

So we lose one functionality, showing the corresponding icon for the url in
the lineedit, but gain the undo/redo functionality, the latter being a
functionality that is available/expectted in all Qt/KDE lineedits.

0x00007ffff6b9aa40 in QLineEdit::setText(QString const&amp;)@plt () from /lib64/libQt5Widgets.so.5
0x00007ffff6cb8a83 in QComboBoxPrivate::_q_dataChanged (this=0x5555558f9560, topLeft=..., bottomRight=...)

0x00007ffff5e23235 in QAbstractItemModel::dataChanged (this=this@entry=0x5555558f9800, _t1=..., _t2=..., _t3=...)
0x00007ffff66d7780 in QStandardItemModelPrivate::itemChanged (this=&lt;optimized out&gt;, item=item@entry=0x555555d8cfe0, roles=...)
0x00007ffff66d7ff8 in QStandardItem::setData (this=0x555555d8cfe0, value=..., role=&lt;optimized out&gt;)
0x00007ffff66db16c in QStandardItemModel::setData (role=1, value=..., index=..., this=0x5555558f9800)
QStandardItemModel::setData (this=this@entry=0x5555558f9800, index=..., value=..., role=role@entry=1)
0x00007ffff6cb369f in QComboBox::setItemIcon (this=&lt;optimized out&gt;, index=index@entry=0, icon=...)
0x00007ffff7f30501 in KFileWidgetPrivate::setDummyHistoryEntry (this=this@entry=0x5555556ddbb0, text=..., icon=...,
  usePreviousPixmapIfNull=usePreviousPixmapIfNull@entry=true)

M  +11   -107  src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/commit/42395623a8fb577a70188b7db6d2b5c42386867c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>