phonemgr r315 - in trunk: . libgsm
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: phonemgr r315 - in trunk: . libgsm
- Date: Fri, 20 Jun 2008 13:05:15 +0000 (UTC)
Author: hadess
Date: Fri Jun 20 13:05:15 2008
New Revision: 315
URL: http://svn.gnome.org/viewvc/phonemgr?rev=315&view=rev
Log:
2008-06-20 Bastien Nocera <hadess hadess net>
* libgsm/glibgsmtest.c (main): Print out an error if a delete failed
* libgsm/phonemgr-listener.c (phonemgr_listener_get_data),
(phonemgr_listener_delete_data): Finish implementing _get_data
for calendar data, implement _delete_data for calendar,
Fix retvals for deletion
Modified:
trunk/ChangeLog
trunk/libgsm/glibgsmtest.c
trunk/libgsm/phonemgr-listener.c
Modified: trunk/libgsm/glibgsmtest.c
==============================================================================
--- trunk/libgsm/glibgsmtest.c (original)
+++ trunk/libgsm/glibgsmtest.c Fri Jun 20 13:05:15 2008
@@ -224,13 +224,15 @@
uuid = phonemgr_listener_put_data (listener, type, contents);
if (uuid != NULL) {
- g_print ("Added vCard at location '%s'\n", uuid);
+ g_print ("Added data at location '%s'\n", uuid);
g_free (uuid);
} else {
g_message ("Failed to add data from '%s' to the device", put_card);
}
} else if (delete_uuid != NULL) {
- phonemgr_listener_delete_data (listener, type, delete_uuid);
+ if (phonemgr_listener_delete_data (listener, type, delete_uuid) == FALSE) {
+ g_print ("Failed to delete data at location '%s'\n", delete_uuid);
+ }
} else {
g_message ("Nothing to do!");
}
Modified: trunk/libgsm/phonemgr-listener.c
==============================================================================
--- trunk/libgsm/phonemgr-listener.c (original)
+++ trunk/libgsm/phonemgr-listener.c Fri Jun 20 13:05:15 2008
@@ -1284,12 +1284,11 @@
g_mutex_unlock (l->mutex);
return NULL;
}
- //retval = gn_phonebook2vcardstr (&calnote);
+ retval = gn_calnote2icalstr (&calnote);
g_mutex_unlock (l->mutex);
- return NULL;
- //return retval;
+ return retval;
}
break;
case PHONEMGR_LISTENER_DATA_TODO:
@@ -1440,10 +1439,34 @@
g_mutex_unlock (l->mutex);
- return (error != GN_ERR_NONE);
+ return (error == GN_ERR_NONE);
}
break;
case PHONEMGR_LISTENER_DATA_CALENDAR:
+ {
+ gn_calnote_list calnote_list;
+ gn_calnote calnote;
+ char *memory_type;
+ gn_error error;
+ int index;
+
+ if (phonemgr_listener_parse_data_uuid (dataid, NULL, &index) == FALSE)
+ return FALSE;
+
+ g_mutex_lock (l->mutex);
+
+ memset (&calnote, 0, sizeof (calnote));
+ memset (&calnote_list, 0, sizeof (calnote_list));
+ l->phone_state->data.calnote = &calnote;
+ l->phone_state->data.calnote_list = &calnote_list;
+
+ calnote.location = index;
+ error = phonemgr_listener_gnokii_func (GN_OP_DeleteCalendarNote, l);
+
+ g_mutex_unlock (l->mutex);
+
+ return (error == GN_ERR_NONE);
+ }
break;
case PHONEMGR_LISTENER_DATA_TODO:
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]