diff options
author | Darin Adler <darin@src.gnome.org> | 2000-04-03 18:27:22 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-04-03 18:27:22 +0000 |
commit | 2fe15f1645d39857e32adcdb375c93ec1bb2a3ed (patch) | |
tree | 9f371171bbbad091f58f6f7650c38f032ffdc750 /components/rpmview | |
parent | 2ee8f8389a3b49c2894529cdd9b5a2bf60dca6a9 (diff) | |
download | nautilus-2fe15f1645d39857e32adcdb375c93ec1bb2a3ed.tar.gz |
Fix the build. Changes in GtkHtml and Bonobo required us
to catch up.
* libnautilus/ntl-meta-view-frame.h:
* libnautilus/ntl-meta-view-frame.c:
Rewrote to use the new property bag. This requires us to
store our own properties, since the bag no longer provides
any storage.
(nautilus_meta_view_frame_initialize): Set up the label.
(nautilus_meta_view_frame_new_from_bonobo_control): Make it
actually take a BonoboControl instead of a BonoboObject and
make it set up the property bag.
(nautilus_meta_view_destroy): Free the label.
(autilus_meta_view_frame_set_label): Just set the label.
The property bag simply uses our stored label.
* components/html/ntl-web-browser.c (browser_url_load_gone):
Changed call to match name in new version of GtkHtml.
Unfortunately, the new name makes it clear the call is
intended to be private.
* components/rpmview/.cvsignore: Ignore the actual binary,
not nautilus-music-view.
* components/rpmview/Makefile.am: Turned on -Werror.
* components/music/Makefile.am: Turned on -Werror.
* components/rpmview/nautilus-rpm-view.c: Fixed warnings.
Diffstat (limited to 'components/rpmview')
-rw-r--r-- | components/rpmview/.cvsignore | 2 | ||||
-rw-r--r-- | components/rpmview/Makefile.am | 7 | ||||
-rw-r--r-- | components/rpmview/nautilus-rpm-view.c | 127 |
3 files changed, 69 insertions, 67 deletions
diff --git a/components/rpmview/.cvsignore b/components/rpmview/.cvsignore index 1c2b6dfaa..65720a854 100644 --- a/components/rpmview/.cvsignore +++ b/components/rpmview/.cvsignore @@ -2,4 +2,4 @@ .libs Makefile Makefile.in -nautilus-music-view +nautilus-rpm-view diff --git a/components/rpmview/Makefile.am b/components/rpmview/Makefile.am index d3a648c20..1e3cc7007 100644 --- a/components/rpmview/Makefile.am +++ b/components/rpmview/Makefile.am @@ -1,5 +1,3 @@ - - CPPFLAGS = \ -DPREFIX=\"$(prefix)\" -DG_LOG_DOMAIN=\"Nautilus-RPM\" @@ -8,7 +6,8 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I/usr/include/rpm \ - $(GNOMEUI_CFLAGS) + $(GNOMEUI_CFLAGS) \ + $(WERROR) gnorbadir = $(sysconfdir)/CORBA/servers @@ -19,7 +18,7 @@ gnorba_DATA = \ bin_PROGRAMS = \ nautilus-rpm-view -nautilus_rpm_view_SOURCES = \ +nautilus_rpm_view_SOURCES = \ nautilus-rpm-view.c \ nautilus-rpm-view.h \ main.c diff --git a/components/rpmview/nautilus-rpm-view.c b/components/rpmview/nautilus-rpm-view.c index 5bae42b76..077eef78d 100644 --- a/components/rpmview/nautilus-rpm-view.c +++ b/components/rpmview/nautilus-rpm-view.c @@ -336,15 +336,19 @@ nautilus_rpm_view_realize(GtkWidget *widget) nautilus_background_set_color (background, RPM_VIEW_DEFAULT_BACKGROUND_COLOR); } -/* utility to format time using std libarary routines */ +/* utility to format time using std library routines */ -gchar* format_time(gint time_value) +#if 0 + +static char* format_time(time_t time_value) { - gchar *time_string = strdup(ctime(&time_value)); + char *time_string = g_strdup(ctime(&time_value)); time_string[strlen(time_string) - 1] = '\0'; return time_string; } +#endif + /* here's where we do most of the real work of populating the view with info from the package */ /* open the package and copy the information, and then set up the appropriate views with it */ /* FIXME: use gnome-vfs to open the package */ @@ -355,19 +359,19 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri) /* open the package */ HeaderIterator iterator; Header header_info, signature; - gchar buffer[512]; - gint iterator_tag, type, data_size, result; - gchar *data_ptr, *temp_str, *time_string; - gint file_descriptor; - gint *integer_ptr; - gchar *temp_version = NULL; - gchar *temp_release = NULL; - const gchar *path_name = uri + 7; + char buffer[512]; + int iterator_tag, type, data_size, result; + char *data_ptr, *temp_str; + int file_descriptor; + int *integer_ptr; + char *temp_version = NULL; + char *temp_release = NULL; + const char *path_name = uri + 7; file_descriptor = open(path_name, O_RDONLY, 0644); if (file_descriptor >= 0) { - + /* read out the appropriate fields, and set them up in the view */ result = rpmReadPackageInfo((FD_t)&file_descriptor, &signature, &header_info); if (result) { @@ -379,53 +383,53 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri) while (headerNextIterator(iterator, &iterator_tag, &type, (void**)&data_ptr, &data_size)) { integer_ptr = (int*) data_ptr; switch (iterator_tag) { - case RPMTAG_NAME: - temp_str = g_strdup_printf("Package \"%s\" ", data_ptr); - gtk_label_set (GTK_LABEL (rpm_view->details->package_title), temp_str); - g_free(temp_str); - break; - case RPMTAG_VERSION: - temp_version = strdup(data_ptr); - break; - case RPMTAG_RELEASE: - temp_release = strdup(data_ptr); - break; - case RPMTAG_SUMMARY: - gtk_label_set (GTK_LABEL (rpm_view->details->package_summary), data_ptr+4); - break; - case RPMTAG_DESCRIPTION: - gtk_label_set (GTK_LABEL (rpm_view->details->package_description), data_ptr+4); - break; - case RPMTAG_SIZE: - temp_str = gnome_vfs_file_size_to_string (*integer_ptr); - gtk_label_set (GTK_LABEL (rpm_view->details->package_size), temp_str); - g_free(temp_str); - break; - case RPMTAG_DISTRIBUTION: - gtk_label_set (GTK_LABEL (rpm_view->details->package_distribution), data_ptr+4); - break; - case RPMTAG_GROUP: - break; - case RPMTAG_ICON: - break; - case RPMTAG_LICENSE: - gtk_label_set (GTK_LABEL (rpm_view->details->package_license), data_ptr); - break; - case RPMTAG_BUILDTIME: - strftime(buffer, 511, "%a %b %d %I:%M:%S %Z %Y", gmtime(integer_ptr)); - gtk_label_set(GTK_LABEL(rpm_view->details->package_bdate), buffer); - break; - case RPMTAG_INSTALLTIME: - strftime(buffer, 511, "%a %b %d %I:%M:%S %Z %Y", gmtime(integer_ptr)); - gtk_label_set(GTK_LABEL(rpm_view->details->package_idate), buffer); - break; - case RPMTAG_VENDOR: - gtk_label_set (GTK_LABEL (rpm_view->details->package_vendor), data_ptr); - break; - case RPMTAG_GIF: - break; - case RPMTAG_XPM: - break; + case RPMTAG_NAME: + temp_str = g_strdup_printf("Package \"%s\" ", data_ptr); + gtk_label_set (GTK_LABEL (rpm_view->details->package_title), temp_str); + g_free(temp_str); + break; + case RPMTAG_VERSION: + temp_version = g_strdup(data_ptr); + break; + case RPMTAG_RELEASE: + temp_release = g_strdup(data_ptr); + break; + case RPMTAG_SUMMARY: + gtk_label_set (GTK_LABEL (rpm_view->details->package_summary), data_ptr+4); + break; + case RPMTAG_DESCRIPTION: + gtk_label_set (GTK_LABEL (rpm_view->details->package_description), data_ptr+4); + break; + case RPMTAG_SIZE: + temp_str = gnome_vfs_file_size_to_string (*integer_ptr); + gtk_label_set (GTK_LABEL (rpm_view->details->package_size), temp_str); + g_free(temp_str); + break; + case RPMTAG_DISTRIBUTION: + gtk_label_set (GTK_LABEL (rpm_view->details->package_distribution), data_ptr+4); + break; + case RPMTAG_GROUP: + break; + case RPMTAG_ICON: + break; + case RPMTAG_LICENSE: + gtk_label_set (GTK_LABEL (rpm_view->details->package_license), data_ptr); + break; + case RPMTAG_BUILDTIME: + strftime(buffer, 511, "%a %b %d %I:%M:%S %Z %Y", gmtime((time_t *) data_ptr)); + gtk_label_set(GTK_LABEL(rpm_view->details->package_bdate), buffer); + break; + case RPMTAG_INSTALLTIME: + strftime(buffer, 511, "%a %b %d %I:%M:%S %Z %Y", gmtime((time_t *) data_ptr)); + gtk_label_set(GTK_LABEL(rpm_view->details->package_idate), buffer); + break; + case RPMTAG_VENDOR: + gtk_label_set (GTK_LABEL (rpm_view->details->package_vendor), data_ptr); + break; + case RPMTAG_GIF: + break; + case RPMTAG_XPM: + break; } } @@ -455,15 +459,14 @@ void nautilus_rpm_view_load_uri (NautilusRPMView *rpm_view, const char *uri) { g_free(rpm_view->details->current_uri); - rpm_view->details->current_uri = g_strdup (uri); nautilus_rpm_view_update_from_uri(rpm_view, uri); } static void rpm_view_notify_location_change_callback (NautilusContentViewFrame *view, - Nautilus_NavigationInfo *navinfo, - NautilusRPMView *rpm_view) + Nautilus_NavigationInfo *navinfo, + NautilusRPMView *rpm_view) { Nautilus_ProgressRequestInfo progress; |