diff options
author | Alexander Kurtakov | 2016-12-02 07:47:09 +0000 |
---|---|---|
committer | Arun Thondapu | 2016-12-13 14:28:43 +0000 |
commit | a9044b3a6b51fa846973a4798ba1d073efe8697a (patch) | |
tree | 53b8a8cdb7e4bbb9bb827d56ae1c60d26e33115f | |
parent | 0f45d534d667dcf5e2522428d6cb179fcc3c8a6a (diff) | |
download | rt.equinox.framework-a9044b3a6b51fa846973a4798ba1d073efe8697a.tar.gz rt.equinox.framework-a9044b3a6b51fa846973a4798ba1d073efe8697a.tar.xz rt.equinox.framework-a9044b3a6b51fa846973a4798ba1d073efe8697a.zip |
Bug 508576 - Simplify GTK initialization
Function gtk_init_with_args is present in the min GTK version required
so there is no need to check for it's existence and try gtk_init_check
after that.
Also g_error_free is mandatory function so no need for if(g_error_free)
g_error_free(...).
Change-Id: Idd13fb1009e0b0e434e0a409487863dd3ea06325
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
3 files changed, 9 insertions, 17 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h index b23c9fb09..9d76885ea 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,7 +20,6 @@ struct GTK_PTRS { void (*gtk_container_add) (GtkContainer*, GtkWidget*); gint (*gtk_dialog_run) (GtkDialog *); GtkWidget* (*gtk_image_new_from_pixbuf)(GdkPixbuf*); - gboolean (*gtk_init_check) (int*, char***); gboolean (*gtk_init_with_args) (int*, char***, const char *, void *, const char *, GError **); GtkWidget* (*gtk_message_dialog_new) (GtkWindow*, GtkDialogFlags, GtkMessageType, GtkButtonsType, const gchar*, ...); void (*gtk_widget_destroy) (GtkWidget*); diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c index 7dbc86012..0e0e82707 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -90,19 +90,13 @@ int initWindowSystem(int* pArgc, char* argv[], int showSplash) } /* Initialize GTK. */ - if (gtk.gtk_init_with_args) { - GError *error = NULL; - if (!gtk.gtk_init_with_args(0, NULL, NULL, NULL, NULL, &error)) { - if (error) { - fprintf(stderr, "%s: %s\n", getOfficialName(), error->message); - if (gtk.g_error_free) gtk.g_error_free(error); - } - return -1; - } - } else { - if (!gtk.gtk_init_check(pArgc, &argv)) { - return -1; + GError *error = NULL; + if (!gtk.gtk_init_with_args(0, NULL, NULL, NULL, NULL, &error)) { + if (error) { + fprintf(stderr, "%s: %s\n", getOfficialName(), error->message); + gtk.g_error_free(error); } + return -1; } /*_gdk_set_program_class(getOfficialName());*/ diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c index 15dda64d7..ccfea8b54 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c @@ -33,8 +33,7 @@ static FN_TABLE gtkFunctions[] = { FN_TABLE_ENTRY(gtk_container_add, 1), FN_TABLE_ENTRY(gtk_dialog_run, 1), FN_TABLE_ENTRY(gtk_image_new_from_pixbuf, 1), - FN_TABLE_ENTRY(gtk_init_check, 1), - FN_TABLE_ENTRY(gtk_init_with_args, 0), + FN_TABLE_ENTRY(gtk_init_with_args, 1), FN_TABLE_ENTRY(gtk_message_dialog_new, 1), FN_TABLE_ENTRY(gtk_widget_destroy, 1), FN_TABLE_ENTRY(gtk_widget_destroyed, 1), |