Some cleanups

This commit is contained in:
Markus Koch 2017-02-03 19:40:05 +01:00
parent ecf84fcd67
commit 0a5ba481bc

View File

@ -357,8 +357,8 @@ struct mainWindow *mainWindow_new()
/**
* These need to be set to oldest and newest after indexing date
*/
gtk_entry_set_text(mainWindow->dateStart, "2016-01-01");
gtk_entry_set_text(mainWindow->dateEnd, "2017-01-01");
gtk_entry_set_text(GTK_ENTRY(mainWindow->dateStart), "2016-01-01");
gtk_entry_set_text(GTK_ENTRY(mainWindow->dateEnd), "2017-01-01");
return mainWindow;
}
@ -433,12 +433,12 @@ void mainWindow_dateChanged(GtkWidget *widget, gpointer user_data)
GDateTime *datetime;
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
datetime = mainWindow_get_date_from_string(gtk_entry_get_text(GTK_ENTRY(mainWindow->dateStart)));
datetime = mainWindow_get_date_from_string((gchar *)gtk_entry_get_text(GTK_ENTRY(mainWindow->dateStart)));
if (datetime) {
mainWindow->filterSettings.time_start = g_date_time_to_unix(datetime);
g_date_time_unref(datetime);
}
datetime = mainWindow_get_date_from_string(gtk_entry_get_text(GTK_ENTRY(mainWindow->dateEnd)));
datetime = mainWindow_get_date_from_string((gchar *)gtk_entry_get_text(GTK_ENTRY(mainWindow->dateEnd)));
if (datetime) {
mainWindow->filterSettings.time_end = g_date_time_to_unix(datetime);
g_date_time_unref(datetime);
@ -452,7 +452,7 @@ void mainWindow_checkDate(GtkWidget *widget, gint event, gpointer user_data)
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
GDateTime *datetime;
datetime = mainWindow_get_date_from_string(gtk_entry_get_text(GTK_ENTRY(widget)));
datetime = mainWindow_get_date_from_string((char *)gtk_entry_get_text(GTK_ENTRY(widget)));
if (!datetime) {
datetime = g_date_time_new_from_unix_local(widget == mainWindow->dateStart
? mainWindow->filterSettings.time_start