Changeset 1760

Show
Ignore:
Timestamp:
02/19/07 13:45:59 (22 months ago)
Author:
mjahn
Message:

- remove osync_debug
- add a OSyncKDEEnv stuct that contains a contact_sink

Location:
plugins/kdepim/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • plugins/kdepim/src/kaddrbook.cpp

    r1757 r1760  
    4646        //Regard entries with invalid revision dates as having just been changed. 
    4747        QDateTime revdate = e.revision(); 
    48         osync_debug("kde", 3, "Getting hash: %s", revdate.toString().data()); 
     48//      osync_debug("kde", 3, "Getting hash: %s", revdate.toString().data()); 
    4949        if (!revdate.isValid()) { 
    5050                revdate = QDateTime::currentDateTime(); 
     
    202202                        QString hash = calc_hash(addressee); 
    203203                        osync_change_set_hash(chg, hash); 
    204                         osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY UPDATED (UID=%s)", (const char *)uid.local8Bit()); 
     204//                      osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY UPDATED (UID=%s)", (const char *)uid.local8Bit()); 
    205205                        break; 
    206206                } 
     
    218218                        QString hash = calc_hash(addressee); 
    219219                        osync_change_set_hash(chg, hash); 
    220                         osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY ADDED (UID=%s)", (const char *)addressee.uid().local8Bit()); 
     220//                      osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY ADDED (UID=%s)", (const char *)addressee.uid().local8Bit()); 
    221221                        break; 
    222222                } 
     
    233233                                addressbookptr->removeAddressee(addressee); 
    234234 
    235                         osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY DELETED (UID=%s)", (const char*)uid.local8Bit()); 
     235//                      osync_debug("kde", 3, "KDE ADDRESSBOOK ENTRY DELETED (UID=%s)", (const char*)uid.local8Bit()); 
    236236 
    237237                        break; 
  • plugins/kdepim/src/kcal.cpp

    r1757 r1760  
    8080        } 
    8181 
    82         osync_debug("kcal", 3, "Calendar: %d events", calendar->events().size()); 
     82//      osync_debug("kcal", 3, "Calendar: %d events", calendar->events().size()); 
    8383 
    8484        connected = true; 
     
    116116bool KCalDataSource::report_incidence(OSyncContext *ctx, KCal::Incidence *e, const char *objtype, const char *objformat) 
    117117{ 
    118         osync_debug("kcal", 3, "One calendar incidence (%s)", objtype); 
     118//      osync_debug("kcal", 3, "One calendar incidence (%s)", objtype); 
    119119        QString hash = calc_hash(e); 
    120120 
     
    123123        /* Build a local calendar for the incidence data */ 
    124124        KCal::CalendarLocal cal(calendar->timeZoneId()); 
    125         osync_debug("kcal", 3, "timezoneid: %s\n", (const char*)cal.timeZoneId().local8Bit()); 
     125//      osync_debug("kcal", 3, "timezoneid: %s\n", (const char*)cal.timeZoneId().local8Bit()); 
    126126        cal.addIncidence(e->clone()); 
    127127 
     
    131131        const char *data = datastr; 
    132132 
    133         osync_debug("kcal", 3, "UID: %s\n", (const char*)uid.local8Bit()); 
     133//      osync_debug("kcal", 3, "UID: %s\n", (const char*)uid.local8Bit()); 
    134134        OSyncChange *chg = osync_change_new(); 
    135135        osync_change_set_uid(chg, uid.local8Bit()); 
     
    155155{ 
    156156        KCal::Event::List events = calendar->events(); 
    157         osync_debug("kcal", 3, "Number of events: %d", events.size()); 
     157//      osync_debug("kcal", 3, "Number of events: %d", events.size()); 
    158158 
    159159        if (osync_member_get_slow_sync(member, "event")) { 
    160                 osync_debug("kcal", 3, "Setting slow-sync for events"); 
     160//              osync_debug("kcal", 3, "Setting slow-sync for events"); 
    161161                osync_hashtable_set_slow_sync(hashtable, "event"); 
    162162        } 
     
    184184        KCal::Todo::List todos = calendar->todos(); 
    185185 
    186         osync_debug("kcal", 3, "Number of to-dos: %d", todos.size()); 
     186//      osync_debug("kcal", 3, "Number of to-dos: %d", todos.size()); 
    187187 
    188188        if (osync_member_get_slow_sync(member, "todo")) { 
    189                 osync_debug("kcal", 3, "Setting slow-sync for todos"); 
     189//              osync_debug("kcal", 3, "Setting slow-sync for todos"); 
    190190                osync_hashtable_set_slow_sync(hashtable, "todo"); 
    191191        } 
    192192 
    193193        for (KCal::Todo::List::ConstIterator i = todos.begin(); i != todos.end(); i++) { 
    194                 osync_debug("kcal", 3, "%p: doesFloat: %d", *i, (*i)->doesFloat()); 
     194//              osync_debug("kcal", 3, "%p: doesFloat: %d", *i, (*i)->doesFloat()); 
    195195                if (!report_incidence(ctx, *i, "todo", "vtodo20")) 
    196196                        return false; 
     
    214214{ 
    215215        OSyncChangeType type = osync_change_get_changetype(chg); 
    216         osync_debug("kcal", 3, "%s", __FUNCTION__); 
     216//      osync_debug("kcal", 3, "%s", __FUNCTION__); 
    217217        switch (type) { 
    218218                case OSYNC_CHANGE_TYPE_DELETED: { 
     
    261261                                        e->setUid(osync_change_get_uid(chg)); 
    262262 
    263                                 osync_debug("kcal", 3, "Writing incidence: uid: %s, summary: %s", 
     263//                              osync_debug("kcal", 3, "Writing incidence: uid: %s, summary: %s", 
    264264                                                (const char*)e->uid().local8Bit(), (const char*)e->summary().local8Bit()); 
    265265 
  • plugins/kdepim/src/kdepim_sync.cpp

    r1757 r1760  
    4848        void *module; 
    4949 
    50         osync_debug("kde", 3, "%s", __FUNCTION__); 
    51  
    52         osync_debug("kde", 3, "Loading implementation module"); 
     50//      osync_debug("kde", 3, "%s", __FUNCTION__); 
     51 
     52//      osync_debug("kde", 3, "Loading implementation module"); 
    5353        module = dlopen(KDEPIM_LIBDIR"/kdepim_lib.so", RTLD_NOW); 
    5454        if (!module) { 
    55                 osync_error_set(e, OSYNC_ERROR_INITIALIZATION, "Can't load plugin implementation module from %s: %s", 
     55                osync_error_set(error, OSYNC_ERROR_INITIALIZATION, "Can't load plugin implementation module from %s: %s", 
    5656                                KDEPIM_LIBDIR"/kdepim_lib.so", dlerror()); 
    5757                goto error; 
    5858        } 
    59         osync_debug("kde", 3, "Getting initialization function"); 
     59//      osync_debug("kde", 3, "Getting initialization function"); 
    6060        init_func = (KdeImplInitFunc)dlsym(module, "new_KdePluginImplementation"); 
    6161        if (!init_func) { 
    62                 osync_error_set(e, OSYNC_ERROR_INITIALIZATION, "Invalid plugin implementation module"); 
     62                osync_error_set(error, OSYNC_ERROR_INITIALIZATION, "Invalid plugin implementation module"); 
    6363                goto error; 
    6464        } 
    6565 
    66         osync_debug("kde", 3, "Initializing implementation module"); 
    67         impl_object = init_func(member, e); 
     66//      osync_debug("kde", 3, "Initializing implementation module"); 
     67        impl_object = init_func(plugin, info, error); 
    6868        if (!impl_object) 
    6969                goto error; 
     
    7777static void kde_finalize(void *data) 
    7878{ 
    79         osync_debug("kde", 3, "%s()", __FUNCTION__); 
     79//      osync_debug("kde", 3, "%s()", __FUNCTION__); 
    8080 
    8181        KdePluginImplementationBase *impl_object = (KdePluginImplementationBase *)data; 
     
    9999{ 
    100100        KdePluginImplementationBase *impl_object = impl_object_for_context(ctx); 
    101         osync_debug("kde", 3, "%s",__FUNCTION__); 
     101//      osync_debug("kde", 3, "%s",__FUNCTION__); 
    102102 
    103103        impl_object->get_changeinfo(ctx); 
     
    108108        KdePluginImplementationBase *impl_object = impl_object_for_context(ctx); 
    109109 
    110         osync_debug("kde", 3, "%s()",__FUNCTION__); 
     110//      osync_debug("kde", 3, "%s()",__FUNCTION__); 
    111111 
    112112        impl_object->sync_done(ctx); 
     
    117117        KdePluginImplementationBase *impl_object = impl_object_for_context(ctx); 
    118118 
    119         osync_debug("kde", 3, "%s()",__FUNCTION__); 
     119//      osync_debug("kde", 3, "%s()",__FUNCTION__); 
    120120 
    121121        return impl_object->vcard_commit_change(ctx, change); 
     
    126126        KdePluginImplementationBase *impl_object = impl_object_for_context(ctx); 
    127127 
    128         osync_debug("kde", 3, "%s()",__FUNCTION__); 
     128//      osync_debug("kde", 3, "%s()",__FUNCTION__); 
    129129 
    130130        return impl_object->vcard_access(ctx, change); 
     
    140140        osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, error); 
    141141         
    142         OSyncEvoEnv *env = (OSyncEvoEnv *)data; 
     142        OSyncKDEEnv *env = (OSyncKDEEnv *)data; 
    143143 
    144144        osync_objtype_sink_set_available(env->contact_sink, TRUE); 
  • plugins/kdepim/src/knotes.cpp

    r1757 r1760  
    155155 
    156156        if (osync_member_get_slow_sync(member, "note")) { 
    157                 osync_debug("kcal", 3, "Setting slow-sync for notes"); 
     157//              osync_debug("kcal", 3, "Setting slow-sync for notes"); 
    158158                osync_hashtable_set_slow_sync(hashtable, "note"); 
    159159        } 
     
    165165                 */ 
    166166                if (kn_iface->text(i.key()) == "") { 
    167                         osync_debug("knotes", 4, "Skipping empty note"); 
     167//                      osync_debug("knotes", 4, "Skipping empty note"); 
    168168                        continue; 
    169169                } 
    170170 
    171                 osync_debug("knotes", 4, "Note key: %s", (const char*)i.key().local8Bit()); 
    172                 osync_debug("knotes", 4, "Note summary: %s", (const char*)i.data().local8Bit()); 
     171//              osync_debug("knotes", 4, "Note key: %s", (const char*)i.key().local8Bit()); 
     172//              osync_debug("knotes", 4, "Note summary: %s", (const char*)i.data().local8Bit()); 
    173173                osync_trace(TRACE_INTERNAL, "reporting notes %s\n", (const char*)i.key().local8Bit()); 
    174174 
     
    207207                osync_change_set_data(chg, (char*)doc, sizeof(doc), 1); 
    208208 
    209                 osync_debug("knotes", 4, "Reporting note:\%s", osync_change_get_printable(chg)); 
     209//              osync_debug("knotes", 4, "Reporting note:\%s", osync_change_get_printable(chg)); 
    210210 
    211211                // Use the hash table to check if the object 
     
    327327                QString asdasd = "dcop knotes KNotesIface killNote " + uid + " true"; 
    328328                system((const char*)asdasd.local8Bit()); 
    329                 osync_debug("knotes", 4, "Deleting note %s", (const char*)uid.local8Bit()); 
     329//              osync_debug("knotes", 4, "Deleting note %s", (const char*)uid.local8Bit()); 
    330330                /*kn_iface->killNote(uid, true); 
    331331                if (kn_iface->status() != DCOPStub::CallSucceeded) { 
  • plugins/kdepim/src/osyncbase.h

    r1757 r1760  
    55{ 
    66#include <opensync/opensync.h> 
     7#include <opensync/opensync-plugin.h> 
     8#include <opensync/opensync-context.h> 
     9#include <opensync/opensync-data.h> 
     10#include <opensync/opensync-helper.h> 
    711} 
     12 
     13typedef struct OSyncKDEEnv { 
     14        char *change_id; 
     15        OSyncObjTypeSink *contact_sink; 
     16} OSyncKDEEnv; 
    817/** Base class to OpenSync plugin. 
    918 * 
     
    3241}; 
    3342 
    34 typedef KdePluginImplementationBase *(*KdeImplInitFunc)(OSyncMember *m, OSyncError **e); 
     43typedef KdePluginImplementationBase *(*KdeImplInitFunc)(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); 
    3544 
    3645#endif // KDEPIM_OSYNC_BASE_H