[Bug 214366]
Acelists
214366 at bugs.launchpad.net
Mon Feb 10 08:11:50 UTC 2014
(In reply to neil at parkwaycc.co.uk from comment #107)
> Comment on attachment 8371072
> WIP patch 3
>
> >+ newFolderName.Assign(folderName);
> >+ bool containsChild = true;
> >+ uint32_t i = 1;
> >+ while (containsChild) {
> >+ rv = ContainsChildNamed(newFolderName, &containsChild);
> >+ NS_ENSURE_SUCCESS(rv, rv);
> >+ if (!containsChild)
> >+ break;
> >+ // This could be localizable but Toolkit is fine without it, see
> >+ // mozilla/toolkit/content/contentAreaUtils.js::uniqueFile()
> >+ i++;
> >+ newFolderName.Assign(folderName);
> >+ newFolderName.AppendLiteral("(");
> >+ newFolderName.AppendInt(i);
> >+ newFolderName.AppendLiteral(")");
> >+ }
> bool containsChild;
> rv = ContainsChildNamed(folderName, &containsChild);
> NS_ENSURE_SUCCESS(rv, rv);
> while (containsChild) {
> i++;
> newFolderName.Assign(folderName);
> newFolderName.AppendLiteral("(");
> newFolderName.AppendInt(i);
> newFolderName.AppendLiteral(")");
> rv = ContainsChildNamed(newFolderName, &containsChild);
> NS_ENSURE_SUCCESS(rv, rv);
> }
Well, I always try to avoid the duplication of the main logic (rv =
ContainsChildNamed(folderName, &containsChild);) that is why I did not
write it this way :)
--
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to Mozilla.
https://bugs.launchpad.net/bugs/214366
Title:
Can't delete a folder if Trash already contains a folder of the same
name
To manage notifications about this bug go to:
https://bugs.launchpad.net/thunderbird/+bug/214366/+subscriptions
More information about the Ubuntu-mozillateam-bugs
mailing list