[gnome-photos] Use gtk_show_uri_on_window instead of deprecated gtk_show_uri
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] Use gtk_show_uri_on_window instead of deprecated gtk_show_uri
- Date: Wed, 22 Mar 2017 13:31:19 +0000 (UTC)
commit a44e86061d9fc026f9a6a69906d2c13e0d9f46f8
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Mar 21 09:46:39 2017 +0100
Use gtk_show_uri_on_window instead of deprecated gtk_show_uri
src/photos-application.c | 9 +++------
src/photos-base-item.c | 8 ++++----
src/photos-base-item.h | 4 ++--
src/photos-facebook-item.c | 4 ++--
src/photos-flickr-item.c | 4 ++--
src/photos-google-item.c | 4 ++--
6 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index a798d7c..dcf0a37 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -259,8 +259,7 @@ photos_application_help (PhotosApplication *self, GVariant *parameter)
GtkWindow *parent;
parent = gtk_application_get_active_window (GTK_APPLICATION (self));
- gtk_show_uri (gtk_window_get_screen (parent), "help:gnome-photos",
- GDK_CURRENT_TIME, NULL);
+ gtk_show_uri_on_window (parent, "help:gnome-photos", GDK_CURRENT_TIME, NULL);
}
@@ -927,11 +926,9 @@ photos_application_load_changed (PhotosApplication *self)
static void
photos_application_open_current (PhotosApplication *self)
{
- GdkScreen *screen;
PhotosBaseItem *item;
guint32 time;
- screen = gtk_window_get_screen (GTK_WINDOW (self->main_window));
time = gtk_get_current_event_time ();
if (photos_selection_controller_get_selection_mode (self->sel_cntrlr))
@@ -945,7 +942,7 @@ photos_application_open_current (PhotosApplication *self)
const gchar *urn = (gchar *) l->data;
item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (self->state->item_mngr, urn));
- photos_base_item_open (item, screen, time);
+ photos_base_item_open (item, GTK_WINDOW (self->main_window), time);
}
}
else
@@ -953,7 +950,7 @@ photos_application_open_current (PhotosApplication *self)
item = PHOTOS_BASE_ITEM (photos_base_manager_get_active_object (self->state->item_mngr));
g_return_if_fail (item != NULL);
- photos_base_item_open (item, screen, time);
+ photos_base_item_open (item, GTK_WINDOW (self->main_window), time);
}
photos_selection_controller_set_selection_mode (self->sel_cntrlr, FALSE);
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index f9458fe..a6b59f8 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -568,7 +568,7 @@ photos_base_item_default_metadata_add_shared (PhotosBaseItem *self,
static void
-photos_base_item_default_open (PhotosBaseItem *self, GdkScreen *screen, guint32 timestamp)
+photos_base_item_default_open (PhotosBaseItem *self, GtkWindow *parent, guint32 timestamp)
{
PhotosBaseItemPrivate *priv;
GError *error;
@@ -595,7 +595,7 @@ photos_base_item_default_open (PhotosBaseItem *self, GdkScreen *screen, guint32
else
{
error = NULL;
- gtk_show_uri (screen, priv->uri, timestamp, &error);
+ gtk_show_uri_on_window (parent, priv->uri, timestamp, &error);
if (error != NULL)
{
g_warning ("Unable to show URI %s: %s", priv->uri, error->message);
@@ -3627,10 +3627,10 @@ photos_base_item_metadata_add_shared_finish (PhotosBaseItem *self, GAsyncResult
void
-photos_base_item_open (PhotosBaseItem *self, GdkScreen *screen, guint32 timestamp)
+photos_base_item_open (PhotosBaseItem *self, GtkWindow *parent, guint32 timestamp)
{
g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
- PHOTOS_BASE_ITEM_GET_CLASS (self)->open (self, screen, timestamp);
+ PHOTOS_BASE_ITEM_GET_CLASS (self)->open (self, parent, timestamp);
}
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 8b13140..44e157e 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -69,7 +69,7 @@ struct _PhotosBaseItemClass
const gchar *shared_id,
GCancellable *cancellable,
GError **error);
- void (*open) (PhotosBaseItem *self, GdkScreen *screen, guint32 timestamp);
+ void (*open) (PhotosBaseItem *self, GtkWindow *parent, guint32 timestamp);
void (*set_favorite) (PhotosBaseItem *self, gboolean favorite);
void (*trash) (PhotosBaseItem *self);
void (*update_type_description) (PhotosBaseItem *self);
@@ -197,7 +197,7 @@ gboolean photos_base_item_metadata_add_shared_finish (PhotosBaseItem
GError **error);
void photos_base_item_open (PhotosBaseItem *self,
- GdkScreen *screen,
+ GtkWindow *parent,
guint32 timestamp);
void photos_base_item_operation_add_async (PhotosBaseItem *self,
diff --git a/src/photos-facebook-item.c b/src/photos-facebook-item.c
index 65b2210..274b980 100644
--- a/src/photos-facebook-item.c
+++ b/src/photos-facebook-item.c
@@ -271,7 +271,7 @@ photos_facebook_item_get_source_widget (PhotosBaseItem *item)
/* TODO */
static void
-photos_facebook_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 timestamp)
+photos_facebook_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
{
GError *error;
const gchar *facebook_uri;
@@ -279,7 +279,7 @@ photos_facebook_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 time
facebook_uri = photos_base_item_get_uri (item);
error = NULL;
- gtk_show_uri (screen, facebook_uri, timestamp, &error);
+ gtk_show_uri_on_window (parent, facebook_uri, timestamp, &error);
if (error != NULL)
{
g_warning ("Unable to show URI %s: %s", facebook_uri, error->message);
diff --git a/src/photos-flickr-item.c b/src/photos-flickr-item.c
index 76eac8f..c7b787f 100644
--- a/src/photos-flickr-item.c
+++ b/src/photos-flickr-item.c
@@ -340,7 +340,7 @@ photos_flickr_item_get_source_widget (PhotosBaseItem *item)
static void
-photos_flickr_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 timestamp)
+photos_flickr_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
{
PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (item);
GError *error;
@@ -363,7 +363,7 @@ photos_flickr_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 timest
flickr_uri = g_strdup_printf ("https://www.flickr.com/photos/%s/%s", identity, identifier);
error = NULL;
- gtk_show_uri (screen, flickr_uri, timestamp, &error);
+ gtk_show_uri_on_window (parent, flickr_uri, timestamp, &error);
if (error != NULL)
{
g_warning ("Unable to show URI %s: %s", flickr_uri, error->message);
diff --git a/src/photos-google-item.c b/src/photos-google-item.c
index 67d1317..35e3738 100644
--- a/src/photos-google-item.c
+++ b/src/photos-google-item.c
@@ -297,7 +297,7 @@ photos_google_item_get_source_widget (PhotosBaseItem *item)
* 'Sorry, that page was not found.' if the user is not logged in with the respective account
*/
static void
-photos_google_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 timestamp)
+photos_google_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
{
GError *error;
const gchar *google_uri;
@@ -305,7 +305,7 @@ photos_google_item_open (PhotosBaseItem *item, GdkScreen *screen, guint32 timest
google_uri = photos_base_item_get_uri (item);
error = NULL;
- gtk_show_uri (screen, google_uri, timestamp, &error);
+ gtk_show_uri_on_window (parent, google_uri, timestamp, &error);
if (error != NULL)
{
g_warning ("Unable to show URI %s: %s", google_uri, error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]