[perl-Glib-IO] Specify class-static methods for Glib::IO::File



commit b918d1aae0d160ca2df6c671472fc198731a6c7a
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Apr 25 19:55:56 2010 +0200

    Specify class-static methods for Glib::IO::File

 lib/Glib/IO.pm     |   17 +++++++++++++----
 t/file-attribute.t |    2 +-
 t/file.t           |   11 +++++------
 3 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/lib/Glib/IO.pm b/lib/Glib/IO.pm
index 005a63e..b09e1d6 100644
--- a/lib/Glib/IO.pm
+++ b/lib/Glib/IO.pm
@@ -16,10 +16,19 @@ sub import {
     'Glib::IO::file_parse_name'              => 'Glib::IO::File::parse_name',
   );
 
-  Glib::Object::Introspection->setup(basename => $GIO_BASENAME,
-                                     version => $GIO_VERSION,
-                                     package => $GIO_PACKAGE,
-                                     name_corrections => \%name_corrections);
+  my @class_static_methods = qw(
+    Glib::IO::File::new_for_commandline_arg
+    Glib::IO::File::new_for_path
+    Glib::IO::File::new_for_uri
+    Glib::IO::File::parse_name
+  );
+
+  Glib::Object::Introspection->setup(
+    basename => $GIO_BASENAME,
+    version => $GIO_VERSION,
+    package => $GIO_PACKAGE,
+    name_corrections => \%name_corrections,
+    class_static_methods => \ class_static_methods);
 }
 
 1;
diff --git a/t/file-attribute.t b/t/file-attribute.t
index 69e6287..f747235 100644
--- a/t/file-attribute.t
+++ b/t/file-attribute.t
@@ -5,7 +5,7 @@ use Test::More tests => 3;
 use Glib::IO;
 
 {
-  my $file = Glib::IO::File::new_for_path ($0);
+  my $file = Glib::IO::File->new_for_path ($0);
   my $attrs = $file->query_settable_attributes ();
 
   $attrs->add ('perl::booze', 'boolean', [qw/copy-with-file copy-when-moved/]);
diff --git a/t/file.t b/t/file.t
index 2091524..6085312 100644
--- a/t/file.t
+++ b/t/file.t
@@ -7,13 +7,12 @@ use Glib::IO;
 SKIP: {
   skip 'hash is broken', 1;
 
-  # FIXME: Glib::IO::File->new_for_path?
-  my $file = Glib::IO::File::new_for_path ($0);
+  my $file = Glib::IO::File->new_for_path ($0);
   ok (defined $file->hash ());
 }
 
 {
-  my $file = Glib::IO::File::new_for_path ('non-existent');
+  my $file = Glib::IO::File->new_for_path ('non-existent');
   my $result = eval { $file->read (); 1 };
   ok (!$result);
   ok (defined $@);
@@ -22,7 +21,7 @@ SKIP: {
 {
   my $loop = Glib::MainLoop->new ();
 
-  my $file = Glib::IO::File::new_for_path ($0);
+  my $file = Glib::IO::File->new_for_path ($0);
   $file->query_info_async ('*', [], 0, undef, \&info, [ 23, 'bla' ]);
   sub info {
     my ($file, $res, $data) = @_;
@@ -47,8 +46,8 @@ SKIP: {
 
   my $loop = Glib::MainLoop->new ();
 
-  my $src = Glib::IO::File::new_for_path ($0);
-  my $dst = Glib::IO::File::new_for_path ($0 . '.bak');
+  my $src = Glib::IO::File->new_for_path ($0);
+  my $dst = Glib::IO::File->new_for_path ($0 . '.bak');
   $src->copy_async ($dst, [], 0, undef, \&progress, [ 23, 'bla' ], \&read, [ 42, 'blub' ]);
 
   my $progress_called = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]