Menu

#656 recent files - gui hangs when tried to open a deleted file

open
nobody
puredata (322)
5
2011-03-30
2011-02-25
Anonymous
No

Needs checking for existence of file before opening from the list of recent files.

I just checkout from git repo and am on linux with tk8.5

Discussion

  • Anonymous

    Anonymous - 2011-03-15

    this patch should fix that.

    From 1b2db5e4348149b1cb7fa58fd62518a20a4d8550 Mon Sep 17 00:00:00 2001
    From: Yvan Volochine <yvan.volochine@gmail.com>
    Date: Tue, 15 Mar 2011 04:04:09 +0100
    Subject: [PATCH] fix: check for recent file existence

    ---
    tcl/wheredoesthisgo.tcl | 7 +++++--
    1 files changed, 5 insertions(+), 2 deletions(-)

    diff --git a/tcl/wheredoesthisgo.tcl b/tcl/wheredoesthisgo.tcl
    index 1e9e034..60b70fd 100644
    --- a/tcl/wheredoesthisgo.tcl
    +++ b/tcl/wheredoesthisgo.tcl
    @@ -6,7 +6,10 @@ package provide wheredoesthisgo 0.1
    proc open_file {filename} {
    set directory [file normalize [file dirname $filename]]
    set basename [file tail $filename]
    - if {[regexp -nocase -- "\.(pd|pat|mxt)$" $filename]} {
    + if {
    + [file exists $filename] == 1
    + && [regexp -nocase -- "\.(pd|pat|mxt)$" $filename]
    + } then {
    ::pdtk_canvas::started_loading_file [format "%s/%s" $basename $filename]
    pdsend "pd open [enquote_path $basename] [enquote_path $directory]"
    # remove duplicates first, then the duplicate added after to the top
    @@ -16,7 +19,7 @@ proc open_file {filename} {
    set ::recentfiles_list [lrange $::recentfiles_list 0 $::total_recentfiles]
    ::pd_menus::update_recentfiles_menu
    } {
    - ::pdwindow::post [format [_ "Ignoring '%s': doesn't look like a Pd-file"] $filename]
    + ::pdwindow::post [format [_ "Ignoring '%s': doesn't exist or look like a Pd-file"] $filename]
    }
    }

    --
    1.7.4.1

     
  • Anonymous

    Anonymous - 2011-03-15

    sorry for the bad formatting...
    the patch is there:
    http://pastebin.com/AhC3U5ti

     
  • Hans-Christoph Steiner

    • labels: 680483 --> puredata
     
  • Hans-Christoph Steiner

    I am assuming this is Yvan, good to see you submitting more patches.

    Patches that are pasting to text fields have high failure rates. Can you attach the patch as a file? Also, if you log in before submitting the patch, you'll automatically get email updates about the status of the patch, and we don't have to guess who submitted it :-)

     

Anonymous
Anonymous

Add attachments
Cancel