Navigation Menu

Skip to content

Commit

Permalink
Fix build for geany 1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Bruguier committed May 5, 2014
1 parent d2f71a8 commit ec183cb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -30,7 +30,7 @@ LIBXML2_REQUIRED=2.7.8
VALA_REQUIRED=0.18.0
WEBKIT_REQUIRED=1.8.1
LIBWNCK_REQUIRED=2.30.0
GEANY_REQUIRED=1.22
GEANY_REQUIRED=1.24
GCONF2_REQUIRED=2.30.0

dnl ****************************************************************************
Expand Down
35 changes: 31 additions & 4 deletions plugins/prj/manager.vala
Expand Up @@ -490,12 +490,12 @@ public class GVT.Manager : GLib.Object
{
if (inSource.filename != null)
{
Gdk.Pixbuf icon = Manager.detect_type_from_file (inSource.filename).icon;
GLib.Icon? icon = Manager.detect_type_from_file (inSource.filename).icon;
Gtk.TreeIter iter;

//debug ("Add source %s in %s", inSource.name, name);
m_TreeStore.append (out iter, inIter);
m_TreeStore.set (iter, 0, icon, 1, inSource.name, 2, inSource);
m_TreeStore.set (iter, 0, Manager.pixbuf_from_icon (icon), 1, inSource.name, 2, inSource);

if (inSource.filename != null && GLib.FileUtils.test (inSource.filename, GLib.FileTest.EXISTS))
{
Expand All @@ -516,13 +516,13 @@ public class GVT.Manager : GLib.Object
{
if (inData.length == 0)
{
Gdk.Pixbuf icon = Manager.detect_type_from_file (inData.filename).icon;
GLib.Icon? icon = Manager.detect_type_from_file (inData.filename).icon;
Gtk.TreeIter iter;
string name = inData.name;

//debug ("Add data %s in %s", inData.name, name);
m_TreeStore.append (out iter, inIter);
m_TreeStore.set (iter, 0, icon, 1, name.length == 0 ? "data" : name, 2, inData);
m_TreeStore.set (iter, 0, Manager.pixbuf_from_icon (icon), 1, name.length == 0 ? "data" : name, 2, inData);
}
else
{
Expand Down Expand Up @@ -1159,6 +1159,33 @@ public class GVT.Manager : GLib.Object
return null;
}

public static inline Gdk.Pixbuf?
pixbuf_from_icon(GLib.Icon? inIcon)
{
Gtk.IconInfo? icon_info = null;

if (inIcon != null)
{
icon_info = Gtk.IconTheme.get_default ().lookup_by_gicon (inIcon, 16, 0);
}
else
{
icon_info = Gtk.IconTheme.get_default ().lookup_icon ("text-x-generic", 16, 0);
}
if (icon_info != null)
{
try
{
return icon_info.load_icon ();
}
catch (GLib.Error err)
{
}
}

return null;
}

public static void
save_all ()
{
Expand Down
2 changes: 1 addition & 1 deletion vapi/geany.vapi
Expand Up @@ -1330,7 +1330,7 @@ namespace Geany {

public string? extension;
public FiletypeGroupID group;
public Gdk.Pixbuf? icon;
public GLib.Icon? icon;
public FiletypeID id;
public TagManager.LangType lang;
public Filetype lexer_filetype;
Expand Down

0 comments on commit ec183cb

Please sign in to comment.