style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / editors / space_info / info_ops.c
index bceb7c3d747af78b045c2f878a6c3d92f863bc4c..3157b920ff09096400a4a16075c34997753f8466 100644 (file)
@@ -85,16 +85,16 @@ static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
        ImBuf *ibuf;
 
        // first check for dirty images
-       for(ima=bmain->image.first; ima; ima=ima->id.next) {
-               if(ima->ibufs.first) { /* XXX FIX */
+       for (ima=bmain->image.first; ima; ima=ima->id.next) {
+               if (ima->ibufs.first) { /* XXX FIX */
                        ibuf= BKE_image_get_ibuf(ima, NULL);
                        
-                       if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
+                       if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
                                break;
                }
        }
 
-       if(ima) {
+       if (ima) {
                uiPupMenuOkee(C, "FILE_OT_pack_all", "Some images are painted on. These changes will be lost. Continue?");
                return OPERATOR_CANCELLED;
        }
@@ -132,7 +132,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op)
        Main *bmain= CTX_data_main(C);
        int method= RNA_enum_get(op->ptr, "method");
 
-       if(method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */
+       if (method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */
        G.fileflags &= ~G_AUTOPACK;
 
        return OPERATOR_FINISHED;
@@ -148,13 +148,13 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
        
        count = countPackedFiles(bmain);
        
-       if(!count) {
+       if (!count) {
                BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled");
                G.fileflags &= ~G_AUTOPACK;
                return OPERATOR_CANCELLED;
        }
 
-       if(count == 1)
+       if (count == 1)
                strcpy(title, "Unpack 1 file");
        else
                BLI_snprintf(title, sizeof(title), "Unpack %d files", count);
@@ -193,7 +193,7 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op)
 {
        Main *bmain= CTX_data_main(C);
 
-       if(!G.relbase_valid) {
+       if (!G.relbase_valid) {
                BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file");
                return OPERATOR_CANCELLED;
        }
@@ -225,7 +225,7 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op)
 {
        Main *bmain= CTX_data_main(C);
 
-       if(!G.relbase_valid) {
+       if (!G.relbase_valid) {
                BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file");
                return OPERATOR_CANCELLED;
        }
@@ -339,7 +339,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
        int send_note= 0;
        
        /* escape if not our timer */
-       if            (reports->reporttimer==NULL) ||
+       if (            (reports->reporttimer==NULL) ||
                        (reports->reporttimer != event->customdata) ||
                        ((report= BKE_reports_last_displayable(reports))==NULL) /* may have been deleted */
        ) {
@@ -363,15 +363,17 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
 
        if (rti->widthfac == 0.0f) {
                /* initialize colors based on report type */
-               if(report->type & RPT_ERROR_ALL) {
+               if (report->type & RPT_ERROR_ALL) {
                        rti->col[0] = 1.0;
                        rti->col[1] = 0.2;
                        rti->col[2] = 0.0;
-               } else if(report->type & RPT_WARNING_ALL) {
+               }
+               else if (report->type & RPT_WARNING_ALL) {
                        rti->col[0] = 1.0;
                        rti->col[1] = 1.0;
                        rti->col[2] = 0.0;
-               } else if(report->type & RPT_INFO_ALL) {
+               }
+               else if (report->type & RPT_INFO_ALL) {
                        rti->col[0] = 0.3;
                        rti->col[1] = 0.45;
                        rti->col[2] = 0.7;
@@ -384,7 +386,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
        color_progress = (float)reports->reporttimer->duration / color_timeout;
        
        /* save us from too many draws */
-       if(color_progress <= 1.0f) {
+       if (color_progress <= 1.0f) {
                send_note= 1;
                
                /* fade colors out sharply according to progress through fade-out duration */
@@ -399,7 +401,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
                send_note= 1;
        }
        
-       if(send_note) {
+       if (send_note) {
                WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
        }