Changeset 1272

Show
Ignore:
Timestamp:
11/28/06 21:54:18
Author:
pvanhoof
Message:

Added a few enums for error reporting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bindings/python/tinymail.defs.extra

    r900 r1272  
     1(define-enum ErrorDomain 
     2  (in-module "Tny") 
     3  (c-name "TnyErrorDomain") 
     4  (gtype-id "TNY_TYPE_ERROR_DOMAIN") 
     5  (values 
     6    '("folder_error" "TNY_FOLDER_ERROR") 
     7    '("folder_store_error" "TNY_FOLDER_STORE_ERROR") 
     8    '("transport_account_error" "TNY_TRANSPORT_ACCOUNT_ERROR") 
     9  ) 
     10) 
     11 
     12(define-enum Error 
     13  (in-module "Tny") 
     14  (c-name "TnyError") 
     15  (gtype-id "TNY_TYPE_ERROR") 
     16  (values 
     17        '("folder_error_expunge" "TNY_FOLDER_ERROR_EXPUNGE") 
     18        '("folder_error_remove_msg" "TNY_FOLDER_ERROR_REMOVE_MSG") 
     19        '("folder_error_add_msg" "TNY_FOLDER_ERROR_ADD_MSG") 
     20        '("folder_error_refresh" "TNY_FOLDER_ERROR_REFRESH") 
     21        '("folder_error_get_msg" "TNY_FOLDER_ERROR_GET_MSG") 
     22        '("folder_error_transfer_msgs" "TNY_FOLDER_ERROR_TRANSFER_MSGS") 
     23        '("folder_error_set_name" "TNY_FOLDER_ERROR_SET_NAME") 
     24        '("folder_store_error_remove_folder" "TNY_FOLDER_STORE_ERROR_REMOVE_FOLDER") 
     25        '("folder_store_error_get_folders" "TNY_FOLDER_STORE_ERROR_GET_FOLDERS") 
     26        '("folder_store_error_create_folder" "TNY_FOLDER_STORE_ERROR_CREATE_FOLDER") 
     27        '("transport_account_error_send" "TNY_TRANSPORT_ACCOUNT_ERROR_SEND") 
     28  ) 
     29) 
     30 
    131(define-enum GetAccountsRequestType 
    232  (in-module "Tny") 
  • trunk/bindings/python/tinymail.override

    r1262 r1272  
    55#include <pygobject.h> 
    66 
     7#include <tny-error.h> 
    78#include <tny-account.h> 
    89#include <tny-account-store.h> 
  • trunk/libtinymail-camel/tny-camel-transport-account.c

    r1270 r1272  
    110110        { 
    111111                g_set_error (err, TNY_TRANSPORT_ERROR,  
    112                         TNY_TRANSPORT_ERROR_ACCOUNT_SEND, 
     112                        TNY_TRANSPORT_ACCOUNT_ERROR_SEND, 
    113113                        camel_exception_get_description (&ex)); 
    114114 
     
    146146        { 
    147147                g_set_error (err, TNY_TRANSPORT_ERROR,  
    148                         TNY_TRANSPORT_ERROR_ACCOUNT_SEND, 
     148                        TNY_TRANSPORT_ACCOUNT_ERROR_SEND, 
    149149                        camel_exception_get_description (&ex)); 
    150150        } 
  • trunk/libtinymail/tny-error.c

    r1262 r1272  
     1/* libtinymail - The Tiny Mail base library 
     2 * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org> 
     3 * 
     4 * This library is free software; you can redistribute it and/or 
     5 * modify it under the terms of the GNU Lesser General Public 
     6 * License as published by the Free Software Foundation; either 
     7 * version 2 of the License, or (at your option) any later version. 
     8 * 
     9 * This library is distributed in the hope that it will be useful, 
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     12 * Lesser General Public License for more details. 
     13 * 
     14 * You should have received a copy of the GNU Lesser General Public 
     15 * License along with self library; if not, write to the 
     16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
     17 * Boston, MA 02111-1307, USA. 
     18 */ 
     19 
     20#include <tny-error.h> 
     21 
     22GType 
     23tny_error_domain_get_type (void) 
     24{ 
     25  static GType etype = 0; 
     26  if (etype == 0) { 
     27    static const GEnumValue values[] = { 
     28      { TNY_FOLDER_ERROR, "TNY_FOLDER_ERROR", "folder_error" }, 
     29      { TNY_FOLDER_STORE_ERROR, "TNY_FOLDER_STORE_ERROR", "folder_store_error" }, 
     30      { TNY_TRANSPORT_ERROR, "TNY_TRANSPORT_ERROR", "transport_error" }, 
     31      { 0, NULL, NULL } 
     32    }; 
     33    etype = g_enum_register_static ("TnyErrorDomain", values); 
     34  } 
     35  return etype; 
     36} 
     37 
     38 
     39 
     40GType 
     41tny_error_get_type (void) 
     42{ 
     43  static GType etype = 0; 
     44  if (etype == 0) { 
     45    static const GEnumValue values[] = { 
     46      { TNY_FOLDER_ERROR_EXPUNGE, "TNY_FOLDER_ERROR_EXPUNGE", "folder_error_expunge" }, 
     47      { TNY_FOLDER_ERROR_REMOVE_MSG, "TNY_FOLDER_ERROR_REMOVE_MSG", "folder_error_remove_msg" }, 
     48      { TNY_FOLDER_ERROR_ADD_MSG, "TNY_FOLDER_ERROR_ADD_MSG", "folder_error_add_msg" }, 
     49      { TNY_FOLDER_ERROR_REFRESH, "TNY_FOLDER_ERROR_REFRESH", "folder_error_refresh" }, 
     50      { TNY_FOLDER_ERROR_GET_MSG, "TNY_FOLDER_ERROR_GET_MSG", "folder_error_get_msg" }, 
     51      { TNY_FOLDER_ERROR_TRANSFER_MSGS, "TNY_FOLDER_ERROR_TRANSFER_MSGS", "folder_error_transfer_msgs" }, 
     52      { TNY_FOLDER_ERROR_SET_NAME, "TNY_FOLDER_ERROR_SET_NAME", "folder_error_set_name" }, 
     53 
     54      { TNY_FOLDER_STORE_ERROR_REMOVE_FOLDER, "TNY_FOLDER_STORE_ERROR_REMOVE_FOLDER", "folder_store_error_remove_folder" }, 
     55      { TNY_FOLDER_STORE_ERROR_GET_FOLDERS, "TNY_FOLDER_STORE_ERROR_GET_FOLDERS", "folder_store_error_get_folders" }, 
     56      { TNY_FOLDER_STORE_ERROR_CREATE_FOLDER, "TNY_FOLDER_STORE_ERROR_CREATE_FOLDER", "folder_store_error_create_folder" }, 
     57 
     58      { TNY_TRANSPORT_ACCOUNT_ERROR_SEND, "TNY_TRANSPORT_ACCOUNT_ERROR_SEND", "transport_error_account_send" }, 
     59 
     60      { 0, NULL, NULL } 
     61    }; 
     62    etype = g_enum_register_static ("TnyError", values); 
     63  } 
     64} 
  • trunk/libtinymail/tny-error.h

    r1269 r1272  
    2222 
    2323#include <glib.h> 
     24#include <glib-object.h> 
    2425#include <tny-shared.h> 
     26 
     27#define TNY_TYPE_ERROR_DOMAIN (tny_error_domain_get_type()) 
    2528 
    2629enum _TnyErrorDomain 
     
    3033        TNY_TRANSPORT_ERROR 
    3134}; 
     35 
     36#define TNY_TYPE_ERROR (tny_error_get_type()) 
    3237 
    3338enum _TnyError  
     
    4550        TNY_FOLDER_STORE_ERROR_CREATE_FOLDER, 
    4651 
    47         TNY_TRANSPORT_ERROR_ACCOUNT_SEND 
     52        TNY_TRANSPORT_ACCOUNT_ERROR_SEND 
    4853}; 
     54 
     55GType tny_error_domain_get_type (void); 
     56GType tny_error_get_type (void); 
    4957 
    5058