[gnome-calendar] Fix gcal_manager_is_client_writable() semantics



commit 5f6bd95750d2ad5ea45e27fbe7df6faeebab7e72
Author: Erick Perez Castellanos <erick red gmail com>
Date:   Wed Oct 7 08:39:51 2015 -0500

    Fix gcal_manager_is_client_writable() semantics
    
    Fix all the calls to it accordingly.

 src/gcal-edit-dialog.c   |    7 ++-----
 src/gcal-manager.c       |    2 +-
 src/gcal-search-view.c   |    2 +-
 src/gcal-source-dialog.c |    2 +-
 src/gcal-year-view.c     |    2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index c83a2cb..6336e7e 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -143,7 +143,7 @@ fill_sources_menu (GcalEditDialog *dialog)
       g_menu_item_set_icon (item, G_ICON (pix));
 
       /* set insensitive for read-only calendars */
-      if (gcal_manager_is_client_writable (priv->manager, source))
+      if (!gcal_manager_is_client_writable (priv->manager, source))
         {
           g_menu_item_set_action_and_target_value (item, "select_calendar", NULL);
         }
@@ -935,10 +935,7 @@ gcal_edit_dialog_set_event_data (GcalEditDialog *dialog,
       g_free (description);
     }
 
-  gcal_edit_dialog_set_writable (
-      dialog,
-      ! gcal_manager_is_client_writable (priv->manager,
-                                         priv->source));
+  gcal_edit_dialog_set_writable (dialog, gcal_manager_is_client_writable (priv->manager, priv->source));
 
   priv->setting_event = FALSE;
 }
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 4ebaeb6..a017cca 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -1451,7 +1451,7 @@ gcal_manager_is_client_writable (GcalManager *manager,
   if (unit == NULL)
     return FALSE;
 
-  return unit->connected && e_client_is_readonly (E_CLIENT (unit->client));
+  return unit->connected && !e_client_is_readonly (E_CLIENT (unit->client));
 }
 
 void
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 9d472f3..4a8930a 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -426,7 +426,7 @@ make_row_for_event_data (GcalSearchView  *view,
     }
 
   /* lock icon */
-  if (gcal_manager_is_client_writable (priv->manager, data->source))
+  if (!gcal_manager_is_client_writable (priv->manager, data->source))
     {
       GtkWidget *lock_icon;
 
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 842dc54..9b00981 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -927,7 +927,7 @@ stack_visible_child_name_changed (GObject    *object,
 
       /* default source check button */
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->default_check), (priv->source == 
default_source));
-      gtk_widget_set_visible (priv->default_check, !gcal_manager_is_client_writable (priv->manager, 
priv->source));
+      gtk_widget_set_visible (priv->default_check, gcal_manager_is_client_writable (priv->manager, 
priv->source));
 
       /* title */
       if (!creation_mode)
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 7a2bf91..605449f 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -247,7 +247,7 @@ add_event_to_day_array (GcalYearView  *year_view,
   priv = year_view->priv;
   child_widget = gcal_event_widget_new_from_data (event_data);
   gcal_event_widget_set_read_only (GCAL_EVENT_WIDGET (child_widget),
-                                   gcal_manager_is_client_writable (priv->manager, event_data->source));
+                                   !gcal_manager_is_client_writable (priv->manager, event_data->source));
 
   dt_start = gcal_event_widget_peek_start_date (GCAL_EVENT_WIDGET (child_widget));
   dt_end = gcal_event_widget_peek_end_date (GCAL_EVENT_WIDGET (child_widget));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]