[gnome-games/wip/exalm/psx-cleanup: 8/10] media-set: Use icon name string instead of GIcon
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/psx-cleanup: 8/10] media-set: Use icon name string instead of GIcon
- Date: Mon, 10 Feb 2020 11:55:36 +0000 (UTC)
commit cf925d9fa2bf47e5b7a0ff484c380d6a8a09b4a5
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Feb 9 16:58:53 2020 +0500
media-set: Use icon name string instead of GIcon
This will make it easier to cache it.
plugins/playstation/src/playstation-game-factory.vala | 2 +-
src/core/media-set/media-set.vala | 2 +-
src/ui/media-menu-button.vala | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/playstation/src/playstation-game-factory.vala
b/plugins/playstation/src/playstation-game-factory.vala
index 6e82831b..f57abd92 100644
--- a/plugins/playstation/src/playstation-game-factory.vala
+++ b/plugins/playstation/src/playstation-game-factory.vala
@@ -113,7 +113,7 @@ public class Games.PlayStationGameFactory : Object, UriGameFactory {
var media_set = new MediaSet ();
foreach (var game_media in new_medias_array)
media_set.add_media (game_media);
- media_set.icon = GLib.Icon.new_for_string (ICON_NAME);
+ media_set.icon_name = ICON_NAME;
var game = create_game (media_set, disc_set_id, uri);
// Creating the Medias, MediaSet and Game worked, we can save them.
diff --git a/src/core/media-set/media-set.vala b/src/core/media-set/media-set.vala
index 3febbd71..cb86e401 100644
--- a/src/core/media-set/media-set.vala
+++ b/src/core/media-set/media-set.vala
@@ -4,7 +4,7 @@ public class Games.MediaSet : Object {
public delegate void MediaCallback (Media media);
public int selected_media_number { get; set; default = 0; }
- public GLib.Icon? icon { get; set; }
+ public string icon_name { get; set; }
private Media[] medias;
diff --git a/src/ui/media-menu-button.vala b/src/ui/media-menu-button.vala
index 0cfc7a7f..3b7f7c64 100644
--- a/src/ui/media-menu-button.vala
+++ b/src/ui/media-menu-button.vala
@@ -22,7 +22,7 @@ private class Games.MediaMenuButton : Gtk.Bin {
if (_media_set != null) {
media_set_changed_id = _media_set.notify["selected-media-number"].connect
(reset_media);
- media_image.set_from_gicon (media_set.icon, Gtk.IconSize.BUTTON);
+ media_image.set_from_icon_name (media_set.icon_name, Gtk.IconSize.BUTTON);
}
reset_media ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]