Minor fix and code cleanup for Geary.Imap.Account.
* src/engine/imap/api/imap-account.vala (Account): Replace camel case methods names with underscores per style guide, fix sense of is_no_select test in fetch_folder_cached_async() to account for the double nagative, and clean up the resulting if/else clause a bit.
This commit is contained in:
parent
d8d4af7eda
commit
69a4e631c1
2 changed files with 12 additions and 12 deletions
|
|
@ -660,7 +660,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
|
|||
// Use local STATUS data cache to be able to present
|
||||
// something to the user at least. XXX get the attrs
|
||||
// from somewhere for Bug 714775
|
||||
opening_folder = this.remote.newSelectableFolder(
|
||||
opening_folder = this.remote.new_selectable_folder(
|
||||
path,
|
||||
local_status,
|
||||
new Imap.MailboxAttributes(new Gee.ArrayList<Geary.Imap.MailboxAttribute>())
|
||||
|
|
|
|||
|
|
@ -187,9 +187,9 @@ private class Geary.Imap.Account : BaseObject {
|
|||
StatusDataType.all(),
|
||||
cancellable
|
||||
);
|
||||
folder = newSelectableFolder(path, status, mailbox_info.attrs);
|
||||
folder = new_selectable_folder(path, status, mailbox_info.attrs);
|
||||
} else {
|
||||
folder = newUnselectableFolder(path, mailbox_info.attrs);
|
||||
folder = new_unselectable_folder(path, mailbox_info.attrs);
|
||||
}
|
||||
|
||||
return folder;
|
||||
|
|
@ -209,8 +209,11 @@ private class Geary.Imap.Account : BaseObject {
|
|||
check_open();
|
||||
|
||||
Imap.Folder? folder = this.folders.get(path);
|
||||
if (folder != null) {
|
||||
if (refresh_counts && folder.properties.attrs.is_no_select) {
|
||||
if (folder == null) {
|
||||
folder = yield fetch_folder_async(path, cancellable);
|
||||
this.folders.set(path, folder);
|
||||
} else {
|
||||
if (refresh_counts && !folder.properties.attrs.is_no_select) {
|
||||
try {
|
||||
ClientSession session = yield claim_session_async(cancellable);
|
||||
StatusData data = yield send_status_async(
|
||||
|
|
@ -227,9 +230,6 @@ private class Geary.Imap.Account : BaseObject {
|
|||
throw_not_found(path);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
folder = yield fetch_folder_async(path, cancellable);
|
||||
this.folders.set(path, folder);
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
|
@ -273,7 +273,7 @@ private class Geary.Imap.Account : BaseObject {
|
|||
FolderPath path = session.get_path_for_mailbox(mailbox_info.mailbox);
|
||||
Folder? child = this.folders.get(path);
|
||||
if (child == null) {
|
||||
child = newUnselectableFolder(path, mailbox_info.attrs);
|
||||
child = new_unselectable_folder(path, mailbox_info.attrs);
|
||||
this.folders.set(path, child);
|
||||
}
|
||||
children.add(child);
|
||||
|
|
@ -323,7 +323,7 @@ private class Geary.Imap.Account : BaseObject {
|
|||
if (child != null) {
|
||||
child.properties.update_status(status);
|
||||
} else {
|
||||
child = newSelectableFolder(child_path, status, mailbox_info.attrs);
|
||||
child = new_selectable_folder(child_path, status, mailbox_info.attrs);
|
||||
this.folders.set(child_path, child);
|
||||
}
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ private class Geary.Imap.Account : BaseObject {
|
|||
return children;
|
||||
}
|
||||
|
||||
internal Imap.Folder newSelectableFolder(FolderPath path, StatusData status, MailboxAttributes attrs) {
|
||||
internal Imap.Folder new_selectable_folder(FolderPath path, StatusData status, MailboxAttributes attrs) {
|
||||
return new Imap.Folder(
|
||||
path, new Imap.FolderProperties.status(status, attrs), this.session_mgr
|
||||
);
|
||||
|
|
@ -580,7 +580,7 @@ private class Geary.Imap.Account : BaseObject {
|
|||
throw new EngineError.OPEN_REQUIRED("Imap.Account not open");
|
||||
}
|
||||
|
||||
private inline Imap.Folder newUnselectableFolder(FolderPath path, MailboxAttributes attrs) {
|
||||
private inline Imap.Folder new_unselectable_folder(FolderPath path, MailboxAttributes attrs) {
|
||||
return new Imap.Folder(
|
||||
path, new Imap.FolderProperties(0, 0, 0, null, null, attrs), this.session_mgr
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue