[Bf-blender-cvs] [42d907a] temp_widgets_c++_experiment: Cleanup: Naming, don't pass object as argument for own function

Julian Eisel noreply at git.blender.org
Sun Dec 20 20:34:56 CET 2015


Commit: 42d907ad29c5146fcaaa8c25d03a52fc058fe851
Author: Julian Eisel
Date:   Sun Dec 20 19:49:34 2015 +0100
Branches: temp_widgets_c++_experiment
https://developer.blender.org/rB42d907ad29c5146fcaaa8c25d03a52fc058fe851

Cleanup: Naming, don't pass object as argument for own function

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

M	source/blender/windowmanager/intern/widgets/wm_widgetmap.cc
M	source/blender/windowmanager/intern/widgets/wm_widgetmap.h
M	source/blender/windowmanager/intern/widgets/wm_widgets_c_api.cc

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

diff --git a/source/blender/windowmanager/intern/widgets/wm_widgetmap.cc b/source/blender/windowmanager/intern/widgets/wm_widgetmap.cc
index 4f3daa0..211a355 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widgetmap.cc
+++ b/source/blender/windowmanager/intern/widgets/wm_widgetmap.cc
@@ -54,17 +54,13 @@
 
 wmWidgetMap::wmWidgetMap()
 {
-	
 }
 
-void wmWidgetMap::find_from_type(
-        wmWidgetMap *wmap, const char *idname,
-        const int spaceid, const int regionid,
-        const bool is_3d)
+void wmWidgetMap::init(const char *idname, const int spaceid, const int regionid, const bool is_3d)
 {
 	wmWidgetMapType *wmaptype = WM_widgetmaptype_find(idname, spaceid, regionid, is_3d, true);
 
-	wmap->type = wmaptype;
+	type = wmaptype;
 
 	/* create all widgetgroups for this widgetmap. We may create an empty one
 	 * too in anticipation of widgets from operators etc */
@@ -74,7 +70,7 @@ void wmWidgetMap::find_from_type(
 	{
 		wmWidgetGroup *wgroup = new wmWidgetGroup;
 		wgroup->type_cxx = wgrouptype;
-		BLI_addtail(&wmap->widgetgroups, wgroup);
+		BLI_addtail(&widgetgroups, wgroup);
 	}
 }
 
diff --git a/source/blender/windowmanager/intern/widgets/wm_widgetmap.h b/source/blender/windowmanager/intern/widgets/wm_widgetmap.h
index 685fa06..ea1132e 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widgetmap.h
+++ b/source/blender/windowmanager/intern/widgets/wm_widgetmap.h
@@ -46,10 +46,7 @@ public:
 	wmWidgetMapType *type;
 	ListBase widgetgroups;
 
-	void find_from_type(
-	        wmWidgetMap *wmap, const char *idname,
-	        const int spaceid, const int regionid,
-	        const bool is_3d);
+	void init(const char *idname, const int spaceid, const int regionid, const bool is_3d);
 
 	void set_highlighted_widget(struct bContext *C, wmWidget *widget, unsigned char part);
 	wmWidget *find_highlighted_widget(bContext *C, const struct wmEvent *event, unsigned char *part);
diff --git a/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.cc b/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.cc
index 1748241..0474c2b 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.cc
+++ b/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.cc
@@ -44,12 +44,10 @@ void wm_widgets_keymap(wmKeyConfig *keyconfig)
 }
 
 
-wmWidgetMap *WM_widgetmap_from_type(
-        const char *idname, const int spaceid, const int regionid,
-        const bool is_3d)
+wmWidgetMap *WM_widgetmap_from_type(const char *idname, const int spaceid, const int regionid, const bool is_3d)
 {
 	wmWidgetMap *wmap = new wmWidgetMap;
-	wmap->find_from_type(wmap, idname, spaceid, regionid, is_3d);
+	wmap->init(idname, spaceid, regionid, is_3d);
 	return wmap;
 }




More information about the Bf-blender-cvs mailing list