<?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>309760</bug_id>
          
          <creation_ts>2012-11-08 17:54:04 +0000</creation_ts>
          <short_desc>Crash while inline-renaming a file and apply change with return-key</short_desc>
          <delta_ts>2012-11-09 11:11:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>dolphin</product>
          <component>general</component>
          <version>2.1</version>
          <rep_platform>Arch Linux</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></keywords>
          <priority>NOR</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emmanuel Pescosta">emmanuelpescosta099</reporter>
          <assigned_to name="Dolphin Bug Assignee">dolphin-bugs-null</assigned_to>
          
          
          <cf_commitlink>http://commits.kde.org/kde-baseapps/3143acc084d54d43df469b54762bfa10a7050a9f</cf_commitlink>
          <cf_versionfixedin>4.9.4</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1313621</commentid>
    <comment_count>0</comment_count>
    <who name="Emmanuel Pescosta">emmanuelpescosta099</who>
    <bug_when>2012-11-08 17:54:04 +0000</bug_when>
    <thetext>The crash was introduced with the commit 951cb9c35d7a9ef814b3de5b359915968da9b881

Author: Frank Reininghaus &lt;frank78ac@googlemail.com&gt;
Date:   Mon Nov 5 22:03:52 2012 +0100

    Prevent crashes caused by nested event loops run when renaming inline
    
    When renaming inline and starting a drag or invoking the context menu,
    a nested event loop will be run. If the role editor loses focus and
    emits roleEditingFinished(), we must prevent that deleteLater() is
    called because this would delete the role editor inside a nested event
    loop which is run from one of its own functions. We would get a crash
    when returning from that event loop otherwise.
    
    BUG: 308018
    BUG: 309421
    FIXED-IN: 4.9.4

Reproducible: Always

Steps to Reproduce:
1. Use inline-renaming instead of rename-dialog
2. Select a file
3. Start renaming
4. Accept changes with RETURN key.
Actual Results:  
Crash -&gt; File not renamed

Expected Results:  
Don&apos;t Crash -&gt; Rename the file

It works fine when you accept the changes with focus losing (click with the mouse outside the inline-renaming box) =&gt; It only crashes with RETURN key

A have already tried to fix that with Locking (QMutex, QMutexLocker), but that didn&apos;t work.

An &quot;ugly&quot; but working fix is, when we replace the line emitRoleEditingFinished(); (kitemlistroleeditor.cpp line 147) with clearFocus();
=&gt; So the event KItemListRoleEditor::event(QEvent* event) is only called once instead of two times, when you press the return key.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313628</commentid>
    <comment_count>1</comment_count>
    <who name="Frank Reininghaus">frank78ac</who>
    <bug_when>2012-11-08 18:30:36 +0000</bug_when>
    <thetext>Thanks Emmanuel! This was actually a rather tricky issue that I spent a lot
of time on, but nonetheless,I forgot to test this trivial use case. This
shows that I should have my own commits reviewed as well, at least the
non-trivial ones.

Using a mutex won&apos;t help because it&apos;s all in the same thread.

I&apos;m not sure when I&apos;ll have the time to look into this. If the clearFocus
hack works, feel free to commit that and add a TODO comment that we should
look for a better long-term solution.

Thanks again for investigating the mess that I caused!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313820</commentid>
    <comment_count>2</comment_count>
    <who name="Emmanuel Pescosta">emmanuelpescosta099</who>
    <bug_when>2012-11-09 11:11:23 +0000</bug_when>
    <thetext>Git commit 3143acc084d54d43df469b54762bfa10a7050a9f by Emmanuel Pescosta.
Committed on 09/11/2012 at 12:10.
Pushed by emmanuelp into branch &apos;KDE/4.9&apos;.

Fix Bug 309760 - Crash while inline-renaming a file and apply change with return-key
FIXED-IN: 4.9.4

M  +2    -1    dolphin/src/kitemviews/private/kitemlistroleeditor.cpp

http://commits.kde.org/kde-baseapps/3143acc084d54d43df469b54762bfa10a7050a9f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>