diff options
Diffstat (limited to 'hardinfo2')
| -rw-r--r-- | hardinfo2/arch/linux/common/filesystem.h | 10 | ||||
| -rw-r--r-- | hardinfo2/callbacks.c | 18 | ||||
| -rw-r--r-- | hardinfo2/computer.c | 3 | ||||
| -rw-r--r-- | hardinfo2/hardinfo.h | 8 | ||||
| -rw-r--r-- | hardinfo2/shell.c | 7 | ||||
| -rw-r--r-- | hardinfo2/uidefs.h | 2 | ||||
| -rw-r--r-- | hardinfo2/util.c | 16 | 
7 files changed, 48 insertions, 16 deletions
| diff --git a/hardinfo2/arch/linux/common/filesystem.h b/hardinfo2/arch/linux/common/filesystem.h index 8300f278..74c019e0 100644 --- a/hardinfo2/arch/linux/common/filesystem.h +++ b/hardinfo2/arch/linux/common/filesystem.h @@ -23,15 +23,23 @@  static gchar *fs_list = NULL; +static gboolean +remove_filesystem_entries(gpointer key, gpointer value, gpointer data) +{ +    return g_str_has_prefix(key, "FS"); +} +  static void  scan_filesystems(void)  {      FILE *mtab;      gchar buf[1024];      struct statfs sfs; +    int count = 0;      g_free(fs_list);      fs_list = g_strdup(""); +    g_hash_table_foreach_remove(moreinfo, remove_filesystem_entries, NULL);      mtab = fopen("/etc/mtab", "r");      if (!mtab) @@ -71,7 +79,7 @@ scan_filesystems(void)  					  strstr(tmp[3], "rw") ? "Read-Write" :  					  "Read-Only", tmp[1], strsize, strused,  					  stravail); -		g_hash_table_insert(moreinfo, g_strdup(tmp[0]), strhash); +		g_hash_table_insert(moreinfo, g_strdup_printf("FS%d", ++count), strhash);  		fs_list = g_strdup_printf("%s$%s$%s=%s total, %s free\n",  					  fs_list, diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index ac47d089..d026d66f 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -149,16 +149,20 @@ void cb_about_module(GtkAction *action)          if ((ma = module_get_about(sm))) {              GtkWidget *about; +            gchar *text;              about = gtk_about_dialog_new(); -            gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), -                                      idle_free(g_strdup_printf("%s Module", sm->name))); + +            text = g_strdup_printf("%s Module", sm->name); +            gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), text); +            g_free(text); +                          gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), ma->version); -            gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), -                                           idle_free(g_strdup_printf("Written by %s\n" -                                                     "Licensed under %s", -                                                     ma->author, -                                                     ma->license))); + +            text = g_strdup_printf("Written by %s\nLicensed under %s", +                                   ma->author, ma->license); +            gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), text); +            g_free(text);              if (ma->description)                  gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c index 8679ffb6..2106ffcf 100644 --- a/hardinfo2/computer.c +++ b/hardinfo2/computer.c @@ -120,8 +120,9 @@ hi_get_field(gchar * field)      gchar *tmp;      if (g_str_equal(field, "Memory")) { -	MemoryInfo *mi = idle_free(computer_get_memory()); +	MemoryInfo *mi = computer_get_memory();  	tmp = g_strdup_printf("%dMB (%dMB used)", mi->total, mi->used); +	g_free(mi);      } else if (g_str_equal(field, "Uptime")) {  	tmp = computer_get_formatted_uptime();      } else if (g_str_equal(field, "Date/Time")) { diff --git a/hardinfo2/hardinfo.h b/hardinfo2/hardinfo.h index 97d3aeea..ba3e23b3 100644 --- a/hardinfo2/hardinfo.h +++ b/hardinfo2/hardinfo.h @@ -81,7 +81,13 @@ gchar    *file_chooser_build_filename(GtkWidget *chooser, gchar *extension);  gpointer  file_types_get_data_by_name(FileTypes *file_types, gchar *name);  /* Misc utility functions */ -gpointer      idle_free(gpointer ptr); +#if RELEASE == 1 +gpointer idle_free(gpointer ptr); +#else +gpointer __idle_free(gpointer ptr, gchar *f, gint l); +#define  idle_free(p) __idle_free(p, __FILE__, __LINE__) +#endif	/* RELEASE == 1 */ +  inline gchar *size_human_readable(gfloat size);  void          nonblock_sleep(guint msec);  void          open_url(gchar *url); diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index db9f15a1..11c42839 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -1131,6 +1131,8 @@ static void module_selected(gpointer data)      /* Get the current selection and shows its related info */      gtk_tree_model_get(model, &parent, TREE_COL_DATA, &entry, -1);      if (entry && !entry->selected) { +        gchar *title; +      	shell_status_set_enabled(TRUE);  	shell_status_update("Updating..."); @@ -1158,8 +1160,9 @@ static void module_selected(gpointer data)  	shell_status_update("Done.");  	shell_status_set_enabled(FALSE); -	gtk_window_set_title(GTK_WINDOW(shell->window), -                             idle_free(g_strdup_printf("%s - System Information", entry->name))); +        title = g_strdup_printf("%s - System Information", entry->name); +	gtk_window_set_title(GTK_WINDOW(shell->window), title); +	g_free(title);  	shell_action_set_enabled("RefreshAction", TRUE);  	shell_action_set_enabled("CopyAction", TRUE); diff --git a/hardinfo2/uidefs.h b/hardinfo2/uidefs.h index 591ecd01..a3a3e32d 100644 --- a/hardinfo2/uidefs.h +++ b/hardinfo2/uidefs.h @@ -5,7 +5,7 @@ char *uidefs_str = "<ui>" \  "	<menubar>" \  "		<menu name=\"InformationMenu\" action=\"InformationMenuAction\">" \  "		<menuitem name=\"Report\" action=\"ReportAction\" />" \ -"		<separator/>" \ +/*"		<separator/>" \ */  "		<menuitem name=\"Copy\" action=\"CopyAction\" />" \  /*   * Save Image is not ready for prime time. Yet. diff --git a/hardinfo2/util.c b/hardinfo2/util.c index 24e7967c..454a3a19 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -886,9 +886,10 @@ void tree_view_save_image(gchar *filename)      gtk_widget_set_sensitive(widget, tv_enabled);  } -  static gboolean __idle_free_do(gpointer ptr)  { +    DEBUG("bla %p", ptr); +      if (ptr) {          g_free(ptr);      } @@ -896,10 +897,16 @@ static gboolean __idle_free_do(gpointer ptr)      return FALSE;  } +#if RELEASE == 1  gpointer idle_free(gpointer ptr) +#else +gpointer __idle_free(gpointer ptr, gchar *f, gint l) +#endif  { +    DEBUG("file: %s, line: %d, ptr %p", f, l, ptr); +      if (ptr) { -        g_timeout_add(15000, __idle_free_do, ptr); +        g_timeout_add(10000, __idle_free_do, ptr);      }      return ptr; @@ -910,6 +917,7 @@ void module_entry_scan_all_except(ModuleEntry *entries, gint except_entry)      ModuleEntry entry;      gint        i = 0;      void        (*scan_callback)(gboolean reload); +    gchar       *text;      shell_view_set_enabled(FALSE); @@ -917,7 +925,9 @@ void module_entry_scan_all_except(ModuleEntry *entries, gint except_entry)          if (i == except_entry)              continue; -        shell_status_update(idle_free(g_strdup_printf("Scanning: %s...", entry.name))); +        text = g_strdup_printf("Scanning: %s...", entry.name); +        shell_status_update(text); +        g_free(text);          if ((scan_callback = entry.scan_callback)) {              scan_callback(FALSE); | 
