diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-09-05 00:27:43 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-09-05 00:27:43 +0400 |
commit | bbc47e96d32b3594dd4fc6eef616d725a8bd75e5 (patch) | |
tree | 8c0bddb6766d6c7f4da1e90079cf884fa911f1c1 /source/blender/src | |
parent | 72e8dd452cd2b4d8969c2ecdef4aa1356d498bb5 (diff) |
== imagebrowser ==
- fix: deleting bookmark didn't update .Bfs file (see tracker #7298)
- also fixed memleak, thanks to the guardedalloc :)
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/editimasel.c | 19 | ||||
-rw-r--r-- | source/blender/src/fsmenu.c | 31 |
2 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c index 506dadfe6bd..6111329e3e7 100644 --- a/source/blender/src/editimasel.c +++ b/source/blender/src/editimasel.c @@ -1058,15 +1058,18 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case XKEY: getmouseco_areawin(mval); if (simasel->flag & FILE_BOOKMARKS) { - if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) { - int nentries = fsmenu_get_nentries(); - set_active_bookmark(simasel, mval[1]); - if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) { - fsmenu_remove_entry(simasel->active_bookmark); - simasel->active_bookmark = -1; - do_draw = 1; - } + if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) { + int nentries = fsmenu_get_nentries(); + set_active_bookmark(simasel, mval[1]); + if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) { + char name[FILE_MAX]; + BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); + fsmenu_remove_entry(simasel->active_bookmark); + fsmenu_write_file(name); + simasel->active_bookmark = -1; + do_draw = 1; } + } } break; } diff --git a/source/blender/src/fsmenu.c b/source/blender/src/fsmenu.c index 1d03291b135..11c0bb6a96e 100644 --- a/source/blender/src/fsmenu.c +++ b/source/blender/src/fsmenu.c @@ -206,24 +206,21 @@ void fsmenu_remove_entry(int idx) idx--; if (fsme) { - if (prev) { - prev->next= fsme->next; - } else { - fsmenu= fsme->next; - if (fsme->save) { - if (prev) { - prev->next= fsme->next; - } else { - fsmenu= fsme->next; - } - // you should only be able to remove entries that were - // not added by default - if (fsme->path) { - MEM_freeN(fsme->path); - } - MEM_freeN(fsme); + /* you should only be able to remove entries that were + not added by default, like windows drives. + also separators (where path == NULL) shouldn't be removed */ + if (fsme->save && fsme->path) { + + /* remove fsme from list */ + if (prev) { + prev->next= fsme->next; + } else { + fsmenu= fsme->next; } - } + /* free entry */ + MEM_freeN(fsme->path); + MEM_freeN(fsme); + } } } |