[gtk+] Add deprecation guards for deprecated GdkAppLaunchContext API
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add deprecation guards for deprecated GdkAppLaunchContext API
- Date: Sat, 25 Dec 2010 01:02:03 +0000 (UTC)
commit 1d41b98cf8bfe8ad7a0693cdebb852ab97929e9c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 24 17:37:00 2010 -0500
Add deprecation guards for deprecated GdkAppLaunchContext API
Also adapt the docs to not use deprecated API.
docs/reference/gtk/migrating-2to3.xml | 2 +-
gdk/gdk.c | 2 +-
gdk/gdkapplaunchcontext.c | 4 ++--
gdk/gdkapplaunchcontext.h | 2 ++
gdk/gdkdisplay.c | 5 +++--
gtk/gtkshow.c | 2 +-
6 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/docs/reference/gtk/migrating-2to3.xml b/docs/reference/gtk/migrating-2to3.xml
index f10f72e..a6f3ca8 100644
--- a/docs/reference/gtk/migrating-2to3.xml
+++ b/docs/reference/gtk/migrating-2to3.xml
@@ -144,7 +144,7 @@
GError *error = NULL;
info = g_desktop_app_info_new ("epiphany.desktop");
- context = gdk_app_launch_context_new ();
+ context = gdk_display_get_app_launch_context (display);
g_app_info_launch (info, NULL, context, &error);
if (error)
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 79f0b84..1667226 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -57,7 +57,7 @@
* Use this macro to guard code that is specific to the X11-backend.
* Since GDK may be configured with multiple backends, an additional
* runtime check for the used backend is recommended:
- * </para>
+ *
* <example>
* <title>Backend-specific code</title>
* <programlisting>
diff --git a/gdk/gdkapplaunchcontext.c b/gdk/gdkapplaunchcontext.c
index 88d5a53..5f9aa24 100644
--- a/gdk/gdkapplaunchcontext.c
+++ b/gdk/gdkapplaunchcontext.c
@@ -41,9 +41,9 @@
* <programlisting>
* GdkAppLaunchContext *context;
*
- * context = gdk_app_launch_context_new (<!-- -->);
+ * context = gdk_display_get_app_launch_context (display);
*
- * gdk_app_launch_context_set_screen (my_screen);
+ * gdk_app_launch_context_set_screen (screen);
* gdk_app_launch_context_set_timestamp (event->time);
*
* if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
diff --git a/gdk/gdkapplaunchcontext.h b/gdk/gdkapplaunchcontext.h
index ad1b1f1..96aeeba 100644
--- a/gdk/gdkapplaunchcontext.h
+++ b/gdk/gdkapplaunchcontext.h
@@ -40,9 +40,11 @@ G_BEGIN_DECLS
GType gdk_app_launch_context_get_type (void);
+#ifndef GDK_DISABLE_DEPRECATED
GdkAppLaunchContext *gdk_app_launch_context_new (void);
void gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display);
+#endif
void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen);
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 117f906..8941d38 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -2218,8 +2218,9 @@ gdk_display_real_get_app_launch_context (GdkDisplay *display)
{
GdkAppLaunchContext *ctx;
- ctx = gdk_app_launch_context_new ();
- gdk_app_launch_context_set_display (ctx, display);
+ ctx = g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT,
+ "display", display,
+ NULL);
return ctx;
}
diff --git a/gtk/gtkshow.c b/gtk/gtkshow.c
index e4e5d50..551f393 100644
--- a/gtk/gtkshow.c
+++ b/gtk/gtkshow.c
@@ -63,7 +63,7 @@ gtk_show_uri (GdkScreen *screen,
g_return_val_if_fail (uri != NULL, FALSE);
- context = gdk_app_launch_context_new ();
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, timestamp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]