From a8d01fd52f98ee06e02b06f0f20135675eb5173f Mon Sep 17 00:00:00 2001 From: hugosenari Date: Fri, 17 Aug 2018 15:30:54 -0300 Subject: [PATCH] [GTK3] Fix GObject deprecation warnings GObject.idle_add is deprecated using GLib.idle_add instead GObject.timeout_add is deprecated using GLib.timeout_add instead GObject.SIGNAL_RUN_LAST is deprecated; use GObject.SignalFlags.RUN_LAST instead GObject.GError is deprecated; use GLib.GError instead GObject.timeout_add is deprecated use GLib.timeout_add instead. ListStore(str, str) using unicode_literals get_value return utf8. --- deluge/ui/gtk3/common.py | 2 +- deluge/ui/gtk3/listview.py | 4 ++-- deluge/ui/gtk3/queuedtorrents.py | 2 +- deluge/ui/gtk3/statusbar.py | 2 +- deluge/ui/gtk3/torrentview.py | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deluge/ui/gtk3/common.py b/deluge/ui/gtk3/common.py index 2fd8fde83..84934de72 100644 --- a/deluge/ui/gtk3/common.py +++ b/deluge/ui/gtk3/common.py @@ -18,7 +18,7 @@ import sys import six.moves.cPickle as pickle from gi.repository.Gdk import SELECTION_CLIPBOARD from gi.repository.GdkPixbuf import Colorspace, Pixbuf -from gi.repository.GObject import GError +from gi.repository.GLib import GError from gi.repository.Gtk import ( Clipboard, IconTheme, diff --git a/deluge/ui/gtk3/listview.py b/deluge/ui/gtk3/listview.py index fed84c7ab..4ed198b54 100644 --- a/deluge/ui/gtk3/listview.py +++ b/deluge/ui/gtk3/listview.py @@ -13,7 +13,7 @@ import logging from gi.repository import GObject, Gtk from gi.repository.Gdk import Event # pylint: disable=ungrouped-imports -from gi.repository.GObject import SIGNAL_RUN_LAST, TYPE_NONE, signal_new +from gi.repository.GObject import TYPE_NONE, SignalFlags, signal_new from deluge.common import decode_bytes @@ -21,7 +21,7 @@ from .common import load_pickled_state_file, save_pickled_state_file # FIXME: ? signal_new( - 'button-press-event', Gtk.TreeViewColumn, SIGNAL_RUN_LAST, TYPE_NONE, (Event,) + 'button-press-event', Gtk.TreeViewColumn, SignalFlags.RUN_LAST, TYPE_NONE, (Event,) ) log = logging.getLogger(__name__) diff --git a/deluge/ui/gtk3/queuedtorrents.py b/deluge/ui/gtk3/queuedtorrents.py index 6babfa6f4..96d3c3139 100644 --- a/deluge/ui/gtk3/queuedtorrents.py +++ b/deluge/ui/gtk3/queuedtorrents.py @@ -12,7 +12,7 @@ from __future__ import unicode_literals import logging import os.path -from gi.repository.GObject import timeout_add +from gi.repository.GLib import timeout_add from gi.repository.Gtk import ( STOCK_SORT_DESCENDING, Builder, diff --git a/deluge/ui/gtk3/statusbar.py b/deluge/ui/gtk3/statusbar.py index 7834da0a2..2674ccdf1 100644 --- a/deluge/ui/gtk3/statusbar.py +++ b/deluge/ui/gtk3/statusbar.py @@ -12,7 +12,7 @@ from __future__ import division, unicode_literals import logging from gi.repository import Gtk -from gi.repository.GObject import timeout_add +from gi.repository.GLib import timeout_add import deluge.component as component from deluge.common import fsize, fspeed, get_pixmap diff --git a/deluge/ui/gtk3/torrentview.py b/deluge/ui/gtk3/torrentview.py index 9eef68d9d..97f406cc0 100644 --- a/deluge/ui/gtk3/torrentview.py +++ b/deluge/ui/gtk3/torrentview.py @@ -14,7 +14,8 @@ import logging from locale import strcoll from gi.repository.Gdk import ModifierType, keyval_name -from gi.repository.GObject import TYPE_UINT64, idle_add +from gi.repository.GLib import idle_add +from gi.repository.GObject import TYPE_UINT64 from gi.repository.Gtk import EntryIconPosition from twisted.internet import reactor @@ -30,7 +31,7 @@ log = logging.getLogger(__name__) try: CTRL_ALT_MASK = ModifierType.CONTROL_MASK | ModifierType.MOD1_MASK except TypeError: - # Sphinx AutoDoc has a mock issue with gtk.gdk masks. + # Sphinx AutoDoc has a mock issue with Gdk masks. pass