Little sophisticated:

>+    newFolderName.Assign(folderName);
>+    for (uint32_t i=2, containsChild; ; i++) {
>+      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()
>+      newFolderName.Assign(folderName);
>+      newFolderName.AppendLiteral("(");
>+      newFolderName.AppendInt(i);
>+      newFolderName.AppendLiteral(")");
>+    }

Or really type clean:
>+    for (uint32_t i=2; ; i++) {
>+      bool containsChild;
>+      rv = ContainsChildNamed(newFolderName, &containsChild);
...

I'm not sure, if newFolderName and rv also could be drawn into the loop,
are they used outside?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
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

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to