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); }
Comment on attachment 8371072
WIP patch 3
>+ newFolderName. Assign( folderName) ; med(newFolderNa me, &containsChild); SUCCESS( rv, rv); toolkit/ content/ contentAreaUtil s.js::uniqueFil e() Assign( folderName) ; AppendLiteral( "("); AppendInt( i); AppendLiteral( ")"); med(folderName, &containsChild); SUCCESS( rv, rv); .Assign( folderName) ; .AppendLiteral( "("); .AppendInt( i); .AppendLiteral( ")"); med(newFolderNa me, &containsChild); SUCCESS( rv, rv);
>+ bool containsChild = true;
>+ uint32_t i = 1;
>+ while (containsChild) {
>+ rv = ContainsChildNa
>+ NS_ENSURE_
>+ if (!containsChild)
>+ break;
>+ // This could be localizable but Toolkit is fine without it, see
>+ // mozilla/
>+ i++;
>+ newFolderName.
>+ newFolderName.
>+ newFolderName.
>+ newFolderName.
>+ }
bool containsChild;
rv = ContainsChildNa
NS_ENSURE_
while (containsChild) {
i++;
newFolderName
newFolderName
newFolderName
newFolderName
rv = ContainsChildNa
NS_ENSURE_
}