Re: [Evolution-hackers] [Camel] Folder names



On Wed, 2005-09-14 at 18:10 +0800, Not Zed wrote:
> > It certainly would. Does any upper-level component do any string
> > manipulation with the full name? My idea is to put the entryid at the
> > end of the full name and separate the full name readable part from the
> > entryid part with '\0'. Something like (non-compilable short-hand):
> 
> > fi = {
> > 	.name = "evolution";
> > 	.full_name = "Inbox/evolution'\0'b7d33043-cfb0-4ea9-8aa1-941b0616e891";
> > };
> > 
> > Would that wreck havoc up-source?
> 
> The full_name may be strcpy'd, so if that is a \0 and not a \\0, then i
> doubt it would work.
> 
> It wouldn't work anyway, you'd have to add it to every folder name in
> the path.
> 
> If you list:
>  Inbox-UID
>  Inbox/evolution-UID
> 
> That wont work, since the parent path must be able to be found by
> stripping off the /.* off a given path.  

Yes, and it won't work for even more reasons. A .name like "child'\0'"
would expand into "parent'\0'/child'\0'" with more than one '\0'...


> Now ... with IMAP, the path we list doesn't map to the server name
> directly either.  

<snip> 

> You could do something like this to store the real folder name/id, and
> have a mapping function, using some fat-like 'low impact' munging to
> give you a unique name that isn't too messy, in the few cases you have
> overlaps.

I just got another idea. Is trailing whitespace ever removed from a name
being it full or not?

I could then add one or more trailing ' 's to any name to make it unique
among other folders with identical display name. Like this:

fi_a = {
	.name = "evolution ";
	.full_name = "Inbox /evolution ";
};

fi_b = {
	.name = "evolution  ";
	.full_name = "Inbox /evolution  ";
};

and keep an internal mapping table that gives me the entryid for any
given full name.

These name are as unique as any other string could be, you can strcpy()
it without any ill effects  and you can strip off the /* for any given
path to get the parent name.
 
A folder name without any trailing ' ' would indicate that the folder
hasn't got an entryid yet. This won't happen on Exchange before it is
committed to db. 

This scheme has the added advantage of producing names that looks
identical to the human eye as we are prone to overlook ' ' characters,
especially the trailing ones. 

Thoughts?
  jules





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