Compare commits

..

No commits in common. "140fba445d86175173d168f0cd05e9d84b1297d0" and "54a7814e0b44bd86a266b73556d826c4def7ddee" have entirely different histories.

5 changed files with 14 additions and 26 deletions

View File

@ -14,7 +14,7 @@ int main(int argc, char *argv[])
gtk_widget_show(mainWindow->mainWindow); gtk_widget_show(mainWindow->mainWindow);
mdiary_scan_to_store(argv[1], mainWindow->entryListStore); mdiary_scan_to_store(argv[1], mainWindow->entryListStore);
mainWindow_set_meta_information(mainWindow, mdiary_get_time_earliest(), mdiary_get_time_latest(), FALSE); mainWindow_set_meta_information(mainWindow, mdiary_get_time_earliest(), mdiary_get_time_latest());
gtk_main(); gtk_main();

View File

@ -17,7 +17,7 @@ static gboolean mainWindow_workspace_entry_visible(GtkTreeModel *model,
gchar *temp; gchar *temp;
gboolean ret = FALSE; gboolean ret = FALSE;
searchString = (gchar *)gtk_entry_get_text(GTK_ENTRY(mainWindow->workspaceSearch)); searchString = gtk_entry_get_text(GTK_ENTRY(mainWindow->workspaceSearch));
if (g_strcmp0(searchString, "")) { if (g_strcmp0(searchString, "")) {
regex = g_regex_new(searchString, G_REGEX_CASELESS, 0, NULL); regex = g_regex_new(searchString, G_REGEX_CASELESS, 0, NULL);
@ -61,9 +61,6 @@ static gboolean mainWindow_list_entry_visible(GtkTreeModel *model,
GDateTime *datetime; GDateTime *datetime;
guint time; guint time;
if (mainWindow->filterSettings.hide_all)
return FALSE;
/* Check text search */ /* Check text search */
searchString = (gchar *)gtk_entry_get_text(GTK_ENTRY(mainWindow->searchEntry)); searchString = (gchar *)gtk_entry_get_text(GTK_ENTRY(mainWindow->searchEntry));
if (searchString[0] != 0 && ( if (searchString[0] != 0 && (
@ -135,7 +132,6 @@ static gint mainWindow_sort_date_compare_func(GtkTreeModel *model,
gtk_tree_model_get(model, a, COL_TIMESTAMP, &datetime1, -1); gtk_tree_model_get(model, a, COL_TIMESTAMP, &datetime1, -1);
gtk_tree_model_get(model, b, COL_TIMESTAMP, &datetime2, -1); gtk_tree_model_get(model, b, COL_TIMESTAMP, &datetime2, -1);
time1 = g_date_time_to_unix(datetime1); time1 = g_date_time_to_unix(datetime1);
time2 = g_date_time_to_unix(datetime2); time2 = g_date_time_to_unix(datetime2);
@ -415,7 +411,6 @@ struct mainWindow *mainWindow_new()
mainWindow->filterSettings.time_start = 0; mainWindow->filterSettings.time_start = 0;
mainWindow->filterSettings.time_end = -1; mainWindow->filterSettings.time_end = -1;
mainWindow->filterSettings.hide_all = TRUE;
mainWindow->time_earliest = 0; mainWindow->time_earliest = 0;
mainWindow->time_latest = 0; mainWindow->time_latest = 0;
@ -438,14 +433,10 @@ struct mainWindow *mainWindow_new()
* @param time_earliest is the reset value for the filter start date * @param time_earliest is the reset value for the filter start date
* @param time_latest is the reset value for the filter end date * @param time_latest is the reset value for the filter end date
*/ */
void mainWindow_set_meta_information(struct mainWindow *mainWindow, void mainWindow_set_meta_information(struct mainWindow *mainWindow, guint time_earliest, guint time_latest)
guint time_earliest,
guint time_latest,
gboolean hide_all)
{ {
mainWindow->time_earliest = time_earliest; mainWindow->time_earliest = time_earliest;
mainWindow->time_latest = time_latest; mainWindow->time_latest = time_latest;
mainWindow->filterSettings.hide_all = hide_all;
mainWindow_clearSearch(NULL, mainWindow); mainWindow_clearSearch(NULL, mainWindow);
} }

View File

@ -28,17 +28,16 @@ struct mainWindow {
GtkWidget *selectedDateEntry; GtkWidget *selectedDateEntry;
GtkTreeModelFilter *entryListFiltered; GtkTreeModelFilter *entryListFiltered;
gint64 time_earliest; guint time_earliest;
gint64 time_latest; guint time_latest;
struct filterSettings { struct filterSettings {
gint64 time_start; guint time_start;
gint64 time_end; guint time_end;
gboolean search_title; gboolean search_title;
gboolean search_tags; gboolean search_tags;
gboolean search_summary; gboolean search_summary;
gboolean search_text; gboolean search_text;
gboolean hide_all;
} filterSettings; } filterSettings;
GtkWidget *buttonOtherWorkspace; GtkWidget *buttonOtherWorkspace;
@ -51,10 +50,7 @@ struct mainWindow {
}; };
struct mainWindow *mainWindow_new(); struct mainWindow *mainWindow_new();
void mainWindow_set_meta_information(struct mainWindow *mainWindow, void mainWindow_set_meta_information(struct mainWindow *mainWindow, guint time_earliest, guint time_latest);
guint time_earliest,
guint time_latest,
gboolean hide_all);
/* Slots */ /* Slots */
void mainWindow_showPopover(GtkWidget *widget, GdkEvent *event, gpointer user_data); void mainWindow_showPopover(GtkWidget *widget, GdkEvent *event, gpointer user_data);

View File

@ -232,7 +232,7 @@ static void mdiary_add_file_to_store(gchar *filename, GtkListStore *entryListSto
GString *text = NULL; GString *text = NULL;
guint header_state = 0; guint header_state = 0;
g_message("Add file: %s\n", filename); g_print("Add file: %s\n", filename);
file = g_file_new_for_path(filename); file = g_file_new_for_path(filename);
stream = g_file_read(file, NULL, &err); stream = g_file_read(file, NULL, &err);
@ -367,7 +367,7 @@ void mdiary_scan_to_store(gchar *base_dir, GtkListStore *entryListStore)
* @brief mdiary_get_time_earliest getter function for time_earliest. Call mdiary_scan_to_store before using. * @brief mdiary_get_time_earliest getter function for time_earliest. Call mdiary_scan_to_store before using.
* @return time_earliest * @return time_earliest
*/ */
gint64 mdiary_get_time_earliest(void) guint mdiary_get_time_earliest(void)
{ {
return time_earliest; return time_earliest;
} }
@ -376,7 +376,7 @@ gint64 mdiary_get_time_earliest(void)
* @brief mdiary_get_time_earliest getter function for time_latest. Call mdiary_scan_to_store before using. * @brief mdiary_get_time_earliest getter function for time_latest. Call mdiary_scan_to_store before using.
* @return time_latest * @return time_latest
*/ */
gint64 mdiary_get_time_latest(void) guint mdiary_get_time_latest(void)
{ {
return time_latest; return time_latest;
} }
@ -433,6 +433,7 @@ void mdiary_add_entry_to_store(GtkListStore *entryListStore,
taglist_copy = g_list_copy_deep(tags, (GCopyFunc) g_strdup, NULL); taglist_copy = g_list_copy_deep(tags, (GCopyFunc) g_strdup, NULL);
taglistString = mdiary_taglist_to_string(taglist_copy); taglistString = mdiary_taglist_to_string(taglist_copy);
gtk_list_store_append(entryListStore, &iter); gtk_list_store_append(entryListStore, &iter);
gtk_list_store_set(entryListStore, &iter, gtk_list_store_set(entryListStore, &iter,
COL_TITLE, title, COL_TITLE, title,

View File

@ -26,7 +26,7 @@ void mdiary_add_entry_to_store(GtkListStore *entryListStore,
gchar *text); gchar *text);
GDateTime *mdiary_get_date_from_string_ext(gchar *string, gchar *prefix, gchar *suffix); GDateTime *mdiary_get_date_from_string_ext(gchar *string, gchar *prefix, gchar *suffix);
GDateTime *mdiary_get_date_from_string(gchar *string); GDateTime *mdiary_get_date_from_string(gchar *string);
gint64 mdiary_get_time_earliest(void); guint mdiary_get_time_earliest(void);
gint64 mdiary_get_time_latest(void); guint mdiary_get_time_latest(void);
#endif /* MDIARY_H */ #endif /* MDIARY_H */