Context menu 'Edit Source' operator no longer needs to be enabled as a build option...
[blender.git] / source / blender / editors / interface / interface.c
index b7b572e..f999107 100644 (file)
@@ -2562,23 +2562,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        if(block->curlayout)
                ui_layout_add_but(block->curlayout, but);
 
-#ifdef WITH_PYTHON_UI_INFO
-       {
-               extern void PyC_FileAndNum_Safe(const char **filename, int *lineno);
-
-               const char *fn;
-               int lineno= -1;
-               PyC_FileAndNum_Safe(&fn, &lineno);
-               if (lineno != -1) {
-                       BLI_strncpy(but->py_dbg_fn, fn, sizeof(but->py_dbg_fn));
-                       but->py_dbg_ln= lineno;
-               }
-               else {
-                       but->py_dbg_fn[0]= '\0';
-                       but->py_dbg_ln= -1;
-               }
+       /* if the 'UI_OT_editsource' is running, extract the source info from the button  */
+       if (UI_editsource_enable_check()) {
+               UI_editsource_active_but_test(but);
        }
-#endif /* WITH_PYTHON_UI_INFO */
 
        return but;
 }