]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gio-2.0: Fix g_file_monitor_directory binding
authorJürg Billeter <j@bitron.ch>
Wed, 3 Jun 2009 11:27:55 +0000 (13:27 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 3 Jun 2009 11:27:55 +0000 (13:27 +0200)
Fixes bug 527793.

vala/valainterface.vala
vapi/gio-2.0.vapi
vapi/packages/gio-2.0/gio-2.0-custom.vala
vapi/packages/gio-2.0/gio-2.0.metadata

index c048c9e79ace93157ed574b72f971bd22fe90a98..be55fcfc883e698204806cd619e2b2143c3176ed 100644 (file)
@@ -259,7 +259,13 @@ public class Vala.Interface : ObjectTypeSymbol {
 
        public override string get_cname (bool const_type = false) {
                if (cname == null) {
-                       cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
+                       var attr = get_attribute ("CCode");
+                       if (attr != null) {
+                               cname = attr.get_string ("cname");
+                       }
+                       if (cname == null) {
+                               cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
+                       }
                }
                return cname;
        }
index 2b68078bacc6392531249575deb045d4ada80a08..44d9b9d490b9706fac1acfee7da15a146f187655 100644 (file)
@@ -256,9 +256,7 @@ namespace GLib {
        [CCode (cheader_filename = "gio/gio.h")]
        public class FileMonitor : GLib.Object {
                public virtual bool cancel ();
-               public static unowned GLib.FileMonitor directory (GLib.File file, GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable) throws GLib.Error;
                public void emit_event (GLib.File child, GLib.File other_file, GLib.FileMonitorEvent event_type);
-               public static unowned GLib.FileMonitor file (GLib.File file, GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable) throws GLib.Error;
                public bool is_cancelled ();
                public void set_rate_limit (int limit_msecs);
                [NoAccessorMethod]
@@ -732,10 +730,9 @@ namespace GLib {
                public bool make_directory_with_parents (GLib.Cancellable? cancellable) throws GLib.Error;
                public abstract bool make_symbolic_link (string symlink_value, GLib.Cancellable? cancellable) throws GLib.Error;
                public unowned GLib.FileMonitor monitor (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable) throws GLib.Error;
-               [NoWrapper]
-               public abstract unowned GLib.FileMonitor monitor_dir (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable) throws GLib.Error;
-               [NoWrapper]
-               public abstract unowned GLib.FileMonitor monitor_file (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable) throws GLib.Error;
+               [CCode (vfunc_name = "monitor_dir")]
+               public abstract GLib.FileMonitor monitor_directory (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public abstract GLib.FileMonitor monitor_file (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                public abstract void mount_enclosing_volume (GLib.MountMountFlags flags, GLib.MountOperation? mount_operation, GLib.Cancellable? cancellable, GLib.AsyncReadyCallback? callback);
                public abstract bool mount_enclosing_volume_finish (GLib.AsyncResult _result) throws GLib.Error;
                public abstract void mount_mountable (GLib.MountMountFlags flags, GLib.MountOperation? mount_operation, GLib.Cancellable? cancellable, GLib.AsyncReadyCallback? callback);
index 9c2b9008db765c90974945ce8e6c14eeb627a1ff..63956c435dc509be8df4618c57f9ca1d8306cf3b 100644 (file)
@@ -26,5 +26,12 @@ namespace GLib {
        public class IOExtension {
                public extern Type get_type ();
        }
+
+       [CCode (cname = "GFile")]
+       public interface File : Object {
+               [CCode (vfunc_name = "monitor_dir")]
+               public abstract GLib.FileMonitor monitor_directory (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public abstract GLib.FileMonitor monitor_file (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+       }
 }
 
index 87cb1560c92f744d0521b3b8e03370ff2e371565..0aa7f1b5303092d7033dde1b880732c2163266ac 100644 (file)
@@ -41,6 +41,9 @@ g_file_load_partial_contents_finish.contents transfer_ownership="1"
 g_file_load_partial_contents_finish.length is_out="1"
 g_file_load_partial_contents_finish.etag_out transfer_ownership="1"
 GFileMonitor::changed.other_file nullable="1"
+g_file_monitor_directory hidden="1"
+g_file_monitor_dir hidden="1"
+g_file_monitor_file hidden="1"
 g_file_move.progress_callback_data hidden="1"
 g_file_new_for_commandline_arg transfer_ownership="1"
 g_file_new_for_path transfer_ownership="1"