GCancellable *cancellable,
GError **error)
{
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
+ CamelSortType fetch_order;
guchar *p = NULL, c;
const gchar *token = NULL;
gboolean ok = FALSE;
g_return_val_if_fail (is->priv->context == NULL, FALSE);
is->priv->context = g_new0 (CamelIMAPXServerUntaggedContext, 1);
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
+ settings = camel_imapx_server_ref_settings (is);
+ fetch_order = camel_imapx_settings_get_fetch_order (settings);
+ g_object_unref (settings);
is->priv->context->lsub = FALSE;
- is->priv->context->fetch_order = camel_imapx_settings_get_fetch_order (
- CAMEL_IMAPX_SETTINGS (settings));
-
- g_object_unref (settings);
- g_object_unref (store);
+ is->priv->context->fetch_order = fetch_order;
e (is->tagprefix, "got untagged response\n");
is->priv->context->id = 0;
RefreshInfoData *data;
gint i;
gboolean success = TRUE;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
guint batch_count;
gboolean mobile_mode;
ifolder = (CamelIMAPXFolder *) job->folder;
isum = (CamelIMAPXSummary *) job->folder->summary;
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- batch_count = camel_imapx_settings_get_batch_fetch_count (
- CAMEL_IMAPX_SETTINGS (settings));
- mobile_mode = camel_imapx_settings_get_mobile_mode (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ batch_count = camel_imapx_settings_get_batch_fetch_count (settings);
+ mobile_mode = camel_imapx_settings_get_mobile_mode (settings);
g_object_unref (settings);
- g_object_unref (store);
i = data->index;
GError **error)
{
CamelIMAPXJob *job;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
RefreshInfoData *data;
guint uidset_size;
gboolean success = TRUE;
data->scan_changes = FALSE;
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- uidset_size = camel_imapx_settings_get_batch_fetch_count (
- CAMEL_IMAPX_SETTINGS (settings));
- mobile_mode = camel_imapx_settings_get_mobile_mode (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ uidset_size = camel_imapx_settings_get_batch_fetch_count (settings);
+ mobile_mode = camel_imapx_settings_get_mobile_mode (settings);
g_object_unref (settings);
- g_object_unref (store);
if (camel_imapx_command_set_error_if_failed (ic, error)) {
g_prefix_error (
{
CamelIMAPXCommand *ic;
RefreshInfoData *data;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
gboolean mobile_mode;
gchar *uid = NULL;
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- mobile_mode = camel_imapx_settings_get_mobile_mode (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ mobile_mode = camel_imapx_settings_get_mobile_mode (settings);
g_object_unref (settings);
- g_object_unref (store);
if (mobile_mode)
uid = imapx_get_uid_from_index (job->folder->summary, 0);
CamelIMAPXCommand *ic;
CamelFolder *folder = job->folder;
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) folder;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
CamelSortType fetch_order;
RefreshInfoData *data;
guint32 total, diff;
data = camel_imapx_job_get_data (job);
g_return_if_fail (data != NULL);
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- fetch_order = camel_imapx_settings_get_fetch_order (
- CAMEL_IMAPX_SETTINGS (settings));
-
- uidset_size = camel_imapx_settings_get_batch_fetch_count (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ fetch_order = camel_imapx_settings_get_fetch_order (settings);
+ uidset_size = camel_imapx_settings_get_batch_fetch_count (settings);
g_object_unref (settings);
- g_object_unref (store);
total = camel_folder_summary_count (folder->summary);
diff = ifolder->exists_on_server - total;
CamelFetchType ftype;
gint fetch_limit;
CamelSortType fetch_order;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
guint uidset_size;
RefreshInfoData *data;
data = camel_imapx_job_get_data (job);
g_return_if_fail (data != NULL);
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- fetch_order = camel_imapx_settings_get_fetch_order (
- CAMEL_IMAPX_SETTINGS (settings));
+ settings = camel_imapx_server_ref_settings (is);
+ fetch_order = camel_imapx_settings_get_fetch_order (settings);
+ uidset_size = camel_imapx_settings_get_batch_fetch_count (settings);
+ g_object_unref (settings);
total = camel_folder_summary_count (folder->summary);
ftype = data->fetch_type;
fetch_limit = data->fetch_msg_limit;
- uidset_size = camel_imapx_settings_get_batch_fetch_count (
- CAMEL_IMAPX_SETTINGS (settings));
-
- g_object_unref (settings);
- g_object_unref (store);
-
if (ftype == CAMEL_FETCH_NEW_MESSAGES ||
(ftype == CAMEL_FETCH_OLD_MESSAGES && total <=0 )) {
gboolean need_rescan = FALSE;
gboolean is_selected = FALSE;
gboolean can_qresync = FALSE;
- CamelIMAPXStore *store;
- CamelSettings *settings;
+ CamelIMAPXSettings *settings;
gboolean mobile_mode;
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- mobile_mode = camel_imapx_settings_get_mobile_mode (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ mobile_mode = camel_imapx_settings_get_mobile_mode (settings);
g_object_unref (settings);
- g_object_unref (store);
full_name = camel_folder_get_full_name (folder);
CamelStore *parent_store;
SyncChangesData *data;
const gchar *full_name;
- CamelSettings *settings;
- CamelIMAPXStore *store;
+ CamelIMAPXSettings *settings;
gboolean mobile_mode;
gboolean success = TRUE;
data = camel_imapx_job_get_data (job);
g_return_val_if_fail (data != NULL, FALSE);
- store = camel_imapx_server_ref_store (is);
- settings = camel_service_ref_settings (CAMEL_SERVICE (store));
-
- mobile_mode = camel_imapx_settings_get_mobile_mode (
- CAMEL_IMAPX_SETTINGS (settings));
-
+ settings = camel_imapx_server_ref_settings (is);
+ mobile_mode = camel_imapx_settings_get_mobile_mode (settings);
g_object_unref (settings);
- g_object_unref (store);
job->commands--;
return g_weak_ref_get (&server->priv->store);
}
+CamelIMAPXSettings *
+camel_imapx_server_ref_settings (CamelIMAPXServer *server)
+{
+ CamelIMAPXStore *store;
+ CamelSettings *settings;
+
+ g_return_val_if_fail (CAMEL_IS_IMAPX_SERVER (server), NULL);
+
+ store = camel_imapx_server_ref_store (server);
+ settings = camel_service_ref_settings (CAMEL_SERVICE (store));
+ g_object_unref (store);
+
+ return CAMEL_IMAPX_SETTINGS (settings);
+}
+
CamelIMAPXStream *
camel_imapx_server_ref_stream (CamelIMAPXServer *server)
{