Re: [evolution-patches] Patch to allow a contact to be opened in the editor from command-line.



On Tue, 2005-07-12 at 15:52 +0800, Not Zed wrote:
> On Tue, 2005-07-12 at 13:22 +0530, Veerapuram Varadhan wrote:
> > On Tue, 2005-07-12 at 09:06 +0800, Not Zed wrote:
> > 
> > > Easily.
> > > 
> > > url = url_new();
> > > url.set_parameter("name", "value");
> > > 
> > > etc.
> > > 
> > > NEVER.  And I mean NEVER, EVER, use printf to create url strings.
> > 
> > IIUC, the above sample code will go in to the application that invokes
> > evolution with a URI, isn't it?
> 
> Umm, the code in question was creating a uri string.  Thats all i was
> talking about.
> 
IIRC, the code in question is not creating a uri rather parses it.

[snip..]
> 1. you weren't using e_uri anyway, 

+       if (!strncmp (uri, "contacts:", 9)) {
+               EUri *euri = e_uri_new (uri);
+               const char *p;
+               char *header, *content;
+               size_t len, clen;
+
+               p = euri->query;
.....
....
...

This is the code fragment that *handles* the URI and uses EUri.

> and 2. the only code i saw, which i
> was commenting about, was using query parameters, not uri parameters,
> and it wasn't doing any encoding on them.

Yes, the "source-uid" and "contact-uid" are passed as query strings.
For example: 
evolution-2.4  'contacts:///?source-uid=1118659288.31725.10%
40vvaradhan-test&contact-uid=pas-id-42AFFC8700000000'

And changing it to 

evolution-2.4 'contacts:///source-uid=1118659288.31725.10%
40vvaradhan-test;contact-uid=pas-id-42AFFC8700000000'

will not be a problem.  However, would like to know the preferred way of
passing arguments in URI.  If it is passing as parameters, do we need to
change the way "calendar" URI is handled?

Thanks,

V. Varadhan



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