Simplify by not using a temporary variable, and clarify the documentation.
2004-03-03 Federico Mena Quintero <federico@ximian.com> * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by not using a temporary variable, and clarify the documentation. Fixes #136008.
This commit is contained in:
committed by
Federico Mena Quintero
parent
3c8e60e7f1
commit
ecb01c42d9
@@ -1,3 +1,9 @@
|
||||
2004-03-03 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by
|
||||
not using a temporary variable, and clarify the documentation.
|
||||
Fixes #136008.
|
||||
|
||||
2004-03-03 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gtk/gtkexpander.c:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2004-03-03 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by
|
||||
not using a temporary variable, and clarify the documentation.
|
||||
Fixes #136008.
|
||||
|
||||
2004-03-03 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gtk/gtkexpander.c:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2004-03-03 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by
|
||||
not using a temporary variable, and clarify the documentation.
|
||||
Fixes #136008.
|
||||
|
||||
2004-03-03 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gtk/gtkexpander.c:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2004-03-03 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by
|
||||
not using a temporary variable, and clarify the documentation.
|
||||
Fixes #136008.
|
||||
|
||||
2004-03-03 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gtk/gtkexpander.c:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2004-03-03 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by
|
||||
not using a temporary variable, and clarify the documentation.
|
||||
Fixes #136008.
|
||||
|
||||
2004-03-03 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gtk/gtkexpander.c:
|
||||
|
||||
@@ -497,12 +497,13 @@ gtk_file_system_volume_render_icon (GtkFileSystem *file_system,
|
||||
* @parent: location to store parent path name
|
||||
* @error: location to store error, or %NULL
|
||||
*
|
||||
* Gets the name of the parent folder of a file.
|
||||
* Gets the name of the parent folder of a path. If the path has no parent, as when
|
||||
* you request the parent of a file system root, then @parent will be set to %NULL.
|
||||
*
|
||||
* Return value: TRUE if the operation was successful; note that in this case @parent
|
||||
* can be returned as %NULL if the base @path has no parent folder (i.e. if it is
|
||||
* already a file system root). If the operation fails, this function returns FALSE
|
||||
* and sets the @error value if it is specified.
|
||||
* Return value: %TRUE if the operation was successful: @parent will be set to
|
||||
* the name of the @path's parent, or to %NULL if @path is already a file system
|
||||
* root. If the operation fails, this function returns %FALSE, sets @parent to
|
||||
* NULL, and sets the @error value if it is specified.
|
||||
**/
|
||||
gboolean
|
||||
gtk_file_system_get_parent (GtkFileSystem *file_system,
|
||||
@@ -510,21 +511,18 @@ gtk_file_system_get_parent (GtkFileSystem *file_system,
|
||||
GtkFilePath **parent,
|
||||
GError **error)
|
||||
{
|
||||
GtkFilePath *tmp_parent = NULL;
|
||||
gboolean result;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_SYSTEM (file_system), FALSE);
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
g_return_val_if_fail (parent != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
result = GTK_FILE_SYSTEM_GET_IFACE (file_system)->get_parent (file_system, path, &tmp_parent, error);
|
||||
g_assert (result || tmp_parent == NULL);
|
||||
*parent = NULL;
|
||||
|
||||
result = GTK_FILE_SYSTEM_GET_IFACE (file_system)->get_parent (file_system, path, parent, error);
|
||||
g_assert (result || *parent == NULL);
|
||||
|
||||
if (parent)
|
||||
*parent = tmp_parent;
|
||||
else
|
||||
gtk_file_path_free (tmp_parent);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user