Outliner: Remove User Preferences
authorDalai Felinto <dfelinto@gmail.com>
Fri, 19 Jan 2018 17:44:26 +0000 (15:44 -0200)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 19 Jan 2018 18:06:14 +0000 (16:06 -0200)
This was introduced to the outliner when we had no User Preference
window back in 2.5x. Right now it makes no sense to keep this around.

But how about addon user preferences:
* They belong in the user preference window under the addon.

How about the user preferences themselves:
* You find them in the user preference window.

And templates?
* Why are they here in the first place?

After talking to Pablo Vazquez (who in turn poked Sergey Sharybin) we found
it reasonable to get rid of this. If it turns out that we were wrong we
revert this.

As for leaving this exposed as a debug option (as suggested on IRC) I would say
no, please. This end up polluting the code and never cleaned up in the end.
(this was specific talking about templates).

Technical note: I left the functions in outliner still hanging around.
While I used UNUSED_FUNCTION for one of them, for the other one I had to use:
`#if 0` because the function was calling itself, which would fail to build if
I used UNUSED_FUNCTION.

release/scripts/startup/bl_ui/space_outliner.py
source/blender/blenloader/intern/versioning_260.c
source/blender/blenloader/intern/versioning_280.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

index eb259eece66350e09bc14a4c850fc3c54e78b914..8b46ae99b8c571468212872c0fe71ee6e52a6a50 100644 (file)
@@ -138,7 +138,7 @@ class OUTLINER_MT_view(Menu):
 
         space = context.space_data
 
-        if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES'}:
+        if space.display_mode != 'DATABLOCKS':
             layout.prop(space, "use_sort_alpha")
             layout.prop(space, "show_restrict_columns")
             layout.separator()
index d26c30e6d31222d5f353ff381e4436db6edb2f36..3ac934f7de7e2613fc3b73aa79f561f1e4239718 100644 (file)
@@ -2458,8 +2458,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                                                          SO_GROUPS,
                                                          SO_LIBRARIES,
                                                          SO_SEQUENCE,
-                                                         SO_DATABLOCKS,
-                                                         SO_USERDEF))
+                                                         SO_DATABLOCKS))
                                                {
                                                        so->outlinevis = SO_SCENES;
                                                }
index 1f92852e54fd2cde407ccf5a29e8933143a1ce09..b5530d9033034e0a2f87b8d7b9745d065bc0e067 100644 (file)
@@ -903,7 +903,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
                                                                          SO_LIBRARIES,
                                                                          SO_SEQUENCE,
                                                                          SO_DATABLOCKS,
-                                                                         SO_USERDEF,
                                                                  SO_ID_ORPHANS,
                                                                  SO_VIEW_LAYER,
                                                                  SO_COLLECTIONS))
index c903a5026cfb803fd930fb2f2e3f9dc0f3976110..807a6555a01fb32cb4956a976f7ecb713898110b 100644 (file)
@@ -671,7 +671,7 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOops *soops
        }
 }
 
-static void outliner_draw_rnacols(ARegion *ar, int sizex)
+static void UNUSED_FUNCTION(outliner_draw_rnacols)(ARegion *ar, int sizex)
 {
        View2D *v2d = &ar->v2d;
 
@@ -697,6 +697,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex)
        immUnbindProgram();
 }
 
+#if 0
 static void outliner_draw_rnabuts(uiBlock *block, ARegion *ar, SpaceOops *soops, int sizex, ListBase *lb)
 {
        TreeElement *te;
@@ -741,6 +742,7 @@ static void outliner_draw_rnabuts(uiBlock *block, ARegion *ar, SpaceOops *soops,
 
        UI_block_emboss_set(block, UI_EMBOSS);
 }
+#endif
 
 static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, TreeElement *te)
 {
@@ -1788,7 +1790,7 @@ static void outliner_draw_tree(
 
        glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); // only once
 
-       if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
+       if (soops->outlinevis == SO_DATABLOCKS) {
                /* struct marks */
                starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET;
                outliner_draw_struct_marks(ar, soops, &soops->tree, &starty);
@@ -1911,7 +1913,7 @@ void draw_outliner(const bContext *C)
        /* get extents of data */
        outliner_height(soops, &soops->tree, &sizey);
 
-       if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
+       if (soops->outlinevis == SO_DATABLOCKS) {
                /* RNA has two columns:
                 *  - column 1 is (max_width + OL_RNA_COL_SPACEX) or
                 *                               (OL_RNA_COL_X), whichever is wider...
@@ -1958,13 +1960,8 @@ void draw_outliner(const bContext *C)
        outliner_back(ar);
        block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
        outliner_draw_tree((bContext *)C, block, scene, view_layer, ar, soops, has_restrict_icons, &te_edit);
-       
-       if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
-               /* draw rna buttons */
-               outliner_draw_rnacols(ar, sizex_rna);
-               outliner_draw_rnabuts(block, ar, soops, sizex_rna, &soops->tree);
-       }
-       else if ((soops->outlinevis == SO_ID_ORPHANS) && has_restrict_icons) {
+
+       if ((soops->outlinevis == SO_ID_ORPHANS) && has_restrict_icons) {
                /* draw user toggle columns */
                outliner_draw_restrictcols(ar);
                outliner_draw_userbuts(block, ar, soops, &soops->tree);
index e13177a862aadf30ceb9bf81602ef7c50bc04578..b9222e62bb0458c33291e564d29d7d83409197f1 100644 (file)
@@ -1005,7 +1005,7 @@ static bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_
 
 static bool outliner_is_co_within_restrict_columns(const SpaceOops *soops, const ARegion *ar, float view_co_x)
 {
-       return (!ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF) &&
+       return ((soops->outlinevis != SO_DATABLOCKS) &&
                !(soops->flag & SO_HIDE_RESTRICTCOLS) &&
                (view_co_x > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX));
 }
index 78956db6de269d1bf803b43adad783b2ea487249..be60312b1105cdc6ca6d04f1b4b6d56979749e2e 100644 (file)
@@ -2292,18 +2292,6 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa
                        tselem->flag &= ~TSE_CLOSED;
                }
        }
-       else if (soops->outlinevis == SO_USERDEF) {
-               PointerRNA userdefptr;
-
-               RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &userdefptr);
-
-               ten = outliner_add_element(soops, &soops->tree, (void *)&userdefptr, NULL, TSE_RNA_STRUCT, -1);
-
-               if (show_opened) {
-                       tselem = TREESTORE(ten);
-                       tselem->flag &= ~TSE_CLOSED;
-               }
-       }
        else if (soops->outlinevis == SO_ID_ORPHANS) {
                outliner_add_orphaned_datablocks(mainvar, soops);
        }
index 16ddce72dae3336bb6d758f248f25b3899726a78..077ac4f7aa32d596d62026634c9b64d269dc0546 100644 (file)
@@ -342,7 +342,7 @@ typedef enum eSpaceOutliner_Mode {
        /* SO_VERSE_MS       = 9, */  /* deprecated! */
        SO_SEQUENCE       = 10,
        SO_DATABLOCKS     = 11,
-       SO_USERDEF        = 12,
+       /* SO_USERDEF        = 12, */  /* deprecated! */
        /* SO_KEYMAP      = 13, */    /* deprecated! */
        SO_ID_ORPHANS     = 14,
        SO_VIEW_LAYER     = 15,
index b2892f7e9a9d1c8ac1f851994119a2d1637d0d8b..4ff8444cd71b4a464f90d6f757ac27a4e820cb3c 100644 (file)
@@ -2109,7 +2109,6 @@ static void rna_def_space_outliner(BlenderRNA *brna)
                {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"},
                {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
                {SO_DATABLOCKS, "DATABLOCKS", 0, "Data-Blocks", "Display all raw data-blocks"},
-               {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"},
                {SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data",
                                "Display data-blocks which are unused and/or will be lost when the file is reloaded"},
                {0, NULL, 0, NULL, NULL}