Changeset 1957

Show
Ignore:
Timestamp:
05/15/07 23:16:49
Author:
pvanhoof
Message:

The new TnyQueue type

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r1956 r1957  
     12007-05-15  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * The new TnyQueue and TnyQueueTasks types 
     4        * Major rewrites of libtinymail-queues 
     5        * It's not stricly depending on AsyncWorker anymore 
     6        * Introduction of libtinymail-asyncworker 
     7 
     8        * This was a major API change in libtinymail-queues 
     9        * This was a major API change in libtinymail-asyncworker 
     10 
    1112007-05-15  Philip Van Hoof  <pvanhoof@gnome.org> 
    212 
  • trunk/Makefile.am

    r1932 r1957  
    2929if BUILD_QUEUES 
    3030SUBDIRS += libtinymail-queues 
     31endif 
     32 
     33if BUILD_ASYNCWORKER 
     34SUBDIRS += libtinymail-asyncworker 
    3135endif 
    3236 
  • trunk/configure.ac

    r1932 r1957  
    5656dnl ### default values (will get overwritten) 
    5757build_queues=false 
     58build_asyncworker=false 
    5859build_acap=false 
    5960build_gnome=true 
     
    199200  *) AC_MSG_ERROR(bad value ${enableval} for --enable-queues) ;; 
    200201esac],[build_queues=$build_queues]) 
     202 
     203dnl ### Enable asyncworker ## 
     204AC_ARG_ENABLE(asyncworker, 
     205AC_HELP_STRING([--enable-asyncworker], 
     206  [Build using asyncworker]), 
     207[case "${enableval}" in 
     208  yes) 
     209        build_queues=true 
     210        build_asyncworker=true 
     211  ;; 
     212  no)   
     213        build_asyncworker=false  
     214        build_queues=false 
     215  ;; 
     216  *) AC_MSG_ERROR(bad value ${enableval} for --enable-asyncworker) ;; 
     217esac],[build_asyncworker=$build_asyncworker]) 
     218 
     219AM_CONDITIONAL(BUILD_ASYNCWORKER, test x$build_asyncworker = xtrue) 
    201220AM_CONDITIONAL(BUILD_QUEUES, test x$build_queues = xtrue) 
    202  
    203221 
    204222 
     
    280298 
    281299if test x$build_queues = xtrue; then 
    282 PKG_CHECK_MODULES(LIBTINYMAIL_QUEUES, oasyncworker-1.0 glib-2.0 >= 2.8 gobject-2.0) 
     300PKG_CHECK_MODULES(LIBTINYMAIL_QUEUES, glib-2.0 >= 2.8 gobject-2.0) 
    283301AC_SUBST(LIBTINYMAIL_QUEUES_CFLAGS) 
    284302AC_SUBST(LIBTINYMAIL_QUEUES_LIBS) 
     303 if test x$build_asyncworker = xtrue; then 
     304  PKG_CHECK_MODULES(LIBTINYMAIL_ASYNCWORKER, oasyncworker-1.0 glib-2.0 >= 2.8 gobject-2.0) 
     305  AC_SUBST(LIBTINYMAIL_ASYNCWORKER_CFLAGS) 
     306  AC_SUBST(LIBTINYMAIL_ASYNCWORKER_LIBS) 
     307 fi 
    285308fi 
    286309 
     
    465488libtinymail-queues/Makefile 
    466489libtinymail-queues/libtinymail-queues.pc 
     490libtinymail-asyncworker/Makefile 
     491libtinymail-asyncworker/libtinymail-asyncworker.pc 
    467492tests/Makefile 
    468493tests/c-demo/Makefile 
     
    480505echo "  Enable ACAP features:        $build_acap" 
    481506echo "  Build the queues library:    $build_queues" 
     507echo "   Build the asyncworker impl: $build_asyncworker" 
    482508echo "  HTML component:              ${with_html_component}" 
    483509echo "  Python language bindings:    $build_pytinymail" 
  • trunk/libtinymail-queues/Makefile.am

    r1815 r1957  
    1 INCLUDES = $(LIBTINYMAIL_QUEUES_CFLAGS) $(LIBTINYMAIL_CFLAGS) -I. -I$(top_srcdir)
    2         -I$(top_srcdir)/libtinymail 
     1INCLUDES = $(LIBTINYMAIL_QUEUES_CFLAGS) $(LIBTINYMAIL_CFLAGS)
     2        -I. -I$(top_srcdir) -I$(top_srcdir)/libtinymail 
    33 
    44lib_LTLIBRARIES = libtinymail-queues-1.0.la 
    55 
    66libtinymail_queues_1_0_headers = \ 
    7         tny-get-msg-queue-priv.h \ 
     7        tny-queue.h tny-queue-task.h \ 
    88        tny-get-msg-queue.h \ 
    9         tny-generic-send-queue-priv.h \ 
    109        tny-generic-send-queue.h 
    1110 
    1211libtinymail_queues_1_0_la_SOURCES = \ 
     12        tny-queue.c tny-queue-task.c \ 
     13        tny-get-msg-queue-priv.h \ 
     14        tny-generic-send-queue-priv.h \ 
    1315        $(libtinymail_queues_1_0_headers) \ 
    1416        tny-get-msg-queue.c \ 
    1517        tny-generic-send-queue.c 
    1618 
    17 libtinymail_queues_1_0_la_LIBADD = $(LIBTINYMAIL_LIBS) $(LIBTINYMAIL_QUEUES_LIBS) 
     19libtinymail_queues_1_0_la_LIBADD = $(LIBTINYMAIL_LIBS) $(LIBTINYMAIL_QUEUES_LIBS) \ 
     20        $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la 
    1821libtinymail_queues_1_0_la_LDFLAGS = -export-dynamic -version-info $(LT_VERSION_INFO) $(LIBTOOL_EXPORT_OPTIONS) 
    19 libtinymail_queues_1_0_includedir = $(includedir)/libtinymail-$(API_VERSION) 
    20 libtinymail_queues_1_0_include_HEADERS = $(libtinymail_queues_1_0_headers) 
    2122 
    2223%-$(API_VERSION).pc: %.pc 
  • trunk/libtinymail-queues/tny-generic-send-queue-priv.h

    r1817 r1957  
    2525struct _TnyGenericSendQueuePriv 
    2626{ 
    27         OAsyncWorker *queue; 
     27        TnyQueue *queue; 
    2828        GMutex *lock; 
    2929        TnyFolder *outbox, *sentbox; 
  • trunk/libtinymail-queues/tny-generic-send-queue.c

    r1920 r1957  
    2222#include <glib/gi18n-lib.h> 
    2323 
    24 #include <oasyncworker/oasyncworker.h> 
    25  
    26  
    2724#include <tny-generic-send-queue.h> 
    2825#include <tny-simple-list.h> 
     
    8986 
    9087static gpointer 
    91 generic_send_task (OAsyncWorkerTask *task, gpointer arguments) 
     88generic_send_task (TnyQueueTask *task, gpointer arguments) 
    9289{ 
    9390        GenericSendInfo *info = (GenericSendInfo *) arguments; 
     
    133130 
    134131static void  
    135 generic_send_callback (OAsyncWorkerTask *task, gpointer func_result) 
    136 { 
    137         GenericSendInfo *info = o_async_worker_task_get_arguments (task); 
     132generic_send_callback (TnyQueueTask *task, gpointer func_result) 
     133{ 
     134        GenericSendInfo *info = tny_queue_task_get_arguments (task); 
    138135        g_object_unref (info->self); 
    139136        g_slice_free (GenericSendInfo, info); 
     
    175172        while (!tny_iterator_is_done (iter)) 
    176173        { 
    177                 OAsyncWorkerTask *task; 
     174                TnyQueueTask *task; 
    178175                GenericSendInfo *info = g_slice_new (GenericSendInfo); 
    179176                TnyHeader *header = TNY_HEADER (tny_iterator_get_current (iter)); 
     
    203200                } 
    204201 
    205                 task = o_async_worker_task_new (); 
    206                 o_async_worker_task_set_arguments (task, info); 
    207                 o_async_worker_task_set_func (task, generic_send_task); 
    208                 o_async_worker_task_set_callback (task, generic_send_callback); 
    209  
    210                 item = o_async_worker_add (priv->queue, task); 
     202                task = tny_queue_create_task (priv->queue); 
     203                tny_queue_task_set_arguments (task, info); 
     204                tny_queue_task_set_func (task, generic_send_task); 
     205                tny_queue_task_set_callback (task, generic_send_callback); 
     206 
     207                item = tny_queue_add_task (priv->queue, task); 
    211208 
    212209                g_object_unref (header); 
     
    254251        TnyGenericSendQueuePriv *priv = TNY_GENERIC_SEND_QUEUE_GET_PRIVATE (self); 
    255252        TnyFolder *outbox; 
    256         OAsyncWorkerTask *task; 
     253        TnyQueueTask *task; 
    257254        GenericSendInfo *info; 
    258255        TnyFolderChangeChanged changed; 
     
    299296                        } 
    300297 
    301                         task = o_async_worker_task_new (); 
    302                         o_async_worker_task_set_arguments (task, info); 
    303                         o_async_worker_task_set_func (task, generic_send_task); 
    304                         o_async_worker_task_set_callback (task, generic_send_callback); 
    305  
    306                         o_async_worker_add (priv->queue, task); 
     298                        task = tny_queue_create_task (priv->queue); 
     299                        tny_queue_task_set_arguments (task, info); 
     300                        tny_queue_task_set_func (task, generic_send_task); 
     301                        tny_queue_task_set_callback (task, generic_send_callback); 
     302 
     303                        tny_queue_add_task (priv->queue, task); 
    307304 
    308305                        g_object_unref (G_OBJECT (header)); 
     
    333330 
    334331        priv->cancelled = TRUE; 
    335         o_async_worker_join (priv->queue); 
     332        tny_queue_join (priv->queue); 
    336333 
    337334        g_mutex_lock (priv->lock); 
     
    417414} 
    418415 
     416 
     417 
     418static gint 
     419tny_generic_send_queue_add_task (TnyQueue *self, TnyQueueTask *task) 
     420{ 
     421        TnyGenericSendQueuePriv *priv = TNY_GENERIC_SEND_QUEUE_GET_PRIVATE (self); 
     422        return tny_queue_add_task (priv->queue, task); 
     423} 
     424 
     425static void 
     426tny_generic_send_queue_join (TnyQueue *self) 
     427{ 
     428        TnyGenericSendQueuePriv *priv = TNY_GENERIC_SEND_QUEUE_GET_PRIVATE (self); 
     429        tny_queue_join (priv->queue); 
     430        return; 
     431} 
     432 
     433 
     434static TnyQueueTask* 
     435tny_generic_send_queue_create_task (TnyQueue *self) 
     436{ 
     437        TnyGenericSendQueuePriv *priv = TNY_GENERIC_SEND_QUEUE_GET_PRIVATE (self); 
     438        return tny_queue_create_task (priv->queue); 
     439} 
     440 
    419441/** 
    420442 * tny_generic_send_queue_new: 
     443 * @decorated: The #TnyQueue to decorate with this queue 
    421444 * @account: a #TnyTransportAccount object 
    422445 * @outbox: a #TnyFolder object 
     
    429452 **/ 
    430453TnySendQueue* 
    431 tny_generic_send_queue_new (TnyTransportAccount *account, TnyFolder *outbox, TnyFolder *sentbox) 
     454tny_generic_send_queue_new (TnyQueue *decorated, TnyTransportAccount *account, TnyFolder *outbox, TnyFolder *sentbox) 
    432455{ 
    433456        TnyGenericSendQueue *self = g_object_new (TNY_TYPE_GENERIC_SEND_QUEUE, NULL); 
    434457        TnyGenericSendQueuePriv *priv = TNY_GENERIC_SEND_QUEUE_GET_PRIVATE (self); 
    435458 
     459        priv->queue = TNY_QUEUE (g_object_ref (decorated)); 
    436460        priv->account = TNY_TRANSPORT_ACCOUNT (g_object_ref (account)); 
    437461        priv->outbox = TNY_FOLDER (g_object_ref (outbox)); 
     
    452476 
    453477        priv->cancelled = TRUE; 
    454         o_async_worker_join (priv->queue); 
     478        tny_queue_join (priv->queue); 
    455479 
    456480        g_mutex_lock (priv->lock); 
     
    475499 
    476500        g_mutex_lock (priv->lock); 
    477         priv->queue = o_async_worker_new ()
     501        priv->queue = NULL
    478502        priv->account = NULL; 
    479503        priv->sentbox = NULL; 
     
    510534        klass->update_func = tny_generic_send_queue_update; 
    511535} 
     536 
     537static void 
     538tny_queue_init (TnyQueueIface *klass) 
     539{ 
     540        klass->add_task_func = tny_generic_send_queue_add_task; 
     541        klass->join_func = tny_generic_send_queue_join; 
     542        klass->create_task_func = tny_generic_send_queue_create_task; 
     543} 
     544 
    512545 
    513546static void 
     
    557590                }; 
    558591 
     592                static const GInterfaceInfo tny_queue_info =  
     593                { 
     594                        (GInterfaceInitFunc) tny_queue_init, /* interface_init */ 
     595                        NULL,         /* interface_finalize */ 
     596                        NULL          /* interface_data */ 
     597                }; 
     598 
    559599                type = g_type_register_static (G_TYPE_OBJECT, 
    560600                        "TnyGenericSendQueue", 
     
    567607                        &tny_folder_observer_info); 
    568608 
     609                g_type_add_interface_static (type, TNY_TYPE_QUEUE, 
     610                        &tny_queue_info); 
     611 
    569612        } 
    570613        return type; 
  • trunk/libtinymail-queues/tny-generic-send-queue.h

    r1851 r1957  
    2121 */ 
    2222#include <tny-shared.h> 
     23#include <tny-queue.h> 
     24#include <tny-queue-task.h> 
    2325#include <tny-send-queue.h> 
    2426#include <tny-msg.h> 
  • trunk/libtinymail-queues/tny-get-msg-queue-priv.h

    r1884 r1957  
    2525struct _TnyGetMsgQueuePriv 
    2626{ 
    27         OAsyncWorker *queue; 
     27        TnyQueue *queue; 
    2828        GMutex *lock; 
    2929        guint total; 
  • trunk/libtinymail-queues/tny-get-msg-queue.c

    r1920 r1957  
    2929 
    3030#include <tny-get-msg-queue.h> 
    31 #include <oasyncworker/oasyncworker.h> 
    3231 
    3332static GObjectClass *parent_class = NULL; 
     
    4342        TnyStatusCallback status_callback; 
    4443        gpointer user_data; 
     44        TnyFolder *folder; 
    4545        guint i; 
    4646        GError *err; 
     
    4949 
    5050static gpointer 
    51 get_msg_task (OAsyncWorkerTask *task, gpointer arguments) 
     51get_msg_task (TnyQueueTask *task, gpointer arguments) 
    5252{ 
    5353        TnyMsg *retval = NULL; 
     
    6060        g_print ("Getting message (%d of %d): %s\n", info->i, priv->total,  
    6161                tny_header_get_subject (info->header)); 
    62         folder = tny_header_get_folder (info->header); 
     62        info->folder = tny_header_get_folder (info->header); 
    6363 
    6464        if (info->status_callback) { 
     
    7676        } 
    7777 
    78         retval = tny_folder_get_msg (folder, info->header, &info->err); 
    79  
    80         g_object_unref (folder); 
     78        if (info->folder) 
     79                retval = tny_folder_get_msg (info->folder, info->header, &info->err); 
    8180 
    8281        return (gpointer) retval; 
     
    8483 
    8584static void  
    86 get_msg_callback (OAsyncWorkerTask *task, gpointer func_result) 
    87 { 
    88         GetMsgInfo *info = o_async_worker_task_get_arguments (task); 
     85get_msg_callback (TnyQueueTask *task, gpointer func_result) 
     86{ 
     87        GetMsgInfo *info = tny_queue_task_get_arguments (task); 
    8988        TnyMsg *msg = (TnyMsg *) func_result; 
    9089        TnyFolder *folder; 
     
    9291        info->err = NULL; 
    9392 
    94         folder = tny_header_get_folder (info->header); 
    95  
    96         if (info->callback) 
    97                 info->callback (folder, FALSE, msg, &info->err, info->user_data); 
     93         
     94        if (info->callback && info->folder) 
     95                info->callback (info->folder, FALSE, msg, &info->err, info->user_data); 
    9896 
    9997        if (msg) 
    10098                g_object_unref (msg); 
    101   
    102         g_object_unref (folder); 
     99 
     100 
    103101        g_object_unref (info->header); 
     102 
     103        if (info->folder) 
     104                g_object_unref (info->folder); 
     105 
    104106        g_object_unref (info->self); 
    105107 
     
    130132{ 
    131133        TnyGetMsgQueuePriv *priv = TNY_GET_MSG_QUEUE_GET_PRIVATE (self); 
    132         OAsyncWorkerTask *task = o_async_worker_task_new (); 
     134        TnyQueueTask *task = tny_queue_create_task (priv->queue); 
    133135        GetMsgInfo *info = g_slice_new (GetMsgInfo); 
    134136 
     
    141143        info->user_data = user_data; 
    142144 
    143         o_async_worker_task_set_arguments (task, info); 
    144         o_async_worker_task_set_func (task, get_msg_task); 
    145         o_async_worker_task_set_callback (task, get_msg_callback); 
     145        tny_queue_task_set_arguments (task, info); 
     146        tny_queue_task_set_func (task, get_msg_task); 
     147        tny_queue_task_set_callback (task, get_msg_callback); 
    146148 
    147149        g_mutex_lock (priv->lock); 
    148         o_async_worker_add (priv->queue, task); 
     150        tny_queue_add_task (priv->queue, task); 
    149151        g_mutex_unlock (priv->lock); 
    150152 
     
    306308/** 
    307309 * tny_get_msg_queue_new: 
     310 * @decorated: The #TnyQueue to decorate with this queue 
    308311 * 
    309312 * Creates a queue that can get messages for you 
    310313 * 
    311  * Return value: a new #TnyGetMsgQueue instance 
     314 * Return value: a new #TnyQueue instance 
    312315 **/ 
    313 TnyGetMsgQueue* 
    314 tny_get_msg_queue_new (void) 
     316TnyQueue* 
     317tny_get_msg_queue_new (TnyQueue *decorated) 
    315318{ 
    316319        TnyGetMsgQueue *self = g_object_new (TNY_TYPE_GET_MSG_QUEUE, NULL); 
    317  
    318         return self; 
     320        TnyGetMsgQueuePriv *priv = TNY_GET_MSG_QUEUE_GET_PRIVATE (self); 
     321 
     322        priv->queue = TNY_QUEUE (g_object_ref (decorated)); 
     323 
     324        return TNY_QUEUE (self); 
     325
     326 
     327static gint 
     328tny_get_msg_queue_add_task (TnyQueue *self, TnyQueueTask *task) 
     329
     330        TnyGetMsgQueuePriv *priv = TNY_GET_MSG_QUEUE_GET_PRIVATE (self); 
     331        return tny_queue_add_task (priv->queue, task); 
     332
     333 
     334 
     335static void 
     336tny_get_msg_queue_join (TnyQueue *self) 
     337
     338        TnyGetMsgQueuePriv *priv = TNY_GET_MSG_QUEUE_GET_PRIVATE (self); 
     339        tny_queue_join (priv->queue); 
     340        return; 
     341
     342 
     343static TnyQueueTask* 
     344tny_get_msg_queue_create_task (TnyQueue *self) 
     345
     346        TnyGetMsgQueuePriv *priv = TNY_GET_MSG_QUEUE_GET_PRIVATE (self); 
     347        return tny_queue_create_task (priv->queue); 
     348
     349 
     350 
     351static void 
     352tny_queue_init (TnyQueueIface *klass) 
     353
     354        klass->add_task_func = tny_get_msg_queue_add_task; 
     355        klass->join_func = tny_get_msg_queue_join; 
     356        klass->create_task_func = tny_get_msg_queue_create_task; 
    319357} 
    320358 
     
    326364 
    327365        g_mutex_lock (priv->lock); 
    328         g_object_unref (G_OBJECT (priv->queue)); 
     366        g_object_unref (priv->queue); 
    329367        g_mutex_unlock (priv->lock); 
    330368        g_mutex_free (priv->lock); 
     
    342380        priv->total = 0; 
    343381        g_mutex_lock (priv->lock); 
    344         priv->queue = o_async_worker_new ()
     382        priv->queue = NULL
    345383        g_mutex_unlock (priv->lock); 
    346384 
     
    383421                }; 
    384422 
     423                static const GInterfaceInfo tny_queue_info =  
     424                { 
     425                        (GInterfaceInitFunc) tny_queue_init, /* interface_init */ 
     426                        NULL,         /* interface_finalize */ 
     427                        NULL          /* interface_data */ 
     428                }; 
     429 
    385430                type = g_type_register_static (G_TYPE_OBJECT, 
    386431                        "TnyGetMsgQueue", 
    387432                        &info, 0); 
     433 
     434                g_type_add_interface_static (type, TNY_TYPE_QUEUE, 
     435                        &tny_queue_info); 
    388436        } 
    389437        return type; 
  • trunk/libtinymail-queues/tny-get-msg-queue.h

    r1884 r1957  
    2121 */ 
    2222#include <tny-shared.h> 
    23  
     23#include <tny-queue.h> 
     24#include <tny-queue-task.h> 
    2425#include <tny-folder.h> 
    2526#include <tny-msg.h> 
     
    5253 
    5354GType tny_get_msg_queue_get_type (void); 
    54 TnyGetMsgQueue* tny_get_msg_queue_new (void); 
     55TnyQueue* tny_get_msg_queue_new (TnyQueue *decorated); 
    5556 
    5657void tny_get_msg_queue_get_msg (TnyGetMsgQueue *self, TnyHeader *header, TnyGetMsgCallback callback, TnyStatusCallback status_callback, gpointer user_data); 
  • trunk/libtinymailui/tny-account-store-view.c

    r1198 r1957  
    3535tny_account_store_view_set_account_store (TnyAccountStoreView *self, TnyAccountStore *account_store) 
    3636{ 
    37 #ifdef DEBUG 
    38         if (!TNY_ACCOUNT_STORE_VIEW_GET_IFACE (self)->set_account_store_func) 
    39                g_critical ("You must implement tny_account_store_view_set_account_store\n"); 
     37#ifdef DBC /* require */ 
     38        g_assert (TNY_IS_ACCOUNT_STORE_VIEW (self)); 
     39        g_assert (TNY_ACCOUNT_STORE_VIEW_GET_IFACE (self)->set_account_store_func != NULL); 
    4040#endif 
     41 
    4142        TNY_ACCOUNT_STORE_VIEW_GET_IFACE (self)->set_account_store_func (self, account_store); 
     43 
    4244        return; 
    4345} 
  • trunk/tests/c-demo/Makefile.am

    r1884 r1957  
    1515if BUILD_QUEUES 
    1616INCLUDES += -DQUEUES -I$(top_srcdir)/libtinymail-queues 
     17endif 
     18 
     19if BUILD_ASYNCWORKER 
     20INCLUDES += -DASYNCWORKER -I$(top_srcdir)/libtinymail-asyncworker $(LIBTINYMAIL_ASYNCWORKER_CFLAGS) 
    1721endif 
    1822 
     
    4145endif 
    4246 
     47if BUILD_ASYNCWORKER 
     48tny_demoui_LDADD +=  $(top_builddir)/libtinymail-asyncworker/libtinymail-asyncworker-$(API_VERSION).la \ 
     49        $(LIBTINYMAIL_ASYNCWORKER_LIBS) 
     50endif 
     51 
  • trunk/tests/c-demo/tny-demoui-summary-view.c

    r1930 r1957  
    7878 
    7979 
    80 #ifdef QUEUES 
     80#ifdef ASYNCWORKER 
     81#include <tny-async-worker-queue.h> 
    8182#include <tny-get-msg-queue.h> 
    8283#endif 
     
    753754} 
    754755 
    755 #ifdef QUEUES 
    756 static TnyGetMsgQueue *fullqueue = NULL; 
     756#ifdef ASYNCWORKER 
     757static TnyQueue *fullqueue = NULL; 
     758static TnyQueue *real_queue = NULL; 
     759 
     760static TnyQueue* 
     761get_queue (void) 
     762
     763        if (!real_queue) 
     764                real_queue = tny_async_worker_queue_new_from_scratch (); 
     765        return real_queue; 
     766
    757767 
    758768static void  
     
    780790                                &folder, -1); 
    781791 
     792 
    782793                        if (!fullqueue) 
    783                                 fullqueue = tny_get_msg_queue_new (); 
    784  
    785                         tny_get_msg_queue_full_msg_retrieval (fullqueue, folder,  
    786                                 NULL, NULL, status_update, self); 
     794                                fullqueue = tny_get_msg_queue_new (get_queue ()); 
     795 
     796                        tny_get_msg_queue_full_msg_retrieval (TNY_GET_MSG_QUEUE (fullqueue),  
     797                                folder, NULL, NULL, status_update, self); 
    787798 
    788799                        g_object_unref (G_OBJECT (folder)); 
     
    11221133        GtkSelectionMode mode; 
    11231134        GtkWidget *mrename, *mdelete, *mcreate, *mmerge; 
    1124 #ifdef QUEUES 
     1135#ifdef ASYNCWORKER 
    11251136        GtkWidget *fdown; 
    11261137#endif 
     
    11321143        mdelete = gtk_menu_item_new_with_label (_("Delete folder")); 
    11331144 
    1134 #ifdef QUEUES 
     1145#ifdef ASYNCWORKER 
    11351146        fdown = gtk_menu_item_new_with_label (_("Download entire folder")); 
    11361147#endif 
     
    11511162        g_signal_connect (G_OBJECT (mmerge), "activate", 
    11521163                G_CALLBACK (on_merge_view_activate), user_data); 
    1153 #ifdef QUEUES 
     1164#ifdef ASYNCWORKER 
    11541165        g_signal_connect (G_OBJECT (fdown), "activate", 
    11551166                G_CALLBACK (on_full_download_folder_activate), user_data); 
     
    11601171        gtk_menu_prepend (menu, mdelete); 
    11611172        gtk_menu_prepend (menu, mmerge); 
    1162 #ifdef QUEUES 
     1173#ifdef ASYNCWORKER 
    11631174        gtk_menu_prepend (menu, fdown); 
    11641175