[maemo-commits] [maemo-commits] r17105 - in projects/haf/trunk/totem-pl-parser: . plparse
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jan 12 16:43:29 EET 2009
- Previous message: [maemo-commits] r17104 - in projects/haf/trunk/totem-pl-parser: . plparse
- Next message: [maemo-commits] r17106 - projects/haf/trunk/totem-pl-parser/po
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: ifrade Date: 2009-01-12 16:43:28 +0200 (Mon, 12 Jan 2009) New Revision: 17105 Modified: projects/haf/trunk/totem-pl-parser/ChangeLog projects/haf/trunk/totem-pl-parser/plparse/totem-disc.c projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.c projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.h Log: 2008-11-27 Philip Withnall <philip at tecnocode.co.uk> * plparse/totem-disc.c (cd_cache_new), (cd_cache_open_device), (cd_cache_open_mountpoint): * plparse/totem-pl-parser.c: * plparse/totem-pl-parser.h: Expand API documentation re. error codes; fix g_set_error calls with 0 domain/code; and mention functions which do sync I/O. (Closes: #560495, #560493, #560491) Modified: projects/haf/trunk/totem-pl-parser/ChangeLog =================================================================== --- projects/haf/trunk/totem-pl-parser/ChangeLog 2009-01-12 14:43:27 UTC (rev 17104) +++ projects/haf/trunk/totem-pl-parser/ChangeLog 2009-01-12 14:43:28 UTC (rev 17105) @@ -1,3 +1,12 @@ +2008-11-27 Philip Withnall <philip at tecnocode.co.uk> + + * plparse/totem-disc.c (cd_cache_new), (cd_cache_open_device), + (cd_cache_open_mountpoint): + * plparse/totem-pl-parser.c: + * plparse/totem-pl-parser.h: Expand API documentation re. error codes; + fix g_set_error calls with 0 domain/code; and mention functions which + do sync I/O. (Closes: #560495, #560493, #560491) + 2008-11-13 Bastien Nocera <hadess at hadess.net> * plparse/totem-pl-parser.c Modified: projects/haf/trunk/totem-pl-parser/plparse/totem-disc.c =================================================================== --- projects/haf/trunk/totem-pl-parser/plparse/totem-disc.c 2009-01-12 14:43:27 UTC (rev 17104) +++ projects/haf/trunk/totem-pl-parser/plparse/totem-disc.c 2009-01-12 14:43:28 UTC (rev 17105) @@ -315,8 +315,8 @@ if (data.error) { g_propagate_error (error, data.error); } else { - g_set_error (error, 0, 0, - _("Failed to mount %s"), cache->device); + g_set_error (error, TOTEM_PL_PARSER_ERROR, TOTEM_PL_PARSER_ERROR_MOUNT_FAILED, + _("Failed to mount %s."), cache->device); } cd_cache_free (cache); return FALSE; @@ -345,8 +345,8 @@ mon = g_volume_monitor_get (); found = cd_cache_get_dev_from_volumes (mon, device, &mountpoint, &volume); if (!found) { - g_set_error (error, 0, 0, - _("No media in drive for device '%s'"), + g_set_error (error, TOTEM_PL_PARSER_ERROR, TOTEM_PL_PARSER_ERROR_NO_DISC, + _("No media in drive for device '%s'."), device); g_free (device); return NULL; @@ -399,7 +399,7 @@ } if (cd_cache_has_medium (cache) == FALSE) { - g_set_error (error, 0, 0, + g_set_error (error, TOTEM_PL_PARSER_ERROR, TOTEM_PL_PARSER_ERROR_NO_DISC, _("Please check that a disc is present in the drive.")); return FALSE; } @@ -456,8 +456,8 @@ if (data.error) { g_propagate_error (error, data.error); } else { - g_set_error (error, 0, 0, - _("Failed to mount %s"), cache->device); + g_set_error (error, TOTEM_PL_PARSER_ERROR, TOTEM_PL_PARSER_ERROR_MOUNT_FAILED, + _("Failed to mount %s."), cache->device); } return FALSE; } else { @@ -628,6 +628,14 @@ * a string pointer is passed to @url, it will return the disc's * MRL as from totem_cd_mrl_from_type(). * + * Note that this function does synchronous I/O. + * + * If no disc is present in the drive, a #TOTEM_PL_PARSER_ERROR_NO_DISC + * error will be returned. On unknown mounting errors, a + * #TOTEM_PL_PARSER_ERROR_MOUNT_FAILED error will be returned. On other + * I/O errors, or if resolution of symlinked mount paths failed, a code from + * #GIOErrorEnum will be returned. + * * Return value: #TotemDiscMediaType corresponding to the disc's type, or #MEDIA_TYPE_ERROR on failure **/ TotemDiscMediaType @@ -688,6 +696,10 @@ * a string pointer is passed to @url, it will return the disc's * MRL as from totem_cd_mrl_from_type(). * + * Note that this function does synchronous I/O. + * + * Possible error codes are as per totem_cd_detect_type_from_dir(). + * * Return value: #TotemDiscMediaType corresponding to the disc's type, or #MEDIA_TYPE_ERROR on failure **/ TotemDiscMediaType @@ -779,6 +791,8 @@ * * Detects the disc's type, given its device node path. * + * Possible error codes are as per totem_cd_detect_type_with_url(). + * * Return value: #TotemDiscMediaType corresponding to the disc's type, or #MEDIA_TYPE_ERROR on failure **/ TotemDiscMediaType Modified: projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.c =================================================================== --- projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.c 2009-01-12 14:43:27 UTC (rev 17104) +++ projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.c 2009-01-12 14:43:28 UTC (rev 17105) @@ -750,6 +750,7 @@ * @error: return location for a #GError, or %NULL * * Writes the string @buf out to the file specified by @handle. + * Possible error codes are as per totem_pl_parser_write_buffer(). * * Return value: %TRUE on success **/ @@ -771,6 +772,8 @@ * * Writes @len bytes of @buf to the file specified by @handle. * + * A value of @len greater than #G_MAXSSIZE will cause a #G_IO_ERROR_INVALID_ARGUMENT argument. + * * Return value: %TRUE on success **/ gboolean @@ -870,6 +873,20 @@ * @user_data), which gets various metadata values about the entry for * the playlist writer. * + * If the @output file is a directory the #G_IO_ERROR_IS_DIRECTORY error + * will be returned, and if the file is some other form of non-regular file + * then a #G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some file + * systems don't allow all file names, and may return a + * #G_IO_ERROR_INVALID_FILENAME error, and if the name is too long, + * #G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible + * too, and depend on what kind of filesystem the file is on. + * + * In extreme cases, a #G_IO_ERROR_INVALID_ARGUMENT error can be returned, if + * parts of the playlist to be written are too long. + * + * If writing a PLA playlist and there is an error converting a URI's encoding, + * a code from #GConvertError will be returned. + * * Return value: %TRUE on success **/ gboolean @@ -926,6 +943,8 @@ * @user_data), which gets various metadata values about the entry for * the playlist writer. * + * Possible error codes are as per totem_pl_parser_write_with_title(). + * * Return value: %TRUE on success **/ gboolean Modified: projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.h =================================================================== --- projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.h 2009-01-12 14:43:27 UTC (rev 17104) +++ projects/haf/trunk/totem-pl-parser/plparse/totem-pl-parser.h 2009-01-12 14:43:28 UTC (rev 17105) @@ -288,6 +288,8 @@ * TotemPlParserError: * @TOTEM_PL_PARSER_ERROR_VFS_OPEN: Error on opening a file * @TOTEM_PL_PARSER_ERROR_VFS_WRITE: Error on writing a file + * @TOTEM_PL_PARSER_ERROR_NO_DISC: Error attempting to open a disc device when no disc is present + * @TOTEM_PL_PARSER_ERROR_MOUNT_FAILED: An attempted mount operation failed * * Allows you to differentiate between different * errors occurring during file operations in a #TotemPlParser. @@ -296,6 +298,8 @@ { TOTEM_PL_PARSER_ERROR_VFS_OPEN, TOTEM_PL_PARSER_ERROR_VFS_WRITE, + TOTEM_PL_PARSER_ERROR_NO_DISC, + TOTEM_PL_PARSER_ERROR_MOUNT_FAILED } TotemPlParserError; #define TOTEM_PL_PARSER_ERROR (totem_pl_parser_error_quark ())
- Previous message: [maemo-commits] r17104 - in projects/haf/trunk/totem-pl-parser: . plparse
- Next message: [maemo-commits] r17106 - projects/haf/trunk/totem-pl-parser/po
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]