Hi,
This is my first real attempt to add a new feature so its going to take quite
some time. My long
term goal is to implement the RecycleBin for ReactOS and for Wine to make it
interface with the
FreeDesktop.org draft trashcan spec. The latter might require a extension to
Wines or some other
process to move files out of the C:\Recycled folder and in to the users
~/Desktop/Trash
I have started by adding a little support for the FOF_ALLOWUNDO flag in
SHFileOperationW. Windows
can use either Drive:\Recycled or Drive:\Recycler depending on if the TrashCan
is on a NTFS drive
or not so I am not sure how we want to handle it in Wine. With my first patch
if you delete a file
with this flag it will move the file to C:\Trash which is a file not a
directory.
I am using the sample programs here to reverse how its supposed to work
http://www.maddogsw.com/cmdutils/
If anyone would like to help they can start working on the namespace stuff
needed for the
RecycleBin.
Thanks
Steven
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
? .shellpath.c.swp
? trashcan-4.13.05.patch
Index: regsvr.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/regsvr.c,v
retrieving revision 1.7
diff -u -r1.7 regsvr.c
--- regsvr.c 9 Mar 2005 16:41:17 -0000 1.7
+++ regsvr.c 13 Apr 2005 16:45:49 -0000
@@ -477,6 +477,12 @@
"shell32.dll",
"Apartment"
},
+ { &CLSID_DragDropHelper,
+ "Shell Drag and Drop Helper",
+ NULL,
+ "shell32.dll",
+ "Apartment"
+ },
{ &CLSID_MyComputer,
"My Computer",
NULL,
Index: shlfileop.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlfileop.c,v
retrieving revision 1.53
diff -u -r1.53 shlfileop.c
--- shlfileop.c 21 Feb 2005 18:37:33 -0000 1.53
+++ shlfileop.c 13 Apr 2005 16:45:50 -0000
@@ -55,6 +55,7 @@
static const WCHAR wWildcardFile[] = {'*',0};
static const WCHAR wWildcardChars[] = {'*','?',0};
static const WCHAR wBackslash[] = {'\\',0};
+static const WCHAR wTrashFile[] = {'C',':','T','r','a','s','h','\0'};
static BOOL SHELL_DeleteDirectoryW(LPCWSTR path, BOOL bShowUI);
static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec);
@@ -925,7 +926,7 @@
debug_shfileops_action(FuncSwitch), level, nFileOp.fFlags);
/* OFl &= (-1 - (FOF_MULTIDESTFILES | FOF_FILESONLY)); */
/* OFl ^= (FOF_SILENT | FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS | FOF_NOCONFIRMMKDIR); */
- OFl &= (~(FOF_MULTIDESTFILES | FOF_NOCONFIRMATION | FOF_FILESONLY)); /* implemented */
+ OFl &= (~(FOF_ALLOWUNDO | FOF_MULTIDESTFILES | FOF_NOCONFIRMATION | FOF_FILESONLY)); /* implemented */
OFl ^= (FOF_SILENT | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_NOCOPYSECURITYATTRIBS); /* ignored, if one */
OFl &= (~FOF_SIMPLEPROGRESS); /* ignored, only with FOF_SILENT */
if (OFl)
@@ -1163,6 +1164,19 @@
/* for all */
/* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */
+
+ if(!pTo && nFileOp.fFlags == FOF_ALLOWUNDO) /* Move to the trash */
+ {
+ FIXME("Trash\n");
+ /* we use SHNotifyMoveFile() instead MoveFileW */
+ if (SHNotifyMoveFileW(pTempFrom, wTrashFile) != ERROR_SUCCESS)
+ {
+ /* we need still the value for the returncode, we use the mostly assumed */
+ retCode = 0xb7;
+ goto shfileop_end;
+ }
+ }
+
if (!pTo) /* FO_DELETE */
{
retCode = shfileops_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind);