Commit 63d4a318 authored by Darin Adler's avatar Darin Adler
Browse files

A little more desktop window work.

	* src/nautilus-desktop-window.c:
	(nautilus_desktop_window_initialize_class),
	(nautilus_desktop_window_initialize),
	(nautilus_desktop_window_new):
	* src/nautilus-desktop-window.h:
	* src/ntl-app.c: (nautilus_app_startup), (nautilus_app_quit),
	(nautilus_app_create_window):
	* src/ntl-app.h:
	* src/ntl-main.c: (main):
	Made a desktop window that's created when you start the program
	if you pass the --desktop option. At the moment it's a normal
	window and not set up to take over the desktop.

	* libnautilus-extensions/nautilus-glib-extensions.c:
	(nautilus_self_check_glib_extensions): Fixed some broken self-
	checks. Now we have one really broken self-check in the
	nautilus-directory.c file. I might turn that one off soon so we
	can at least run the others.

	* libnautilus-extensions/nautilus-gtk-macros.h:
	Changed how some of the macros work. Few of these macros were used
	in Nautilus. I hope they aren't used in the Mozilla component,
	because then I broke it.

	* libnautilus-extensions/nautilus-list-column-title.c:
	(nautilus_list_column_title_motion),
	(nautilus_list_column_title_button_press),
	(nautilus_list_column_title_button_release):
	Updated to use NAUTILUS_INVOKE_METHOD instead of NAUTILUS_KLASS,
	because I renamed it to NAUTILUS_CLASS and had to change these
	anyway.

	A little sweep for code that should be using
	CORBA_Object_is_nil instead of direct compares with
	CORBA_OBJECT_NIL.

	* components/html/main.c: (url_requested_cb):
	* libnautilus-extensions/bonobo-stream-vfs.c:
	(bonobo_stream_create):
	* libnautilus/nautilus-undo-manager.c:
	(set_up_bonobo_control):
	* libnautilus/nautilus-undoable.c: (nautilus_undo_register_full),
	(nautilus_undo_unregister), (nautilus_undo):
	* src/file-manager/dfos.c: (dfos_new):
	Switch to use CORBA_Object_is_nil.

	* libnautilus/nautilus-undo-manager.c: (undo_manager_unref),
	(nautilus_attach_undo_manager), (nautilus_share_undo_manager),
	(set_up_bonobo_control):
	Do some missing duplicate and release calls.

	* libnautilus/nautilus-undoable.c: (nautilus_undo_unregister):
	Fix a place where we'd keep a reference to a freed list.
	Change O(n^2) walk of list by index to O(n) walk by pointer.

	* src/ntl-index-panel.c: (nautilus_index_panel_remove_meta_view):
	Changed g_warning to a g_return_if_fail, which was designed for
	cases just like this one.

	* src/ntl-view-bonobo-subdoc.c:
	(bonobo_subdoc_notify_location_change):
	Put in a better version of the FIXME.

	* RENAMING: More updates.
parent 7f5aef64
2000-05-26 Darin Adler <darin@eazel.com>
A little more desktop window work.
* src/nautilus-desktop-window.c:
(nautilus_desktop_window_initialize_class),
(nautilus_desktop_window_initialize),
(nautilus_desktop_window_new):
* src/nautilus-desktop-window.h:
* src/ntl-app.c: (nautilus_app_startup), (nautilus_app_quit),
(nautilus_app_create_window):
* src/ntl-app.h:
* src/ntl-main.c: (main):
Made a desktop window that's created when you start the program
if you pass the --desktop option. At the moment it's a normal
window and not set up to take over the desktop.
* libnautilus-extensions/nautilus-glib-extensions.c:
(nautilus_self_check_glib_extensions): Fixed some broken self-
checks. Now we have one really broken self-check in the
nautilus-directory.c file. I might turn that one off soon so we
can at least run the others.
* libnautilus-extensions/nautilus-gtk-macros.h:
Changed how some of the macros work. Few of these macros were used
in Nautilus. I hope they aren't used in the Mozilla component,
because then I broke it.
* libnautilus-extensions/nautilus-list-column-title.c:
(nautilus_list_column_title_motion),
(nautilus_list_column_title_button_press),
(nautilus_list_column_title_button_release):
Updated to use NAUTILUS_INVOKE_METHOD instead of NAUTILUS_KLASS,
because I renamed it to NAUTILUS_CLASS and had to change these
anyway.
A little sweep for code that should be using
CORBA_Object_is_nil instead of direct compares with
CORBA_OBJECT_NIL.
* components/html/main.c: (url_requested_cb):
* libnautilus-extensions/bonobo-stream-vfs.c:
(bonobo_stream_create):
* libnautilus/nautilus-undo-manager.c:
(set_up_bonobo_control):
* libnautilus/nautilus-undoable.c: (nautilus_undo_register_full),
(nautilus_undo_unregister), (nautilus_undo):
* src/file-manager/dfos.c: (dfos_new):
Switch to use CORBA_Object_is_nil.
* libnautilus/nautilus-undo-manager.c: (undo_manager_unref),
(nautilus_attach_undo_manager), (nautilus_share_undo_manager),
(set_up_bonobo_control):
Do some missing duplicate and release calls.
* libnautilus/nautilus-undoable.c: (nautilus_undo_unregister):
Fix a place where we'd keep a reference to a freed list.
Change O(n^2) walk of list by index to O(n) walk by pointer.
* src/ntl-index-panel.c: (nautilus_index_panel_remove_meta_view):
Changed g_warning to a g_return_if_fail, which was designed for
cases just like this one.
* src/ntl-view-bonobo-subdoc.c:
(bonobo_subdoc_notify_location_change):
Put in a better version of the FIXME.
* RENAMING: More updates.
2000-05-26 Ramiro Estrugo <ramiro@eazel.com>
Add support for toggling sidebar panels on the fly via the
......@@ -48,7 +117,6 @@
2000-05-26 Ramiro Estrugo <ramiro@eazel.com>
* src/ntl-index-panel.c: (nautilus_index_panel_remove_meta_view):
Remove the tab associated with meta view as well. Add a warning
for the case when the page_num is bogus. Perhaps this should be
an assertion. But at least this way it wont fail silently.
......
......@@ -48,13 +48,15 @@ classes and other data types
----------------------------
*IndexPanel* -> *Sidebar*
*MetaView* -> *SidebarPanel*
GtkScrollFrame -> NautilusScrollFrame
NavigationRequestInfo -> NavigationRequest
NavigationInfo -> Location
SelectionInfo -> Selection
SelectionRequestInfo -> SelectionRequest
StatusRequestInfo -> Status (or StatusRequest)
NautilusApp -> NautilusApplication
--------------
function names
--------------
nautilus_index_panel_add_meta_view -> nautilus_sidebar_add_panel
nautilus_index_panel_remove_meta_view -> nautilus_sidebar_remove_panel
......@@ -316,6 +316,7 @@ bonobo_stream_create (GnomeVFSHandle *fd)
{
BonoboStreamVFS *stream_vfs;
Bonobo_Stream corba_stream;
CORBA_Environment ev;
stream_vfs = gtk_type_new (bonobo_stream_vfs_get_type ());
if (stream_vfs == NULL)
......@@ -326,10 +327,15 @@ bonobo_stream_create (GnomeVFSHandle *fd)
corba_stream = create_bonobo_stream_vfs (
BONOBO_OBJECT (stream_vfs));
if (corba_stream == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (stream_vfs));
CORBA_exception_init (&ev);
if (CORBA_Object_is_nil (corba_stream, &ev)){
gtk_object_unref (GTK_OBJECT (stream_vfs));
CORBA_exception_free (&ev);
return NULL;
}
CORBA_exception_free (&ev);
return bonobo_stream_vfs_construct (stream_vfs, corba_stream);
}
......
......@@ -280,7 +280,7 @@ url_requested_cb (GtkHTML *html,
CORBA_exception_free (&ev);
return;
}
if (loader == CORBA_OBJECT_NIL) {
if (CORBA_Object_is_nil (loader, &ev)) {
g_warning ("Our client site does not support Bonobo::ProgressiveLoader!");
CORBA_exception_free (&ev);
return;
......
......@@ -316,6 +316,7 @@ bonobo_stream_create (GnomeVFSHandle *fd)
{
BonoboStreamVFS *stream_vfs;
Bonobo_Stream corba_stream;
CORBA_Environment ev;
stream_vfs = gtk_type_new (bonobo_stream_vfs_get_type ());
if (stream_vfs == NULL)
......@@ -326,10 +327,15 @@ bonobo_stream_create (GnomeVFSHandle *fd)
corba_stream = create_bonobo_stream_vfs (
BONOBO_OBJECT (stream_vfs));
if (corba_stream == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (stream_vfs));
CORBA_exception_init (&ev);
if (CORBA_Object_is_nil (corba_stream, &ev)){
gtk_object_unref (GTK_OBJECT (stream_vfs));
CORBA_exception_free (&ev);
return NULL;
}
CORBA_exception_free (&ev);
return bonobo_stream_vfs_construct (stream_vfs, corba_stream);
}
......
......@@ -565,7 +565,7 @@ nautilus_self_check_glib_extensions (void)
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
gint64 time1, time2;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
......@@ -578,41 +578,42 @@ nautilus_self_check_glib_extensions (void)
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, "five"), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, ""), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, "o"), -1);
g_strfreev (strv);
/* nautilus_get_system_time */
NAUTILUS_CHECK_BOOLEAN_RESULT ((nautilus_get_system_time () - nautilus_get_system_time ()) > -1000LL, TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT ((nautilus_get_system_time () - nautilus_get_system_time ()) < 0LL, TRUE);
g_strfreev (strv);
time1 = nautilus_get_system_time ();
time2 = nautilus_get_system_time ();
NAUTILUS_CHECK_BOOLEAN_RESULT (time1 - time2 > -1000, TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (time1 - time2 <= 0, TRUE);
/* nautilus_g_str_list_equal */
/* We g_strdup because identical string constants can be shared. */
compare_list_1 = NULL;
compare_list_1 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_1 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_1 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("Apple"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("zebra"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("!@#!@$#@$!"));
compare_list_2 = NULL;
compare_list_2 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_2 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_2 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("Apple"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("zebra"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("!@#!@$#@$!"));
compare_list_3 = NULL;
compare_list_3 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_3 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_3 = g_list_append (compare_list_3, g_strdup ("Apple"));
compare_list_3 = g_list_append (compare_list_3, g_strdup ("zebra"));
compare_list_4 = NULL;
compare_list_4 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("foobar"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("Apple"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("zebra"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("!@#!@$#@$!"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("foobar"));
compare_list_5 = NULL;
compare_list_5 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_5 = g_list_append (list_to_partition, g_strdup ("zzzzzebraaaaaa"));
compare_list_5 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("Apple"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("zzzzzebraaaaaa"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("!@#!@$#@$!"));
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (compare_list_1, compare_list_2), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (compare_list_1, compare_list_3), FALSE);
......@@ -635,25 +636,26 @@ nautilus_self_check_glib_extensions (void)
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (list_to_partition, "Cadillac");
expected_passed = g_list_append (list_to_partition, "Ford");
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (list_to_partition, "Pontiac");
expected_failed = g_list_append (list_to_partition, "Range Rover");
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_failed, actual_failed), TRUE);
nautilus_g_list_free_deep (expected_passed);
nautilus_g_list_free_deep (actual_passed);
nautilus_g_list_free_deep (expected_failed);
nautilus_g_list_free_deep (actual_failed);
g_list_free (list_to_partition);
g_list_free (expected_passed);
g_list_free (actual_passed);
g_list_free (expected_failed);
g_list_free (actual_failed);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
......@@ -30,7 +30,7 @@
Since this is boilerplate, it's better not to repeat it over and over again.
Called like this:
NAUTILUS_DEFINE_CLASS_BOILERPLATE(NautilusBookmark, nautilus_bookmark, GTK_TYPE_OBJECT)
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusBookmark, nautilus_bookmark, GTK_TYPE_OBJECT)
The parent_class_type parameter is guaranteed to be evaluated only once
so it can be an expression, even an expression that contains a function call.
......@@ -78,8 +78,6 @@ class_name_in_function_format##_get_type (void) \
? 0 \
: ((* parent_class_cast_macro (parent_class)->signal) parameters)
#ifndef G_DISABLE_ASSERT
/* Define a signal that is not implemented by this class but must be
......@@ -110,47 +108,31 @@ class_name_in_function_format##_unimplemented_##signal (void) \
g_warning ("failed to override signal " #class_name_in_function_format "->" #signal); \
}
#else
#else /* G_DISABLE_ASSERT */
#define NAUTILUS_DEFINE_MUST_OVERRIDE_SIGNAL(class_cast_macro, class_pointer, class_name_in_function_format, signal)
#define NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL(class_name_in_function_format, signal)
#endif /* G_DISABLE_ASSERT */
/* Access the class for a given object. */
#define NAUTILUS_CLASS(object) (GTK_OBJECT (object)->klass)
/*
* Access the class for a given object
*/
#define NAUTILUS_KLASS(obj) \
(GTK_OBJECT (obj)->klass)
/* Access a method. */
#define NAUTILUS_ACCESS_METHOD(class_cast_macro, object, method) \
(class_cast_macro (NAUTILUS_CLASS (object))->method)
/*
* Invoke a method for a given object
*/
#define NAUTILUS_INVOKE_METHOD(obj, gtk_type, structure, method) \
(*(GTK_CHECK_CLASS_CAST ((NAUTILUS_KLASS (obj)), gtk_type, structure)) -> method)
/* Invoke a method for a given object. */
#define NAUTILUS_INVOKE_METHOD(class_cast_macro, object, method, parameters) \
((* NAUTILUS_ACCESS_METHOD (class_cast_macro, object, method)) parameters)
/*
* Access a method.
*/
#define NAUTILUS_ACCESS_METHOD(obj, gtk_type, structure, method) \
((GTK_CHECK_CLASS_CAST ((NAUTILUS_KLASS (obj)), gtk_type, structure)) -> method)
/* Assert the non-nullness of a method for a given object. */
#define NAUTILUS_ASSERT_METHOD(class_cast_macro, object, method) \
g_assert (NAUTILUS_ACCESS_METHOD (class_cast_macro, object, method) != NULL)
/*
* Assert the non-nullness of a method for a given object
*/
#ifndef G_DISABLE_ASSERT
#define NAUTILUS_ASSERT_METHOD(obj, gtk_type, structure, method) \
g_assert (((GTK_CHECK_CLASS_CAST ((NAUTILUS_KLASS (obj)), gtk_type, structure)) -> method) != NULL)
#else
#define NAUTILUS_ASSERT_METHOD(obj, gtk_type, structure, method)
#endif
/*
* Invoke a method if it aint null.
*/
#define NAUTILUS_INVOKE_METHOD_IF(obj, gtk_type, structure, method) \
if (NAUTILUS_ACCESS_METHOD (obj, gtk_type, structure, method)) \
NAUTILUS_INVOKE_METHOD (obj, gtk_type, structure, method)
/* Invoke a method if it ain't null. */
#define NAUTILUS_INVOKE_METHOD_IF(class_cast_macro, object, method, parameters) \
(NAUTILUS_ACCESS_METHOD (class_cast_macro, object, method) ? 0 : \
NAUTILUS_INVOKE_METHOD (class_cast_macro, object, method, parameters))
#endif /* NAUTILUS_GTK_MACROS_H */
......@@ -747,9 +747,10 @@ nautilus_list_column_title_motion (GtkWidget *widget, GdkEventMotion *event)
if (column_title->details->last_tracking_x != mouse_x) {
/* mouse did move horizontally since last time */
column_title->details->last_tracking_x = mouse_x;
(NAUTILUS_LIST_CLASS (NAUTILUS_KLASS (parent_list)))->
column_resize_track (parent_list,
column_title->details->tracking_column_resize);
NAUTILUS_INVOKE_METHOD
(NAUTILUS_LIST_CLASS, parent_list,
column_resize_track,
(parent_list, column_title->details->tracking_column_resize));
title_update_needed = TRUE;
}
} else {
......@@ -848,8 +849,10 @@ nautilus_list_column_title_button_press (GtkWidget *widget, GdkEventButton *even
gtk_widget_set_state (widget, GTK_STATE_NORMAL);
/* start column resize tracking */
(NAUTILUS_LIST_CLASS (NAUTILUS_KLASS (parent_list)))->
column_resize_track_start (parent_list, resized_column);
NAUTILUS_INVOKE_METHOD
(NAUTILUS_LIST_CLASS, parent_list,
column_resize_track_start,
(parent_list, resized_column));
return FALSE;
}
......@@ -903,9 +906,10 @@ nautilus_list_column_title_button_release (GtkWidget *widget, GdkEventButton *ev
if (column_title->details->tracking_column_resize != -1) {
/* end column resize tracking */
(NAUTILUS_LIST_CLASS (NAUTILUS_KLASS (parent_list)))->
column_resize_track_end (parent_list,
column_title->details->tracking_column_resize);
NAUTILUS_INVOKE_METHOD
(NAUTILUS_LIST_CLASS, parent_list,
column_resize_track_end,
(parent_list, column_title->details->tracking_column_resize));
column_title->details->tracking_column_resize = -1;
} else if (column_title->details->tracking_column_press != -1) {
......
......@@ -325,6 +325,7 @@ nautilus_undo_manager_add_transaction (NautilusUndoManager *manager,
g_return_if_fail (transaction != CORBA_OBJECT_NIL);
CORBA_exception_init (&ev);
/* Check and see if we are over our queue limit */
length = g_list_length (manager->details->undo_list);
if (length >= manager->details->queue_depth) {
......@@ -579,6 +580,7 @@ undo_manager_unref (gpointer manager)
CORBA_exception_init (&ev);
Nautilus_Undo_Manager_unref (manager, &ev);
CORBA_Object_release (manager, &ev);
CORBA_exception_free (&ev);
}
......@@ -587,6 +589,7 @@ nautilus_attach_undo_manager (GtkObject *object,
Nautilus_Undo_Manager manager)
{
CORBA_Environment ev;
Nautilus_Undo_Manager stored_manager;
g_return_if_fail (GTK_IS_OBJECT (object));
......@@ -597,10 +600,12 @@ nautilus_attach_undo_manager (GtkObject *object,
CORBA_exception_init (&ev);
Nautilus_Undo_Manager_ref (manager, &ev);
stored_manager = CORBA_Object_duplicate (manager, &ev);
CORBA_exception_free (&ev);
gtk_object_set_data_full
(object, "Nautilus undo",
manager, undo_manager_unref);
stored_manager, undo_manager_unref);
}
/* This is useful because nautilus_get_undo_manager will be
......@@ -610,9 +615,16 @@ void
nautilus_share_undo_manager (GtkObject *destination_object,
GtkObject *source_object)
{
Nautilus_Undo_Manager manager;
CORBA_Environment ev;
manager = nautilus_get_undo_manager (source_object);
nautilus_attach_undo_manager
(destination_object,
nautilus_get_undo_manager (source_object));
(destination_object, manager);
CORBA_exception_init (&ev);
CORBA_Object_release (manager, &ev);
CORBA_exception_free (&ev);
}
/* Locates an undo manager for this bonobo control.
......@@ -633,21 +645,26 @@ set_up_bonobo_control (BonoboControl *control)
manager = CORBA_OBJECT_NIL;
CORBA_exception_init (&ev);
/* Find the undo manager. */
control_frame = bonobo_control_get_control_frame (control);
if (control_frame != CORBA_OBJECT_NIL) {
CORBA_exception_init (&ev);
if (!CORBA_Object_is_nil (control_frame, &ev)) {
undo_context = Bonobo_Control_query_interface
(control_frame, "IDL:Nautilus/Undo/Context:1.0", &ev);
if (undo_context != CORBA_OBJECT_NIL) {
if (!CORBA_Object_is_nil (undo_context, &ev)) {
manager = Nautilus_Undo_Context__get_undo_manager (undo_context, &ev);
}
CORBA_exception_free (&ev);
CORBA_Object_release (undo_context, &ev);
}
CORBA_Object_release (control_frame, &ev);
/* Attach the undo manager to the widget, or detach the old one. */
widget = bonobo_control_get_widget (control);
nautilus_attach_undo_manager (GTK_OBJECT (widget), manager);
CORBA_Object_release (manager, &ev);
CORBA_exception_free (&ev);
}
void
......
......@@ -316,6 +316,7 @@ bonobo_stream_create (GnomeVFSHandle *fd)
{
BonoboStreamVFS *stream_vfs;
Bonobo_Stream corba_stream;
CORBA_Environment ev;
stream_vfs = gtk_type_new (bonobo_stream_vfs_get_type ());
if (stream_vfs == NULL)
......@@ -326,10 +327,15 @@ bonobo_stream_create (GnomeVFSHandle *fd)
corba_stream = create_bonobo_stream_vfs (
BONOBO_OBJECT (stream_vfs));
if (corba_stream == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (stream_vfs));
CORBA_exception_init (&ev);
if (CORBA_Object_is_nil (corba_stream, &ev)){
gtk_object_unref (GTK_OBJECT (stream_vfs));
CORBA_exception_free (&ev);
return NULL;
}
CORBA_exception_free (&ev);
return bonobo_stream_vfs_construct (stream_vfs, corba_stream);
}
......
......@@ -565,7 +565,7 @@ nautilus_self_check_glib_extensions (void)
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
gint64 time1, time2;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
......@@ -578,41 +578,42 @@ nautilus_self_check_glib_extensions (void)
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, "five"), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, ""), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strv_find (strv, "o"), -1);
g_strfreev (strv);
/* nautilus_get_system_time */
NAUTILUS_CHECK_BOOLEAN_RESULT ((nautilus_get_system_time () - nautilus_get_system_time ()) > -1000LL, TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT ((nautilus_get_system_time () - nautilus_get_system_time ()) < 0LL, TRUE);
g_strfreev (strv);
time1 = nautilus_get_system_time ();
time2 = nautilus_get_system_time ();
NAUTILUS_CHECK_BOOLEAN_RESULT (time1 - time2 > -1000, TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (time1 - time2 <= 0, TRUE);
/* nautilus_g_str_list_equal */
/* We g_strdup because identical string constants can be shared. */
compare_list_1 = NULL;
compare_list_1 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_1 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_1 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("Apple"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("zebra"));
compare_list_1 = g_list_append (compare_list_1, g_strdup ("!@#!@$#@$!"));
compare_list_2 = NULL;
compare_list_2 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_2 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_2 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("Apple"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("zebra"));
compare_list_2 = g_list_append (compare_list_2, g_strdup ("!@#!@$#@$!"));
compare_list_3 = NULL;
compare_list_3 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_3 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_3 = g_list_append (compare_list_3, g_strdup ("Apple"));
compare_list_3 = g_list_append (compare_list_3, g_strdup ("zebra"));
compare_list_4 = NULL;
compare_list_4 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("zebra"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_4 = g_list_append (list_to_partition, g_strdup ("foobar"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("Apple"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("zebra"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("!@#!@$#@$!"));
compare_list_4 = g_list_append (compare_list_4, g_strdup ("foobar"));
compare_list_5 = NULL;
compare_list_5 = g_list_append (list_to_partition, g_strdup ("Apple"));
compare_list_5 = g_list_append (list_to_partition, g_strdup ("zzzzzebraaaaaa"));
compare_list_5 = g_list_append (list_to_partition, g_strdup ("!@#!@$#@$!"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("Apple"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("zzzzzebraaaaaa"));
compare_list_5 = g_list_append (compare_list_5, g_strdup ("!@#!@$#@$!"));
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (compare_list_1, compare_list_2), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (compare_list_1, compare_list_3), FALSE);
......@@ -635,25 +636,26 @@ nautilus_self_check_glib_extensions (void)
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (list_to_partition, "Cadillac");
expected_passed = g_list_append (list_to_partition, "Ford");
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (list_to_partition, "Pontiac");
expected_failed = g_list_append (list_to_partition, "Range Rover");
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);