Don't separate the function name and its arguments types in 2 different
columns in the assert dialog, this doesn't really work with const methods as
"const" can't be separated from the function like this. The old code just
didn't take "const" into account at all and mangled all the const methods by
showing ") cons" (no typo) at the end.
Just show everything in one column to avoid the problem and also simplify the
code.
Closes #14104.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70954
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Implement support for wxBG_STYLE_TRANSPARENT (Armel Asselin).
- Fix wxNotebook best size calculation.
- Implement wxDirDialog::Create() and wxFileDialog::Create() (vinayakgarg).
- Implement support for wxBG_STYLE_TRANSPARENT (Armel Asselin).
- Fix wxNotebook best size calculation.
- Implement wxDirDialog::Create() and wxFileDialog::Create() (vinayakgarg).
+- Fix const methods display in assert dialog (vinayakgarg).
/* appends a stack frame to the dialog */
void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
const gchar *function,
/* appends a stack frame to the dialog */
void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
const gchar *function,
- const gchar *arguments,
const gchar *sourcefile,
guint line_number);
const gchar *sourcefile,
guint line_number);
in gtk_assert_dialog_create_backtrace_list_model() function
*/
#define STACKFRAME_LEVEL_COLIDX 0
in gtk_assert_dialog_create_backtrace_list_model() function
*/
#define STACKFRAME_LEVEL_COLIDX 0
-#define FUNCTION_NAME_COLIDX 1
+#define FUNCTION_PROTOTYPE_COLIDX 1
#define SOURCE_FILE_COLIDX 2
#define LINE_NUMBER_COLIDX 3
#define SOURCE_FILE_COLIDX 2
#define LINE_NUMBER_COLIDX 3
-#define FUNCTION_ARGS_COLIDX 4
GtkWidget *treeview;
/* create list store */
GtkWidget *treeview;
/* create list store */
- store = gtk_list_store_new (5,
+ store = gtk_list_store_new (4,
G_TYPE_UINT, /* stack frame number */
G_TYPE_UINT, /* stack frame number */
- G_TYPE_STRING, /* function name */
+ G_TYPE_STRING, /* function prototype */
G_TYPE_STRING, /* source file name */
G_TYPE_STRING, /* source file name */
- G_TYPE_STRING, /* line number */
- G_TYPE_STRING); /* function arguments */
+ G_TYPE_STRING); /* line number */
/* create the tree view */
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store));
/* create the tree view */
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store));
/* append columns */
gtk_assert_dialog_append_text_column(treeview, "#", STACKFRAME_LEVEL_COLIDX);
/* append columns */
gtk_assert_dialog_append_text_column(treeview, "#", STACKFRAME_LEVEL_COLIDX);
- gtk_assert_dialog_append_text_column(treeview, "Function name", FUNCTION_NAME_COLIDX);
- gtk_assert_dialog_append_text_column(treeview, "Function args", FUNCTION_ARGS_COLIDX);
+ gtk_assert_dialog_append_text_column(treeview, "Function Prototype", FUNCTION_PROTOTYPE_COLIDX);
gtk_assert_dialog_append_text_column(treeview, "Source file", SOURCE_FILE_COLIDX);
gtk_assert_dialog_append_text_column(treeview, "Line #", LINE_NUMBER_COLIDX);
gtk_assert_dialog_append_text_column(treeview, "Source file", SOURCE_FILE_COLIDX);
gtk_assert_dialog_append_text_column(treeview, "Line #", LINE_NUMBER_COLIDX);
gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
{
gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
{
- gchar *function, *arguments, *sourcefile, *linenum;
+ gchar *function, *sourcefile, *linenum;
guint count;
GtkTreeModel *model;
guint count;
GtkTreeModel *model;
do
{
/* append this stack frame's info to the string */
do
{
/* append this stack frame's info to the string */
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get(model, &iter,
STACKFRAME_LEVEL_COLIDX, &count,
STACKFRAME_LEVEL_COLIDX, &count,
- FUNCTION_NAME_COLIDX, &function,
- FUNCTION_ARGS_COLIDX, &arguments,
+ FUNCTION_PROTOTYPE_COLIDX, &function,
SOURCE_FILE_COLIDX, &sourcefile,
LINE_NUMBER_COLIDX, &linenum,
-1);
SOURCE_FILE_COLIDX, &sourcefile,
LINE_NUMBER_COLIDX, &linenum,
-1);
- g_string_append_printf (string, "[%u] %s(%s)",
- count, function, arguments);
+ g_string_append_printf(string, "[%u] %s",
+ count, function);
if (sourcefile[0] != '\0')
g_string_append_printf (string, " %s", sourcefile);
if (linenum[0] != '\0')
if (sourcefile[0] != '\0')
g_string_append_printf (string, " %s", sourcefile);
if (linenum[0] != '\0')
g_string_append (string, "\n");
g_free (function);
g_string_append (string, "\n");
g_free (function);
g_free (sourcefile);
g_free (linenum);
g_free (sourcefile);
g_free (linenum);
void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
const gchar *function,
void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
const gchar *function,
- const gchar *arguments,
const gchar *sourcefile,
guint line_number)
{
const gchar *sourcefile,
guint line_number)
{
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
gtk_list_store_set (GTK_LIST_STORE(model), &iter,
STACKFRAME_LEVEL_COLIDX, count+1, /* start from 1 and not from 0 */
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
gtk_list_store_set (GTK_LIST_STORE(model), &iter,
STACKFRAME_LEVEL_COLIDX, count+1, /* start from 1 and not from 0 */
- FUNCTION_NAME_COLIDX, function,
- FUNCTION_ARGS_COLIDX, arguments,
+ FUNCTION_PROTOTYPE_COLIDX, function,
SOURCE_FILE_COLIDX, sourcefile,
LINE_NUMBER_COLIDX, linenum->str,
-1);
SOURCE_FILE_COLIDX, sourcefile,
LINE_NUMBER_COLIDX, linenum->str,
-1);
virtual void OnStackFrame(const wxStackFrame& frame)
{
wxString fncname = frame.GetName();
virtual void OnStackFrame(const wxStackFrame& frame)
{
wxString fncname = frame.GetName();
- wxString fncargs = fncname;
-
- size_t n = fncname.find(wxT('('));
- if (n != wxString::npos)
- {
- // remove arguments from function name
- fncname.erase(n);
-
- // remove function name and brackets from arguments
- fncargs = fncargs.substr(n+1, fncargs.length()-n-2);
- }
- else
- fncargs = wxEmptyString;
// append this stack frame's info in the dialog
if (!frame.GetFileName().empty() || !fncname.empty())
gtk_assert_dialog_append_stack_frame(m_dlg,
fncname.mb_str(),
// append this stack frame's info in the dialog
if (!frame.GetFileName().empty() || !fncname.empty())
gtk_assert_dialog_append_stack_frame(m_dlg,
fncname.mb_str(),
frame.GetFileName().mb_str(),
frame.GetLine());
}
frame.GetFileName().mb_str(),
frame.GetLine());
}