Changeset 1107

Show
Ignore:
Timestamp:
11/09/06 01:01:07
Author:
pvanhoof
Message:

Assertions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r1106 r1107  
    22 
    33        * Introduction of the new TnySendQueue interface 
     4        * Added a lot assertions to check for type safety 
    45 
    56        * This was a major API change 
  • trunk/libtinymail-camel/tny-camel-account.c

    r1079 r1107  
    160160 
    161161        /* I know this isn't polite. But it works ;-) */ 
    162      
    163162        /* camel_operation_cancel (NULL); */ 
    164       thread = g_thread_create (camel_cancel_hack_thread, NULL, TRUE, NULL); 
     163      thread = g_thread_create (camel_cancel_hack_thread, NULL, TRUE, NULL); 
    165164        g_thread_join (thread); 
    166165 
     
    177176 
    178177        while (priv->inuse_spin);  
    179      
     178 
    180179        priv->inuse_spin = TRUE; 
    181180 
     
    228227 
    229228        g_static_rec_mutex_lock (priv->service_lock); 
    230  
    231229        priv->session = session; 
    232      
    233230        TNY_CAMEL_ACCOUNT_GET_CLASS (self)->reconnect_func (self); 
    234  
    235231        _tny_session_camel_add_account (session, self); 
    236      
    237232        g_static_rec_mutex_unlock (priv->service_lock); 
    238233 
  • trunk/libtinymail-camel/tny-camel-folder.c

    r1105 r1107  
    240240        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 
    241241 
     242        g_assert (TNY_IS_HEADER (header)); 
     243 
    242244        if (!priv->remove_strat) 
    243245                return; 
     
    411413{ 
    412414        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 
     415 
     416        g_assert (TNY_IS_CAMEL_STORE_ACCOUNT (account)); 
     417 
    413418        priv->account = TNY_STORE_ACCOUNT (account); 
    414419 
     
    589594        if (!load_folder_no_lock (priv)) 
    590595        { 
    591                 tny_camel_folder_refresh_async_destroyer (info);            
     596                tny_camel_folder_refresh_async_destroyer (info); 
    592597                camel_exception_free (ex); 
    593                 g_mutex_unlock (priv->folder_lock);         
     598                g_mutex_unlock (priv->folder_lock); 
    594599                g_thread_exit (NULL); 
    595600                return NULL; 
     
    696701        if (G_LIKELY (priv->folder) && CAMEL_IS_FOLDER (priv->folder) && G_LIKELY (priv->has_summary_cap)) 
    697702                priv->unread_length = (guint)camel_folder_get_unread_message_count (priv->folder); 
    698         camel_exception_free (ex);      
     703        camel_exception_free (ex); 
    699704 
    700705        g_mutex_unlock (priv->folder_lock); 
     
    717722        CamelException ex; 
    718723        FldAndPriv *ptr = NULL; 
     724 
     725        g_assert (TNY_IS_LIST (headers)); 
    719726 
    720727        g_mutex_lock (priv->folder_lock); 
     
    773780        const gchar *id; 
    774781        CamelException *ex = camel_exception_new (); 
     782 
     783        g_assert (TNY_IS_HEADER (header)); 
    775784 
    776785        g_mutex_lock (priv->folder_lock); 
  • trunk/libtinymail-camel/tny-camel-header.c

    r1104 r1107  
    4646destroy_write (TnyCamelHeader *self) 
    4747{ 
    48       /* Also check out tny-msg.c: tny_msg_finalize (read the stupid hack) */ 
     48      /* Also check out tny-msg.c: tny_msg_finalize (read the stupid hack) */ 
    4949        if (((WriteInfo*)self->info)->msg) 
    5050                camel_object_unref (CAMEL_OBJECT (((WriteInfo*)self->info)->msg)); 
  • trunk/libtinymail-camel/tny-camel-mime-part.c

    r1103 r1107  
    9393        CamelDataWrapper *wrapper; 
    9494        CamelMedium *medium; 
    95         CamelStream *cstream = tny_stream_camel_new (stream); 
     95        CamelStream *cstream; 
     96 
     97        g_assert (TNY_IS_STREAM (stream)); 
     98 
     99        cstream = tny_stream_camel_new (stream); 
    96100 
    97101        g_mutex_lock (priv->part_lock); 
     
    130134camel_stream_format_text (CamelDataWrapper *dw, CamelStream *stream) 
    131135{ 
    132 /* Stolen from evolution, evil evil me!! moehahah */ 
    133          
     136       /* Stolen from evolution, evil evil me!! moehahah */ 
     137 
    134138        CamelStreamFilter *filter_stream; 
    135139        CamelMimeFilterCharset *filter; 
    136140        const char *charset = "UTF-8"; /* I default to UTF-8, like it or not */ 
    137141        CamelMimeFilterWindows *windows = NULL; 
    138          
     142 
    139143        if (dw->mime_type && (charset = camel_content_type_param  
    140144                        (dw->mime_type, "charset")) &&  
     
    195199        CamelDataWrapper *wrapper; 
    196200        CamelMedium *medium; 
    197         CamelStream *cstream = tny_stream_camel_new (stream); 
     201        CamelStream *cstream; 
     202 
     203        g_assert (TNY_IS_STREAM (stream)); 
     204 
     205        cstream = tny_stream_camel_new (stream); 
    198206 
    199207        g_mutex_lock (priv->part_lock); 
     
    237245tny_camel_mime_part_construct_from_stream_default (TnyMimePart *self, TnyStream *stream, const gchar *type) 
    238246{ 
    239  
    240247        TnyCamelMimePartPriv *priv = TNY_CAMEL_MIME_PART_GET_PRIVATE (self); 
    241248        CamelDataWrapper *wrapper; 
    242249        gint retval = -1; 
    243250        CamelMedium *medium; 
    244         CamelStream *cstream = tny_stream_camel_new (stream); 
    245          
     251        CamelStream *cstream; 
     252 
     253        g_assert (TNY_IS_STREAM (stream)); 
     254 
     255        cstream = tny_stream_camel_new (stream); 
     256 
    246257        g_mutex_lock (priv->part_lock); 
    247258        medium = CAMEL_MEDIUM (priv->part); 
     
    281292        CamelMedium *medium; 
    282293        CamelStream *stream = camel_stream_mem_new (); 
    283          
     294 
    284295        g_mutex_lock (priv->part_lock); 
    285296        medium =  CAMEL_MEDIUM (priv->part); 
     
    637648{ 
    638649        TnyCamelMimePart *self = g_object_new (TNY_TYPE_CAMEL_MIME_PART, NULL); 
    639          
     650 
    640651        tny_camel_mime_part_set_part (self, part); 
    641652 
  • trunk/libtinymail-camel/tny-camel-msg-remove-strategy.c

    r1095 r1107  
    3939 
    4040 
    41  
    4241static void 
    4342tny_camel_msg_remove_strategy_remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header) 
    4443{ 
    45         TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (folder)
     44        TnyCamelFolderPriv *priv
    4645        const gchar *id; 
    4746 
     47        g_assert (TNY_IS_CAMEL_FOLDER (folder)); 
     48 
     49        priv = TNY_CAMEL_FOLDER_GET_PRIVATE (folder); 
    4850        id = tny_header_get_uid (TNY_HEADER (header)); 
    4951        camel_folder_delete_message (priv->folder, id); 
     
    138140                g_type_add_interface_static (type, TNY_TYPE_MSG_REMOVE_STRATEGY,  
    139141                        &tny_camel_msg_remove_strategy_info); 
    140  
    141142        } 
    142143 
  • trunk/libtinymail-camel/tny-camel-msg.c

    r1102 r1107  
    7474                        if (part) 
    7575                        { 
    76                         /* http://bugzilla.gnome.org/show_bug.cgi?id=343683  
    77                         and tny-mime-part.c:515 ! */ 
    78                                  
     76                               /* http://bugzilla.gnome.org/show_bug.cgi?id=343683  
     77                               and tny-mime-part.c:515 ! */ 
     78 
    7979                                go = message_foreach_part_rec (msg, part, callback, data); 
    8080                        } else go = FALSE; 
     
    9898        if (!part) 
    9999                return FALSE; 
    100          
     100 
    101101        /* http://bugzilla.gnome.org/show_bug.cgi?id=343683  
    102102           and tny-mime-part.c:515 ! */ 
     
    168168        TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 
    169169 
     170        g_assert (TNY_IS_CAMEL_FOLDER (folder)); 
     171 
    170172        g_mutex_lock (priv->folder_lock); 
    171173        priv->folder = (TnyFolder*)folder; 
     
    187189        TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 
    188190        TnyCamelMimePartPriv *ppriv = TNY_CAMEL_MIME_PART_GET_PRIVATE (self); 
     191 
     192        g_assert (TNY_IS_LIST (list)); 
    189193 
    190194        g_mutex_lock (priv->parts_lock); 
     
    234238        CamelDataWrapper *containee; 
    235239        gint curl = 0, retval = 0; 
     240 
     241        /* Yes, indeed (I don't yet support non TnyCamelMimePart mime part  
     242           instances, and I know I should. Feel free to implement the copying 
     243           if you really need it) */ 
     244 
     245        g_assert (TNY_IS_CAMEL_MIME_PART (part)); 
    236246 
    237247        g_mutex_lock (priv->message_lock); 
     
    255265        } 
    256266 
    257         /* TODO: coupling mistake. This makes it obligated to use a specific 
    258            implementation of MsgMimePart (the camel one). */ 
    259  
    260267        g_mutex_lock (priv->parts_lock); 
    261268 
     
    284291 
    285292static void  
    286 tny_camel_msg_del_part_default (TnyMsg *self, TnyMimePart *part) 
     293tny_camel_msg_del_part_default (TnyMsg *self, TnyMimePart *part) 
    287294{ 
    288295        TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 
    289296        TnyCamelMimePartPriv *ppriv = TNY_CAMEL_MIME_PART_GET_PRIVATE (self); 
    290297        CamelDataWrapper *containee; 
     298 
     299 
     300        /* Yes, indeed (I don't yet support non TnyCamelMimePart mime part  
     301           instances, and I know I should. Feel free to implement the copying 
     302           if you really need it) */ 
     303 
     304        g_assert (TNY_IS_CAMEL_MIME_PART (part)); 
    291305 
    292306        g_mutex_lock (priv->message_lock); 
     
    331345        CamelMimeMessage *msg; 
    332346        TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 
     347 
     348        g_assert (TNY_IS_CAMEL_HEADER (header)); 
    333349 
    334350        g_mutex_lock (priv->header_lock); 
  • trunk/libtinymail-camel/tny-camel-store-account.c

    r1038 r1107  
    173173        CamelStore *store; 
    174174 
     175        g_assert (TNY_IS_CAMEL_FOLDER (folder)); 
     176 
    175177        g_static_rec_mutex_lock (apriv->service_lock); 
    176178        store = camel_session_get_store ((CamelSession*) apriv->session,  
     
    195197        CamelStore *store; 
    196198 
     199        g_assert (TNY_IS_CAMEL_FOLDER (folder)); 
     200 
    197201        g_static_rec_mutex_lock (apriv->service_lock); 
    198202        store = camel_session_get_store ((CamelSession*) apriv->session,  
     
    206210 
    207211        camel_object_unref (CAMEL_OBJECT (store)); 
    208      
     212 
    209213        return; 
    210214} 
     
    236240        apriv->account_type = TNY_ACCOUNT_TYPE_STORE; 
    237241        priv->managed_folders = NULL; 
    238      
     242 
    239243        return; 
    240244} 
     
    250254                TNY_CAMEL_FOLDER_GET_PRIVATE (folder)->iter_parented = FALSE; 
    251255        } 
    252      
     256 
    253257        return; 
    254258} 
     
    257261tny_camel_store_account_finalize (GObject *object) 
    258262{ 
    259         TnyCamelStoreAccount *self = (TnyCamelStoreAccount *)object;    
     263        TnyCamelStoreAccount *self = (TnyCamelStoreAccount *)object; 
    260264        TnyCamelStoreAccountPriv *priv = TNY_CAMEL_STORE_ACCOUNT_GET_PRIVATE (self); 
    261265 
    262       g_list_foreach (priv->managed_folders, foreach_managed_folder, self); 
     266      g_list_foreach (priv->managed_folders, foreach_managed_folder, self); 
    263267        g_list_free (priv->managed_folders); 
    264       priv->managed_folders = NULL; 
    265      
    266       if (priv->iter_store && CAMEL_IS_STORE (priv->iter_store)) 
     268      priv->managed_folders = NULL; 
     269 
     270      if (priv->iter_store && CAMEL_IS_STORE (priv->iter_store)) 
    267271        { 
    268272                camel_store_free_folder_info (priv->iter_store, priv->iter); 
    269273                camel_object_unref (CAMEL_OBJECT (priv->iter_store)); 
    270274        } 
    271      
     275 
    272276        (*parent_class->finalize) (object); 
    273277 
     
    285289{ 
    286290        TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    287         CamelException ex = CAMEL_EXCEPTION_INITIALISER;     
    288         CamelStore *store = camel_session_get_store ((CamelSession*) apriv->session,  
    289                         apriv->url_string, &ex); 
     291        CamelException ex = CAMEL_EXCEPTION_INITIALISER; 
    290292        TnyCamelFolder *cfol = TNY_CAMEL_FOLDER (folder); 
    291293        TnyCamelFolderPriv *cpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (cfol); 
    292  
    293         if (cpriv->folder_name) 
    294         { 
    295                 camel_store_delete_folder (store, cpriv->folder_name, &ex); 
    296                 g_free (cpriv->folder_name); cpriv->folder_name = NULL; 
    297         } 
    298      
     294        CamelStore *store; 
     295 
     296        g_assert (TNY_IS_CAMEL_FOLDER (folder)); 
     297 
     298        store = camel_session_get_store ((CamelSession*) apriv->session,  
     299                        apriv->url_string, &ex); 
     300 
     301        if (store) 
     302        { 
     303                if (cpriv->folder_name) 
     304                { 
     305                        camel_store_delete_folder (store, cpriv->folder_name, &ex); 
     306                        if (camel_exception_is_set (&ex)) 
     307                                g_critical ("Could not delete folder %s (%s)\n", 
     308                                cpriv->folder_name, camel_exception_get_description (&ex)); 
     309                        g_free (cpriv->folder_name); cpriv->folder_name = NULL; 
     310                } 
     311 
     312                camel_object_unref (CAMEL_OBJECT (store)); 
     313        } else  
     314                g_critical ("Store not available for %s (%s)\n",  
     315                        apriv->url_string, camel_exception_get_description (&ex)); 
     316 
    299317        /* TODO: error handling using 'ex' */ 
    300318 
     
    314332        TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    315333        CamelException ex = CAMEL_EXCEPTION_INITIALISER;     
    316         CamelStore *store = camel_session_get_store ((CamelSession*) apriv->session,  
    317                         apriv->url_string, &ex); 
    318334        TnyFolder *folder = tny_camel_folder_new (); 
    319335        CamelFolderInfo *info; 
    320  
    321         info = camel_store_create_folder (store, "/", name, &ex); 
    322      
    323         _tny_camel_folder_set_id (TNY_CAMEL_FOLDER (folder), info->full_name); 
    324         camel_store_free_folder_info (store, info); 
     336        CamelStore *store; 
     337 
     338        store = camel_session_get_store ((CamelSession*) apriv->session,  
     339                        apriv->url_string, &ex); 
     340 
     341        if (store) 
     342        { 
     343                info = camel_store_create_folder (store, "/", name, &ex); 
     344                if (info) 
     345                { 
     346                        _tny_camel_folder_set_id (TNY_CAMEL_FOLDER (folder), info->full_name); 
     347                        camel_store_free_folder_info (store, info); 
     348                } else 
     349                        g_critical ("Failed to create folder %s (%s)\n", name, 
     350                                camel_exception_get_description (&ex)); 
     351 
     352                camel_object_unref (CAMEL_OBJECT (store)); 
     353        } else  
     354                g_critical ("Store not available for %s (%s)\n",  
     355                        apriv->url_string, camel_exception_get_description (&ex)); 
    325356 
    326357        /* TODO: Error handling using 'ex' */ 
     
    344375        CamelFolderInfo *iter; 
    345376        guint32 flags; 
    346         CamelStore *store = camel_session_get_store ((CamelSession*) apriv->session,  
     377        CamelStore *store; 
     378 
     379        g_assert (TNY_IS_LIST (list)); 
     380        if (query) 
     381                g_assert (TNY_IS_FOLDER_STORE_QUERY (query)); 
     382 
     383        store = camel_session_get_store ((CamelSession*) apriv->session,  
    347384                        apriv->url_string, &ex); 
    348385 
    349386        if (!store) 
     387        { 
     388                g_critical ("Store not available for %s (%s)\n",  
     389                        apriv->url_string, camel_exception_get_description (&ex)); 
     390 
    350391                return; 
     392        } 
    351393 
    352394        flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL | 
     
    381423                        _tny_camel_folder_set_account (folder, TNY_STORE_ACCOUNT (self)); 
    382424 
    383                         tny_list_prepend (list, G_OBJECT (folder));     
     425                        tny_list_prepend (list, G_OBJECT (folder)); 
    384426                } 
    385427                iter = iter->next; 
     
    404446{ 
    405447        GetFoldersInfo *info = thr_user_data; 
    406      
     448 
    407449        /* gidle reference */ 
    408450        g_object_unref (G_OBJECT (info->self)); 
    409451        g_object_unref (G_OBJECT (info->list)); 
    410452 
    411         g_free (info); 
     453        g_slice_free (GetFoldersInfo, info); 
    412454 
    413455        return; 
     
    429471{ 
    430472        GetFoldersInfo *info = (GetFoldersInfo*) thr_user_data; 
    431      
     473 
    432474        tny_folder_store_get_folders (TNY_FOLDER_STORE (info->self), 
    433475                info->list, info->query); 
    434      
    435       if (info->query) 
     476 
     477      if (info->query) 
    436478                g_object_unref (G_OBJECT (info->query)); 
    437479 
    438       /* thread reference */ 
     480      /* thread reference */ 
    439481        g_object_unref (G_OBJECT (info->self)); 
    440482        g_object_unref (G_OBJECT (info->list)); 
    441      
     483 
    442484        if (info->callback) 
    443485        { 
     
    457499        } 
    458500 
    459          
    460501        g_thread_exit (NULL); 
    461      
     502 
    462503        return NULL; 
    463504} 
     
    472513tny_camel_store_account_get_folders_async_default (TnyFolderStore *self, TnyList *list, TnyGetFoldersCallback callback, TnyFolderStoreQuery *query, gpointer user_data) 
    473514{ 
    474         GetFoldersInfo *info = g_new0 (GetFoldersInfo, 1)
     515        GetFoldersInfo *info
    475516        GThread *thread; 
    476517 
     518        g_assert (TNY_IS_LIST (list)); 
     519 
     520        info = g_slice_new0 (GetFoldersInfo); 
     521 
    477522        info->self = self; 
    478       info->list = list; 
     523      info->list = list; 
    479524        info->callback = callback; 
    480525        info->user_data = user_data; 
    481526        info->query = query; 
    482527        info->depth = g_main_depth (); 
    483      
     528 
    484529        /* thread reference */ 
    485530        g_object_ref (G_OBJECT (info->self)); 
    486531        g_object_ref (G_OBJECT (info->list));  
    487       if (info->query) 
     532      if (info->query) 
    488533                g_object_ref (G_OBJECT (info->query)); 
    489534 
  • trunk/libtinymail-camel/tny-camel-transport-account.c

    r1103 r1107  
    9494{ 
    9595        TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    96         TnyHeader *header = (TnyHeader *)tny_msg_get_header (msg); 
    97         CamelMimeMessage *message = _tny_camel_msg_get_camel_mime_message (TNY_CAMEL_MSG (msg)); 
     96        TnyHeader *header; CamelMimeMessage *message; 
    9897        CamelException ex =  CAMEL_EXCEPTION_INITIALISER; 
    9998        CamelTransport *transport; 
     99 
     100        g_assert (TNY_IS_CAMEL_MSG (msg)); 
     101 
     102        header = tny_msg_get_header (msg); 
     103        message = _tny_camel_msg_get_camel_mime_message (TNY_CAMEL_MSG (msg)); 
    100104 
    101105        transport = camel_session_get_transport ((CamelSession*) apriv->session,  
  • trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c

    r1047 r1107  
    344344        TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 
    345345        gint i=0, count; 
     346 
     347        g_assert (TNY_IS_LIST (list)); 
    346348 
    347349        count = gconf_client_get_int (priv->client,  
     
    527529        gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL); 
    528530 
     531        g_assert (TNY_IS_ACCOUNT (account)); 
     532 
    529533        key = g_strdup_printf ("/apps/tinymail/accounts/%d/hostname", count); 
    530534        gconf_client_set_string (priv->client, (const gchar*) key,  
  • trunk/libtinymail-gnomevfs/tny-vfs-stream.c

    r966 r1107  
    5959}; 
    6060 
    61 #define TNY_VFS_STREAM_GET_PRIVATE(o) 
     61#define TNY_VFS_STREAM_GET_PRIVATE(o)
    6262        (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_VFS_STREAM, TnyVfsStreamPriv)) 
    6363 
     
    160160        gssize nb_read; 
    161161        gssize nb_written; 
    162          
     162 
     163        g_assert (TNY_IS_STREAM (output)); 
     164 
    163165        while (G_UNLIKELY (!tny_stream_is_eos (self))) { 
    164166                nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 
  • trunk/libtinymail-gpe/tny-gpe-account-store.c

    r971 r1107  
    229229        TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 
    230230        gint i=0, count; 
     231 
     232        g_assert (TNY_IS_LIST (list)); 
    231233 
    232234        count = gconf_client_get_int (priv->client,  
     
    413415        gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL); 
    414416 
     417        g_assert (TNY_IS_ACCOUNT (account)); 
     418 
    415419        count++; 
    416420 
  • trunk/libtinymail-maemo/tny-maemo-account-store.c

    r971 r1107  
    230230        TnyMaemoAccountStorePriv *priv = TNY_MAEMO_ACCOUNT_STORE_GET_PRIVATE (self); 
    231231        gint i=0, count; 
     232 
     233        g_assert (TNY_IS_LIST (list)); 
    232234 
    233235        count = gconf_client_get_int (priv->client,  
     
    415417        gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL); 
    416418 
     419        g_assert (TNY_IS_ACCOUNT (account)); 
     420 
    417421        count++; 
    418422 
  • trunk/libtinymail-olpc/tny-olpc-account-store.c

    r971 r1107  
    187187        GDir *dir ; 
    188188 
     189        g_assert (TNY_IS_LIST (list)); 
     190 
    189191        configd = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir(),  
    190192                ".tinymail", "accounts", NULL); 
  • trunk/libtinymailui-gtk/tny-gtk-header-view.c

    r1097 r1107  
    6969{ 
    7070        TnyGtkHeaderViewPriv *priv = TNY_GTK_HEADER_VIEW_GET_PRIVATE (self); 
     71 
     72        if (header) 
     73                g_assert (TNY_IS_HEADER (header)); 
    7174 
    7275        if (G_LIKELY (priv->header)) 
  • trunk/libtinymailui-gtk/tny-gtk-mime-part-save-strategy.c

    r1097 r1107  
    106106        GtkFileChooserDialog *dialog; 
    107107        gboolean destr=FALSE; 
     108 
     109        g_assert (TNY_IS_MIME_PART (part)); 
    108110 
    109111        dialog = GTK_FILE_CHOOSER_DIALOG  
  • trunk/libtinymailui-gtk/tny-gtk-msg-view.c

    r1097 r1107  
    8383        TnyMimePartView *retval = NULL; 
    8484 
     85        g_assert (TNY_IS_MIME_PART (part)); 
     86 
    8587        if (tny_mime_part_content_type_is (part, "text/*")) 
    8688        { 
     
    198200        if (msg) 
    199201        { 
     202                g_assert (TNY_IS_MSG (msg)); 
     203 
    200204                g_object_ref (G_OBJECT (msg)); 
    201205                priv->msg = msg; 
  • trunk/libtinymailui-gtk/tny-gtk-msg-window.c

    r1097 r1107  
    7575{ 
    7676        TnyGtkMsgWindowPriv *priv = TNY_GTK_MSG_WINDOW_GET_PRIVATE (self); 
    77         TnyHeader *header = TNY_HEADER (tny_msg_get_header (msg)); 
    78  
     77        TnyHeader *header; 
     78 
     79        if (msg) 
     80        { 
     81                g_assert (TNY_IS_MSG (msg)); 
     82 
     83                header = TNY_HEADER (tny_msg_get_header (msg)); 
     84                gtk_window_set_title (GTK_WINDOW (self),  
     85                        tny_header_get_subject (header)); 
     86                g_object_unref (G_OBJECT (header)); 
     87        } 
    7988        tny_msg_view_set_msg (priv->msg_view, msg); 
    80  
    81         gtk_window_set_title (GTK_WINDOW (self), tny_header_get_subject (header)); 
    82  
    83         g_object_unref (G_OBJECT (header)); 
    8489 
    8590        return; 
  • trunk/libtinymailui-gtk/tny-gtk-text-buffer-stream.c

    r1097 r1107  
    5555        gssize nb_read; 
    5656        gssize nb_written; 
    57          
     57 
     58        g_assert (TNY_IS_STREAM (output)); 
     59 
    5860        while (G_LIKELY (!tny_stream_is_eos (self)))  
    5961        { 
  • trunk/libtinymailui-gtk/tny-gtk-text-mime-part-view.c

    r1098 r1107  
    8181{ 
    8282        TnyGtkTextMimePartViewPriv *priv = TNY_GTK_TEXT_MIME_PART_VIEW_GET_PRIVATE (self); 
     83 
     84        g_assert (TNY_IS_MIME_PART (part)); 
    8385 
    8486        if (G_LIKELY (priv->part)) 
  • trunk/libtinymailui-mozembed/tny-moz-embed-msg-view.c

    r994 r1107  
    6060        TnyMimePartView *retval = NULL; 
    6161 
     62        g_assert (TNY_IS_MIME_PART (part)); 
     63 
    6264        if (tny_mime_part_content_type_is (part, "text/html")) 
    6365        { 
     
    6971        if (!retval) 
    7072                retval = TNY_MOZ_EMBED_MSG_VIEW_GET_CLASS (self)->create_mime_part_view_for_orig_func (self, part); 
    71          
     73 
    7274        return retval; 
    7375} 
  • trunk/libtinymailui-mozembed/tny-moz-embed-stream.c

    r984 r1107  
    4141}; 
    4242 
    43 #define TNY_MOZ_EMBED_STREAM_GET_PRIVATE(o)   
     43#define TNY_MOZ_EMBED_STREAM_GET_PRIVATE(o)
    4444        (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MOZ_EMBED_STREAM, TnyMozEmbedStreamPriv)) 
    4545 
     
    5353        ssize_t nb_read; 
    5454        ssize_t nb_written; 
    55          
     55 
     56        g_assert (TNY_IS_STREAM (output)); 
     57 
    5658        while (G_LIKELY (!tny_stream_is_eos (self)))  
    5759        {