1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 18:29:19 +02:00

send at least one MR_EVENT_IMEX_PROGRESS event.

This commit is contained in:
B. Petersen 2017-12-01 12:36:36 +01:00
parent 48ab655372
commit 9f05277398
2 changed files with 8 additions and 2 deletions

View file

@ -86,12 +86,16 @@ static uintptr_t receive_event(mrmailbox_t* mailbox, int event, uintptr_t data1,
return (uintptr_t)ret; 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: 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; break;
default: 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; break;
} }
return 0; return 0;

View file

@ -885,6 +885,7 @@ int mrmailbox_imex(mrmailbox_t* mailbox, int what, const char* param1, const cha
s_imex_do_exit = 0; s_imex_do_exit = 0;
mrmailbox_log_info(mailbox, 0, "Import/export process started."); 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) ) { if( !mrsqlite3_is_open(mailbox->m_sql) ) {
mrmailbox_log_error(mailbox, 0, "Import/export: Database not opened."); 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; success = 1;
cleanup: cleanup:
mailbox->m_cb(mailbox, MR_EVENT_IMEX_PROGRESS, 1000, 0);
mrmailbox_log_info(mailbox, 0, "Import/export process ended."); mrmailbox_log_info(mailbox, 0, "Import/export process ended.");
s_imex_do_exit = 1; /* avoids mrmailbox_imex_cancel() to stop the thread */ s_imex_do_exit = 1; /* avoids mrmailbox_imex_cancel() to stop the thread */
s_imex_running = 0; s_imex_running = 0;