gweled New Patch

This commit is contained in:
alick01
2021-01-05 20:02:46 +03:00
parent d96a5ac896
commit 2a3199ec65
2 changed files with 63 additions and 3 deletions
@@ -0,0 +1,50 @@
=== modified file 'src/sge_utils.c'
--- src/sge_utils.c 2011-08-01 21:29:27 +0000
+++ src/sge_utils.c 2018-02-15 23:10:09 +0000
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <gio/gio.h>
#include <gtk/gtk.h>
#include <librsvg/rsvg.h>
@@ -30,7 +31,8 @@
{
gchar *full_pathname;
GdkPixbuf *pixbuf = NULL;
- GError *error;
+ GError *error = NULL;
+ GFile *file;
full_pathname = g_strconcat(DATADIR "/pixmaps/",
filename,
@@ -38,13 +40,25 @@
if (g_file_test(full_pathname, G_FILE_TEST_IS_REGULAR)) {
pixbuf = rsvg_pixbuf_from_file_at_size (full_pathname, width,
height, &error);
- g_free (full_pathname);
+ if (pixbuf == NULL) {
+ // Some versions of librsvg need URI instead of path.
+ // https://gitlab.gnome.org/GNOME/librsvg/issues/198
+ g_clear_error (&error);
+ file = g_file_new_for_path (full_pathname);
+ g_free (full_pathname);
+ full_pathname = g_file_get_uri (file);
+ g_object_unref (file);
+ pixbuf = rsvg_pixbuf_from_file_at_size (full_pathname, width,
+ height, &error);
+ }
if (pixbuf == NULL)
- g_free (error);
+ g_error_free (error);
} else
g_warning ("%s not found", filename);
+ g_free (full_pathname);
+
return pixbuf;
}
+13 -3
View File
@@ -15,8 +15,9 @@
<Description>Gweled is a GTK+ version of a popular PalmOS/Windows/Java game called "Bejeweled", originally written by Sebastien Delestaing. The aim of the game is to make alignment of 3 or more gems, both vertically or horizontally by swapping adjacent gems.</Description>
<Archive sha1sum="ff4a59935c9e1eb4a202e723baabaab39f526714" type="targz">http://launchpad.net/gweled/trunk/0.9.1/+download/gweled-0.9.1.tar.gz</Archive>
<BuildDependencies>
<Dependency>gtk2-devel</Dependency>
<Dependency>gtk3-devel</Dependency>
<Dependency>intltool</Dependency>
<Dependency>icon-theme-hicolor</Dependency>
<Dependency>gdk-pixbuf-devel</Dependency>
<Dependency>glib2-devel</Dependency>
<Dependency>librsvg-devel</Dependency>
@@ -24,8 +25,10 @@
</BuildDependencies>
<Patches>
<Patch level="1">gweled-0.9.1-fix-open.patch</Patch>
<Patch level="1">translate-paused-string.patch</Patch>
<Patch level="1">translate-paused-string.patch</Patch>gweled-librsvg-crash
<Patch level="1">turkish.patch</Patch>
<!-- Patch level="1">turkish.patch</Patch -->
<Patch>gweled-librsvg-crash.patch</Patch>
</Patches>
</Source>
@@ -35,7 +38,7 @@
<Dependency>librsvg</Dependency>
<Dependency>libmikmod</Dependency>
<Dependency>glib2</Dependency>
<Dependency>gtk2</Dependency>
<Dependency>gtk3</Dependency>
<Dependency>gdk-pixbuf</Dependency>
</RuntimeDependencies>
<Files>
@@ -48,6 +51,13 @@
</Package>
<History>
<Update release="4">
<Date>2021-01-05</Date>
<Version>0.9.1</Version>
<Comment>Rebuild New Patch</Comment>
<Name>Ali Cengiz Kurt</Name>
<Email>alicengizkurt@gmail.com</Email>
</Update>
<Update release="3">
<Date>2018-09-14</Date>
<Version>0.9.1</Version>