Camel.StoreSummary

g Camel.StoreSummary Camel.StoreSummary GObject.Object GObject.Object GObject.Object->Camel.StoreSummary

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add (info)

add_from_path (path)

array ()

array_free (array)

connect_folder_summary (path, folder_summary)

count ()

disconnect_folder_summary (folder_summary)

info_new ()

info_unref (info)

load ()

remove (info)

remove_path (path)

save ()

set_filename (filename)

sort (compare_func, *user_data)

touch ()

Virtual Methods

Inherited:

GObject.Object (7)

do_store_info_free (info)

do_store_info_load (file)

do_store_info_new (path)

do_store_info_save (file, info)

do_store_info_set_value (info, type, value)

do_summary_header_load (file)

do_summary_header_save (file)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Camel.StoreSummary(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Camel.StoreSummaryClass

classmethod new()
Returns:

a new Camel.StoreSummary object

Return type:

Camel.StoreSummary

Create a new Camel.StoreSummary object.

add(info)
Parameters:

info (Camel.StoreInfo) – a Camel.StoreInfo

The info record should have been generated by calling one of the info_new_*() functions, as it will be free’d based on the summary class. And MUST NOT be allocated directly using malloc.

add_from_path(path)
Parameters:

path (str) – item path

Returns:

the newly added record or None if the path already exists

Return type:

Camel.StoreInfo or None

Build a new info record based on the name, and add it to the summary.

array()
Returns:

the summary array

Return type:

[Camel.StoreInfo]

Obtain a copy of the summary array. This is done atomically, so cannot contain empty entries.

It must be freed using g_ptr_array_unref().

array_free(array)
Parameters:

array ([Camel.StoreInfo]) – the summary array as gotten from Camel.StoreSummary.array()

Free the folder summary array.

Deprecated since version 3.46: Use g_ptr_array_unref() directly.

connect_folder_summary(path, folder_summary)
Parameters:
Returns:

Whether successfully connect callbacks for count change notifications.

Return type:

bool

Connects listeners for count changes on folder_summary to keep Camel.StoreInfo.total and Camel.StoreInfo.unread in sync transparently. The folder_summary is stored in self as path. Use Camel.StoreSummary.disconnect_folder_summary() to disconnect from listening.

New in version 3.4.

count()
Returns:

the number of items int he summary.

Return type:

int

Get the number of summary items stored in this summary.

disconnect_folder_summary(folder_summary)
Parameters:

folder_summary (Camel.FolderSummary) – a Camel.FolderSummary object

Returns:

Whether such connection existed and whether was successfully removed.

Return type:

bool

Diconnects count change listeners previously connected by Camel.StoreSummary.connect_folder_summary().

New in version 3.4.

info_new()
Returns:

the newly allocated Camel.StoreInfo

Return type:

Camel.StoreInfo

Allocate a new Camel.StoreInfo, suitable for adding to this summary.

info_unref(info)
Parameters:

info (Camel.StoreInfo) – a Camel.StoreInfo

Unref and potentially free info, and all associated memory.

Deprecated since version 3.46: Use Camel.StoreInfo.unref() instead.

load()
Returns:

0 on success or -1 on fail

Return type:

int

Load the summary off disk.

remove(info)
Parameters:

info (Camel.StoreInfo) – a Camel.StoreInfo

Remove a specific info record from the summary.

remove_path(path)
Parameters:

path (str) – item path

Remove a specific info record from the summary, by path.

save()
Returns:

0 on success or -1 on fail

Return type:

int

Writes the summary to disk. The summary is only written if changes have occurred.

set_filename(filename)
Parameters:

filename (str) – a filename

Set the filename where the summary will be loaded to/saved from.

sort(compare_func, *user_data)
Parameters:

Sorts the array of the folders using the compare_func.

New in version 3.24.

touch()

Mark the summary as changed, so that a save will force it to be written back to disk.

do_store_info_free(info) virtual
Parameters:

info (Camel.StoreInfo) –

do_store_info_load(file) virtual
Parameters:

file (object or None) –

Return type:

Camel.StoreInfo

do_store_info_new(path) virtual
Parameters:

path (str) –

Return type:

Camel.StoreInfo

do_store_info_save(file, info) virtual
Parameters:
Return type:

int

do_store_info_set_value(info, type, value) virtual
Parameters:
do_summary_header_load(file) virtual
Parameters:

file (object or None) –

Return type:

int

do_summary_header_save(file) virtual
Parameters:

file (object or None) –

Return type:

int