mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Remove deprecated linkstatus completely from conky source
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@909 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
b29d46c3f5
commit
8370c19025
@ -221,11 +221,6 @@ void update_stuff()
|
||||
if (NEED(INFO_DISKIO))
|
||||
update_diskio();
|
||||
|
||||
#if 0
|
||||
if (NEED(INFO_WIFI))
|
||||
update_wifi_stats();
|
||||
#endif
|
||||
|
||||
if (NEED(INFO_MAIL))
|
||||
update_mail_count();
|
||||
|
||||
|
20
src/conky.c
20
src/conky.c
@ -943,7 +943,6 @@ enum text_object_type {
|
||||
OBJ_adt746xfan,
|
||||
OBJ_acpifan,
|
||||
OBJ_addr,
|
||||
OBJ_linkstatus,
|
||||
OBJ_acpitemp,
|
||||
OBJ_acpitempf,
|
||||
OBJ_battery,
|
||||
@ -2680,15 +2679,6 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
||||
else {
|
||||
CRIT_ERR("addr needs argument");
|
||||
}
|
||||
#if 0
|
||||
END OBJ(linkstatus, INFO_WIFI)
|
||||
if(arg) {
|
||||
obj->data.net = get_net_stat(arg);
|
||||
}
|
||||
else {
|
||||
CRIT_ERR("linkstatus needs argument");
|
||||
}
|
||||
#endif
|
||||
END OBJ(tail, 0)
|
||||
char buf[64];
|
||||
int n1, n2;
|
||||
@ -3925,16 +3915,6 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
||||
sa_data[5] & 255);
|
||||
|
||||
}
|
||||
OBJ(linkstatus) {
|
||||
if (!use_spacer) {
|
||||
snprintf(p, p_max_size, "%d",
|
||||
obj->data.net->linkstatus);
|
||||
} else
|
||||
{
|
||||
snprintf(p, 5, "%4d ",
|
||||
obj->data.net->linkstatus);
|
||||
}
|
||||
}
|
||||
#if defined(IMLIB2) && defined(X11)
|
||||
OBJ(image) {
|
||||
if (obj->a < 1) {
|
||||
|
@ -119,7 +119,6 @@ struct net_stat {
|
||||
long long recv, trans;
|
||||
double recv_speed, trans_speed;
|
||||
struct sockaddr addr;
|
||||
int linkstatus;
|
||||
double net_rec[15], net_trans[15];
|
||||
// wireless extensions
|
||||
char essid[32];
|
||||
@ -496,9 +495,6 @@ void prepare_update(void);
|
||||
void update_uptime(void);
|
||||
void update_meminfo(void);
|
||||
void update_net_stats(void);
|
||||
#if 0
|
||||
void update_wifi_stats(void);
|
||||
#endif
|
||||
void update_cpu_usage(void);
|
||||
void update_total_processes(void);
|
||||
void update_running_processes(void);
|
||||
|
53
src/linux.c
53
src/linux.c
@ -166,8 +166,6 @@ void update_meminfo()
|
||||
fclose (meminfo_fp);
|
||||
}
|
||||
|
||||
static FILE *net_wireless_fp;
|
||||
|
||||
inline void update_net_stats()
|
||||
{
|
||||
FILE *net_dev_fp;
|
||||
@ -355,57 +353,6 @@ inline void update_net_stats()
|
||||
info.mask |= (1 << INFO_NET);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* deprecated */
|
||||
inline void update_wifi_stats()
|
||||
{
|
||||
/** wireless stats patch by Bobby Beckmann **/
|
||||
static int rep = 0;
|
||||
int i;
|
||||
char buf[256];
|
||||
/*open file and ignore first two lines sorry, this code sucks ass right now, i'll clean it up later */
|
||||
if (net_wireless_fp == NULL)
|
||||
net_wireless_fp = open_file("/proc/net/wireless", &rep);
|
||||
else
|
||||
fseek(net_wireless_fp, 0, SEEK_SET);
|
||||
if (net_wireless_fp == NULL)
|
||||
return;
|
||||
|
||||
fgets(buf, 255, net_wireless_fp); /* garbage */
|
||||
fgets(buf, 255, net_wireless_fp); /* garbage (field names) */
|
||||
|
||||
/* read each interface */
|
||||
for (i = 0; i < 16; i++) {
|
||||
struct net_stat *ns;
|
||||
char *s, *p;
|
||||
int l, m, n;
|
||||
|
||||
if (fgets(buf, 255, net_wireless_fp) == NULL)
|
||||
break;
|
||||
p = buf;
|
||||
while (isspace((int) *p))
|
||||
p++;
|
||||
|
||||
s = p;
|
||||
|
||||
while (*p && *p != ':')
|
||||
p++;
|
||||
if (*p == '\0')
|
||||
continue;
|
||||
*p = '\0';
|
||||
p++;
|
||||
|
||||
ns = get_net_stat(s);
|
||||
|
||||
sscanf(p, "%*d %d. %d. %d", &l, &m, &n);
|
||||
|
||||
ns->linkstatus = (int) (log(MIN(MAX(l,1),92)) / log(92) * 100);
|
||||
}
|
||||
|
||||
/*** end wireless patch ***/
|
||||
}
|
||||
#endif
|
||||
|
||||
int result;
|
||||
|
||||
void update_total_processes()
|
||||
|
@ -531,6 +531,8 @@ update_top()
|
||||
proc_find_top(info.cpu, info.memu);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* deprecated, will rewrite this soon in update_net_stats() -hifi */
|
||||
void
|
||||
update_wifi_stats()
|
||||
{
|
||||
@ -581,6 +583,8 @@ cleanup:
|
||||
close(s);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
update_diskio()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user