Closed Bug 1890453 Opened 10 months ago Closed 10 months ago

Add C++ shortcut URI accessor to nsIMsgFolder

Categories

(MailNews Core :: General, task)

Tracking

(Not tracked)

RESOLVED FIXED
126 Branch

People

(Reporter: benc, Assigned: benc)

Details

Attachments

(1 file)

There are a lot of places in the C++ side which access the folder URI. But currently you need use GetURI() to assign it to a string. Since URI must always be set (it's read only and set at folder creation time), it'd be nice to have a C++ shortcut to access it, something along the lines of nsIFile::HumanReadablePath().

So we can replace this kind of thing:

nsAutoCString uri;
rv = folder->GetURI(uri);
NS_ENSURE_SUCCESS(rv);
DoThingWithURI(uri);

with:

DoThingWithURI(folder->URI());

This is especially useful for debugging and logging code.

Summary: Add C++ URI accessor to nsIMsgFolder to simplify debugging and logging code. → Add C++ shortcut URI accessor to nsIMsgFolder

There's a generic nsIMsgFolder::URI() which is implemented in terms of GetURI().
This will work on non nsMsgDBFolder-based folders, even if they are written in JS or rust or whatever.
Then there's also an inline nsMsgDBFolder::URI() which the compiler can optimise for when the concrete type is availible to it.

Status: NEW → ASSIGNED
Target Milestone: --- → 126 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/ceccb46eba33
Add C++ shortcut URI accessor to nsIMsgFolder (and nsMsgDBFolder). r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: