[Evolution-hackers] Regarding ESource and ESourceExtension



Hi again,
    I've been looking deeper into the details of creating addressbooks
and using fancy extensions and I have another question/issue, that
would be: How do you ask a backend if it supports a given extension ?

Currently, as far as I can see it's possible to blindly add extensions
to sources and not know if they are indeed supported, like this:

   source = e_source_new_with_uid ();
   backend = e_source_get_extension (source,
                                     E_SOURCE_EXTENSION_ADDRESS_BOOK);

   /* Create our addressbook with the backend this tool was
    * configured to use:
    */
   e_source_backend_set_backend_name (backend, "abstract backend name");

   /* Add our awesome configuration values, we hope that this
    * backend supports the feature set provided by EAwesomeExtension:
    */
   awesome = e_source_get_extension(source, E_SOURCE_EXTENSION_AWESOME);
   e_awesome_extension_configure(awesome, E_AWESOME_DO_IT_AWESOMELY);

   /* Hmmm... I hope this addressbook is indeed awesome,
    * but I can't know for sure...
    */
   e_source_registry_commit_source ();

Is it intended that the frontend must know what extensions are
supported by a given backend ?

Perhaps a generic backend property could essentially be used
to check which extensions are indeed supported by a given backend,
i.e. after the backend is actually opened ?

(not sure that that approach would be ideal, perhaps backends could
install something for the registry to read at build time, indicating
what extensions are supported by the freshly built backend...).


Cheers,
          -Tristan


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