Re: [Vala] Vala to Genie



On Mon, 2011-02-21 at 12:42 +0100, Nicolas wrote:

def async search (query : Query) : ResultSet? raises SearchError

Don't forget to build with "--pkg gio-2.0"

Nicolas.

Nope, neither when swapped async and ResultSet.

Compilation failed: 1 error(s), 1 warning(s)
     def search (query : Query) : async ResultSet? raises SearchError

Yeah! It works. Probably need to move this to Genie wiki.

But I fall into another issues so need some more help :)

    def register_plugin()
      DataSink.PluginRegistry.get_default().register_plugin(
        typeof (GeniePlugin),
                "Genie Example", // Plugin title
        _ ("Synapse plugin example wiritten in Genie language"), 
        "terminal",       // icon name
        register_plugin,  // reference to this function
        ...
      );

valac complains:

genie-test-plugin.gs:25.206-25.220: error: Cannot create delegate
without target for instance method or closure
        register_plugin, // reference to this function


Also need to translate following:

    private class Connect : Object, Match {
      // from Match interface
      public string title             { get; construct set; }
      public string description       { get; set; }
      public string icon_name         { get; construct set; }
      public bool   has_thumbnail     { get; construct set; }
      public string thumbnail_path    { get; construct set; }
      public int    default_relevancy { get; set; default = 0; }      
      public MatchType match_type     { get; construct set; }
   
I made something like this:

   class Connect : Object implements Match
    
      prop title : string
      prop description : string
      prop icon_name : string
      prop has_thumbnail : bool
      prop thumbnail_path : bool
      prop match_type : MatchType

Valac complains here:

genie-test-plugin.gs:44.7-44.25: error: Type and/or accessors of
overriding property `Synapse.GeniePlugin.GenieItem.title' do not match
overridden property `Synapse.Match.title'.
      prop title : string
      ^^^^^^^^^^^^^^^^^^^
genie-test-plugin.gs:46.7-46.29: error: Type and/or accessors of
overriding property `Synapse.GeniePlugin.GenieItem.icon_name' do not
match overridden property `Synapse.Match.icon_name'.
      prop icon_name : string
      ^^^^^^^^^^^^^^^^^^^^^^^

etc. 

I'am begginer in Vala and Genie so dont 




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