Commit e308553c authored by Mathieu Lacage's avatar Mathieu Lacage Committed by Mathieu Lacage
Browse files

Cleans up the HistoryFrame : remove the History object and replaces it

2000-08-18  Mathieu Lacage  <mathieu@eazel.com>


	Cleans up the HistoryFrame : remove the History object
	and replaces it with HistoryList.
	* components/history/nautilus-history-view.c: (get_history_list),
	(history_load_location):
	* libnautilus/nautilus-view-component.idl:
	* src/nautilus-history-frame.c:
	* src/nautilus-view-frame.c:
	(nautilus_view_frame_get_history_list):
	* src/nautilus-view-frame.h:
	* src/nautilus-window.c:
	(nautilus_window_get_history_list_callback):
parent 425ec101
2000-08-18 Mathieu Lacage <mathieu@eazel.com>
Cleans up the HistoryFrame : remove the History object
and replaces it with HistoryList.
* components/history/nautilus-history-view.c: (get_history_list),
(history_load_location):
* libnautilus/nautilus-view-component.idl:
* src/nautilus-history-frame.c:
* src/nautilus-view-frame.c:
(nautilus_view_frame_get_history_list):
* src/nautilus-view-frame.h:
* src/nautilus-window.c:
(nautilus_window_get_history_list_callback):
2000-08-18 John Sullivan <sullivan@eazel.com>
More menu tweaking, including switching over to use
......
......@@ -115,12 +115,12 @@ history_view_update_icons (GtkCList *clist)
}
}
static Nautilus_History *
static Nautilus_HistoryList *
get_history_list (HistoryView *hview)
{
CORBA_Environment ev;
Nautilus_HistoryFrame view_frame;
Nautilus_History *list;
Nautilus_HistoryList *list;
view_frame = history_view_frame_call_begin (hview->view, &ev);
list = Nautilus_HistoryFrame_get_history_list (view_frame, &ev);
......@@ -131,14 +131,14 @@ get_history_list (HistoryView *hview)
static void
history_load_location (NautilusView *view,
const char *location,
HistoryView *hview)
const char *location,
HistoryView *hview)
{
char *cols[HISTORY_VIEW_COLUMN_COUNT];
int new_rownum;
GtkCList *clist;
NautilusBookmark *bookmark;
Nautilus_History *history;
Nautilus_HistoryList *history_list;
Nautilus_HistoryItem *item;
int i;
......@@ -151,10 +151,10 @@ history_load_location (NautilusView *view,
gtk_clist_clear (clist);
/* Populate with data from main history list */
history = get_history_list (hview);
history_list = get_history_list (hview);
for (i = 0; i < history->list._length; i++) {
item = &history->list._buffer[i];
for (i = 0; i < history_list->_length; i++) {
item = &history_list->_buffer[i];
bookmark = nautilus_bookmark_new (item->location, item->title);
cols[HISTORY_VIEW_COLUMN_ICON] = NULL;
......@@ -172,7 +172,7 @@ history_load_location (NautilusView *view,
gtk_clist_moveto(clist, new_rownum, -1, 0.5, 0.0);
}
}
CORBA_free (history);
CORBA_free (history_list);
gtk_clist_select_row (clist, 0, 0);
......
......@@ -131,10 +131,6 @@ module Nautilus {
URI location;
};
typedef sequence<HistoryItem> HistoryList;
struct History {
HistoryList list;
long position; /* 0 = end of list */
};
/* An interface that a component can use to get at the history
* list stored in Nautilus.
......@@ -143,7 +139,7 @@ module Nautilus {
/* Called by a view component to get the Nautilus
* history list.
*/
History get_history_list ();
HistoryList get_history_list ();
};
};
......
......@@ -35,7 +35,7 @@ typedef struct {
NautilusViewFrame *view;
} impl_POA_Nautilus_HistoryFrame;
static Nautilus_History *impl_Nautilus_HistoryFrame_get_history_list (PortableServer_Servant servant,
static Nautilus_HistoryList *impl_Nautilus_HistoryFrame_get_history_list (PortableServer_Servant servant,
CORBA_Environment *ev);
POA_Nautilus_HistoryFrame__epv impl_Nautilus_HistoryFrame_epv =
......@@ -94,10 +94,12 @@ impl_Nautilus_HistoryFrame__create (NautilusViewFrame *view,
return bonobo_object;
}
static Nautilus_History *
static Nautilus_HistoryList *
impl_Nautilus_HistoryFrame_get_history_list (PortableServer_Servant servant,
CORBA_Environment *ev)
{
return nautilus_view_frame_get_history_list
(((impl_POA_Nautilus_HistoryFrame *)servant)->view);
}
......@@ -1223,11 +1223,10 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
}
static Nautilus_History *
static Nautilus_HistoryList *
nautilus_window_get_history_list_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
Nautilus_History *history;
Nautilus_HistoryList *list;
NautilusBookmark *bookmark;
int length, i;
......@@ -1237,11 +1236,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
/* Get total number of history items */
length = g_list_length (history_list);
history = Nautilus_History__alloc ();
list = &history->list;
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list = Nautilus_HistoryList__alloc ();
list->_length = length;
list->_maximum = length;
......@@ -1262,7 +1257,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
g_free (location);
}
return history;
return list;
}
void
......
......@@ -1223,11 +1223,10 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
}
static Nautilus_History *
static Nautilus_HistoryList *
nautilus_window_get_history_list_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
Nautilus_History *history;
Nautilus_HistoryList *list;
NautilusBookmark *bookmark;
int length, i;
......@@ -1237,11 +1236,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
/* Get total number of history items */
length = g_list_length (history_list);
history = Nautilus_History__alloc ();
list = &history->list;
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list = Nautilus_HistoryList__alloc ();
list->_length = length;
list->_maximum = length;
......@@ -1262,7 +1257,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
g_free (location);
}
return history;
return list;
}
void
......
......@@ -1223,11 +1223,10 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
}
static Nautilus_History *
static Nautilus_HistoryList *
nautilus_window_get_history_list_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
Nautilus_History *history;
Nautilus_HistoryList *list;
NautilusBookmark *bookmark;
int length, i;
......@@ -1237,11 +1236,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
/* Get total number of history items */
length = g_list_length (history_list);
history = Nautilus_History__alloc ();
list = &history->list;
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list = Nautilus_HistoryList__alloc ();
list->_length = length;
list->_maximum = length;
......@@ -1262,7 +1257,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
g_free (location);
}
return history;
return list;
}
void
......
......@@ -836,10 +836,10 @@ nautilus_view_frame_activate (NautilusViewFrame *view)
}
Nautilus_History *
Nautilus_HistoryList *
nautilus_view_frame_get_history_list (NautilusViewFrame *view)
{
Nautilus_History *history_list;
Nautilus_HistoryList *history_list;
g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), NULL);
......
......@@ -109,7 +109,7 @@ typedef struct {
void (* client_gone) (NautilusViewFrame *view);
/* Get a CORBA copy of the history list */
Nautilus_History *
Nautilus_HistoryList *
(* get_history_list) (NautilusViewFrame *view);
} NautilusViewFrameClass;
......@@ -153,6 +153,6 @@ char * nautilus_view_frame_get_label (NautilusViewFrame *
void nautilus_view_frame_set_label (NautilusViewFrame *view,
const char *label);
void nautilus_view_frame_activate (NautilusViewFrame *view);
Nautilus_History * nautilus_view_frame_get_history_list (NautilusViewFrame *view);
Nautilus_HistoryList * nautilus_view_frame_get_history_list (NautilusViewFrame *view);
#endif /* NAUTILUS_VIEW_FRAME_H */
......@@ -1223,11 +1223,10 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
}
static Nautilus_History *
static Nautilus_HistoryList *
nautilus_window_get_history_list_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
Nautilus_History *history;
Nautilus_HistoryList *list;
NautilusBookmark *bookmark;
int length, i;
......@@ -1237,11 +1236,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
/* Get total number of history items */
length = g_list_length (history_list);
history = Nautilus_History__alloc ();
list = &history->list;
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list = Nautilus_HistoryList__alloc ();
list->_length = length;
list->_maximum = length;
......@@ -1262,7 +1257,7 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
g_free (location);
}
return history;
return list;
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment