Ticket #3247: refactoring of status_msg engine.

Initial commit: create global timer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2014-09-10 09:28:41 +04:00
parent 99dd2ef709
commit be938c611b
3 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <config.h>
#include "global.h"
#include "lib/timer.h"
/* *INDENT-OFF* */
#ifdef ENABLE_SUBSHELL
@ -49,6 +50,7 @@
/* *INDENT-OFF* */
mc_global_t mc_global = {
.mc_run_mode = MC_RUN_FULL,
.timer = NULL,
.midnight_shutdown = FALSE,
.sysconfig_dir = NULL,

View File

@ -173,6 +173,8 @@ typedef enum
typedef struct
{
mc_run_mode_t mc_run_mode;
/* global timer */
struct mc_timer_t *timer;
/* Used so that widgets know if they are being destroyed or shut down */
gboolean midnight_shutdown;

View File

@ -47,6 +47,7 @@
#include "lib/tty/tty.h"
#include "lib/tty/key.h" /* For init_key() */
#include "lib/tty/mouse.h" /* init_mouse() */
#include "lib/timer.h"
#include "lib/skin.h"
#include "lib/filehighlight.h"
#include "lib/fileloc.h"
@ -238,6 +239,8 @@ main (int argc, char *argv[])
char *config_migrate_msg;
int exit_code = EXIT_FAILURE;
mc_global.timer = mc_timer_new ();
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
#ifdef HAVE_SETLOCALE
(void) setlocale (LC_ALL, "");
@ -256,6 +259,7 @@ main (int argc, char *argv[])
g_free (mc_global.tty.shell);
startup_exit_ok:
str_uninit_strings ();
mc_timer_destroy (mc_global.timer);
return exit_code;
}
@ -497,6 +501,8 @@ main (int argc, char *argv[])
exit_code = EXIT_FAILURE;
}
mc_timer_destroy (mc_global.timer);
(void) putchar ('\n'); /* Hack to make shell's prompt start at left of screen */
return exit_code;