diff --git a/cmdline/main.c b/cmdline/main.c index bc48525d..3b591e53 100644 --- a/cmdline/main.c +++ b/cmdline/main.c @@ -86,12 +86,16 @@ static uintptr_t receive_event(mrmailbox_t* mailbox, int event, uintptr_t data1, return (uintptr_t)ret; } + case MR_EVENT_IMEX_PROGRESS: + printf("{{Received event MR_EVENT_IMEX_PROGRESS(%i ‰)}}\n", (int)data1); + break; + case MR_EVENT_IMEX_FILE_WRITTEN: - printf("{{Received event MR_EVENT_IMEX_FILE_WRITTEN (%s, %s)}}\n", (char*)data1, (char*)data2); + printf("{{Received event MR_EVENT_IMEX_FILE_WRITTEN(%s)}}\n", (char*)data1); break; default: - printf("{{Received event #%i (%i, %i)}}\n", (int)event, (int)data1, (int)data2); + printf("{{Received event #%i(%i, %i)}}\n", (int)event, (int)data1, (int)data2); break; } return 0; diff --git a/src/mrmailbox_imex.c b/src/mrmailbox_imex.c index f46aad86..b7e151ed 100644 --- a/src/mrmailbox_imex.c +++ b/src/mrmailbox_imex.c @@ -885,6 +885,7 @@ int mrmailbox_imex(mrmailbox_t* mailbox, int what, const char* param1, const cha s_imex_do_exit = 0; mrmailbox_log_info(mailbox, 0, "Import/export process started."); + mailbox->m_cb(mailbox, MR_EVENT_IMEX_PROGRESS, 0, 0); if( !mrsqlite3_is_open(mailbox->m_sql) ) { mrmailbox_log_error(mailbox, 0, "Import/export: Database not opened."); @@ -940,6 +941,7 @@ int mrmailbox_imex(mrmailbox_t* mailbox, int what, const char* param1, const cha success = 1; cleanup: + mailbox->m_cb(mailbox, MR_EVENT_IMEX_PROGRESS, 1000, 0); mrmailbox_log_info(mailbox, 0, "Import/export process ended."); s_imex_do_exit = 1; /* avoids mrmailbox_imex_cancel() to stop the thread */ s_imex_running = 0;