diff options
| author | Leandro Pereira <leandro@hardinfo.org> | 2019-07-15 18:46:59 -0700 | 
|---|---|---|
| committer | Leandro Pereira <leandro@hardinfo.org> | 2019-08-10 16:50:18 -0700 | 
| commit | 3c83737fa488281f20030b5b36d7e1d4ba4313c9 (patch) | |
| tree | 058ab8e18ff6bacdcf4a2551bf8845b447bab88a /modules | |
| parent | 0133e9fba615d8b5b1c67976a1da702977dd74a3 (diff) | |
Always pulse status bar while spawning processes synchronously
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/computer.c | 4 | ||||
| -rw-r--r-- | modules/computer/boots.c | 2 | ||||
| -rw-r--r-- | modules/computer/languages.c | 2 | ||||
| -rw-r--r-- | modules/computer/os.c | 16 | ||||
| -rw-r--r-- | modules/computer/ubuntu_flavors.c | 2 | ||||
| -rw-r--r-- | modules/network.c | 1 | ||||
| -rw-r--r-- | modules/network/samba.c | 7 | 
7 files changed, 15 insertions, 19 deletions
| diff --git a/modules/computer.c b/modules/computer.c index 99257e9f..0123ef26 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -301,9 +301,9 @@ void scan_dev(gboolean reload)         }         if (detect_lang[i].stdout) { -            found = g_spawn_command_line_sync(detect_lang[i].version_command, &output, &ignored, NULL, NULL); +            found = hardinfo_spawn_command_line_sync(detect_lang[i].version_command, &output, &ignored, NULL, NULL);         } else { -            found = g_spawn_command_line_sync(detect_lang[i].version_command, &ignored, &output, NULL, NULL); +            found = hardinfo_spawn_command_line_sync(detect_lang[i].version_command, &ignored, &output, NULL, NULL);         }         g_free(ignored); diff --git a/modules/computer/boots.c b/modules/computer/boots.c index ba458242..63122994 100644 --- a/modules/computer/boots.c +++ b/modules/computer/boots.c @@ -35,7 +35,7 @@ scan_boots_real(void)      else        return; -    spawned = g_spawn_command_line_sync("last", +    spawned = hardinfo_spawn_command_line_sync("last",              &out, &err, NULL, NULL);      if (spawned && out != NULL) {          p = out; diff --git a/modules/computer/languages.c b/modules/computer/languages.c index 954f5b20..105b9e58 100644 --- a/modules/computer/languages.c +++ b/modules/computer/languages.c @@ -124,7 +124,7 @@ scan_languages(OperatingSystem * os)      locale_info *curr = NULL;      int last = 0; -    spawned = g_spawn_command_line_sync("locale -va", +    spawned = hardinfo_spawn_command_line_sync("locale -va",              &out, &err, NULL, NULL);      if (spawned) {          ret = g_strdup(""); diff --git a/modules/computer/os.c b/modules/computer/os.c index ab557fa6..32e4e8cd 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -47,7 +47,7 @@ get_libc_version(void)          gboolean spawned;          gchar *out, *err, *p; -        spawned = g_spawn_command_line_sync(libs[i].test_cmd, +        spawned = hardinfo_spawn_command_line_sync(libs[i].test_cmd,              &out, &err, NULL, NULL);          if (!spawned)              continue; @@ -92,7 +92,7 @@ static gchar *detect_kde_version(void)          cmd = "kcontrol --version";      } -    spawned = g_spawn_command_line_sync(cmd, &out, NULL, NULL, NULL); +    spawned = hardinfo_spawn_command_line_sync(cmd, &out, NULL, NULL, NULL);      if (!spawned)          return NULL; @@ -107,7 +107,7 @@ detect_gnome_version(void)      gchar *out;      gboolean spawned; -    spawned = g_spawn_command_line_sync( +    spawned = hardinfo_spawn_command_line_sync(          "gnome-shell --version", &out, NULL, NULL, NULL);      if (spawned) {          tmp = strstr(idle_free(out), _("GNOME Shell ")); @@ -118,7 +118,7 @@ detect_gnome_version(void)          }      } -    spawned = g_spawn_command_line_sync( +    spawned = hardinfo_spawn_command_line_sync(          "gnome-about --gnome-version", &out, NULL, NULL, NULL);      if (spawned) {          tmp = strstr(idle_free(out), _("Version: ")); @@ -140,7 +140,7 @@ detect_mate_version(void)      gchar *out;      gboolean spawned; -    spawned = g_spawn_command_line_sync( +    spawned = hardinfo_spawn_command_line_sync(          "mate-about --version", &out, NULL, NULL, NULL);      if (spawned) {          tmp = strstr(idle_free(out), _("MATE Desktop Environment ")); @@ -268,7 +268,7 @@ computer_get_dmesg_status(void)  {      gchar *out = NULL, *err = NULL;      int ex = 1, result = 0; -    g_spawn_command_line_sync("dmesg", &out, &err, &ex, NULL); +    hardinfo_spawn_command_line_sync("dmesg", &out, &err, &ex, NULL);      g_free(out);      g_free(err);      result += (getuid() == 0) ? 2 : 0; @@ -388,7 +388,7 @@ parse_lsb_release(void)      gchar *id = NULL;      gchar **split, *contents, **line; -    if (!g_spawn_command_line_sync("/usr/bin/lsb_release -di", &contents, NULL, NULL, NULL)) +    if (!hardinfo_spawn_command_line_sync("/usr/bin/lsb_release -di", &contents, NULL, NULL, NULL))          return (Distro) {};      split = g_strsplit(idle_free(contents), "\n", 0); @@ -548,7 +548,7 @@ const gchar *  computer_get_selinux(void)  {      int r; -    gboolean spawned = g_spawn_command_line_sync("selinuxenabled", +    gboolean spawned = hardinfo_spawn_command_line_sync("selinuxenabled",                                                   NULL, NULL, &r, NULL);      if (!spawned) diff --git a/modules/computer/ubuntu_flavors.c b/modules/computer/ubuntu_flavors.c index 20e83c82..f50afb0e 100644 --- a/modules/computer/ubuntu_flavors.c +++ b/modules/computer/ubuntu_flavors.c @@ -62,7 +62,7 @@ GSList *ubuntu_flavors_scan(void) {      if (!i)          return NULL; -    spawned = g_spawn_command_line_sync(cmd_line, +    spawned = hardinfo_spawn_command_line_sync(cmd_line,              &out, &err, &exit_status, NULL);      if (spawned) {          p = out; diff --git a/modules/network.c b/modules/network.c index e08f08b6..a40db80e 100644 --- a/modules/network.c +++ b/modules/network.c @@ -161,7 +161,6 @@ void scan_dns(gboolean reload)                __nameservers = h_strdup_cprintf("%s=%s\n",                                                 __nameservers,                                                 ip, hbuf); -            }            shell_status_pulse(); diff --git a/modules/network/samba.c b/modules/network/samba.c index 7e8dc46c..5df28010 100644 --- a/modules/network/samba.c +++ b/modules/network/samba.c @@ -57,7 +57,7 @@ scan_samba_usershares(void)      gchar *usershare, *cmdline;      gsize length; -    spawned = g_spawn_command_line_sync("net usershare list", +    spawned = hardinfo_spawn_command_line_sync("net usershare list",              &out, &err, &status, NULL);      if (spawned && status == 0 && out != NULL) { @@ -66,7 +66,7 @@ scan_samba_usershares(void)          while(next_nl = strchr(p, '\n')) {              cmdline = g_strdup_printf("net usershare info '%s'",                                        strend(p, '\n')); -            if (g_spawn_command_line_sync(cmdline, +            if (hardinfo_spawn_command_line_sync(cmdline,                          &usershare, NULL, NULL, NULL)) {                  length = strlen(usershare);                  scan_samba_from_string(usershare, length); @@ -74,7 +74,6 @@ scan_samba_usershares(void)              }              g_free(cmdline); -            shell_status_pulse();              p = next_nl + 1;          }          g_free(out); @@ -105,8 +104,6 @@ scan_samba_from_string(gchar *str, gsize length)      groups = g_key_file_get_groups(keyfile, NULL);      while (groups[i]) { -        shell_status_pulse(); -          if (g_key_file_has_key(keyfile, groups[i], "path", NULL)) {              gchar *path = g_key_file_get_string(keyfile, groups[i], "path", NULL);              smb_shares_list = h_strdup_cprintf("%s=%s\n", | 
