Fwd: Re: Enhanced Trash functionality

Jonathan Hunt jhuntnz at users.sourceforge.net
Mon Nov 24 11:47:46 EET 2003


Hi,

I have just been mentioning creating an enhance trashbin with KDE folks. I 
wonder if anyone here would mind reading thru my (admittedly long 2 emails) 
for any suggestions of how I could make this project useful to others besides 
KDE (perhaps read the lower email first).

Thanx for your time,
Jonathan
	
----------  Forwarded Message  ----------

Subject: Re: Enhanced Trash functionality
Date: Mon, 24 Nov 2003 10:44 pm
From: Jonathan Hunt <jhuntnz at users.sourceforge.net>
To: kde-devel at kde.org

Thanx for the positive feedback - it sounds as though enhance trash is worth
doing.
Some questions: I am planning to standard C++ with Standard Template
 Libraries for the library interface (ie not dependant on KDE) and for the
 command line util. Interface would be as follows (a C++ class).

namespace Trash {
class TrashIterator {...}
class TrashBin {
public:
	TrashBin (const char *dir = "~/.Trash");

	void trash(const char *filename); // throws exceptions
	TrashIterator getFirstItem();
	TrashIterator getLastItem();
}


class TrashItem
{
	void restore();
	string getfilename();
	date getdatedeletion();
	string getpointer(); // Returns  a string pointing to a file that can be
 used to access read-only the trash item while it is deleted
	string getoriginalpath();
	string getfilesize();
	...
}

Does this sound like a agreeable interface. The only other library besides
 Std C++ and STL I think I would make it dependable on is some common
 database library for keeping track of the files. I'd love to hear any
 suggestions about what I would use here (I'm looking for something small,
 common or at least portable that can handle at least a moderately sized DB
 (I never delete my trash so I want something that can easily scale to > 1000
 files etc.), stable. Most common solutions seem to need a daemon running (eg
 MySQL) which is something I'd rather not bother with in the interests of
 easy setup and self-containment etc. I'd rather not write something like
 this myself just cause it seems like reinventing the wheel but it is an
 option (just a flat file that gets compacted occasionally).
 Suggestions/advice welcome.

Thanx 4 your time,
Jonathan

On Mon, 24 Nov 2003 7:10 pm, you wrote:
> Jonathan Hunt wrote:
> > Hi,
> >
> > One of the things I really like about MS Windows is it's recycle bin.
> > Konqeror under Linux has something similar but it seems much more
> > limited. It cannot do things like hold more than 1 file that has the same
> > name (without renaming) or remember where a file came from and restore
> > it.
> > I am a uni student currently on holiday. I am considering spending some
> > time writing an improved trash bin for linux. The reason I am not going
> > with something like libtrash
> > (http://www.gnu.org/directory/libs/libtrash.html) is because it doesn't
> > seem to solve this problem of having multiple files with the same name
> > and a user friendly restore etc. and also it intercepts all attempts to
> > remove a file - not just "Trash" in Konqeror etc.
> > Anyways I was planning on writing a C++ terminal application (named tra
> > for lack of a better name) using a standalone library libtra that would
> > allow one to us tra just like rm only it would move files to the trash
> > bin (probably make it ~/.Trash). But it would rename the files to be
> > numbered 0, 1 etc. and keep an entry in a database file about date
> > deleted, original name etc. so that tra could have a restore option where
> > u type the name of a file and it goes thru its DB and finds it etc. I
> > would write this using fairly common C++ (no Qt etc.) and a common
> > database library (suggestions here??). Most of the work would be done by
> > libtra so that it can easily be called by other applications etc.
> > KDE comes into it because after I had done this I would like to
> > incorporate it into Konqeuror (Trash function) etc. and also write either
> > a plugin to konqeror or a standalone KDE app that would run when u click
> > on the Trash bin that would be similar in functionality to MS Recycle Bin
> > this would use the libtra library.
> > So I am writing to see how interested KDE project would be in something
> > like this, if there is already a similar effort underway and also for
> > suggestions of a Database library to use that is fast and stable and
> > common on POSIX platforms (or at least portable across them).


--
Jonathan Hunt (The Real Jonathan Hunt) <jhuntnz at users.sourceforge.net>
Jabber at jhuntnz at jabber.org
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Jim Elliot

-------------------------------------------------------

-- 
Jonathan Hunt (The Real Jonathan Hunt) <jhuntnz at users.sourceforge.net>
Jabber at jhuntnz at jabber.org
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Jim Elliot




More information about the xdg mailing list