mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-12-05 06:22:18 +00:00
fix release+refresh hardware caches
This commit is contained in:
6 files changed
+82
-30
No files matched your search
@@ -41,7 +41,7 @@ static zoitechat_plugin *ph;
|
||||
static char name[] = "Sysinfo";
|
||||
static char desc[] = "Display info about your hardware and OS";
|
||||
static char version[] = "2.0";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|MEMORY|STORAGE|DISK|GPU|VGA|CHIPSET|SOUND|NETWORK|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|MEMORY|STORAGE|DISK|GPU|VGA|CHIPSET|SOUND|NETWORK|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n /SYSINFO REFRESH - clear cached hardware information\n";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -241,10 +241,15 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
announce = FALSE;
|
||||
|
||||
cmd = word[2+offset];
|
||||
if (!g_ascii_strcasecmp ("SET", cmd))
|
||||
sysinfo_set_pref (word[3+offset], word_eol[4+offset]);
|
||||
else if (!cmd || !cmd[0])
|
||||
if (!cmd || !cmd[0])
|
||||
print_summary (announce);
|
||||
else if (!g_ascii_strcasecmp ("REFRESH", cmd))
|
||||
{
|
||||
sysinfo_backend_reset_cache ();
|
||||
zoitechat_print (ph, _("Sysinfo: Hardware cache cleared."));
|
||||
}
|
||||
else if (!g_ascii_strcasecmp ("SET", cmd))
|
||||
sysinfo_set_pref (word[3+offset], word_eol[4+offset]);
|
||||
else
|
||||
print_info (cmd, announce);
|
||||
|
||||
@@ -269,6 +274,7 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
int
|
||||
zoitechat_plugin_deinit (void)
|
||||
{
|
||||
sysinfo_backend_reset_cache ();
|
||||
zoitechat_command (ph, "MENU DEL \"Window/Send System Info\"");
|
||||
zoitechat_command (ph, "MENU DEL \"Window/Display System Info\"");
|
||||
zoitechat_printf (ph, _("%s plugin unloaded\n"), name);
|
||||
|
||||
Reference in new issue
Block a user