Changeset 2171


Ignore:
Timestamp:
06/06/07 11:39:52 (6 years ago)
Author:
njp
Message:

Fix call ordering in history; Clean up journal code for outgoing calls

Location:
trunk/src/target/OM-2007/applications/openmoko-dialer/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c

    r2169 r2171  
    727727} 
    728728 
     729/* Sort two entries by date */ 
     730static gint 
     731sort_by_date (MokoJournalEntry *a, MokoJournalEntry *b) 
     732{ 
     733  const MokoTime *at, *bt; 
     734  time_t ta, tb; 
     735   
     736  at = moko_journal_entry_get_dtstart (a); 
     737  bt = moko_journal_entry_get_dtstart (b); 
     738   
     739  ta = moko_time_as_timet (at); 
     740  tb = moko_time_as_timet (bt); 
     741   
     742  return (gint)difftime (ta, tb); 
     743} 
     744 
    729745 
    730746/** 
     
    750766  int i = 0, j =0, n_entries; 
    751767  MokoJournalEntry *j_entry; 
     768  GList *entries = NULL, *e; 
    752769  //DBG_ENTER(); 
    753770 
     
    834851   
    835852  i = j = 0; 
    836   for (i = 0; i < n_entries && j < HISTORY_MAX_ENTRIES; i++) 
     853  for (i = 0; i < n_entries; i++) 
    837854  { 
    838855    moko_journal_get_entry_at (p_dialer_data->journal, i, &j_entry); 
     
    840857    /* We're not interested in anything other than voice entrys */ 
    841858    if (moko_journal_entry_get_type (j_entry) != VOICE_JOURNAL_ENTRY) 
    842     { 
    843859      continue; 
    844     } 
     860 
     861    entries = g_list_insert_sorted (entries,  
     862                                    (gpointer)j_entry, 
     863                                    (GCompareFunc)sort_by_date); 
     864  } 
     865  for (e = entries; e != NULL && j < HISTORY_MAX_ENTRIES; e = e->next)  
     866  { 
    845867    if (history_add_entry (list_store, j_entry)) 
    846868      j++; 
  • trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c

    r2168 r2171  
    154154  moko_journal_entry_get_voice_info (entry, &info); 
    155155  moko_journal_entry_set_dtstart (entry, moko_time_new_today ()); 
     156  moko_journal_voice_info_set_distant_number (info, number); 
    156157  moko_journal_add_entry (data->journal, entry); 
    157   moko_journal_voice_info_set_distant_number (info, number); 
    158   /* FIXME: We should be able to associate a number with a number, and add that 
    159             info to the entry */ 
     158  /* FIXME: We should be able to associate a number with a contact uid, and  
     159            add that info to the entry */ 
    160160 
    161161  /* connect our handler to track call progress */ 
Note: See TracChangeset for help on using the changeset viewer.