gchar* mathg_my_timer_to_string (mathgMyTimer *self) { gchar* result = NULL; GDateTime* _tmp0_ = NULL; gchar* s = NULL; GDateTime* _tmp1_ = NULL; GDateTime* _tmp2_ = NULL; GTimeSpan _tmp3_ = 0LL; gchar* _tmp4_ = NULL; GDateTime* _tmp5_ = NULL; gboolean _tmp6_ = FALSE; GDateTime* _tmp9_ = NULL; _tmp0_ = g_date_time_new_now_local (); _g_date_time_unref0 ((*self).stop); (*self).stop = _tmp0_; _tmp1_ = (*self).stop; _tmp2_ = (*self).start; _tmp3_ = g_date_time_difference (_tmp1_, _tmp2_); _tmp4_ = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) ((_tmp3_ + 500L) / 1000L)); s = _tmp4_; _tmp6_ = (*self).reset; if (_tmp6_) { GDateTime* _tmp7_ = NULL; _tmp7_ = (*self).stop; _tmp5_ = _tmp7_; } else { GDateTime* _tmp8_ = NULL; _tmp8_ = (*self).start; _tmp5_ = _tmp8_; } _tmp9_ = _g_date_time_ref0 (_tmp5_); _g_date_time_unref0 ((*self).start); (*self).start = _tmp9_; result = s; return result; }
void mathg_my_timer_init (mathgMyTimer *self, gboolean b) { gboolean _tmp0_ = FALSE; GDateTime* _tmp1_ = NULL; GDateTime* _tmp2_ = NULL; GDateTime* _tmp3_ = NULL; memset (self, 0, sizeof (mathgMyTimer)); _tmp0_ = b; (*self).reset = _tmp0_; _tmp1_ = g_date_time_new_now_local (); _g_date_time_unref0 ((*self).stop); (*self).stop = _tmp1_; _tmp2_ = (*self).stop; _tmp3_ = _g_date_time_ref0 (_tmp2_); _g_date_time_unref0 ((*self).start); (*self).start = _tmp3_; }
void mathg_my_timer_copy (const mathgMyTimer* self, mathgMyTimer* dest) { gboolean _tmp0_ = FALSE; GDateTime* _tmp1_ = NULL; GDateTime* _tmp2_ = NULL; GDateTime* _tmp3_ = NULL; GDateTime* _tmp4_ = NULL; _tmp0_ = (*self).reset; (*dest).reset = _tmp0_; _tmp1_ = (*self).start; _tmp2_ = _g_date_time_ref0 (_tmp1_); _g_date_time_unref0 ((*dest).start); (*dest).start = _tmp2_; _tmp3_ = (*self).stop; _tmp4_ = _g_date_time_ref0 (_tmp3_); _g_date_time_unref0 ((*dest).stop); (*dest).stop = _tmp4_; }
static gchar* plank_services_logger_get_time (void) { gchar* result = NULL; GDateTime* now = NULL; GDateTime* _tmp0_ = NULL; gint _tmp1_ = 0; gint _tmp2_ = 0; gint _tmp3_ = 0; gint _tmp4_ = 0; gchar* _tmp5_ = NULL; _tmp0_ = g_date_time_new_now_local (); now = _tmp0_; _tmp1_ = g_date_time_get_hour (now); _tmp2_ = g_date_time_get_minute (now); _tmp3_ = g_date_time_get_second (now); _tmp4_ = g_date_time_get_microsecond (now); _tmp5_ = g_strdup_printf ("%.2d:%.2d:%.2d.%.6d", _tmp1_, _tmp2_, _tmp3_, _tmp4_); result = _tmp5_; _g_date_time_unref0 (now); return result; }
gboolean yatla_layout_load_layout (YatlaLayout* self, YatlaSidebar* sidebar, const gchar* list_name) { gboolean result = FALSE; Block4Data* _data4_; YatlaSidebar* _tmp0_ = NULL; YatlaSidebar* _tmp1_ = NULL; const gchar* _tmp2_ = NULL; gchar* _tmp3_ = NULL; const gchar* _tmp4_ = NULL; gchar* _tmp5_ = NULL; GtkBox* _tmp6_ = NULL; const gchar* _tmp7_ = NULL; GtkLabel* _tmp8_ = NULL; GtkLabel* _tmp9_ = NULL; GtkLabel* _tmp10_ = NULL; GtkLabel* _tmp11_ = NULL; const gchar* _tmp12_ = NULL; gchar* _tmp13_ = NULL; gchar* _tmp14_ = NULL; GtkBox* _tmp15_ = NULL; GtkLabel* _tmp16_ = NULL; GtkBox* _tmp17_ = NULL; GtkEntry* _tmp18_ = NULL; GtkEntry* _tmp19_ = NULL; GtkEntry* _tmp20_ = NULL; GtkBox* _tmp21_ = NULL; GtkEntry* _tmp22_ = NULL; GtkBox* _tmp23_ = NULL; gint list_index = 0; YatlaSidebar* _tmp24_ = NULL; GList* _tmp25_ = NULL; gint task_index = 0; guint the_longest_task = 0U; GtkBox* _tmp122_ = NULL; GtkBox* _tmp123_ = NULL; GtkBox* _tmp124_ = NULL; guint _tmp125_ = 0U; GeeTreeMap* _tmp126_ = NULL; GeeCollection* _tmp127_ = NULL; GeeCollection* _tmp128_ = NULL; GeeCollection* _tmp129_ = NULL; gint _tmp130_ = 0; gint _tmp131_ = 0; GtkEntry* _tmp132_ = NULL; GeeMapIterator* map_iterator = NULL; GeeTreeMap* _tmp133_ = NULL; GeeMapIterator* _tmp134_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (sidebar != NULL, FALSE); g_return_val_if_fail (list_name != NULL, FALSE); _data4_ = g_slice_new0 (Block4Data); _data4_->_ref_count_ = 1; _data4_->self = g_object_ref (self); _tmp0_ = sidebar; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (_data4_->sidebar); _data4_->sidebar = _tmp1_; _tmp2_ = list_name; _tmp3_ = g_strdup (_tmp2_); _g_free0 (_data4_->list_name); _data4_->list_name = _tmp3_; _tmp4_ = _data4_->list_name; _tmp5_ = g_strdup (_tmp4_); _g_free0 (self->_name); self->_name = _tmp5_; _tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); g_object_ref_sink (_tmp6_); _g_object_unref0 (self->_top_box1); self->_top_box1 = _tmp6_; _tmp7_ = _data4_->list_name; _tmp8_ = (GtkLabel*) gtk_label_new (_tmp7_); g_object_ref_sink (_tmp8_); _g_object_unref0 (self->_list_name); self->_list_name = _tmp8_; _tmp9_ = self->_list_name; gtk_label_set_use_markup (_tmp9_, TRUE); _tmp10_ = self->_list_name; _tmp11_ = self->_list_name; _tmp12_ = gtk_label_get_text (_tmp11_); _tmp13_ = g_strdup_printf ("<span font='14'><b>%s</b></span>", _tmp12_); _tmp14_ = _tmp13_; gtk_label_set_markup (_tmp10_, _tmp14_); _g_free0 (_tmp14_); _tmp15_ = self->_top_box1; _tmp16_ = self->_list_name; gtk_box_pack_start (_tmp15_, (GtkWidget*) _tmp16_, TRUE, TRUE, (guint) 0); _tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); g_object_ref_sink (_tmp17_); _g_object_unref0 (self->_top_box2); self->_top_box2 = _tmp17_; _tmp18_ = (GtkEntry*) gtk_entry_new (); g_object_ref_sink (_tmp18_); _g_object_unref0 (self->new_task_entry); self->new_task_entry = _tmp18_; _tmp19_ = self->new_task_entry; gtk_entry_set_placeholder_text (_tmp19_, "Add new task"); _tmp20_ = self->new_task_entry; gtk_entry_set_icon_from_stock (_tmp20_, GTK_ENTRY_ICON_SECONDARY, "gtk-edit"); _tmp21_ = self->_top_box2; _tmp22_ = self->new_task_entry; gtk_box_pack_start (_tmp21_, (GtkWidget*) _tmp22_, TRUE, TRUE, (guint) 0); _tmp23_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); g_object_ref_sink (_tmp23_); _g_object_unref0 (self->_tasks_box); self->_tasks_box = _tmp23_; list_index = 0; _tmp24_ = _data4_->sidebar; _tmp25_ = _tmp24_->sidebar_list; { GList* list_collection = NULL; GList* list_it = NULL; list_collection = _tmp25_; for (list_it = list_collection; list_it != NULL; list_it = list_it->next) { YatlaList* _tmp26_ = NULL; YatlaList* list = NULL; _tmp26_ = _g_object_ref0 ((YatlaList*) list_it->data); list = _tmp26_; { YatlaList* _tmp27_ = NULL; const gchar* _tmp28_ = NULL; const gchar* _tmp29_ = NULL; const gchar* _tmp30_ = NULL; gint _tmp31_ = 0; _tmp27_ = list; _tmp28_ = yatla_list_get_name (_tmp27_); _tmp29_ = _tmp28_; _tmp30_ = _data4_->list_name; if (g_strcmp0 (_tmp29_, _tmp30_) == 0) { _g_object_unref0 (list); break; } _tmp31_ = list_index; list_index = _tmp31_ + 1; _g_object_unref0 (list); } } } task_index = 0; the_longest_task = (guint) 0; while (TRUE) { Block5Data* _data5_; gint _tmp32_ = 0; YatlaSidebar* _tmp33_ = NULL; GList* _tmp34_ = NULL; gint _tmp35_ = 0; gconstpointer _tmp36_ = NULL; guint _tmp37_ = 0U; guint _tmp38_ = 0U; gint task_id = 0; YatlaSidebar* _tmp39_ = NULL; GList* _tmp40_ = NULL; gint _tmp41_ = 0; gconstpointer _tmp42_ = NULL; GList* _tmp43_ = NULL; gint _tmp44_ = 0; gconstpointer _tmp45_ = NULL; gint _tmp46_ = 0; gint _tmp47_ = 0; gchar* task_name = NULL; YatlaSidebar* _tmp48_ = NULL; GList* _tmp49_ = NULL; gint _tmp50_ = 0; gconstpointer _tmp51_ = NULL; GList* _tmp52_ = NULL; gint _tmp53_ = 0; gconstpointer _tmp54_ = NULL; const gchar* _tmp55_ = NULL; const gchar* _tmp56_ = NULL; gchar* _tmp57_ = NULL; YatlaSidebar* _tmp58_ = NULL; GList* _tmp59_ = NULL; gint _tmp60_ = 0; gconstpointer _tmp61_ = NULL; GList* _tmp62_ = NULL; gint _tmp63_ = 0; gconstpointer _tmp64_ = NULL; const gchar* _tmp65_ = NULL; const gchar* _tmp66_ = NULL; gchar* _tmp67_ = NULL; GDateTime* task_date = NULL; YatlaSidebar* _tmp68_ = NULL; GList* _tmp69_ = NULL; gint _tmp70_ = 0; gconstpointer _tmp71_ = NULL; GList* _tmp72_ = NULL; gint _tmp73_ = 0; gconstpointer _tmp74_ = NULL; GDateTime* _tmp75_ = NULL; GDateTime* _tmp76_ = NULL; gboolean task_is_done = FALSE; YatlaSidebar* _tmp87_ = NULL; GList* _tmp88_ = NULL; gint _tmp89_ = 0; gconstpointer _tmp90_ = NULL; GList* _tmp91_ = NULL; gint _tmp92_ = 0; gconstpointer _tmp93_ = NULL; gboolean _tmp94_ = FALSE; gboolean _tmp95_ = FALSE; YatlaTask* task = NULL; const gchar* _tmp96_ = NULL; const gchar* _tmp97_ = NULL; GDateTime* _tmp98_ = NULL; gboolean _tmp99_ = FALSE; YatlaTask* _tmp100_ = NULL; YatlaTask* _tmp101_ = NULL; gint _tmp102_ = 0; const gchar* _tmp103_ = NULL; gint _tmp104_ = 0; gint _tmp105_ = 0; guint _tmp106_ = 0U; GtkCheckButton* checkBox = NULL; const gchar* _tmp110_ = NULL; GtkCheckButton* _tmp111_ = NULL; GtkCheckButton* _tmp112_ = NULL; gboolean _tmp113_ = FALSE; GtkCheckButton* _tmp114_ = NULL; GtkCheckButton* _tmp115_ = NULL; GeeTreeMap* _tmp116_ = NULL; YatlaTask* _tmp117_ = NULL; GtkCheckButton* _tmp118_ = NULL; GtkBox* _tmp119_ = NULL; GtkCheckButton* _tmp120_ = NULL; gint _tmp121_ = 0; _data5_ = g_slice_new0 (Block5Data); _data5_->_ref_count_ = 1; _data5_->_data4_ = block4_data_ref (_data4_); _tmp32_ = task_index; _tmp33_ = _data4_->sidebar; _tmp34_ = _tmp33_->sidebar_list; _tmp35_ = list_index; _tmp36_ = g_list_nth_data (_tmp34_, (guint) _tmp35_); _tmp37_ = yatla_list_get_size ((YatlaList*) _tmp36_); _tmp38_ = _tmp37_; if (!(((guint) _tmp32_) != _tmp38_)) { block5_data_unref (_data5_); _data5_ = NULL; break; } _tmp39_ = _data4_->sidebar; _tmp40_ = _tmp39_->sidebar_list; _tmp41_ = list_index; _tmp42_ = g_list_nth_data (_tmp40_, (guint) _tmp41_); _tmp43_ = ((YatlaList*) _tmp42_)->tasks; _tmp44_ = task_index; _tmp45_ = g_list_nth_data (_tmp43_, (guint) _tmp44_); _tmp46_ = yatla_task_get_id ((YatlaTask*) _tmp45_); _tmp47_ = _tmp46_; task_id = _tmp47_; _tmp48_ = _data4_->sidebar; _tmp49_ = _tmp48_->sidebar_list; _tmp50_ = list_index; _tmp51_ = g_list_nth_data (_tmp49_, (guint) _tmp50_); _tmp52_ = ((YatlaList*) _tmp51_)->tasks; _tmp53_ = task_index; _tmp54_ = g_list_nth_data (_tmp52_, (guint) _tmp53_); _tmp55_ = yatla_task_get_name ((YatlaTask*) _tmp54_); _tmp56_ = _tmp55_; _tmp57_ = g_strdup (_tmp56_); task_name = _tmp57_; _tmp58_ = _data4_->sidebar; _tmp59_ = _tmp58_->sidebar_list; _tmp60_ = list_index; _tmp61_ = g_list_nth_data (_tmp59_, (guint) _tmp60_); _tmp62_ = ((YatlaList*) _tmp61_)->tasks; _tmp63_ = task_index; _tmp64_ = g_list_nth_data (_tmp62_, (guint) _tmp63_); _tmp65_ = yatla_task_get_note ((YatlaTask*) _tmp64_); _tmp66_ = _tmp65_; _tmp67_ = g_strdup (_tmp66_); _data5_->task_note = _tmp67_; _tmp68_ = _data4_->sidebar; _tmp69_ = _tmp68_->sidebar_list; _tmp70_ = list_index; _tmp71_ = g_list_nth_data (_tmp69_, (guint) _tmp70_); _tmp72_ = ((YatlaList*) _tmp71_)->tasks; _tmp73_ = task_index; _tmp74_ = g_list_nth_data (_tmp72_, (guint) _tmp73_); _tmp75_ = yatla_task_get_date ((YatlaTask*) _tmp74_); _tmp76_ = _tmp75_; if (_tmp76_ != NULL) { YatlaSidebar* _tmp77_ = NULL; GList* _tmp78_ = NULL; gint _tmp79_ = 0; gconstpointer _tmp80_ = NULL; GList* _tmp81_ = NULL; gint _tmp82_ = 0; gconstpointer _tmp83_ = NULL; GDateTime* _tmp84_ = NULL; GDateTime* _tmp85_ = NULL; GDateTime* _tmp86_ = NULL; _tmp77_ = _data4_->sidebar; _tmp78_ = _tmp77_->sidebar_list; _tmp79_ = list_index; _tmp80_ = g_list_nth_data (_tmp78_, (guint) _tmp79_); _tmp81_ = ((YatlaList*) _tmp80_)->tasks; _tmp82_ = task_index; _tmp83_ = g_list_nth_data (_tmp81_, (guint) _tmp82_); _tmp84_ = yatla_task_get_date ((YatlaTask*) _tmp83_); _tmp85_ = _tmp84_; _tmp86_ = _g_date_time_ref0 (_tmp85_); _g_date_time_unref0 (task_date); task_date = _tmp86_; } else { _g_date_time_unref0 (task_date); task_date = NULL; } _tmp87_ = _data4_->sidebar; _tmp88_ = _tmp87_->sidebar_list; _tmp89_ = list_index; _tmp90_ = g_list_nth_data (_tmp88_, (guint) _tmp89_); _tmp91_ = ((YatlaList*) _tmp90_)->tasks; _tmp92_ = task_index; _tmp93_ = g_list_nth_data (_tmp91_, (guint) _tmp92_); _tmp94_ = yatla_task_get_is_done ((YatlaTask*) _tmp93_); _tmp95_ = _tmp94_; task_is_done = _tmp95_; _tmp96_ = task_name; _tmp97_ = _data5_->task_note; _tmp98_ = task_date; _tmp99_ = task_is_done; _tmp100_ = yatla_task_new (_tmp96_, _tmp97_, _tmp98_, _tmp99_); task = _tmp100_; _tmp101_ = task; _tmp102_ = task_id; yatla_task_set_id (_tmp101_, _tmp102_); _tmp103_ = task_name; _tmp104_ = strlen (_tmp103_); _tmp105_ = _tmp104_; _tmp106_ = the_longest_task; if (((guint) _tmp105_) > _tmp106_) { const gchar* _tmp107_ = NULL; gint _tmp108_ = 0; gint _tmp109_ = 0; _tmp107_ = task_name; _tmp108_ = strlen (_tmp107_); _tmp109_ = _tmp108_; the_longest_task = (guint) _tmp109_; } _tmp110_ = task_name; _tmp111_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp110_); g_object_ref_sink (_tmp111_); checkBox = _tmp111_; _tmp112_ = checkBox; _tmp113_ = task_is_done; gtk_toggle_button_set_active ((GtkToggleButton*) _tmp112_, _tmp113_); _tmp114_ = checkBox; gtk_widget_set_has_tooltip ((GtkWidget*) _tmp114_, TRUE); _tmp115_ = checkBox; g_signal_connect_data ((GtkWidget*) _tmp115_, "query-tooltip", (GCallback) ____lambda4__gtk_widget_query_tooltip, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0); _tmp116_ = self->tasks; _tmp117_ = task; _tmp118_ = checkBox; gee_abstract_map_set ((GeeAbstractMap*) _tmp116_, _tmp117_, _tmp118_); _tmp119_ = self->_tasks_box; _tmp120_ = checkBox; gtk_box_pack_start (_tmp119_, (GtkWidget*) _tmp120_, TRUE, TRUE, (guint) 0); _tmp121_ = task_index; task_index = _tmp121_ + 1; _g_object_unref0 (checkBox); _g_object_unref0 (task); _g_date_time_unref0 (task_date); _g_free0 (task_name); block5_data_unref (_data5_); _data5_ = NULL; } _tmp122_ = self->_top_box1; gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp122_, 25, 20); _tmp123_ = self->_top_box2; gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp123_, 20, 40); _tmp124_ = self->_tasks_box; gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp124_, 20, 100); _tmp125_ = the_longest_task; g_object_set ((GtkLayout*) self, "width", 65 + (_tmp125_ * 7), NULL); _tmp126_ = self->tasks; _tmp127_ = gee_abstract_map_get_values ((GeeMap*) _tmp126_); _tmp128_ = _tmp127_; _tmp129_ = _tmp128_; _tmp130_ = gee_collection_get_size (_tmp129_); _tmp131_ = _tmp130_; g_object_set ((GtkLayout*) self, "height", (guint) (100 + (_tmp131_ * 30)), NULL); _g_object_unref0 (_tmp129_); gtk_widget_show_all ((GtkWidget*) self); _tmp132_ = self->new_task_entry; g_signal_connect_data (_tmp132_, "icon-press", (GCallback) ___lambda5__gtk_entry_icon_press, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0); _tmp133_ = self->tasks; _tmp134_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) _tmp133_); map_iterator = _tmp134_; while (TRUE) { Block6Data* _data6_; GeeMapIterator* _tmp135_ = NULL; gboolean _tmp136_ = FALSE; GeeMapIterator* _tmp137_ = NULL; gpointer _tmp138_ = NULL; GeeMapIterator* _tmp139_ = NULL; gpointer _tmp140_ = NULL; GtkCheckButton* _tmp141_ = NULL; _data6_ = g_slice_new0 (Block6Data); _data6_->_ref_count_ = 1; _data6_->_data4_ = block4_data_ref (_data4_); _tmp135_ = map_iterator; _tmp136_ = gee_map_iterator_next (_tmp135_); if (!_tmp136_) { block6_data_unref (_data6_); _data6_ = NULL; break; } _tmp137_ = map_iterator; _tmp138_ = gee_map_iterator_get_value (_tmp137_); _data6_->checkBox = (GtkCheckButton*) _tmp138_; _tmp139_ = map_iterator; _tmp140_ = gee_map_iterator_get_key (_tmp139_); _data6_->task = (YatlaTask*) _tmp140_; _tmp141_ = _data6_->checkBox; g_signal_connect_data ((GObject*) _tmp141_, "notify::active", (GCallback) ____lambda11__g_object_notify, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0); block6_data_unref (_data6_); _data6_ = NULL; } result = TRUE; _g_object_unref0 (map_iterator); block4_data_unref (_data4_); _data4_ = NULL; return result; }
void mathg_my_timer_destroy (mathgMyTimer* self) { _g_date_time_unref0 ((*self).start); _g_date_time_unref0 ((*self).stop); }
static GList* daemon_data_sqlite_data_real_GetLog (DaemonDataIDataAccess* base, const gchar* channel, const gchar* server, GError** error) { DaemonDataSqliteData * self; GList* result = NULL; gchar* _tmp0_; gchar* commandText; sqlite3_stmt* statement = NULL; sqlite3_stmt* _tmp1_ = NULL; gchar* _tmp2_; gchar* _tmp3_; gint _result_; GList* results; GError * _inner_error_ = NULL; self = (DaemonDataSqliteData*) base; g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (server != NULL, NULL); _tmp0_ = g_strdup ("SELECT * FROM Log WHERE Channel = @1 AND Server = @2 ORDER BY Timestam" \ "p DESC LIMIT 50"); commandText = _tmp0_; sqlite3_prepare_v2 (self->priv->_database, commandText, -1, &_tmp1_, NULL); _sqlite3_finalize0 (statement); statement = _tmp1_; _tmp2_ = g_strdup (channel); sqlite3_bind_text (statement, 1, _tmp2_, -1, g_free); _tmp3_ = g_strdup (server); sqlite3_bind_text (statement, 2, _tmp3_, -1, g_free); _result_ = 0; results = NULL; { gboolean _tmp4_; _tmp4_ = TRUE; while (TRUE) { gint _tmp5_; if (!_tmp4_) { if (!(_result_ == SQLITE_ROW)) { break; } } _tmp4_ = FALSE; _tmp5_ = sqlite3_step (statement); _result_ = _tmp5_; switch (_result_) { case SQLITE_DONE: { { break; } } case SQLITE_ROW: { { const gchar* _tmp6_ = NULL; gchar* _tmp7_; gchar* username; const gchar* _tmp8_ = NULL; gchar* _tmp9_; gchar* data; const gchar* _tmp10_ = NULL; gchar* _tmp11_; gchar* eventChannel; const gchar* _tmp12_ = NULL; gchar* _tmp13_; gchar* eventServer; gint64 _tmp14_; GDateTime* _tmp15_ = NULL; GDateTime* timestamp; gint _tmp16_; DaemonDataEventTypes type; DaemonEventsLogEvent* current; DaemonEventsLogEvent* _tmp21_; _tmp6_ = sqlite3_column_text (statement, 0); _tmp7_ = g_strdup (_tmp6_); username = _tmp7_; _tmp8_ = sqlite3_column_text (statement, 1); _tmp9_ = g_strdup (_tmp8_); data = _tmp9_; _tmp10_ = sqlite3_column_text (statement, 2); _tmp11_ = g_strdup (_tmp10_); eventChannel = _tmp11_; _tmp12_ = sqlite3_column_text (statement, 3); _tmp13_ = g_strdup (_tmp12_); eventServer = _tmp13_; _tmp14_ = sqlite3_column_int64 (statement, 4); _tmp15_ = daemon_helpers_date_time_converter_FromUnixTimestamp (_tmp14_); timestamp = _tmp15_; _tmp16_ = sqlite3_column_int (statement, 5); type = (DaemonDataEventTypes) _tmp16_; current = NULL; switch (type) { case DAEMON_DATA_EVENT_TYPES_Joined: { { DaemonEventsStatusEvent* _tmp17_ = NULL; _tmp17_ = daemon_events_status_event_new_WithTimestamp (username, DAEMON_EVENTS_STATUS_CHANGE_Join, eventChannel, eventServer, timestamp); _g_object_unref0 (current); current = (DaemonEventsLogEvent*) _tmp17_; break; } } case DAEMON_DATA_EVENT_TYPES_Left: { { DaemonEventsStatusEvent* _tmp18_ = NULL; _tmp18_ = daemon_events_status_event_new_WithTimestamp (username, DAEMON_EVENTS_STATUS_CHANGE_Leave, eventChannel, eventServer, timestamp); _g_object_unref0 (current); current = (DaemonEventsLogEvent*) _tmp18_; break; } } case DAEMON_DATA_EVENT_TYPES_ChangedName: { { DaemonEventsChangeNameEvent* _tmp19_ = NULL; _tmp19_ = daemon_events_change_name_event_new_WithTimestamp (username, data, eventChannel, eventServer, timestamp); _g_object_unref0 (current); current = (DaemonEventsLogEvent*) _tmp19_; break; } } case DAEMON_DATA_EVENT_TYPES_Message: { { DaemonEventsMessageEvent* _tmp20_ = NULL; _tmp20_ = daemon_events_message_event_new_WithTimestamp (username, data, eventChannel, eventServer, timestamp); _g_object_unref0 (current); current = (DaemonEventsLogEvent*) _tmp20_; break; } } default: break; } _tmp21_ = _g_object_ref0 (current); results = g_list_append (results, _tmp21_); _g_object_unref0 (current); _g_date_time_unref0 (timestamp); _g_free0 (eventServer); _g_free0 (eventChannel); _g_free0 (data); _g_free0 (username); break; } } default: { { const gchar* _tmp22_ = NULL; GError* _tmp23_ = NULL; _tmp22_ = sqlite3_errmsg (self->priv->_database); _tmp23_ = g_error_new_literal (DAEMON_DATA_DATA_ACCESS_ERROR, DAEMON_DATA_DATA_ACCESS_ERROR_ReadError, _tmp22_); _inner_error_ = _tmp23_; if (_inner_error_->domain == DAEMON_DATA_DATA_ACCESS_ERROR) { g_propagate_error (error, _inner_error_); __g_list_free__g_object_unref0_0 (results); _sqlite3_finalize0 (statement); _g_free0 (commandText); return NULL; } else { __g_list_free__g_object_unref0_0 (results); _sqlite3_finalize0 (statement); _g_free0 (commandText); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } } } } } result = results; _sqlite3_finalize0 (statement); _g_free0 (commandText); return result; }
void irc_sq_lite_db_ShowLog (const char* username) { sqlite3* _tmp0_ = NULL; sqlite3* _tmp1_; char* commandText; sqlite3_stmt* statement; sqlite3_stmt* _tmp2_ = NULL; sqlite3_stmt* _tmp3_; gint _result_; GList* results; g_return_if_fail (username != NULL); fprintf (stdout, "Datenbank wird ausgelesen!\n"); sqlite3_open (IRC_SQ_LITE_DB__path, &_tmp0_); irc_sq_lite_db_DataBase = (_tmp1_ = _tmp0_, _sqlite3_close0 (irc_sq_lite_db_DataBase), _tmp1_); commandText = g_strdup ("SELECT * FROM MyLogData WHERE Username = @1 ORDER BY Timestamp DESC LI" \ "MIT 10"); statement = NULL; sqlite3_prepare_v2 (irc_sq_lite_db_DataBase, commandText, -1, &_tmp2_, NULL); statement = (_tmp3_ = _tmp2_, _sqlite3_finalize0 (statement), _tmp3_); sqlite3_bind_text (statement, 1, g_strdup (username), -1, g_free); _result_ = sqlite3_step (statement); results = NULL; while (TRUE) { char* Username; char* MessageContent; char* Channel; char* Server; GDateTime* FromUnixTime; IRCMessage* msg; if (!(_result_ == SQLITE_ROW)) { break; } Username = g_strdup (sqlite3_column_text (statement, 0)); MessageContent = g_strdup (sqlite3_column_text (statement, 1)); Channel = g_strdup (sqlite3_column_text (statement, 2)); Server = g_strdup (sqlite3_column_text (statement, 3)); FromUnixTime = g_date_time_new_from_unix_local (g_ascii_strtoll (sqlite3_column_text (statement, 4), NULL, 0)); msg = irc_message_new (Username, MessageContent, Channel, Server, FromUnixTime); results = g_list_append (results, _irc_message_ref0 (msg)); _result_ = sqlite3_step (statement); _irc_message_unref0 (msg); _g_date_time_unref0 (FromUnixTime); _g_free0 (Server); _g_free0 (Channel); _g_free0 (MessageContent); _g_free0 (Username); } { GList* r_collection; GList* r_it; r_collection = results; for (r_it = r_collection; r_it != NULL; r_it = r_it->next) { IRCMessage* r; r = _irc_message_ref0 ((IRCMessage*) r_it->data); { fprintf (stdout, "%s\n", irc_message_get_MessageContent (r)); _irc_message_unref0 (r); } } } __g_list_free_irc_message_unref0 (results); _sqlite3_finalize0 (statement); _g_free0 (commandText); }