~ubuntu-branches/ubuntu/oneiric/alarm-clock/oneiric

« back to all changes in this revision

Viewing changes to src/alarm_thread.c

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-12-23 11:43:59 UTC
  • mfrom: (1.2.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20091223114359-ovqkh2imhh0ehmt7
* update watch file
* New Upstream Version (Closes: #558591)
* remove the gtk-builder-proper-error-handling patch, fixed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
319
319
        GtkTreeIter iter;
320
320
        gchar *name;
321
321
        count = 0;
 
322
        gboolean first = TRUE;
322
323
 
323
324
        time ( &rawtime );
324
325
        timeinfo = localtime ( &rawtime );
325
326
        gboolean snoozed;
326
327
 
 
328
        g_get_current_time(&current_time);
327
329
 
328
330
        alarms = g_key_file_get_groups(loaded_alarms, NULL);
329
 
        
330
331
        while(TRUE)
331
332
        {
332
333
        if (alarms[count] == NULL) break;
333
334
                alarm_type = g_key_file_get_string(loaded_alarms, alarms[count], "AlarmType", NULL);
334
335
                snoozed = g_key_file_get_boolean(loaded_alarms, alarms[count], "Snoozed", NULL);
335
 
                
 
336
 
336
337
                if (g_strcmp0(alarm_type, "Single") == 0 || g_strcmp0(alarm_type, "Counter") == 0)
337
338
                {
338
339
                        iso_date = g_key_file_get_string(loaded_alarms, alarms[count], "DateTime", NULL);
343
344
                }
344
345
                else
345
346
                {
346
 
 
 
347
                        g_free(alarm_type);
347
348
                        return;
348
349
                }
349
350
                
350
 
                
351
 
                g_time_val_from_iso8601(iso_date, &alarm_time);
352
 
                g_free(iso_date);
353
 
                iso_date = g_strdup_printf("%i-%i-%iT%i:%i:%i", timeinfo->tm_year + 1900, timeinfo->tm_mon + 1,
354
 
                                                                   timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
355
 
                g_time_val_from_iso8601(iso_date, &current_time);
356
 
                g_free(iso_date);
357
 
 
358
 
 
359
 
 
 
351
                g_time_val_from_iso8601(iso_date, &alarm_time);
 
352
                g_free(iso_date);
 
353
 
 
354
                g_get_current_time(&current_time);
 
355
 
 
356
                iso_date = g_time_val_to_iso8601(&alarm_time);
 
357
                g_time_val_from_iso8601(iso_date, &alarm_time);
 
358
 
 
359
                g_free(iso_date);
360
360
                
361
361
                diff = alarm_time.tv_sec - current_time.tv_sec;
362
362
                gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter);
402
402
                {
403
403
                        manage_old_alarm(alarms[count]);
404
404
                }
405
 
 
406
 
                count++;        
407
 
        }       
 
405
                if (first) {
 
406
                        first = FALSE;
 
407
                        continue;
 
408
                }
 
409
                else {
 
410
                count++; }
 
411
                g_free(alarm_type);
 
412
        }
 
413
        g_strfreev(alarms);
408
414
}
409
415
 
410
416
void
447
453
                g_time_val_from_iso8601(iso_date, &current_time);
448
454
                g_free(iso_date);
449
455
                diff = alarm_time.tv_sec - current_time.tv_sec;
450
 
 
451
456
                count++;        
452
457
        }
453
458
        update_alarm_thread();