1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Use null check convention in titlebar.c

This commit is contained in:
James Booth 2015-05-04 23:08:09 +01:00
parent bf5646aee3
commit dd386b4a4e

View File

@ -80,7 +80,7 @@ title_bar_update_virtual(void)
{ {
ProfWin *window = wins_get_current(); ProfWin *window = wins_get_current();
if (window->type != WIN_CONSOLE) { if (window->type != WIN_CONSOLE) {
if (typing_elapsed != NULL) { if (typing_elapsed) {
gdouble seconds = g_timer_elapsed(typing_elapsed, NULL); gdouble seconds = g_timer_elapsed(typing_elapsed, NULL);
if (seconds >= 10) { if (seconds >= 10) {
@ -128,7 +128,7 @@ title_bar_set_presence(contact_presence_t presence)
void void
title_bar_switch(void) title_bar_switch(void)
{ {
if (typing_elapsed != NULL) { if (typing_elapsed) {
g_timer_destroy(typing_elapsed); g_timer_destroy(typing_elapsed);
typing_elapsed = NULL; typing_elapsed = NULL;
typing = FALSE; typing = FALSE;
@ -141,7 +141,7 @@ void
title_bar_set_typing(gboolean is_typing) title_bar_set_typing(gboolean is_typing)
{ {
if (is_typing) { if (is_typing) {
if (typing_elapsed != NULL) { if (typing_elapsed) {
g_timer_start(typing_elapsed); g_timer_start(typing_elapsed);
} else { } else {
typing_elapsed = g_timer_new(); typing_elapsed = g_timer_new();