diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2019-01-22 10:40:24 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2019-01-22 10:40:24 +0000 |
| commit | 7b6634670dbf891e2bd933c30604cf995384423d (patch) | |
| tree | a6ea46c7f7c9ce14056117ccdf0eed25c3cd2d72 /src/widgets/toolbox.cpp | |
| parent | Tidy up toolbox utilities (diff) | |
| download | inkscape-7b6634670dbf891e2bd933c30604cf995384423d.tar.gz inkscape-7b6634670dbf891e2bd933c30604cf995384423d.zip | |
Get rid of unused empty toolbox creation
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index cdc1717c4..db0dded73 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later + /** * @file * Inkscape toolbar definitions and general utility functions. @@ -121,9 +122,6 @@ enum BarId { #define BAR_ID_KEY "BarIdValue" #define HANDLE_POS_MARK "x-inkscape-pos" -static GtkWidget *sp_empty_toolbox_new(SPDesktop *desktop); - - GtkIconSize ToolboxFactory::prefToSize( Glib::ustring const &path, int base ) { static GtkIconSize sizeChoices[] = { GTK_ICON_SIZE_LARGE_TOOLBAR, @@ -937,17 +935,12 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop) GtkWidget* kludge = aux_toolboxes[i].prep_func(desktop, mainActions->gobj()); gtk_widget_set_name( kludge, "Kludge" ); dataHolders[aux_toolboxes[i].type_name] = kludge; - } else { + } else if (aux_toolboxes[i].create_func) { // For the "create" method, directly create a "real" toolbar, // which contains visible, fully functional widgets. Note that // this should also contain any swatches that are needed. - GtkWidget *sub_toolbox = nullptr; - if (aux_toolboxes[i].create_func == nullptr) { - sub_toolbox = sp_empty_toolbox_new(desktop); - } else { - sub_toolbox = aux_toolboxes[i].create_func(desktop); - } + GtkWidget *sub_toolbox = aux_toolboxes[i].create_func(desktop); gtk_widget_set_name( sub_toolbox, "SubToolBox" ); gtk_size_group_add_widget( grouper, sub_toolbox ); @@ -960,6 +953,8 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop) // so that we can store a list of toolbars, rather than using // GObject data g_object_set_data(G_OBJECT(toolbox), aux_toolboxes[i].data_name, sub_toolbox); + } else { + g_warning("Could not create toolbox %s", aux_toolboxes[i].ui_name); } } @@ -1517,18 +1512,6 @@ void ToolboxFactory::showAuxToolbox(GtkWidget *toolbox_toplevel) gtk_widget_show_all(shown_toolbox); } -static GtkWidget *sp_empty_toolbox_new(SPDesktop *desktop) -{ - GtkWidget *tbl = gtk_toolbar_new(); - g_object_set_data(G_OBJECT(tbl), "dtw", desktop->canvas); - g_object_set_data(G_OBJECT(tbl), "desktop", desktop); - - gtk_widget_show_all(tbl); - sp_set_font_size_smaller (tbl); - - return tbl; -} - #define MODE_LABEL_WIDTH 70 |
