Skip to content

Commit

Permalink
Places notification clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
thewaiter committed Jun 2, 2018
1 parent c4c90f5 commit 518e796
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/modules/places/e_mod_places.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void _places_header_activated_cb(void *data __UNUSED__, Evas_Object *o __UNUSED_
static Ecore_Timer *poller = NULL;
static char theme_file[PATH_MAX];
Eina_List *volumes = NULL;
static int perc_backup[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};


/* Implementation */
Expand Down Expand Up @@ -95,6 +94,7 @@ places_volume_add(const char *id, Eina_Bool first_time)

// safe defaults
v->id = eina_stringshare_add(id);
v->perc_backup = 0;
v->valid = EINA_FALSE;
v->objs = NULL;
v->icon = NULL;
Expand Down Expand Up @@ -533,7 +533,6 @@ _places_poller(void *data __UNUSED__)
Eina_List *l;
long long new;
int percent;
int i=0;
static E_Notification *notification;
char diskname[200];
char diskpercent[200];
Expand All @@ -551,9 +550,9 @@ _places_poller(void *data __UNUSED__)

#ifdef HAVE_ENOTIFY
if ((places_conf->alert_p > 0) && (percent > places_conf->alert_p)
&& (percent > perc_backup[i]))
&& (percent > vol->perc_backup))
{
//~ sprintf(diskname,_("Disk ""%s"" is full!"), vol->label);

sprintf(diskname,_("Places warning!"));
sprintf(diskpercent,_("Disk ''%s'' usage is %d %%!"), vol->label, percent);

Expand All @@ -564,8 +563,7 @@ _places_poller(void *data __UNUSED__)
e_notification_unref(notification);
notification = NULL;
}
perc_backup[i] = percent;
i++;
vol->perc_backup = percent;
#endif

places_volume_update(vol);
Expand Down
4 changes: 3 additions & 1 deletion src/modules/places/e_mod_places.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ typedef struct _Volume Volume;
struct _Volume
{
const char *id;

int perc_backup;

const char *label;
const char *icon;
const char *device;
Expand All @@ -23,6 +24,7 @@ struct _Volume
unsigned long long free_space;
Eina_Bool mounted;


const char *bus;
const char *drive_type;
const char *model;
Expand Down

0 comments on commit 518e796

Please sign in to comment.