[Xfce4-commits] [apps/catfish] 01/01: Fix crash when GdkDisplay and GdkScreen calls return None (LP: #1822914)

noreply at xfce.org noreply at xfce.org
Fri Nov 15 22:50:56 CET 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/catfish.

commit fd4af6351f49db04ea3d4b0a114b669c81278b64
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Nov 15 16:50:50 2019 -0500

    Fix crash when GdkDisplay and GdkScreen calls return None (LP: #1822914)
---
 catfish/CatfishWindow.py |  6 ++++-
 catfish_lib/helpers.py   |  8 ++++--
 po/catfish.pot           | 68 ++++++++++++++++++++++++------------------------
 3 files changed, 45 insertions(+), 37 deletions(-)

diff --git a/catfish/CatfishWindow.py b/catfish/CatfishWindow.py
index dd13949..c98c4be 100644
--- a/catfish/CatfishWindow.py
+++ b/catfish/CatfishWindow.py
@@ -360,12 +360,16 @@ class CatfishWindow(Window):
 
     def get_screen_size(self):
         s = Gdk.Screen.get_default()
+        if s is None:
+            return (800, 600)
         return (s.get_width(), s.get_height())
 
     def get_display_size(self):
         d = Gdk.Display.get_default()
-        w = Gdk.get_default_root_window()
+        if d is None:
+            return (800, 600)
 
+        w = Gdk.get_default_root_window()
         m = d.get_monitor_at_window(w)
         monitor = m.get_geometry()
         return (monitor.width, monitor.height)
diff --git a/catfish_lib/helpers.py b/catfish_lib/helpers.py
index be40ac5..8cdbc3b 100644
--- a/catfish_lib/helpers.py
+++ b/catfish_lib/helpers.py
@@ -202,8 +202,12 @@ def check_x11_session():
     backend_env = GLib.environ_getenv(GLib.get_environ(), 'GDK_BACKEND')
     if backend_env is None:
         # We look for default display
-        display = Gdk.Display.get_default().get_name()
-        if display.startswith('wayland'):
+        display = Gdk.Display.get_default()
+        if display is None:
+            return True
+
+        name = display.get_name()
+        if name.startswith('wayland'):
             return False
         else:
             return True
diff --git a/po/catfish.pot b/po/catfish.pot
index c8ca373..ca5b8f0 100644
--- a/po/catfish.pot
+++ b/po/catfish.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-11-15 16:31-0500\n"
+"POT-Creation-Date: 2019-11-15 16:49-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -18,7 +18,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 
 #: ../org.xfce.Catfish.desktop.in.h:1 ../data/ui/CatfishWindow.ui.h:28
-#: ../catfish/CatfishWindow.py:718
+#: ../catfish/CatfishWindow.py:722
 msgid "Catfish File Search"
 msgstr ""
 
@@ -213,11 +213,11 @@ msgstr ""
 msgid "File Type"
 msgstr ""
 
-#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1277
+#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1281
 msgid "Modified"
 msgstr ""
 
-#: ../data/ui/CatfishWindow.ui.h:29 ../catfish/CatfishWindow.py:1727
+#: ../data/ui/CatfishWindow.ui.h:29 ../catfish/CatfishWindow.py:1731
 msgid "Results will be displayed as soon as they are found."
 msgstr ""
 
@@ -365,140 +365,140 @@ msgid ""
 "or click the %s icon for more options."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:686
+#: ../catfish/CatfishWindow.py:690
 msgid "An error occurred while updating the database."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:688
+#: ../catfish/CatfishWindow.py:692
 msgid "Authentication failed."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:694
+#: ../catfish/CatfishWindow.py:698
 msgid "Authentication cancelled."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:700
+#: ../catfish/CatfishWindow.py:704
 msgid "Search database updated successfully."
 msgstr ""
 
 #. Set the dialog status to running.
-#: ../catfish/CatfishWindow.py:775
+#: ../catfish/CatfishWindow.py:779
 msgid "Updating..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:809
+#: ../catfish/CatfishWindow.py:813
 msgid "Stop Search"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:810
+#: ../catfish/CatfishWindow.py:814
 msgid ""
 "Search is in progress...\n"
 "Press the cancel button or the Escape key to stop."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:819
+#: ../catfish/CatfishWindow.py:823
 msgid "Begin Search"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1097
+#: ../catfish/CatfishWindow.py:1101
 #, python-format
 msgid "\"%s\" could not be opened."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1149
+#: ../catfish/CatfishWindow.py:1153
 #, python-format
 msgid "\"%s\" could not be saved."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1166
+#: ../catfish/CatfishWindow.py:1170
 #, python-format
 msgid "\"%s\" could not be deleted."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1206
+#: ../catfish/CatfishWindow.py:1210
 #, python-format
 msgid "Save \"%s\" as..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1241
+#: ../catfish/CatfishWindow.py:1245
 #, python-format
 msgid ""
 "Are you sure that you want to \n"
 "permanently delete \"%s\"?"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1245
+#: ../catfish/CatfishWindow.py:1249
 #, python-format
 msgid ""
 "Are you sure that you want to \n"
 "permanently delete the %i selected files?"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1248
+#: ../catfish/CatfishWindow.py:1252
 msgid "If you delete a file, it is permanently lost."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1271
+#: ../catfish/CatfishWindow.py:1275
 msgid "Filename"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1273
+#: ../catfish/CatfishWindow.py:1277
 msgid "Size"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1275
+#: ../catfish/CatfishWindow.py:1279
 msgid "Location"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1287
+#: ../catfish/CatfishWindow.py:1291
 msgid "Preview"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1295
+#: ../catfish/CatfishWindow.py:1299
 msgid "Details"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1514
+#: ../catfish/CatfishWindow.py:1518
 msgid "Today"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1516
+#: ../catfish/CatfishWindow.py:1520
 msgid "Yesterday"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1597
+#: ../catfish/CatfishWindow.py:1601
 msgid "No files found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1599
+#: ../catfish/CatfishWindow.py:1603
 msgid ""
 "Try making your search less specific\n"
 "or try another directory."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1606
+#: ../catfish/CatfishWindow.py:1610
 msgid "1 file found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1608
+#: ../catfish/CatfishWindow.py:1612
 #, python-format
 msgid "%i files found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1614
+#: ../catfish/CatfishWindow.py:1618
 msgid "bytes"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1725 ../catfish/CatfishWindow.py:1735
+#: ../catfish/CatfishWindow.py:1729 ../catfish/CatfishWindow.py:1739
 msgid "Searching..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1733
+#: ../catfish/CatfishWindow.py:1737
 #, python-format
 msgid "Searching for \"%s\""
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1822
+#: ../catfish/CatfishWindow.py:1826
 #, python-format
 msgid "Search results for \"%s\""
 msgstr ""

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list