ensure_account


Description:

[ Version ( deprecated = true , since = "0.9.0" ) ]
public unowned Account ensure_account (string path)

Warning: ensure_account is deprecated.

Lookup an account in the account manager this.

Note:

New code should call ensure_account on this object's factory instead, which ensures that a new reference is returned.

If the desired account has already been ensured then the same object will be returned, otherwise it will create a new Account and add it to this. As a result, if this thinks that the account doesn't exist, this will still add it to this to avoid races.

The account will be constructed via this account manager's factory (so it will be of an appropriate Account subclass if the factory returns one), but does not necessarily have any features prepared yet. Use prepare_async to prepare features, using the contents of dup_account_features as a parameter if you want to prepare the same features that would normally be used.

The caller must keep a ref to the returned object using @ref if it is to be kept.

Parameters:

this

a AccountManager

path

the object path for an account

Returns:

a new Account at path, or null if path is not a valid account path.