~ubuntu-branches/ubuntu/hardy/evolution-data-server/hardy-updates

« back to all changes in this revision

Viewing changes to calendar/libedata-cal/e-cal-backend-cache.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-11-13 10:59:20 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20071113105920-nb6w14udvgx0ghi3
Tags: 2.21.2-0ubuntu1
* New upstream version:
  Bug Fixes:
  - #318842: Task lists should be sorted (LP: #23912)
  - #345135: Disable SSLv2 compatible HELLO on SSL stream when 
    SSLv2 is disabled
  - #359267: Not all memos are showed in calendar view
  - #430420: Returned size <= 0 is an error
  - #460649: Meeting UI Needs To Show Color Of Selected Calendar Source
  - #487229: Use GKeyFile instead of gnome-config to access stored passwords
  - #488156: Minimize use of the WITH_GNOME_KEYRING macro
  - #492130: ESourceSelector uses pointers to ESource
  - #494304: Fix leak
  Updated Translations
  New in 2.21.1:
  - Support for Google Calendar
  Bug Fixes:
  - #203480: (Novell Bugzilla) Compiler warning fix 
    for usage ofunintialized variable
  - #231178: New symbol 'set-label' defined and added corresponding callback
  - #271777: Keep character's case as user types
  - #417999: Don't use deprecated GTK+ symbols
  - #420167: e-d-s now exits with gnome-session
  - #469657: Better use of GHashTable
  - #474000: Use GLib's Base64 API instead of Camel's
  - #475487: When creating the default contact, print errors to the console
  - #475493: Use G_DEFINE_TYPE
  - #475494: Use G_LOCK instead of a static mutex for clearer code
  - #478404: Reset the id to zero
  - #483301: Remove an unused variable
  - #487270: Fix typo in documentation
  - #488173: Remove __FUNCTION__, which is a gcc-ism
  - #488351: Fix an addressbook error on a fresh install
  Other Contributors:
  - Protect against a NULL subject string. 
* debian/*.preinst:
  - On upgrades from Gutsy, remove the symlinks introduced in Gutsy. They
    break upgrades all over, and current cdbs just symlinks individual files.
* Sync with Debian
* debian/control:
  - evolution-data-server Breaks evolution (<< 2.9), 
    evolution-exchange (<= 2.8.1-0ubuntu1),
    evolution-jescs (<= 2.8.2-0ubuntu3), 
    evolution-scalix (<= 10.0.0.357-0ubuntu6)
  - updated maintainer to desktop team
* debian/rules:
  - don't specify the paths for nspr and nss since the package is built 
    with firefox
  - don't build documentation, it's distributed in the upstream tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
}
141
141
 
142
142
static void
143
 
free_timezone_hash (gpointer key, gpointer value, gpointer user_data)
144
 
{
145
 
        g_free (key);
146
 
        icaltimezone_free (value, 1);
147
 
}
148
 
 
149
 
static void
150
143
e_cal_backend_cache_finalize (GObject *object)
151
144
{
152
145
        ECalBackendCache *cache;
161
154
                        priv->uri = NULL;
162
155
                }
163
156
 
164
 
                if (priv->timezones) {
165
 
                        g_hash_table_foreach (priv->timezones, (GHFunc) free_timezone_hash, NULL);
166
 
                        g_hash_table_destroy (priv->timezones);
167
 
                        priv->timezones = NULL;
168
 
                }
 
157
                g_hash_table_destroy (priv->timezones);
 
158
                priv->timezones = NULL;
169
159
 
170
160
                g_free (priv);
171
161
                cache->priv = NULL;
234
224
}
235
225
 
236
226
static void
 
227
timezones_value_destroy (icaltimezone *zone)
 
228
{
 
229
        icaltimezone_free (zone, 1);
 
230
}
 
231
 
 
232
static void
237
233
e_cal_backend_cache_init (ECalBackendCache *cache)
238
234
{
239
235
        ECalBackendCachePrivate *priv;
240
236
 
241
237
        priv = g_new0 (ECalBackendCachePrivate, 1);
242
 
        priv->timezones = g_hash_table_new (g_str_hash, g_str_equal);
 
238
        priv->timezones = g_hash_table_new_full (
 
239
                g_str_hash, g_str_equal,
 
240
                (GDestroyNotify) g_free,
 
241
                (GDestroyNotify) timezones_value_destroy);
243
242
 
244
243
        cache->priv = priv;
245
244
 
602
601
e_cal_backend_cache_put_timezone (ECalBackendCache *cache, const icaltimezone *zone)
603
602
{
604
603
        ECalBackendCachePrivate *priv;
605
 
        gpointer orig_key, orig_value;
606
604
        icaltimezone *new_zone;
607
605
        icalcomponent *icalcomp;
608
606
        gboolean retval;
630
628
        if (!retval)
631
629
                return FALSE;
632
630
 
633
 
        /* check if the timezone already exists */
634
 
        if (g_hash_table_lookup_extended (priv->timezones, icaltimezone_get_tzid ((icaltimezone *)zone),
635
 
                                          &orig_key, &orig_value)) {
636
 
                /* remove the previous timezone */
637
 
                g_hash_table_remove (priv->timezones, orig_key);
638
 
                g_free (orig_key);
639
 
                icaltimezone_free (orig_value, 1);
640
 
        }
641
 
 
642
631
        /* add the timezone to the hash table */
643
632
        new_zone = icaltimezone_new ();
644
633
        icaltimezone_set_component (new_zone, icalcomponent_new_clone (icalcomp));
740
729
gboolean
741
730
e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const char *tzid)
742
731
{
743
 
        gpointer orig_key, orig_value;
744
732
        ECalBackendCachePrivate *priv;
745
733
 
746
734
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
748
736
 
749
737
        priv = cache->priv;
750
738
 
751
 
        if (g_hash_table_lookup_extended (priv->timezones, tzid, &orig_key, &orig_value)) {
752
 
                g_hash_table_remove (priv->timezones, tzid);
753
 
                g_free (orig_key);
754
 
                icaltimezone_free (orig_value, 1);
755
 
        }
 
739
        g_hash_table_remove (priv->timezones, tzid);
756
740
 
757
741
        return e_file_cache_remove_object (E_FILE_CACHE (cache), tzid);
758
742
}