changing between libraries with the append/link library selector didnt re-read a...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 May 2008 13:18:56 +0000 (13:18 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 May 2008 13:18:56 +0000 (13:18 +0000)
it looks like this only ever worked for the first library selected.

source/blender/src/filesel.c

index bfff2f10ab6d5456075a7eaaf3a2ee1a42a1728e..9689ffdafebc76ec5a2dd8d9d20eb96c8658cc83 100644 (file)
@@ -1588,8 +1588,7 @@ static void do_filesel_buttons(short event, SpaceFile *sfile)
                BLI_strncpy(sfile->dir, butname, sizeof(sfile->dir));
 
                /* strip the trailing slash if its a real dir */
-               if (strlen(butname)!=1)
-                       butname[strlen(butname)-1]=0;
+               BLI_del_slash(butname);
                
                if(sfile->type & FILE_UNIX) {
                        if (!BLI_exists(butname)) {
@@ -1633,6 +1632,11 @@ static void do_filesel_buttons(short event, SpaceFile *sfile)
                        BLI_strncpy(sfile->dir, lib->filename, sizeof(sfile->dir));
                        BLI_make_exist(sfile->dir);
                        BLI_cleanup_dir(G.sce, sfile->dir);
+                       
+                       /* forced re-reading the blend file */
+                       if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
+                       sfile->libfiledata= 0;
+                       
                        freefilelist(sfile);
                        sfile->ofs= 0;
                        scrarea_queue_winredraw(curarea);