Commit: 48f815b17e8bef8544af9c2ab10625547888c8ba
Author: Mateusz Grzeliński
Date:   Fri Aug 14 18:26:00 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB48f815b17e8bef8544af9c2ab10625547888c8ba

SpaceInfo: use single variable for log formatting

===================================================================

M       source/blender/blenloader/intern/versioning_defaults.c
M       source/blender/editors/space_info/info_draw_clog.c
M       source/blender/makesdna/DNA_space_types.h
M       source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.c
index 0d303f55c0f..f7732735e60 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -182,7 +182,6 @@ static void blo_update_defaults_screen(bScreen *screen,
       sinfo->report_mask_exclude = RPT_DEBUG_ALL;
       sinfo->log_severity_mask = INFO_CLOG_SEVERITY_MASK_DEFAULT;
       sinfo->log_format = INFO_CLOG_FORMAT_DEFAULT;
-      sinfo->use_short_file_line = true;
     }
     else if (area->spacetype == SPACE_TEXT) {
       /* Show syntax and line numbers in Script workspace text editor. */
diff --git a/source/blender/editors/space_info/info_draw_clog.c 
b/source/blender/editors/space_info/info_draw_clog.c
index d9143f9b5b0..548c965bf1a 100644
--- a/source/blender/editors/space_info/info_draw_clog.c
+++ b/source/blender/editors/space_info/info_draw_clog.c
@@ -199,14 +199,14 @@ void clog_textview_text_get(struct TextViewContext *tvc,
     BLI_dynstr_appendf(dynStr, "(%s) ", record->type->identifier);
   }
   if (sinfo->log_format & INFO_CLOG_SHOW_FILE_LINE) {
-    const char *file_line = (sinfo->use_short_file_line) ? 
BLI_path_basename(record->file_line) :
+    const char *file_line = (sinfo->log_format & 
INFO_CLOG_USE_SHORT_FILTE_LINE) ? BLI_path_basename(record->file_line) :
                                                            record->file_line;
     BLI_dynstr_appendf(dynStr, "%s ", file_line);
   }
   if (sinfo->log_format & INFO_CLOG_SHOW_FUNCTION) {
     BLI_dynstr_appendf(dynStr, "%s ", record->function);
   }
-  if (sinfo->use_log_message_new_line) {
+  if (sinfo->log_format & INFO_CLOG_USE_MESSAGE_NEW_LINE) {
     BLI_dynstr_append(dynStr, "\n");
   }
 
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index 3d230e9ff68..f1878ef3d09 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -129,14 +129,12 @@ typedef struct SpaceInfo {
   int report_mask_exclude;
   int active_index;
   char view;
-  char use_log_message_new_line;
-  char _pad1[6];
+  char _pad1[7];
 
   int log_format;
-  char use_short_file_line;
   /** for boolean properties use_log_*_filter */
   char use_log_filter;
-  char _pad2[2];
+  char _pad2[3];
 
   SpaceInfoFilter *search_filter;
 
@@ -184,10 +182,13 @@ typedef enum eSpaceInfo_logFormat {
   INFO_CLOG_SHOW_LEVEL = (1 << 2),
   INFO_CLOG_SHOW_FILE_LINE = (1 << 3),
   INFO_CLOG_SHOW_FUNCTION = (1 << 4),
+  INFO_CLOG_USE_MESSAGE_NEW_LINE = (1 << 5),
+  INFO_CLOG_USE_SHORT_FILTE_LINE = (1 << 6),
 } eSpaceInfo_logFormat;
 
 #define INFO_CLOG_FORMAT_DEFAULT \
-  INFO_CLOG_SHOW_LEVEL | INFO_CLOG_SHOW_FILE_LINE | INFO_CLOG_SHOW_FUNCTION
+  INFO_CLOG_SHOW_LEVEL | INFO_CLOG_SHOW_FILE_LINE | INFO_CLOG_SHOW_FUNCTION | \
+      INFO_CLOG_USE_MESSAGE_NEW_LINE | INFO_CLOG_USE_SHORT_FILTE_LINE
 
 /** \} */
 
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index fccaf430ba2..794ea5da68b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -6121,11 +6121,6 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Filter Log Severity", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
 
-  prop = RNA_def_property(srna, "use_short_file_line", PROP_BOOLEAN, 
PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_short_file_line", true);
-  RNA_def_property_ui_text(prop, "Shorten File Path", "");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
-
   prop = RNA_def_property(srna, "use_log_level_filter", PROP_BOOLEAN, 
PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", 
INFO_FILTER_CLOG_LEVEL);
   RNA_def_property_ui_text(prop, "Use Log Level Filter", "");
@@ -6172,11 +6167,6 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Log File Line Filter", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
 
-  prop = RNA_def_property(srna, "use_log_message_new_line", PROP_BOOLEAN, 
PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_log_message_new_line", true);
-  RNA_def_property_ui_text(prop, "Print Log Message In New Line", "");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
-
   prop = RNA_def_property(srna, "filter_log_level", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "filter_log_level");
   RNA_def_property_ui_text(prop, "Filter Log Level", "");
@@ -6196,7 +6186,16 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_enum_items(prop, rna_enum_log_format_items);
   RNA_def_property_ui_text(prop, "Log Printing format", "");
   RNA_def_property_flag(prop, PROP_ENUM_FLAG);
-  RNA_def_property_enum_default(prop, INFO_CLOG_FORMAT_DEFAULT);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "use_log_message_new_line", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "log_format", 
INFO_CLOG_USE_MESSAGE_NEW_LINE);
+  RNA_def_property_ui_text(prop, "Print Log Message In New Line", "");
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "use_short_file_line", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "log_format", 
INFO_CLOG_USE_SHORT_FILTE_LINE);
+  RNA_def_property_ui_text(prop, "Shorten File Path", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
 
   static const EnumPropertyItem rna_enum_view_type_items[] = {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to