octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56298] [Windows] File Browser "rename" operat


From: Rik
Subject: [Octave-bug-tracker] [bug #56298] [Windows] File Browser "rename" operation deletes file when only changing case of file name
Date: Mon, 13 May 2019 15:17:42 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #56298 (project octave):

                  Status:               Confirmed => Patch Submitted        

    _______________________________________________________

Follow-up Comment #5:

This is such a bother.  If I had to guess, they applied some sort of fix to
the rename() member function in QFile, but neglected to do the same to QDir. 
So, if we're nice, we should probably file an upstream bug about that.

I suppose we have to work around it until they fix it.  I tested and
QFile.rename seems to work for both files and directories.  This patch should
be enough


diff -r 4092ffc1e43c libgui/src/files-dock-widget.cc
--- a/libgui/src/files-dock-widget.cc   Fri May 10 22:15:37 2019 +0200
+++ b/libgui/src/files-dock-widget.cc   Mon May 13 12:14:37 2019 -0700
@@ -671,7 +671,8 @@ namespace octave
             // editor: close old
             emit file_remove_signal (old_name, new_name);
             // Do the renaming
-            bool st = path.rename (old_name, new_name);
+            QFile f (old_name);  // Must use QFile, not QDir (bug #56298)
+            bool st = f.rename (new_name);
             // editor: load new/old file depending on success
             emit file_renamed_signal (st);
             // Clear cache of file browser


Attached is a complete changeset for testing.


(file #46900)
    _______________________________________________________

Additional Item Attachment:

File name: bug56298.cset                  Size:1 KB
    <https://savannah.gnu.org/file/bug56298.cset?file_id=46900>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56298>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]