...
 
Commits (20)
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
project(evolution
VERSION 3.29.2
VERSION 3.29.3
LANGUAGES C)
set(PROJECT_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution")
set(PROJECT_URL "http://wiki.gnome.org/Apps/Evolution/")
......@@ -91,6 +91,7 @@ set(gnome_autoar_minimum_version 0.1.1)
set(gweather_minimum_version 3.10)
set(libcanberra_gtk_minimum_version 0.25)
set(libnotify_minimum_version 0.7)
set(libunity_minimum_version 7.1.4)
# Load modules from the source tree
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
......@@ -380,7 +381,10 @@ if(NOT HAVE_ICONV)
endif(NOT HAVE_ICONV)
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBS})
CHECK_C_SOURCE_RUNS("#include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/" _binary_dir_with_separator)
CHECK_C_SOURCE_RUNS("#define ICONV_DETECT_BUILD_DIR \"${_binary_dir_with_separator}\"
#include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
unset(_binary_dir_with_separator)
unset(CMAKE_REQUIRED_LIBRARIES)
if(NOT _correct_iconv)
......@@ -585,6 +589,13 @@ set(CERT_UI_LIBS ${MANUAL_NSPR_LIBS})
pkg_check_modules(LIBNOTIFY libnotify>=${libnotify_minimum_version})
set(HAVE_LIBNOTIFY ${LIBNOTIFY_FOUND})
# ******************************
# Libunity
# ******************************
pkg_check_modules(LIBUNITY unity>=${libunity_minimum_version})
set(HAVE_LIBUNITY ${LIBUNITY_FOUND})
# ******************************
# libical tweaks
# ******************************
......
Evolution 3.29.2 2018-05-21
---------------------------
Bug Fixes:
Bug 795289 - Proxy settings ignored when checking for auth types (Milan Crha)
Bug 795331 - Use correct desktop-entry name in notifications (Mathieu Bridon)
Bug 795447 - Enigmail GPG encrypted Subject not shown in message list (Milan Crha)
Bug 795567 - Do not expand archive folder in Copy/Move message to folder dialog (Milan Crha)
Bug 795977 - AutoArchive archives Junk and Deleted messages too (Milan Crha)
Bug 796114 - [Collection Accounts] Preselect each unique collection kind, not only first (Milan Crha)
Miscellaneous:
Move evolution-alarm-notify to evolution-data-server (Milan Crha)
Address some of the clang warnings (Milan Crha)
Address some of the compiler and static analyzers warnings (Milan Crha)
Crash when making links clickable in composer (Milan Crha)
Shift+Click on switcher button to open a new window (Milan Crha)
Translations:
Fabio Tomat (fur)
Yuras Shumovich (be)
Marek Černocký (cs)
Christian Kirbach (de)
Evolution 3.29.1 2018-04-16
---------------------------
......
......@@ -99,6 +99,9 @@
/* Define if you have libnotify */
#cmakedefine HAVE_LIBNOTIFY 1
/* Define if you have libunity */
#cmakedefine HAVE_LIBUNITY 1
/* libical provides ical_set_unknown_token_handling_setting function */
#cmakedefine HAVE_ICAL_UNKNOWN_TOKEN_HANDLING 1
......
......@@ -50,8 +50,8 @@ enum {
typedef struct {
char *charset;
char *format;
const char *charset;
const char *format;
int id;
} CharInfo;
......@@ -90,8 +90,8 @@ static int num_iso10646_tests = sizeof (iso10646_tests) / sizeof (CharInfo);
static int
test_iconv (void)
{
char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
char *jp = (char *) "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
char *transbuf = malloc (10), *trans = transbuf;
iconv_t cd;
size_t jp_len = strlen (jp), utf8_len = 10;
......@@ -128,7 +128,7 @@ main (int argc,
if (!test_iconv ())
return 1;
fp = fopen ("iconv-detect.h", "w");
fp = fopen (ICONV_DETECT_BUILD_DIR "iconv-detect.h", "w");
if (fp == NULL)
return 255;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -245,6 +245,7 @@ eab_editor_show (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->show != NULL);
class->show (editor);
......@@ -258,6 +259,7 @@ eab_editor_close (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->close != NULL);
class->close (editor);
......@@ -271,6 +273,7 @@ eab_editor_raise (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->raise != NULL);
class->raise (editor);
......@@ -285,6 +288,7 @@ eab_editor_save_contact (EABEditor *editor,
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->save_contact != NULL);
class->save_contact (editor, should_close);
......@@ -298,6 +302,7 @@ eab_editor_is_changed (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), FALSE);
class = EAB_EDITOR_GET_CLASS (editor);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_changed != NULL, FALSE);
return class->is_changed (editor);
......@@ -311,6 +316,7 @@ eab_editor_is_valid (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), FALSE);
class = EAB_EDITOR_GET_CLASS (editor);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_valid != NULL, FALSE);
return class->is_valid (editor);
......@@ -324,6 +330,7 @@ eab_editor_get_window (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), NULL);
class = EAB_EDITOR_GET_CLASS (editor);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_window != NULL, NULL);
return class->get_window (editor);
......
......@@ -285,13 +285,13 @@ contact_list_editor_add_email (EContactListEditor *editor,
addr = camel_internet_address_new ();
addr_length = camel_address_unformat (CAMEL_ADDRESS (addr), email);
if (addr_length >= 1) {
const gchar *name, *mail;
gint ii;
for (ii = 0; ii < addr_length; ii++) {
camel_internet_address_get (addr, ii, &name, &mail);
const gchar *name = NULL, *mail = NULL;
if (name || mail) {
if (camel_internet_address_get (addr, ii, &name, &mail) &&
(name || mail)) {
dest = e_destination_new ();
if (mail)
e_destination_set_email (dest, mail);
......
......@@ -45,8 +45,8 @@ struct _MergeContext {
guint pending_removals;
gboolean pending_adds;
gint remove_from_source : 1;
gint copy_done : 1;
guint remove_from_source : 1;
guint copy_done : 1;
};
enum {
......
......@@ -1153,13 +1153,12 @@ e_minicard_reflow (GnomeCanvasItem *item,
for (list = e_minicard->fields; list; list = g_list_next (list)) {
EMinicardField *field = E_MINICARD_FIELD (list->data);
/* Why not use the item that is passed in? */
GnomeCanvasItem *item = field->label;
GnomeCanvasItem *label_item = field->label;
g_object_get (
item,
label_item,
"height", &text_height,
NULL);
e_canvas_item_move_absolute (item, 2, e_minicard->height);
e_canvas_item_move_absolute (label_item, 2, e_minicard->height);
e_minicard->height += text_height;
}
e_minicard->height += 2;
......
......@@ -638,7 +638,7 @@ check_if_same (EContact *contact,
} else { /* Do pairwise-comparisons on all of the e-mail addresses. */
iter1 = email_attr_list1;
while (iter1) {
gboolean match = FALSE;
gboolean matches = FALSE;
EVCardAttribute *attr;
gchar *email_address1;
......@@ -646,14 +646,14 @@ check_if_same (EContact *contact,
email_address1 = e_vcard_attribute_get_value (attr);
iter2 = email_attr_list2;
while ( iter2 && match == FALSE) {
while ( iter2 && matches == FALSE) {
gchar *email_address2;
attr = iter2->data;
email_address2 = e_vcard_attribute_get_value (attr);
if (g_ascii_strcasecmp (email_address1, email_address2) == 0) {
match = TRUE;
matches = TRUE;
}
g_free (email_address2);
......@@ -663,7 +663,7 @@ check_if_same (EContact *contact,
g_free (email_address1);
iter1 = g_list_next (iter1);
if (match == FALSE) {
if (matches == FALSE) {
res = FALSE;
break;
}
......
......@@ -430,10 +430,10 @@ parseLine (CSVImporter *gci,
home_street = g_string_new ("");
work_street = g_string_new ("");
other_street = g_string_new ("");
home_address = g_new0 (EContactAddress, 1);
work_address = g_new0 (EContactAddress, 1);
other_address = g_new0 (EContactAddress, 1);
bday = g_new0 (EContactDate, 1);
home_address = e_contact_address_new ();
work_address = e_contact_address_new ();
other_address = e_contact_address_new ();
bday = e_contact_date_new ();
if (!g_utf8_validate (pptr, -1, NULL)) {
do_free = g_convert (pptr, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
......@@ -627,6 +627,10 @@ parseLine (CSVImporter *gci,
e_contact_set (contact, E_CONTACT_BIRTH_DATE, bday);
}
e_contact_address_free (home_address);
e_contact_address_free (work_address);
e_contact_address_free (other_address);
e_contact_date_free (bday);
g_free (do_free);
return TRUE;
......
......@@ -638,7 +638,7 @@ ecal_event (ECalendarItem *calitem,
icaltimezone *timezone;
time_t et;
e_calendar_item_get_selection (calitem, &start_date, &end_date);
g_warn_if_fail (e_calendar_item_get_selection (calitem, &start_date, &end_date));
timezone = e_cal_data_model_get_timezone (dlg->data_model);
tt.year = g_date_get_year (&start_date);
......
......@@ -255,6 +255,7 @@ e_comp_editor_property_part_create_widgets (ECompEditorPropertyPart *property_pa
g_return_if_fail (property_part->priv->edit_widget == NULL);
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
g_return_if_fail (klass != NULL);
g_return_if_fail (klass->create_widgets != NULL);
klass->create_widgets (property_part, out_label_widget, out_edit_widget);
......@@ -285,6 +286,7 @@ e_comp_editor_property_part_fill_widget (ECompEditorPropertyPart *property_part,
g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART (property_part));
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
g_return_if_fail (klass != NULL);
g_return_if_fail (klass->fill_widget != NULL);
klass->fill_widget (property_part, component);
......@@ -299,6 +301,7 @@ e_comp_editor_property_part_fill_component (ECompEditorPropertyPart *property_pa
g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART (property_part));
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
g_return_if_fail (klass != NULL);
g_return_if_fail (klass->fill_component != NULL);
klass->fill_component (property_part, component);
......
......@@ -1175,10 +1175,7 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
if (can_draw_in_region (draw_region, rect_x, rect_y, rect_width, rect_height)) {
cairo_save (cr);
gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED]);
if (e_day_view_get_draw_flat_events (day_view))
cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
else
cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
cairo_fill (cr);
cairo_restore (cr);
}
......
......@@ -517,7 +517,7 @@ e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelec
y = 2 * mts->row_height - scroll_y - 1;
/* Get the first visible busy periods for all the attendees. */
first_periods = g_new (gint, e_meeting_store_count_actual_attendees (mts->model));
first_periods = g_new0 (gint, e_meeting_store_count_actual_attendees (mts->model) + 1);
for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++)
first_periods[row] = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row);
......
......@@ -213,7 +213,7 @@ ea_cal_view_event_get_name (AtkObject *accessible)
const gchar *alarm_string;
const gchar *recur_string;
const gchar *meeting_string;
gchar *summary_string;
gchar *summary_string = NULL;
const gchar *summary;
g_return_val_if_fail (EA_IS_CAL_VIEW_EVENT (accessible), NULL);
......@@ -237,15 +237,13 @@ ea_cal_view_event_get_name (AtkObject *accessible)
if (e_cal_util_component_has_organizer (event->comp_data->icalcomp))
meeting_string = _("It is a meeting.");
summary = icalcomponent_get_summary (event->comp_data->icalcomp);
if (summary)
summary_string = g_strdup_printf (_("Calendar Event: Summary is %s."), summary);
}
summary = icalcomponent_get_summary (event->comp_data->icalcomp);
if (summary)
summary_string = g_strdup_printf (
_("Calendar Event: Summary is %s."), summary);
else
summary_string = g_strdup (
_("Calendar Event: It has no summary."));
if (!summary_string)
summary_string = g_strdup (_("Calendar Event: It has no summary."));
name_string = g_strdup_printf (
"%s %s %s %s", summary_string,
......
......@@ -324,14 +324,14 @@ action_interface_do_action (AtkAction *action,
break;
case 1:
/* New All Day Event */
e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
g_warn_if_fail (e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend));
e_cal_ops_new_component_editor_from_model (
e_calendar_view_get_model (cal_view), NULL,
dtstart, dtend, FALSE, TRUE);
break;
case 2:
/* New Meeting */
e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
g_warn_if_fail (e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend));
e_cal_ops_new_component_editor_from_model (
e_calendar_view_get_model (cal_view), NULL,
dtstart, dtend, TRUE, FALSE);
......
......@@ -267,12 +267,12 @@ ea_week_view_ref_child (AtkObject *accessible,
ea_calendar_helpers_get_accessible_for (
span->text_item);
} else {
gint index;
gint jump_index;
index = (current_day != -1) ? current_day : 0;
jump_index = (current_day != -1) ? current_day : 0;
atk_object =
ea_calendar_helpers_get_accessible_for (
week_view->jump_buttons[index]);
week_view->jump_buttons[jump_index]);
}
g_object_ref (atk_object);
break;
......
......@@ -428,6 +428,8 @@ ivcal_import_items (gpointer d)
{
ICalImporter *ici = d;
ici->idle_id = 0;
switch (ici->source_type) {
case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
prepare_events (ici->icalcomp, NULL);
......@@ -440,13 +442,10 @@ ivcal_import_items (gpointer d)
default:
g_warn_if_reached ();
ici->idle_id = 0;
ivcal_import_done (ici, NULL);
return FALSE;
}
ici->idle_id = 0;
return FALSE;
}
......@@ -1230,7 +1229,7 @@ preview_comp (EWebViewPreview *preview,
have = FALSE;
if (e_cal_component_has_recurrences (comp)) {
e_web_view_preview_add_section (preview, have ? NULL : str, C_("iCalImp", "has recurrences"));
e_web_view_preview_add_section (preview, /*have ? NULL :*/ str, C_("iCalImp", "has recurrences"));
have = TRUE;
}
......
......@@ -130,7 +130,8 @@ e_composer_private_constructed (EMsgComposer *composer)
priv->set_signature_from_message = FALSE;
priv->disable_signature = FALSE;
priv->busy = FALSE;
priv->soft_busy_count = 0;
priv->had_activities = FALSE;
priv->saved_editable = FALSE;
priv->dnd_history_saved = FALSE;
priv->check_if_signature_is_changed = FALSE;
......@@ -357,7 +358,7 @@ e_composer_private_constructed (EMsgComposer *composer)
* a simple inverted binding to EMsgComposer's "busy" property. */
e_binding_bind_property (
composer, "busy",
composer, "soft-busy",
priv->async_actions, "sensitive",
G_BINDING_SYNC_CREATE |
G_BINDING_INVERT_BOOLEAN);
......
......@@ -92,7 +92,8 @@ struct _EMsgComposerPrivate {
CamelMimeMessage *redirect;
gboolean busy;
guint soft_busy_count; /* Only to disable async operations when >0 */
gboolean had_activities; /* Hard busy flag */
gboolean disable_signature;
gboolean is_reply_or_forward;
/* The web view is uneditable while the editor is busy.
......
......@@ -90,6 +90,7 @@ typedef enum {
enum {
PROP_0,
PROP_BUSY,
PROP_SOFT_BUSY,
PROP_EDITOR,
PROP_FOCUS_TRACKER,
PROP_SHELL,
......@@ -169,6 +170,30 @@ async_context_free (AsyncContext *context)
g_slice_free (AsyncContext, context);
}
static void
e_msg_composer_inc_soft_busy (EMsgComposer *composer)
{
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
g_return_if_fail (composer->priv->soft_busy_count + 1 > composer->priv->soft_busy_count);
composer->priv->soft_busy_count++;
if (composer->priv->soft_busy_count == 1)
g_object_notify (G_OBJECT (composer), "soft-busy");
}
static void
e_msg_composer_dec_soft_busy (EMsgComposer *composer)
{
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
g_return_if_fail (composer->priv->soft_busy_count > 0);
composer->priv->soft_busy_count--;
if (composer->priv->soft_busy_count == 0)
g_object_notify (G_OBJECT (composer), "soft-busy");
}
/**
* emcu_part_to_html:
* @part:
......@@ -734,9 +759,9 @@ composer_build_message_pgp (AsyncContext *context,
g_object_unref (context->top_level_part);
context->top_level_part = NULL;
if (pgp_key_id == NULL || *pgp_key_id == '\0')
camel_internet_address_get (
context->from, 0, NULL, &pgp_key_id);
if ((pgp_key_id == NULL || *pgp_key_id == '\0') &&
!camel_internet_address_get (context->from, 0, NULL, &pgp_key_id))
pgp_key_id = NULL;
if (context->pgp_sign) {
CamelMimePart *npart;
......@@ -1102,10 +1127,10 @@ composer_build_message (EMsgComposer *composer,
const gchar *from_domain;
gint i;
e_msg_composer_inc_soft_busy (composer);
priv = composer->priv;
table = e_msg_composer_get_header_table (composer);
view = e_msg_composer_get_attachment_view (composer);
store = e_attachment_view_get_store (view);
identity_uid = e_composer_header_table_dup_identity_uid (table, NULL, NULL);
if (identity_uid) {
......@@ -1154,6 +1179,8 @@ composer_build_message (EMsgComposer *composer,
/* If this is a redirected message, just tweak the headers. */
if (priv->redirect) {
e_msg_composer_dec_soft_busy (composer);
context->skip_content = TRUE;
context->message = g_object_ref (priv->redirect);
build_message_headers (composer, context->message, TRUE);
......@@ -1474,6 +1501,9 @@ composer_build_message (EMsgComposer *composer,
g_slist_free_full (inline_images_parts, g_object_unref);
}
view = e_msg_composer_get_attachment_view (composer);
store = e_attachment_view_get_store (view);
/* If there are attachments, wrap what we've built so far
* along with the attachments in a multipart/mixed part. */
if (e_attachment_store_get_num_attachments (store) > 0) {
......@@ -1508,6 +1538,8 @@ composer_build_message (EMsgComposer *composer,
else
g_simple_async_result_complete (simple);
e_msg_composer_dec_soft_busy (composer);
g_object_unref (simple);
}
......@@ -2163,6 +2195,12 @@ msg_composer_get_property (GObject *object,
E_MSG_COMPOSER (object)));
return;
case PROP_SOFT_BUSY:
g_value_set_boolean (
value, e_msg_composer_is_soft_busy (
E_MSG_COMPOSER (object)));
return;
case PROP_EDITOR:
g_value_set_object (
value, e_msg_composer_get_editor (
......@@ -2240,35 +2278,31 @@ composer_notify_activity_cb (EActivityBar *activity_bar,
{
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gboolean editable = TRUE;
gboolean busy;
gboolean has_activities;
busy = (e_activity_bar_get_activity (activity_bar) != NULL);
has_activities = (e_activity_bar_get_activity (activity_bar) != NULL);
if (busy == composer->priv->busy)
if (has_activities == composer->priv->had_activities)
return;
composer->priv->busy = busy;
if (busy)
e_msg_composer_save_focused_widget (composer);
composer->priv->had_activities = has_activities;
editor = e_msg_composer_get_editor (composer);
cnt_editor = e_html_editor_get_content_editor (editor);
if (busy) {
editable = e_content_editor_is_editable (cnt_editor);
if (has_activities) {
e_msg_composer_save_focused_widget (composer);
composer->priv->saved_editable = e_content_editor_is_editable (cnt_editor);
e_content_editor_set_editable (cnt_editor, FALSE);
composer->priv->saved_editable = editable;
} else {
editable = composer->priv->saved_editable;
e_content_editor_set_editable (cnt_editor, editable);
e_content_editor_set_editable (cnt_editor, composer->priv->saved_editable);
e_msg_composer_restore_focus_on_composer (composer);
}
g_object_notify (G_OBJECT (composer), "busy");
if (!busy)
e_msg_composer_restore_focus_on_composer (composer);
g_object_notify (G_OBJECT (composer), "soft-busy");
}
static void
......@@ -2627,7 +2661,24 @@ e_msg_composer_is_busy (EMsgComposer *composer)
{
g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
return composer->priv->busy;
return composer->priv->had_activities;
}
/**
* e_msg_composer_is_soft_busy:
* @composer: an #EMsgComposer
*
* Returns: %TRUE when e_msg_composer_is_busy() returns %TRUE or
* when the asynchronous operations are disabled.
*
* Since: 3.29.3
**/
gboolean
e_msg_composer_is_soft_busy (EMsgComposer *composer)
{
g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
return composer->priv->soft_busy_count > 0 || e_msg_composer_is_busy (composer);
}
static void
......@@ -2662,6 +2713,17 @@ e_msg_composer_class_init (EMsgComposerClass *class)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (
object_class,
PROP_SOFT_BUSY,
g_param_spec_boolean (
"soft-busy",
"Soft Busy",
"Whether asynchronous actions are disabled",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (
object_class,
PROP_EDITOR,
......
......@@ -207,6 +207,7 @@ void e_msg_composer_save_focused_widget
void e_msg_composer_restore_focus_on_composer
(EMsgComposer *composer);
gboolean e_msg_composer_is_busy (EMsgComposer *composer);
gboolean e_msg_composer_is_soft_busy (EMsgComposer *composer);
gboolean e_msg_composer_get_is_reply_or_forward
(EMsgComposer *composer);
void e_msg_composer_set_is_reply_or_forward
......
......@@ -1189,7 +1189,7 @@ accounts_window_tree_view_enabled_toggled_cb (GtkCellRendererToggle *cell_render
/* And finally the collection, but only to enable it, if disabled */
collection = e_source_registry_find_extension (accounts_window->priv->registry, source, E_SOURCE_EXTENSION_COLLECTION);
if (collection && set_enabled && (e_source_get_enabled (collection) ? 1 : 0) != (set_enabled ? 1 : 0)) {
if (collection && set_enabled && (e_source_get_enabled (collection) ? 1 : 0) != 1) {
e_source_set_enabled (collection, set_enabled);
if (e_source_get_writable (collection))
......
......@@ -44,7 +44,7 @@ struct _EActionComboBoxPrivate {
guint changed_handler_id; /* action::changed */
guint group_sensitive_handler_id; /* action-group::sensitive */
guint group_visible_handler_id; /* action-group::visible */
gboolean group_has_icons : 1;
gboolean group_has_icons;
};
G_DEFINE_TYPE (
......
......@@ -429,6 +429,7 @@ e_activity_describe (EActivity *activity)
g_return_val_if_fail (E_IS_ACTIVITY (activity), NULL);
class = E_ACTIVITY_GET_CLASS (activity);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->describe != NULL, NULL);
return class->describe (activity);
......
......@@ -103,6 +103,7 @@ e_attachment_handler_get_drag_actions (EAttachmentHandler *handler)
g_return_val_if_fail (E_IS_ATTACHMENT_HANDLER (handler), 0);
class = E_ATTACHMENT_HANDLER_GET_CLASS (handler);
g_return_val_if_fail (class != NULL, 0);
if (class->get_drag_actions != NULL)
return class->get_drag_actions (handler);
......@@ -119,6 +120,7 @@ e_attachment_handler_get_target_table (EAttachmentHandler *handler,
g_return_val_if_fail (E_IS_ATTACHMENT_HANDLER (handler), NULL);
class = E_ATTACHMENT_HANDLER_GET_CLASS (handler);
g_return_val_if_fail (class != NULL, NULL);
if (class->get_target_table != NULL)
return class->get_target_table (handler, n_targets);
......
......@@ -1194,7 +1194,7 @@ e_attachment_view_remove_selected (EAttachmentView *view,
}
/* If we only removed one attachment, try to select another. */
if (select_next && g_list_length (list) == 1) {
if (select_next && list && list->data && !list->next) {
GtkTreePath *path = list->data;
e_attachment_view_select_path (view, path);
......@@ -1308,10 +1308,10 @@ e_attachment_view_button_release_event (EAttachmentView *view,
priv = e_attachment_view_get_private (view);
for (iter = priv->event_list; iter != NULL; iter = iter->next) {
GdkEvent *event = iter->data;
GdkEvent *an_event = iter->data;
gtk_propagate_event (widget, event);
gdk_event_free (event);
gtk_propagate_event (widget, an_event);
gdk_event_free (an_event);
}
g_list_free (priv->event_list);
......
......@@ -3142,9 +3142,11 @@ static void
attachment_save_extracted_cancelled_cb (AutoarExtractor *extractor,
SaveContext *save_context)
{
attachment_save_check_for_error (save_context,
g_error_new_literal (
G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")));
if (attachment_save_check_for_error (save_context,
g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")))) {
;
}
g_object_unref (extractor);
}
......@@ -3161,7 +3163,10 @@ attachment_save_extracted_error_cb (AutoarExtractor *extractor,
GError *error,
SaveContext *save_context)
{
attachment_save_check_for_error (save_context, g_error_copy (error));
if (attachment_save_check_for_error (save_context, g_error_copy (error))) {
;
}
g_object_unref (extractor);
}
......
......@@ -527,7 +527,7 @@ e_categories_selector_delete_selection (ECategoriesSelector *selector)
selector->priv->ignore_category_changes = FALSE;
/* If we only remove one category, try to select another */
if (g_list_length (selected) == 1) {
if (selected && selected->data && !selected->next) {
GtkTreePath *path = selected->data;
gtk_tree_selection_select_path (selection, path);
......
......@@ -543,6 +543,28 @@ collection_account_wizard_activate_link_cb (GtkWidget *label,
return TRUE;
}
static gboolean
collection_account_wizard_is_first_result_of_this_kind (GSList *known_results,
EConfigLookupResult *result)
{
GSList *link;
gboolean known = FALSE;
for (link = known_results; link && !known; link = g_slist_next (link)) {
EConfigLookupResult *result2 = link->data;
if (!result2 || result2 == result)
continue;
known = e_config_lookup_result_get_kind (result) ==
e_config_lookup_result_get_kind (result2) &&
g_strcmp0 (e_config_lookup_result_get_protocol (result),
e_config_lookup_result_get_protocol (result2)) == 0;
}
return !known;
}
static gboolean
collection_account_wizard_fill_results (ECollectionAccountWizard *wizard)
{
......@@ -586,6 +608,7 @@ collection_account_wizard_fill_results (ECollectionAccountWizard *wizard)
for (ii = 0; ii < G_N_ELEMENTS (results_info); ii++) {
GSList *results = results_info[ii].results, *link, *known_results = NULL, *klink;
gboolean is_collection_kind = results_info[ii].kind == E_CONFIG_LOOKUP_RESULT_COLLECTION;
GtkTreePath *path;
/* Skip empty groups */
......@@ -598,7 +621,7 @@ collection_account_wizard_fill_results (ECollectionAccountWizard *wizard)
PART_COLUMN_BOOL_ENABLED_VISIBLE, TRUE,
PART_COLUMN_BOOL_RADIO, FALSE,
PART_COLUMN_BOOL_SENSITIVE, results != NULL,
PART_COLUMN_BOOL_IS_COLLECTION_GROUP, results_info[ii].kind == E_CONFIG_LOOKUP_RESULT_COLLECTION,
PART_COLUMN_BOOL_IS_COLLECTION_GROUP, is_collection_kind,
PART_COLUMN_BOOL_ICON_VISIBLE, results_info[ii].icon_name != NULL,
PART_COLUMN_STRING_ICON_NAME, results_info[ii].icon_name,
PART_COLUMN_STRING_DESCRIPTION, _(results_info[ii].display_name),
......@@ -634,9 +657,9 @@ collection_account_wizard_fill_results (ECollectionAccountWizard *wizard)
gtk_tree_store_append (tree_store, &iter, &parent);
gtk_tree_store_set (tree_store, &iter,
PART_COLUMN_BOOL_ENABLED, link == results,
PART_COLUMN_BOOL_ENABLED, link == results || (is_collection_kind && collection_account_wizard_is_first_result_of_this_kind (known_results, result)),
PART_COLUMN_BOOL_ENABLED_VISIBLE, g_slist_next (results) != NULL,
PART_COLUMN_BOOL_RADIO, results_info[ii].kind != E_CONFIG_LOOKUP_RESULT_COLLECTION,
PART_COLUMN_BOOL_RADIO, !is_collection_kind,
PART_COLUMN_BOOL_SENSITIVE, TRUE,
PART_COLUMN_BOOL_ICON_VISIBLE, NULL,
PART_COLUMN_STRING_ICON_NAME, NULL,
......
......@@ -41,9 +41,9 @@ struct _EColorComboPrivate {
guint popup_shown : 1;
guint popup_in_progress : 1;
guint default_transparent: 1;
GdkRGBA *current_color;
GdkRGBA *default_color;
gint default_transparent: 1;
GList *palette;
......
......@@ -22,7 +22,8 @@
#ifndef E_CONFLICT_SEARCH_SELECTOR_H
#define E_CONFLICT_SEARCH_SELECTOR_H
#include <e-util/e-util.h>
#include <libedataserver/libedataserver.h>
#include <e-util/e-source-selector.h>
/* Standard GObject macros */
#define E_TYPE_CONFLICT_SEARCH_SELECTOR \
......
......@@ -235,6 +235,7 @@ e_filter_element_validate (EFilterElement *element,
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), FALSE);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->validate != NULL, FALSE);
return class->validate (element, alert);
......@@ -254,6 +255,7 @@ e_filter_element_eq (EFilterElement *element_a,
return FALSE;
class = E_FILTER_ELEMENT_GET_CLASS (element_a);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->eq != NULL, FALSE);
return class->eq (element_a, element_b);
......@@ -277,6 +279,7 @@ e_filter_element_xml_create (EFilterElement *element,
g_return_if_fail (node != NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_if_fail (class != NULL);
g_return_if_fail (class->xml_create != NULL);
class->xml_create (element, node);
......@@ -298,6 +301,7 @@ e_filter_element_xml_encode (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->xml_encode != NULL, NULL);
return class->xml_encode (element);
......@@ -322,6 +326,7 @@ e_filter_element_xml_decode (EFilterElement *element,
g_return_val_if_fail (node != NULL, FALSE);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->xml_decode != NULL, FALSE);
return class->xml_decode (element, node);
......@@ -343,6 +348,7 @@ e_filter_element_clone (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->clone != NULL, NULL);
return class->clone (element);
......@@ -365,6 +371,7 @@ e_filter_element_get_widget (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_widget != NULL, NULL);
return class->get_widget (element);
......@@ -390,6 +397,7 @@ e_filter_element_build_code (EFilterElement *element,
g_return_if_fail (E_IS_FILTER_PART (part));
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_if_fail (class != NULL);
/* This method is optional. */
if (class->build_code != NULL)
......@@ -414,6 +422,7 @@ e_filter_element_format_sexp (EFilterElement *element,
g_return_if_fail (out != NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
g_return_if_fail (class != NULL);
g_return_if_fail (class->format_sexp != NULL);
class->format_sexp (element, out);
......@@ -439,6 +448,7 @@ e_filter_element_copy_value (EFilterElement *dst_element,
g_return_if_fail (E_IS_FILTER_ELEMENT (src_element));
class = E_FILTER_ELEMENT_GET_CLASS (dst_element);
g_return_if_fail (class != NULL);
g_return_if_fail (class->copy_value != NULL);
class->copy_value (dst_element, src_element);
......
......@@ -547,6 +547,7 @@ e_filter_rule_get_widget (EFilterRule *rule,
g_return_val_if_fail (E_IS_RULE_CONTEXT (context), NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_widget != NULL, NULL);
return class->get_widget (rule, context);
......@@ -1277,6 +1278,7 @@ e_filter_rule_validate (EFilterRule *rule,
g_return_val_if_fail (E_IS_FILTER_RULE (rule), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->validate != NULL, FALSE);
return class->validate (rule, alert);
......@@ -1292,6 +1294,7 @@ e_filter_rule_eq (EFilterRule *rule_a,
g_return_val_if_fail (E_IS_FILTER_RULE (rule_b), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule_a);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->eq != NULL, FALSE);
if (G_OBJECT_TYPE (rule_a) != G_OBJECT_TYPE (rule_b))
......@@ -1308,6 +1311,7 @@ e_filter_rule_xml_encode (EFilterRule *rule)
g_return_val_if_fail (E_IS_FILTER_RULE (rule), NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->xml_encode != NULL, NULL);
return class->xml_encode (rule);
......@@ -1326,6 +1330,7 @@ e_filter_rule_xml_decode (EFilterRule *rule,
g_return_val_if_fail (E_IS_RULE_CONTEXT (context), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->xml_decode != NULL, FALSE);
rule->priv->frozen++;
......@@ -1347,6 +1352,7 @@ e_filter_rule_copy (EFilterRule *dst_rule,
g_return_if_fail (E_IS_FILTER_RULE (src_rule));
class = E_FILTER_RULE_GET_CLASS (dst_rule);
g_return_if_fail (class != NULL);
g_return_if_fail (class->copy != NULL);
class->copy (dst_rule, src_rule);
......@@ -1408,6 +1414,7 @@ e_filter_rule_build_code (EFilterRule *rule,
g_return_if_fail (out != NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
g_return_if_fail (class != NULL);
g_return_if_fail (class->build_code != NULL);
class->build_code (rule, out);
......
......@@ -131,7 +131,7 @@ html_editor_image_dialog_set_width_units (EHTMLEditorImageDialog *dialog)
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gint requested;
gint32 natural = 0;
gint32 natural;
gint width = 0;
editor = e_html_editor_dialog_get_editor (E_HTML_EDITOR_DIALOG (dialog));
......@@ -155,7 +155,7 @@ html_editor_image_dialog_set_width_units (EHTMLEditorImageDialog *dialog)
break;
case 1: /* percent */
if (gtk_widget_is_sensitive (dialog->priv->width_edit)) {
if (natural && gtk_widget_is_sensitive (dialog->priv->width_edit)) {
width = (((gdouble) requested) / natural) * 100;
} else {
width = 100;
......@@ -219,7 +219,7 @@ html_editor_image_dialog_set_height_units (EHTMLEditorImageDialog *dialog)
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gint requested;
gulong natural = 0;
gulong natural;
gint height = -1;
editor = e_html_editor_dialog_get_editor (E_HTML_EDITOR_DIALOG (dialog));
......@@ -243,7 +243,7 @@ html_editor_image_dialog_set_height_units (EHTMLEditorImageDialog *dialog)
break;
case 1: /* percent */
if (gtk_widget_is_sensitive (dialog->priv->height_edit)) {
if (natural && gtk_widget_is_sensitive (dialog->priv->height_edit)) {
height = (((gdouble) requested) / natural) * 100;
} else {
height = 100;
......
......@@ -92,8 +92,8 @@ set_image_from_data (EImageChooser *chooser,
new_height = gdk_pixbuf_get_height (pixbuf);
new_width = gdk_pixbuf_get_width (pixbuf);
if (chooser->priv->image_height == 0
&& chooser->priv->image_width == 0) {
if (chooser->priv->image_height == 0 ||
chooser->priv->image_width == 0) {
scale = 1.0;
} else if (chooser->priv->image_height < new_height
|| chooser->priv->image_width < new_width) {
......
......@@ -915,10 +915,18 @@ prepare_simple_page (GtkAssistant *assistant,
store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (page->filetype)));
gtk_list_store_clear (store);
if (!importers || !importers->data) {
g_slist_free (importers);
return;
}
for (imp = importers; imp; imp = imp->next) {
GtkTreeIter iter;
EImportImporter *eii = imp->data;
if (!eii)
continue;
gtk_list_store_append (store, &iter);
gtk_list_store_set (
store, &iter,
......
......@@ -211,12 +211,12 @@ action_close_cb (GtkAction *action,
"widgets:ask-signature-changed", NULL);
if (response == GTK_RESPONSE_YES) {
GtkActionGroup *action_group;
GtkAction *action;
GtkAction *action2;
action_group = window->priv->action_group;
action = gtk_action_group_get_action (
action2 = gtk_action_group_get_action (
action_group, "save-and-close");
gtk_action_activate (action);
gtk_action_activate (action2);
return;
} else if (response == GTK_RESPONSE_CANCEL)
return;
......
......@@ -935,7 +935,7 @@ build_textrep_for_contact (EContact *contact,
case E_CONTACT_EMAIL:
name = NULL;
l = e_contact_get (contact, cue_field);
email = strdup (g_list_nth_data (l, email_num));
email = g_strdup (g_list_nth_data (l, email_num));
g_list_free_full (l, g_free);
break;
......@@ -944,16 +944,21 @@ build_textrep_for_contact (EContact *contact,
break;
}
g_return_val_if_fail (email, NULL);
g_return_val_if_fail (strlen (email) > 0, NULL);
if (name)
textrep = g_strdup_printf ("%s <%s>", name, email);
else
textrep = g_strdup_printf ("%s", email);
if (email && *email) {
if (name)
textrep = g_strdup_printf ("%s <%s>", name, email);
else
textrep = g_strdup_printf ("%s", email);
} else {
textrep = NULL;
g_warn_if_fail (email != NULL);
if (email)
g_warn_if_fail (*email != '\0');
}
g_free (name);
g_free (email);
return textrep;
}
......
......@@ -589,6 +589,7 @@ e_plugin_construct (EPlugin *plugin,
g_return_val_if_fail (E_IS_PLUGIN (plugin), -1);
class = E_PLUGIN_GET_CLASS (plugin);
g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->construct != NULL, -1);
return class->construct (plugin, root);
......@@ -621,6 +622,7 @@ e_plugin_invoke (EPlugin *plugin,
g_return_val_if_fail (plugin->enabled, NULL);
class = E_PLUGIN_GET_CLASS (plugin);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->invoke != NULL, NULL);
return class->invoke (plugin, name, data);
......@@ -645,6 +647,7 @@ e_plugin_get_symbol (EPlugin *plugin,
g_return_val_if_fail (E_IS_PLUGIN (plugin), NULL);
class = E_PLUGIN_GET_CLASS (plugin);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_symbol != NULL, NULL);
return class->get_symbol (plugin, name);
......@@ -671,6 +674,7 @@ e_plugin_enable (EPlugin *plugin,
return;
class = E_PLUGIN_GET_CLASS (plugin);
g_return_if_fail (class != NULL);
g_return_if_fail (class->enable != NULL);
class->enable (plugin, state);
......@@ -695,6 +699,8 @@ e_plugin_get_configure_widget (EPlugin *plugin)
g_return_val_if_fail (E_IS_PLUGIN (plugin), NULL);
class = E_PLUGIN_GET_CLASS (plugin);
g_return_val_if_fail (class != NULL, NULL);
if (class->get_configure_widget == NULL)
return NULL;
......@@ -892,6 +898,7 @@ e_plugin_hook_enable (EPluginHook *plugin_hook,
g_return_if_fail (E_IS_PLUGIN_HOOK (plugin_hook));
class = E_PLUGIN_HOOK_GET_CLASS (plugin_hook);
g_return_if_fail (class != NULL);
g_return_if_fail (class->enable != NULL);
class->enable (plugin_hook, state);
......
......@@ -57,6 +57,7 @@ e_reflow_model_set_width (EReflowModel *reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (reflow_model));
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_if_fail (class != NULL);
g_return_if_fail (class->set_width != NULL);
class->set_width (reflow_model, width);
......@@ -76,6 +77,7 @@ e_reflow_model_count (EReflowModel *reflow_model)
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->count != NULL, 0);
return class->count (reflow_model);
......@@ -99,6 +101,7 @@ e_reflow_model_height (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->height != NULL, 0);
return class->height (reflow_model, n, parent);
......@@ -124,6 +127,7 @@ e_reflow_model_incarnate (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), NULL);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->incarnate != NULL, NULL);
return class->incarnate (reflow_model, n, parent);
......@@ -147,6 +151,7 @@ e_reflow_model_create_cmp_cache (EReflowModel *reflow_model)
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), NULL);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_val_if_fail (class != NULL, NULL);
if (class->create_cmp_cache == NULL)
return NULL;
......@@ -179,6 +184,7 @@ e_reflow_model_compare (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->compare != NULL, 0);
return class->compare (reflow_model, n1, n2, cmp_cache);
......@@ -202,6 +208,7 @@ e_reflow_model_reincarnate (EReflowModel *reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (reflow_model));
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
g_return_if_fail (class != NULL);
g_return_if_fail (class->reincarnate != NULL);
class->reincarnate (reflow_model, n, item);
......
......@@ -649,6 +649,7 @@ e_rule_context_load (ERuleContext *context,
g_return_val_if_fail (user != NULL, -1);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->load != NULL, -1);
context->priv->frozen++;
......@@ -677,6 +678,7 @@ e_rule_context_save (ERuleContext *context,
g_return_val_if_fail (user != NULL, -1);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->save != NULL, -1);
return class->save (context, user);
......@@ -702,6 +704,7 @@ e_rule_context_revert (ERuleContext *context,
g_return_val_if_fail (user != NULL, 0);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->revert != NULL, 0);
return class->revert (context, user);
......@@ -958,6 +961,7 @@ e_rule_context_rename_uri (ERuleContext *context,
g_return_val_if_fail (compare != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, NULL);
/* This method is optional. */
if (class->rename_uri == NULL)
......@@ -978,6 +982,7 @@ e_rule_context_delete_uri (ERuleContext *context,
g_return_val_if_fail (compare != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, NULL);
/* This method is optional. */
if (class->delete_uri == NULL)
......@@ -1017,6 +1022,7 @@ e_rule_context_new_element (ERuleContext *context,
g_return_val_if_fail (name != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->new_element != NULL, NULL);
return class->new_element (context, name);
......
......@@ -649,6 +649,7 @@ e_rule_editor_set_sensitive (ERuleEditor *editor)
g_return_if_fail (E_IS_RULE_EDITOR (editor));
class = E_RULE_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->set_sensitive != NULL);
class->set_sensitive (editor);
......@@ -663,6 +664,7 @@ e_rule_editor_set_source (ERuleEditor *editor,
g_return_if_fail (E_IS_RULE_EDITOR (editor));
class = E_RULE_EDITOR_GET_CLASS (editor);
g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source != NULL);
class->set_source (editor, source);
......@@ -676,6 +678,7 @@ e_rule_editor_create_rule (ERuleEditor *editor)
g_return_val_if_fail (E_IS_RULE_EDITOR (editor), NULL);
class = E_RULE_EDITOR_GET_CLASS (editor);
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->create_rule != NULL, NULL);
return class->create_rule (editor);
......
......@@ -500,11 +500,16 @@ esma_set_selection_end (ESelectionModel *selection,
gint
e_selection_model_array_get_row_count (ESelectionModelArray *esma)
{
ESelectionModelArrayClass *klass;
g_return_val_if_fail (esma != NULL, 0);
g_return_val_if_fail (E_IS_SELECTION_MODEL_ARRAY (esma), 0);
if (E_SELECTION_MODEL_ARRAY_GET_CLASS (esma)->get_row_count)
return E_SELECTION_MODEL_ARRAY_GET_CLASS (esma)->get_row_count (esma);
klass = E_SELECTION_MODEL_ARRAY_GET_CLASS (esma);
g_return_val_if_fail (klass != NULL, 0);
if (klass->get_row_count)
return klass->get_row_count (esma);
else
return 0;
}
......
......@@ -248,6 +248,7 @@ e_selection_model_is_row_selected (ESelectionModel *model,
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), FALSE);
class = E_SELECTION_MODEL_GET_CLASS (model);
g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_row_selected != NULL, FALSE);
return class->is_row_selected (model, n);
......@@ -273,6 +274,7 @@ e_selection_model_foreach (ESelectionModel *model,
g_return_if_fail (callback != NULL);
class = E_SELECTION_MODEL_GET_CLASS (model);
g_return_if_fail (class != NULL);
g_return_if_fail (class->foreach != NULL);
class->foreach (model, callback, closure);
......@@ -292,6 +294,7 @@ e_selection_model_clear (ESelectionModel *model)