]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
doclets/gtkdoc: Replace deprecated function calls
authorFlorian Brosch <flo.brosch@gmail.com>
Tue, 8 Feb 2011 19:03:47 +0000 (20:03 +0100)
committerFlorian Brosch <flo.brosch@gmail.com>
Tue, 8 Feb 2011 19:04:40 +0000 (20:04 +0100)
src/doclets/gtkdoc/utils.vala

index 59e2df827c874f5f6a295849e63e382e7cd2f4ef..d95e6cc3dac242626d900f9a36fac69be7c66bba 100644 (file)
@@ -27,16 +27,14 @@ using Valadoc.Content;
 
 namespace Gtkdoc {
        public string get_section (string filename) {
-               long dot = filename.pointer_to_offset (filename.rchr (-1, '.'));
-               return Path.get_basename (filename.substring (0, dot));
+               return Path.get_basename (filename.substring (0, filename.last_index_of_char ('.')));
        }
 
        public string commentize (string comment) {
                return string.joinv ("\n * ", comment.split ("\n"));
        }
 
-       public string? get_cname (Api.Item item)
-       {
+       public string? get_cname (Api.Item item) {
                if (item is Api.Method) {
                        return ((Api.Method)item).get_cname ();
                } else if (item is Api.FormalParameter) {
@@ -184,7 +182,7 @@ namespace Gtkdoc {
                if (stream != null) {
                        var line = stream.read_line ();
                        if (line != null) {
-                               return line.str ("generated by valac") != null;
+                               return line.index_of ("generated by valac") >= 0;
                        }
                }
                return false;