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

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

[Octave-bug-tracker] [bug #63548] GUI closing suddenly when selecting a


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #63548] GUI closing suddenly when selecting a recently deleted file
Date: Tue, 20 Dec 2022 08:36:47 -0500 (EST)

Follow-up Comment #12, bug #63548 (project octave):

The following change in file_editor_tab::load_file avoids the problem for me. 
I'm not sure why load_file wants to open the file for reading only, but that
fails if the file doesn't exist.  That failure is apparently not fatal unless
we are trying to reuse an existing "unnamed" buffer.


diff --git a/libgui/src/m-editor/file-editor-tab.cc
b/libgui/src/m-editor/file-editor-tab.cc
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -1802,7 +1802,7 @@ OCTAVE_BEGIN_NAMESPACE(octave)
     else
       file_to_load = fileName;
     QFile file (file_to_load);
-    if (!file.open(QIODevice::ReadOnly))
+    if (!file.open(QIODevice::ReadWrite))
       return file.errorString ();
 
     int col = 0, line = 0;


The attached (larger) diff also avoids the problem by not attempting to reuse
an existing "unnamed" buffer.

(file #54126)

    _______________________________________________________

Additional Item Attachment:

File name: no-reuse-file-diff.txt         Size:1 KB
    <https://file.savannah.gnu.org/file/no-reuse-file-diff.txt?file_id=54126>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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