Commit ce6abc2e authored by William Jon McCann's avatar William Jon McCann

Don't draw a pie chart if the space is unknown

https://bugzilla.gnome.org/show_bug.cgi?id=681692
parent e479c004
......@@ -2977,7 +2977,7 @@ create_pie_widget (NautilusPropertiesWindow *window)
static GtkWidget*
create_volume_usage_widget (NautilusPropertiesWindow *window)
{
GtkWidget *piewidget;
GtkWidget *piewidget = NULL;
gchar *uri;
NautilusFile *file;
GFile *location;
......@@ -3001,11 +3001,12 @@ create_volume_usage_widget (NautilusPropertiesWindow *window)
}
g_object_unref (location);
piewidget = create_pie_widget (window);
gtk_widget_show_all (piewidget);
if (window->details->volume_capacity > 0) {
piewidget = create_pie_widget (window);
gtk_widget_show_all (piewidget);
}
return piewidget;
}
......@@ -3139,9 +3140,12 @@ create_basic_page (NautilusPropertiesWindow *window)
if (should_show_volume_usage (window)) {
volume_usage = create_volume_usage_widget (window);
gtk_container_add_with_properties (GTK_CONTAINER (grid), volume_usage,
"width", 2,
NULL);
if (volume_usage != NULL) {
gtk_container_add_with_properties (GTK_CONTAINER (grid),
volume_usage,
"width", 2,
NULL);
}
}
}
......
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