alpha xffm rpms available

edscott wilson garcia edscott at imp.mx
Wed Jan 29 22:05:44 CET 2003


El mié, 29-01-2003 a las 12:58, Jasper Huijsmans escribió:
> > I built some alpha version rpms for testing xffm. If anybody is
> > interested you can download them from:
> > 
> > http://sourceforge.net/project/showfiles.php?group_id=70875
> > 
> > Many features are still missing and it has some identified bugs listed
> > in the TODO file, but now's the time to suggest ideas.
> > 
> 
> Hey Edscott,
> 
> I must admit I haven't been using xffm at all, so my comments may be
> way off the mark. But here it is.
> 
> I have difficulty using the way xffm handles trash. The distinction
> between local wastebaskets and global trash collecting utility is
> difficult to grasp. Also it takes a very long time to collect trash from
> $HOME.
> 
> Wouldn't it be possible to always collect trash when adding a file to
> the wastebasket and hide the local wastebaskets? I have no idea how
> difficult this would be.

Since it time for admitting, I must admit I haven't been using the trash
collection, just the local wastebaskets. 

Collecting trash simultaneously when adding to wastebasket would be very
easy, also hiding the local wastebaskets. Both of these would have to be
configurable, so I must make options.c work for xffm (that's the
toughest part)
.
> 
> Second question is about the panel plugin. Is there an easy way to check
> the trash? I could use that for the panel plugin. If not I probably will
> remove it, since it now uses the xftree location to check for trash.

The collected trash, yes it is easy. You can linkup to the libxffm
library and use the int count_trash() function, or just put the code in
your src. Its quite simple:

#include <dbh.h>
static DBH *trashbin;
static int trashcount;

static void
count_check (DBHashTable * dbh)
{
  char *p;
  struct stat st;
  char *fullpath = (char *) DBH_DATA (dbh);
  p = strrchr (fullpath, '/');

  /*printf("DBG:%s -> %s\n",fullpath,p); */
  if (!p || strlen (p) <= 1)
    return;
  p++;
  if (lstat (fullpath, &st) < 0)
    return;
  trashcount++;
  return;
}

int
count_trash (void)
{
  char trash_path[256];

  snprintf (trash_path, 255, "%s/.xfce4/xffm", getenv ("HOME"));
  if (!check_dir (trash_path))
    return -1;
  snprintf (trash_path, 255, "%s/.xfce4/xffm/trashbin.dbh", getenv
("HOME"));

  trashcount = 0;		/* for count step */
  if ((trashbin = DBH_open (trash_path)) == NULL)
    return -1;

  DBH_foreach_sweep (trashbin, count_check);
  DBH_close(trashbin);

  return (trashcount);
 }


Edscott






More information about the Xfce4-dev mailing list