[rhythmbox] mtp: report out-of-space errors on track upload



commit dd8555ea48db4489b60013a4b18c394255f68037
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon May 31 22:28:06 2010 +1000

    mtp: report out-of-space errors on track upload

 plugins/mtpdevice/rb-mtp-thread.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/mtpdevice/rb-mtp-thread.c b/plugins/mtpdevice/rb-mtp-thread.c
index 02aac6d..9bd4675 100644
--- a/plugins/mtpdevice/rb-mtp-thread.c
+++ b/plugins/mtpdevice/rb-mtp-thread.c
@@ -517,9 +517,15 @@ upload_track (RBMtpThread *thread, RBMtpThreadTask *task)
 	if (LIBMTP_Send_Track_From_File (thread->device, task->filename, task->track, NULL, NULL)) {
 		stack = LIBMTP_Get_Errorstack (thread->device);
 		rb_debug ("unable to send track: %s", stack->error_text);
-		error = g_error_new (RB_MTP_THREAD_ERROR, RB_MTP_THREAD_ERROR_SEND_TRACK,
-				     _("Unable to send file to MTP device: %s"),
-				     stack->error_text);
+
+		if (stack->errornumber == LIBMTP_ERROR_STORAGE_FULL) {
+			error = g_error_new (RB_MTP_THREAD_ERROR, RB_MTP_THREAD_ERROR_NO_SPACE,
+					     _("No space left on MTP device"));
+		} else {
+			error = g_error_new (RB_MTP_THREAD_ERROR, RB_MTP_THREAD_ERROR_SEND_TRACK,
+					     _("Unable to send file to MTP device: %s"),
+					     stack->error_text);
+		}
 		LIBMTP_Clear_Errorstack (thread->device);
 		task->track->item_id = 0;		/* is this actually an invalid item ID? */
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]