Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-06-05 00:07:06 +0400
committerAndrea Weikert <elubie@gmx.net>2009-06-05 00:07:06 +0400
commitb0b8700a83c9cc6df0582336743cfcd3f863917c (patch)
tree52847adfc95732d4c57343c10831c0ebdf3f5a48 /source/blender/editors/space_file/filelist.c
parent35914d8ca2333808f9ec354ba91e3f63efe16e9c (diff)
2.5 filebrowser
* code cleanup: removed unused fileselect mode (type) * brought back 'hide dot files', needs proper storing of the settings still.
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r--source/blender/editors/space_file/filelist.c99
1 files changed, 40 insertions, 59 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 01cdf559c58..f60b6f08348 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -113,7 +113,6 @@ typedef struct FileList
int numfiles;
int numfiltered;
char dir[FILE_MAX];
- short type;
int has_func;
short prv_w;
short prv_h;
@@ -358,12 +357,6 @@ void filelist_free_icons()
struct FileList* filelist_new()
{
FileList* p = MEM_callocN( sizeof(FileList), "filelist" );
- p->filelist = 0;
- p->numfiles = 0;
- p->dir[0] = '\0';
- p->type = 0;
- p->has_func = 0;
- p->filter = 0;
return p;
}
@@ -373,7 +366,6 @@ struct FileList* filelist_copy(struct FileList* filelist)
BLI_strncpy(p->dir, filelist->dir, FILE_MAX);
p->filelist = NULL;
p->fidx = NULL;
- p->type = filelist->type;
return p;
}
@@ -413,6 +405,7 @@ void filelist_free(struct FileList* filelist)
filelist->filelist = 0;
filelist->filter = 0;
filelist->numfiltered =0;
+ filelist->hide_dot =0;
}
int filelist_numfiles(struct FileList* filelist)
@@ -510,48 +503,46 @@ void filelist_loadimage(struct FileList* filelist, int index)
if (!filelist->filelist[fidx].image)
{
- if (filelist->type != FILE_MAIN)
- {
- if ( (filelist->filelist[fidx].flags & IMAGEFILE) || (filelist->filelist[fidx].flags & MOVIEFILE) ) {
- imb = IMB_thumb_read(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL);
- }
- if (imb) {
- if (imb->x > imb->y) {
- scaledx = (float)imgwidth;
- scaledy = ( (float)imb->y/(float)imb->x )*imgwidth;
- }
- else {
- scaledy = (float)imgheight;
- scaledx = ( (float)imb->x/(float)imb->y )*imgheight;
- }
- ex = (short)scaledx;
- ey = (short)scaledy;
-
- dx = imgwidth - ex;
- dy = imgheight - ey;
-
- // IMB_scaleImBuf(imb, ex, ey);
- filelist->filelist[fidx].image = imb;
- } else {
- /* prevent loading image twice */
- FileImage* limg = filelist->loadimages.first;
- short found= 0;
- while(limg) {
- if (limg->index == fidx) {
- found= 1;
- break;
- }
- limg= limg->next;
- }
- if (!found) {
- FileImage* limg = MEM_callocN(sizeof(struct FileImage), "loadimage");
- limg->index= fidx;
- limg->lock= 0;
- limg->filelist= filelist;
- BLI_addtail(&filelist->loadimages, limg);
+
+ if ( (filelist->filelist[fidx].flags & IMAGEFILE) || (filelist->filelist[fidx].flags & MOVIEFILE) ) {
+ imb = IMB_thumb_read(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL);
+ }
+ if (imb) {
+ if (imb->x > imb->y) {
+ scaledx = (float)imgwidth;
+ scaledy = ( (float)imb->y/(float)imb->x )*imgwidth;
+ }
+ else {
+ scaledy = (float)imgheight;
+ scaledx = ( (float)imb->x/(float)imb->y )*imgheight;
+ }
+ ex = (short)scaledx;
+ ey = (short)scaledy;
+
+ dx = imgwidth - ex;
+ dy = imgheight - ey;
+
+ // IMB_scaleImBuf(imb, ex, ey);
+ filelist->filelist[fidx].image = imb;
+ } else {
+ /* prevent loading image twice */
+ FileImage* limg = filelist->loadimages.first;
+ short found= 0;
+ while(limg) {
+ if (limg->index == fidx) {
+ found= 1;
+ break;
}
- }
- }
+ limg= limg->next;
+ }
+ if (!found) {
+ FileImage* limg = MEM_callocN(sizeof(struct FileImage), "loadimage");
+ limg->index= fidx;
+ limg->lock= 0;
+ limg->filelist= filelist;
+ BLI_addtail(&filelist->loadimages, limg);
+ }
+ }
}
}
@@ -826,16 +817,6 @@ void filelist_swapselect(struct FileList* filelist)
}
}
-void filelist_settype(struct FileList* filelist, int type)
-{
- filelist->type = type;
-}
-
-short filelist_gettype(struct FileList* filelist)
-{
- return filelist->type;
-}
-
void filelist_sort(struct FileList* filelist, short sort)
{
struct direntry *file;