On Wed, 16 Jul 2008, Rob Kendrick wrote:

+struct gui_download_window *gui_download_window_create(const char *url,
+               const char *mime_type, struct fetch *fetch,
+               unsigned int total_size, struct gui_window *gui)
+{
+       nsgtk_download_parent = nsgtk_scaffolding_get_window(gui);
+       struct gui_download_window *download;
+       gchar *domain;
+       gchar *filename;
+       gchar *destination;
+       gchar *size = (total_size == 0 ?
+                       "Unknown" : human_friendly_bytesize(total_size));

i18n.

"gchar *size" should be const, no?

+gchar* nsgtk_download_info_to_string (struct gui_download_window *dl)
+{
+       if (dl->status != NSGTK_DOWNLOAD_ERROR)
+               return g_strdup_printf("%s\n%s of %s completed",
+                       dl->name->str,
+                       human_friendly_bytesize(dl->size_downloaded),
+                       dl->size_total == 0 ? "Unknown" :
+                       human_friendly_bytesize(dl->size_total));
+       else
+               return g_strdup_printf("%s\n%s", dl->name->str,
+                               dl->error->message);
+}

i18n.

Does the thing that call this check for NULL?

+               char *home = getenv("HOME");
+               LOG(("Using '%s' as download directory", home));
+               option_downloads_directory = home;
+       }

It's possible HOME may not be set, you probably want to fallback to pwd at that point.


J.

Reply via email to