# HG changeset patch # User Kai Habel # Date 1290456795 -3600 # Node ID f44c479592560f9f43db3c5bde9098367c15cfd2 # Parent c5e6efdbcf677f3eeae49390f802a1caddd3ac5c uifilefun fixes diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-11-21 Kai Habel + + * (plot/uigetdir.m, plot/private/__fltk_file_filter__.m:): Check if + file argument is a valid path, don't use fileparts in this case. + 2010-11-21 Ben Abbott * plot/__go_draw_axes__.m: Fix plot titles so they are visible for diff --git a/scripts/plot/private/__fltk_file_filter__.m b/scripts/plot/private/__fltk_file_filter__.m --- a/scripts/plot/private/__fltk_file_filter__.m +++ b/scripts/plot/private/__fltk_file_filter__.m @@ -25,6 +25,7 @@ function retval = __fltk_file_filter__ (file_filter) # converts octave's file filter format into fltk's. + retval = ""; if (iscell (file_filter)) [r, c] = size (file_filter); if ((c == 0) || (c > 2)) @@ -61,10 +62,11 @@ endfor retval = fltk_str; elseif (ischar (file_filter)) - outargs{3} = file_filter; - [fdir, fname, fext] = fileparts (file_filter); - if (length (fext) > 0) - retval = strcat ("*", fext, "\t*"); + if (!isdir (file_filter)) + [fdir, fname, fext] = fileparts (file_filter); + if (length (fext) > 0) + retval = strcat ("*", fext, "\t*"); + endif endif endif endfunction diff --git a/scripts/plot/uigetdir.m b/scripts/plot/uigetdir.m --- a/scripts/plot/uigetdir.m +++ b/scripts/plot/uigetdir.m @@ -38,7 +38,9 @@ endif if (any (cellfun(@(x)strcmp (x, "fltk"), available_backends))) - init_path = fileparts (init_path); + if (!isdir (init_path)) + init_path = fileparts (init_path); + endif retdir = __fltk_uigetfile__ ("", name, init_path, [240, 120], "dir"); else error ("uigetdir requires fltk backend.");