[gtk] filechooserwidget: Inline fuction into only caller
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] filechooserwidget: Inline fuction into only caller
- Date: Tue, 30 Apr 2019 04:02:33 +0000 (UTC)
commit 90301c6813914e49f00ae52d3237900e63d3d3ac
Author: Timm Bäder <tbaeder redhat com>
Date: Mon Apr 29 11:15:19 2019 +0200
filechooserwidget: Inline fuction into only caller
gtk/gtkfilechooserwidget.c | 43 ++++++++++++++++++-------------------------
1 file changed, 18 insertions(+), 25 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 3347ede9ca..3039007859 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -714,12 +714,26 @@ gtk_file_chooser_widget_finalize (GObject *object)
G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->finalize (object);
}
-/* Shows an error dialog set as transient for the specified window */
+/* Returns a toplevel GtkWindow, or NULL if none */
+static GtkWindow *
+get_toplevel (GtkWidget *widget)
+{
+ GtkWidget *toplevel;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ if (!gtk_widget_is_toplevel (toplevel))
+ return NULL;
+ else
+ return GTK_WINDOW (toplevel);
+}
+
+/* Shows an error dialog for the file chooser */
static void
-error_message_with_parent (GtkWindow *parent,
- const char *msg,
- const char *detail)
+error_message (GtkFileChooserWidget *impl,
+ const char *msg,
+ const char *detail)
{
+ GtkWindow *parent = get_toplevel (GTK_WIDGET (impl));
GtkWidget *dialog;
dialog = gtk_message_dialog_new (parent,
@@ -737,28 +751,7 @@ error_message_with_parent (GtkWindow *parent,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
-}
-/* Returns a toplevel GtkWindow, or NULL if none */
-static GtkWindow *
-get_toplevel (GtkWidget *widget)
-{
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (widget);
- if (!gtk_widget_is_toplevel (toplevel))
- return NULL;
- else
- return GTK_WINDOW (toplevel);
-}
-
-/* Shows an error dialog for the file chooser */
-static void
-error_message (GtkFileChooserWidget *impl,
- const char *msg,
- const char *detail)
-{
- error_message_with_parent (get_toplevel (GTK_WIDGET (impl)), msg, detail);
}
/* Shows a simple error dialog relative to a path. Frees the GError as well. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]