style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / editors / space_file / file_draw.c
index 1faa69d60e02e84e8e1c6562cf1c05151345d110..4d764bff311d5fb274719564c3a554682de66085 100644 (file)
@@ -157,7 +157,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
        if (available_w <= loadbutton + separator + input_minw 
         || params->title[0] == 0) {
                loadbutton = 0;
-       } else {
+       }
+       else {
                line1_w -= (loadbutton + separator);
                line2_w  = line1_w;
        }
@@ -166,7 +167,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
        fnumbuttons = 2 * btn_fn_w;
        if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
                fnumbuttons = 0;
-       } else {
+       }
+       else {
                line2_w -= (fnumbuttons + separator);
        }
        
@@ -183,7 +185,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
                uiButSetCompleteFunc(but, autocomplete_directory, NULL);
                uiButSetFlag(but, UI_BUT_NO_UTF8);
 
-               if((params->flag & FILE_DIRSEL_ONLY) == 0) {
+               if ((params->flag & FILE_DIRSEL_ONLY) == 0) {
                        but = uiDefBut(block, TEX, B_FS_FILENAME, "",
                                       min_x, line2_y, line2_w-chan_offs, btn_h,
                                       params->file, 0.0, (float)FILE_MAXFILE, 0, 0,
@@ -193,7 +195,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
                        uiButClearFlag(but, UI_BUT_UNDO); /* operator button above does this automatic */
 
                        /* check if this overrides a file and if the operator option is used */
-                       if(overwrite_alert) {
+                       if (overwrite_alert) {
                                uiButSetFlag(but, UI_BUT_REDALERT);
                        }
                }
@@ -220,7 +222,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
        }
        
        /* Execute / cancel buttons. */
-       if(loadbutton) {
+       if (loadbutton) {
                
                uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, IFACE_(params->title),
                        max_x - loadbutton, line1_y, loadbutton, btn_h, TIP_(params->title));
@@ -247,7 +249,7 @@ static int get_file_icon(struct direntry *file)
                if ( strcmp(file->relname, "..") == 0) {
                                return  ICON_FILE_PARENT;
                }
-               if(file->flags & BLENDERFILE) {
+               if (file->flags & BLENDERFILE) {
                        return ICON_FILE_BLEND;
                }
                return ICON_FILE_FOLDER;
@@ -343,7 +345,8 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
                                scaledx =  ( (float)imb->x/(float)imb->y )*layout->prv_h;
                                scale = scaledy/imb->y;
                        }
-               } else {
+               }
+               else {
                        scaledx = (float)imb->x;
                        scaledy = (float)imb->y;
                        scale = 1.0;
@@ -396,7 +399,7 @@ static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname)
        BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename));
        BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename);
 
-       if( strcmp(orgname, newname) != 0 ) {
+       if ( strcmp(orgname, newname) != 0 ) {
                if (!BLI_exists(newname)) {
                        BLI_rename(orgname, newname);
                        /* to make sure we show what is on disk */
@@ -477,7 +480,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
        /* adjust, so the next row is already drawn when scrolling */
        if (layout->flag & FILE_LAYOUT_HOR) {
                numfiles_layout += layout->rows;
-       } else {
+       }
+       else {
                numfiles_layout += layout->columns;
        }
 
@@ -515,7 +519,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
                        }
                        
                        file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
-               } else {
+               }
+               else {
                        file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
                        sx += ICON_DEFAULT_WIDTH_SCALE + 4;
                }
@@ -544,7 +549,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
                                file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);        
                                sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
                        }
-               } else if (params->display == FILE_LONGDISPLAY) {
+               }
+               else if (params->display == FILE_LONGDISPLAY) {
                        sx += (int)layout->column_widths[COLUMN_NAME] + 12;
 
 #ifndef WIN32