Subversion Repositories recyclebinunit

Compare Revisions

Regard whitespace Rev 85 → Rev 86

/trunk/Recycle Bin Unit v2/RecBinUnit2.pas
90,7 → 90,7
property PhysicalFile: string read GetPhysicalFile;
property SourceAnsi: AnsiString read FSourceAnsi;
property SourceUnicode: WideString read FSourceUnicode;
property Source: string read GetSource; // will bei either ANSI or Unicode, sepending on the Delphi version
property Source: string read GetSource; // will bei either ANSI or Unicode, depending on the Delphi version
property ID: string read FID;
property SourceDrive: Char read FSourceDrive;
property DeletionTime: TDateTime read FDeletionTime;
2390,6 → 2390,11
{$ELSE}
result := SourceAnsi;
{$ENDIF}
 
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff)
// TODO: Instead of using this workaround, fix "SourceUnicode" and "SourceAnsi"!
while (Length(result) > 0) and (result[Length(result)] = #0) do
result := Copy(result, 1, Length(result)-1);
end;
 
end.
/trunk/Recycle Bin Unit v2/RecyclerListingMain.pas
1,5 → 1,7
unit RecyclerListingMain;
 
// TODO: Doubleclick to open file!
 
interface
 
uses
55,6 → 57,9
iItem: integer;
item: TRbRecycleBinItem;
nItem: TTreeNode;
sCaption: string;
resourcestring
S_DRIVE = 'Drive %s';
begin
localRecyclersNode.DeleteChildren;
 
70,9 → 75,9
drive := drives.Items[iDrive] as TRbDrive;
 
if drive.VolumeGUIDAvailable then
nDrive := TreeView1.Items.AddChildObject(localRecyclersNode, 'Drive '+drive.DriveLetter+': ' + GUIDToString(drive.VolumeGUID), drive)
nDrive := TreeView1.Items.AddChildObject(localRecyclersNode, Format(S_DRIVE, [drive.DriveLetter])+': ' + GUIDToString(drive.VolumeGUID), drive)
else
nDrive := TreeView1.Items.AddChildObject(localRecyclersNode, 'Drive '+drive.DriveLetter+':', drive);
nDrive := TreeView1.Items.AddChildObject(localRecyclersNode, Format(S_DRIVE, [drive.DriveLetter])+':', drive);
nDrive.ImageIndex := 6;
nDrive.SelectedIndex := nDrive.ImageIndex;
 
95,12 → 100,18
begin
item := items.Items[iItem] as TRbRecycleBinItem;
 
if not FileExists(item.PhysicalFile) and CheckBox2.Checked then continue;
if not FileExists(item.PhysicalFile) and
not DirectoryExists(item.PhysicalFile) and
CheckBox2.Checked then continue;
 
nItem := TreeView1.Items.AddChildObject(nBin, item.Source, bin);
sCaption := item.Source;
if item.IndexFile <> '' then sCaption := sCaption + ' ('+ExtractFileName(item.IndexFile)+')';
nItem := TreeView1.Items.AddChildObject(nBin, sCaption, bin);
 
if FileExists(item.PhysicalFile) then
nItem.ImageIndex := 0
else if DirectoryExists(item.PhysicalFile) then
nItem.ImageIndex := 10 // TODO: Feature: Read folder contents and display them in this graph. (Also change icon to "open folder")
else
nItem.ImageIndex := 8;
nItem.SelectedIndex := nItem.ImageIndex;
126,6 → 137,7
iItem: integer;
item: TRbRecycleBinItem;
nItem: TTreeNode;
sCaption: string;
begin
bin := TRbRecycleBin.Create(LabeledEdit1.Text);
 
140,12 → 152,18
begin
item := items.Items[iItem] as TRbRecycleBinItem;
 
if not FileExists(item.PhysicalFile) and CheckBox2.Checked then continue;
if not FileExists(item.PhysicalFile) and
not DirectoryExists(item.PhysicalFile) and
CheckBox2.Checked then continue;
 
nItem := TreeView1.Items.AddChildObject(nBin, item.Source, bin);
sCaption := item.Source;
if item.IndexFile <> '' then sCaption := sCaption + ' ('+ExtractFileName(item.IndexFile)+')';
nItem := TreeView1.Items.AddChildObject(nBin, sCaption, bin);
 
if FileExists(item.PhysicalFile) then
nItem.ImageIndex := 0
else if DirectoryExists(item.PhysicalFile) then
nItem.ImageIndex := 10 // TODO: Feature: Read folder contents and display them in this graph. (Also change icon to "open folder")
else
nItem.ImageIndex := 8;
nItem.SelectedIndex := nItem.ImageIndex;
158,12 → 176,15
end;
 
procedure TRecyclerListingMainForm.FormShow(Sender: TObject);
resourcestring
S_LOCAL_RECYCLE_BINS = 'Local recycle bins';
S_MANUAL_RECYCLE_BINS ='Manually added recycle bins';
begin
localRecyclersNode := TreeView1.Items.Add(nil, 'Local recyclers');
localRecyclersNode := TreeView1.Items.Add(nil, S_LOCAL_RECYCLE_BINS);
localRecyclersNode.ImageIndex := 2;
localRecyclersNode.SelectedIndex := localRecyclersNode.ImageIndex;
 
individualRecyclersNode := TreeView1.Items.Add(nil, 'Manually added recycle bins');
individualRecyclersNode := TreeView1.Items.Add(nil, S_MANUAL_RECYCLE_BINS);
individualRecyclersNode.ImageIndex := 2;
individualRecyclersNode.SelectedIndex := individualRecyclersNode.ImageIndex;
end;