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



On Wed, 2005-09-14 at 10:15 +0200, Jules Colding wrote:
> On Tue, 2005-09-13 at 22:06 +0800, Not Zed wrote:
> > The full-name is a / separated name, but it doesn't start with /.  i.e.
> > you might have a folderinfo like:
> > 
> > fi = {
> > 	.name = "evolution";
> > 	.full_name = "Inbox/evolution";
> > };
> 
> So when a folder name is given as a parameter to a method, then it is
> the full_name that is given?

For anything like opening/deleting/renaming a folder, yeah.  Creating
folders is a bit different because you get given a parent + name, but
the parent should be a full path.

> > , or add it to the path component, or
> > do fat-style munging.  Or you could use a different top-level namespace.
> > The only problem with this is cosmetic - the full_name is often used
> > when displaying folder paths in various places, so a purely numerical
> > path may look strange.
> 
> 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.  Although the API requires
proper structure to be returned from get_folder_info(), it is rarely
used, in most cases the tree is flattened, and just the full_name is
used.

(i'm not sure i'd call that manipulation, but for the sake of this it
could be).

Now ... with IMAP, the path we list doesn't map to the server name
directly either.  Since the server name should be 'modified utf7'
encoded, although often servers do not enforce this.

So, since the paths must be utf8, the imap code has a mapping function
which maps a name to a raw 'physical' name, which may, or may not be,
utf7 encoded, and then always uses that in server interactions.  This is
stored in a state file, controlled by a camel-store-summary.

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.

-- 
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome 




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