mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Change using DebugLn to thread-safe DCDebug.
This commit is contained in:
parent
299995525b
commit
0a8e476fd7
62 changed files with 477 additions and 334 deletions
|
|
@ -28,7 +28,8 @@ uses
|
|||
uKeyboard,
|
||||
uUniqueInstance,
|
||||
uDCVersion,
|
||||
uCmdLineParams;
|
||||
uCmdLineParams,
|
||||
uDebug;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
|
@ -38,7 +39,7 @@ var
|
|||
{$ENDIF}
|
||||
|
||||
begin
|
||||
DebugLn('Starting Double Commander');
|
||||
DCDebug('Starting Double Commander');
|
||||
|
||||
{$IFDEF NIGHTLY_BUILD}
|
||||
InitLineInfo;
|
||||
|
|
@ -58,18 +59,18 @@ begin
|
|||
AllowDirectorySeparators:= [DirectorySeparator];
|
||||
ThousandSeparator:= ' ';
|
||||
|
||||
DebugLn('Double Commander ' + dcVersion);
|
||||
DebugLn('Revision: ' + dcRevision);
|
||||
DebugLn('Build: ' + dcBuildDate);
|
||||
DebugLn('Lazarus: ' + lazVersion + '-' + lazRevision);
|
||||
DebugLn('Free Pascal: ' + fpcVersion);
|
||||
DebugLn('Platform: ' + TargetCPU + '-' + TargetOS + '-' + TargetWS);
|
||||
DebugLn('System: ' + OSVersion);
|
||||
DCDebug('Double Commander ' + dcVersion);
|
||||
DCDebug('Revision: ' + dcRevision);
|
||||
DCDebug('Build: ' + dcBuildDate);
|
||||
DCDebug('Lazarus: ' + lazVersion + '-' + lazRevision);
|
||||
DCDebug('Free Pascal: ' + fpcVersion);
|
||||
DCDebug('Platform: ' + TargetCPU + '-' + TargetOS + '-' + TargetWS);
|
||||
DCDebug('System: ' + OSVersion);
|
||||
if WSVersion <> EmptyStr then
|
||||
DebugLn('Widgetset library: ' + WSVersion);
|
||||
DebugLn('This program is free software released under terms of GNU GPL 2');
|
||||
DebugLn('(C)opyright 2006-2011 Koblov Alexander (Alexx2000@mail.ru)');
|
||||
DebugLn(' and contributors (see about dialog)');
|
||||
DCDebug('Widgetset library: ' + WSVersion);
|
||||
DCDebug('This program is free software released under terms of GNU GPL 2');
|
||||
DCDebug('(C)opyright 2006-2011 Koblov Alexander (Alexx2000@mail.ru)');
|
||||
DCDebug(' and contributors (see about dialog)');
|
||||
|
||||
ProcessCommandLineParams; // before load paths
|
||||
LoadPaths; // before loading config
|
||||
|
|
@ -101,8 +102,8 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Another instance of DC is already running. Exiting.');
|
||||
DCDebug('Another instance of DC is already running. Exiting.');
|
||||
end;
|
||||
|
||||
DebugLn('Finished Double Commander');
|
||||
end.
|
||||
DCDebug('Finished Double Commander');
|
||||
end.
|
||||
|
|
@ -66,7 +66,6 @@ begin
|
|||
inherited;
|
||||
if (Key = VK_Down) and (cbDataToFind.Items.Count > 0) then
|
||||
cbDataToFind.DroppedDown:= True;
|
||||
DebugLn(IntToStr(Key));
|
||||
if Key = 13 then
|
||||
begin
|
||||
Key:= 0;
|
||||
|
|
@ -77,7 +76,6 @@ begin
|
|||
Key:= 0;
|
||||
ModalResult:= mrCancel;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ uses
|
|||
uFileSourceOperationTypes, uFileSourceCopyOperation, uFileSourceMoveOperation,
|
||||
fFileOpDlg, uFileSourceProperty, uFileSourceExecuteOperation, uArchiveFileSource,
|
||||
uShellExecute, uActs, fSymLink, fHardLink, uExceptions, uUniqueInstance, Clipbrd,
|
||||
uFileSourceOperationOptionsUI
|
||||
uFileSourceOperationOptionsUI, uDebug
|
||||
{$IFDEF LCLQT}
|
||||
, qtwidgets
|
||||
{$ENDIF}
|
||||
|
|
@ -759,7 +759,7 @@ begin
|
|||
{ *HotKeys* }
|
||||
|
||||
UpdateWindowView;
|
||||
//DebugLn('frmMain.FormCreate Done');
|
||||
//DCDebug('frmMain.FormCreate Done');
|
||||
Draging:=false;
|
||||
end;
|
||||
|
||||
|
|
@ -1037,11 +1037,11 @@ procedure TfrmMain.FormDestroy(Sender: TObject);
|
|||
var
|
||||
slCommandHistory: TStringListEx;
|
||||
begin
|
||||
DebugLn('Destroying main form');
|
||||
DCDebug('Destroying main form');
|
||||
|
||||
TDriveWatcher.RemoveObserver(@OnDriveWatcherEvent);
|
||||
TDriveWatcher.Finalize;
|
||||
DebugLn('Drive watcher finished');
|
||||
DCDebug('Drive watcher finished');
|
||||
|
||||
// Close all tabs.
|
||||
CloseNotebook(LeftTabs);
|
||||
|
|
@ -1066,7 +1066,7 @@ begin
|
|||
|
||||
FreeAndNil(DrivesList);
|
||||
|
||||
DebugLn('Main form destroyed');
|
||||
DCDebug('Main form destroyed');
|
||||
end;
|
||||
|
||||
procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
|
|
@ -1579,7 +1579,7 @@ begin
|
|||
if not Draging then
|
||||
begin
|
||||
ExecCmdEx(Sender, NumberOfButton);
|
||||
DebugLn(MainToolBar.Commands[NumberOfButton]);
|
||||
DCDebug(MainToolBar.Commands[NumberOfButton]);
|
||||
end;
|
||||
Draging := false;
|
||||
end;
|
||||
|
|
@ -1613,7 +1613,7 @@ end;
|
|||
|
||||
procedure TfrmMain.frmMainShow(Sender: TObject);
|
||||
begin
|
||||
DebugLn('frmMain.frmMainShow');
|
||||
DCDebug('frmMain.frmMainShow');
|
||||
Application.QueueAsyncCall(@frmMainAfterShow, 0);
|
||||
end;
|
||||
|
||||
|
|
@ -3324,7 +3324,7 @@ begin
|
|||
AFileView := CreateFileView(sViewType, Page, gConfig, ViewNode);
|
||||
end
|
||||
else
|
||||
DebugLn('File view type not specified in configuration: ' + gConfig.GetPathFromNode(ViewNode) + '.');
|
||||
DCDebug('File view type not specified in configuration: ' + gConfig.GetPathFromNode(ViewNode) + '.');
|
||||
end
|
||||
// Else try old configuration.
|
||||
else if gConfig.TryGetValue(TabNode, 'Path', sPath) then
|
||||
|
|
@ -3338,7 +3338,7 @@ begin
|
|||
end;
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + gConfig.GetPathFromNode(TabNode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + gConfig.GetPathFromNode(TabNode) + '.');
|
||||
|
||||
if Assigned(Page) then
|
||||
begin
|
||||
|
|
@ -3918,7 +3918,7 @@ begin
|
|||
WindowState:= lastWindowState;
|
||||
BringToFront;
|
||||
for I:= 0 to ParamCount - 1 do
|
||||
DebugLn(Params[I]);
|
||||
DCDebug(Params[I]);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.tbPasteClick(Sender: TObject);
|
||||
|
|
@ -3980,7 +3980,7 @@ begin
|
|||
begin
|
||||
sDir := mbGetCurrentDir;
|
||||
ActiveFrame.CurrentPath := sDir;
|
||||
DebugLn(sDir);
|
||||
DCDebug(sDir);
|
||||
if gTermWindow and Assigned(Cons) then
|
||||
Cons.Terminal.SetCurrentDir(sDir);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -193,7 +193,8 @@ implementation
|
|||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LCLProc, FileUtil, uLng, uGlobs, uFileProcs, uDCUtils, uOSUtils, uShowMsg, uFileSourceUtil, uFileProperty;
|
||||
LCLProc, FileUtil, uDebug, uLng, uGlobs, uFileProcs, uDCUtils, uOSUtils,
|
||||
uShowMsg, uFileSourceUtil, uFileProperty;
|
||||
|
||||
const
|
||||
sPresetsSection = 'MultiRenamePresets';
|
||||
|
|
@ -925,7 +926,7 @@ begin
|
|||
end;
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
@ -1117,4 +1118,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -546,7 +546,7 @@ uses
|
|||
uLng, uGlobsPaths, uPixMapManager, fMain, LCLProc, LCLVersion,
|
||||
uColorExt, uDCUtils, uOSUtils, fColumnsSetConf, uShowMsg, uShowForm,
|
||||
fTweakPlugin, uhotkeymanger, uTypes, StrUtils, uFindEx, uKeyboard,
|
||||
fMaskInputDlg, uSearchTemplate, uMultiArc, uFile;
|
||||
fMaskInputDlg, uSearchTemplate, uMultiArc, uFile, uDebug;
|
||||
|
||||
const
|
||||
stgCmdCommandIndex = 0;
|
||||
|
|
@ -907,7 +907,7 @@ var
|
|||
sLangName : String;
|
||||
begin
|
||||
lngList.Clear;
|
||||
DebugLn('Language dir: ' + gpLngDir);
|
||||
DCDebug('Language dir: ' + gpLngDir);
|
||||
if FindFirstEx(gpLngDir+'*.po', faAnyFile, fr)<>0 then
|
||||
begin
|
||||
FindCloseEx(fr);
|
||||
|
|
@ -1528,42 +1528,42 @@ begin
|
|||
if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
|
||||
begin
|
||||
WCXmodule := TWCXmodule.Create;
|
||||
DebugLn('TWCXmodule created');
|
||||
DCDebug('TWCXmodule created');
|
||||
try
|
||||
if WCXmodule.LoadModule(PluginFileName) then
|
||||
begin
|
||||
DebugLn('WCXModule Loaded');
|
||||
DCDebug('WCXModule Loaded');
|
||||
WCXmodule.VFSConfigure(stgPlugins.Handle);
|
||||
DebugLn('Dialog executed');
|
||||
DCDebug('Dialog executed');
|
||||
WCXModule.UnloadModule;
|
||||
DebugLn('WCX Module Unloaded');
|
||||
DCDebug('WCX Module Unloaded');
|
||||
end
|
||||
else
|
||||
msgError(rsMsgErrEOpen + ': ' + PluginFileName);
|
||||
finally
|
||||
WCXmodule.Free;
|
||||
DebugLn('WCX Freed');
|
||||
DCDebug('WCX Freed');
|
||||
end;
|
||||
end
|
||||
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
|
||||
begin
|
||||
WFXmodule := TWFXmodule.Create;
|
||||
DebugLn('TWFXmodule created');
|
||||
DCDebug('TWFXmodule created');
|
||||
try
|
||||
if WFXmodule.LoadModule(PluginFileName) then
|
||||
begin
|
||||
DebugLn('WFXModule Loaded');
|
||||
DCDebug('WFXModule Loaded');
|
||||
WfxModule.VFSInit(0);
|
||||
WFXmodule.VFSConfigure(stgPlugins.Handle);
|
||||
DebugLn('Dialog executed');
|
||||
DCDebug('Dialog executed');
|
||||
WFXModule.UnloadModule;
|
||||
DebugLn('WFX Module Unloaded');
|
||||
DCDebug('WFX Module Unloaded');
|
||||
end
|
||||
else
|
||||
msgError(rsMsgErrEOpen + ': ' + PluginFileName);
|
||||
finally
|
||||
WFXmodule.Free;
|
||||
DebugLn('WFX Freed');
|
||||
DCDebug('WFX Freed');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -1768,18 +1768,18 @@ begin
|
|||
odOpenDialog.Filter := 'File system plugins (*.wfx)|*.wfx';
|
||||
if odOpenDialog.Execute then
|
||||
begin
|
||||
DebugLn('Dialog executed');
|
||||
DCDebug('Dialog executed');
|
||||
WfxModule := TWfxModule.Create;
|
||||
DebugLn('TWFXmodule created');
|
||||
DCDebug('TWFXmodule created');
|
||||
if WfxModule.LoadModule(odOpenDialog.FileName) then
|
||||
begin
|
||||
DebugLn('WFXModule Loaded');
|
||||
DCDebug('WFXModule Loaded');
|
||||
sRootName:= WfxModule.VFSRootName;
|
||||
if sRootName <> EmptyStr then
|
||||
sPluginName := sRootName + '=' + SetCmdDirAsEnvVar(odOpenDialog.FileName)
|
||||
else
|
||||
begin
|
||||
DebugLn('WFX alternate name');
|
||||
DCDebug('WFX alternate name');
|
||||
sRootName:= ExtractFileName(odOpenDialog.FileName);
|
||||
sRootName:= Copy(sRootName, 1, Pos('.', sRootName) - 1);
|
||||
sPluginName := sRootName + '=' + SetCmdDirAsEnvVar(odOpenDialog.FileName)
|
||||
|
|
@ -1787,11 +1787,11 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Module not loaded');
|
||||
DCDebug('Module not loaded');
|
||||
sPluginName := ExtractFileName(odOpenDialog.FileName) +'=' + SetCmdDirAsEnvVar(odOpenDialog.FileName);
|
||||
end;
|
||||
|
||||
DebugLn('WFX sPluginName='+sPluginName);
|
||||
DCDebug('WFX sPluginName='+sPluginName);
|
||||
I:= tmpWFXPlugins.AddObject(sPluginName, TObject(True));
|
||||
stgPlugins.RowCount:= tmpWFXPlugins.Count + 1;
|
||||
J:= stgPlugins.RowCount-1;
|
||||
|
|
@ -1799,11 +1799,11 @@ begin
|
|||
stgPlugins.Cells[1, J]:= tmpWFXPlugins.Name[I];
|
||||
stgPlugins.Cells[2, J]:= EmptyStr;
|
||||
stgPlugins.Cells[3, J]:= tmpWFXPlugins.FileName[I];
|
||||
DebugLn('WFX Item Added');
|
||||
DCDebug('WFX Item Added');
|
||||
WFXModule.UnloadModule;
|
||||
DebugLn('WFX Module Unloaded');
|
||||
DCDebug('WFX Module Unloaded');
|
||||
WFXmodule.Free;
|
||||
DebugLn('WFX Freed');
|
||||
DCDebug('WFX Freed');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ implementation
|
|||
|
||||
uses
|
||||
FileUtil, IntfGraphics, uLng, uShowMsg, uGlobs, LCLType, LConvEncoding, uClassesEx,
|
||||
uFindMmap, uDCUtils, LCLIntf;
|
||||
uFindMmap, uDCUtils, LCLIntf, uDebug;
|
||||
|
||||
const
|
||||
// Status bar panels indexes.
|
||||
|
|
@ -301,7 +301,7 @@ procedure ShowViewer(const FilesToView:TStringList; const aFileSource: IFileSour
|
|||
var
|
||||
Viewer: TfrmViewer;
|
||||
begin
|
||||
//DebugLn('ShowViewer - Using Internal');
|
||||
//DCDebug('ShowViewer - Using Internal');
|
||||
Viewer := TfrmViewer.Create(Application, aFileSource);
|
||||
Viewer.QuickView:= False;
|
||||
Viewer.FileList.Assign(FilesToView);// Make a copy of the list
|
||||
|
|
@ -942,17 +942,17 @@ var
|
|||
I: Integer;
|
||||
begin
|
||||
I:= 0;
|
||||
// DebugLn('WlXPlugins.Count = ' + IntToStr(WlxPlugins.Count));
|
||||
// DCDebug('WlXPlugins.Count = ' + IntToStr(WlxPlugins.Count));
|
||||
while (I < WlxPlugins.Count) do
|
||||
if WlxPlugins.GetWLxModule(I).FileParamVSDetectStr(sFileName) then
|
||||
begin
|
||||
Result:= True;
|
||||
DebugLn('I = '+IntToStr(I));
|
||||
DCDebug('I = '+IntToStr(I));
|
||||
{$PUSH}{$R-}
|
||||
if not WlxPrepareContainer(pnlLister.Handle) then {TODO: ERROR and exit;};
|
||||
{$POP}
|
||||
WlxPlugins.LoadModule(I);
|
||||
DebugLn('WlxModule.Name = ', WlxPlugins.GetWLxModule(I).Name);
|
||||
DCDebug('WlxModule.Name = ', WlxPlugins.GetWLxModule(I).Name);
|
||||
if WlxPlugins.GetWLxModule(I).CallListLoad(pnlLister.Handle, sFileName, {TODO: showFlags}0) = 0 then
|
||||
begin
|
||||
WlxPlugins.GetWLxModule(I).UnloadModule;
|
||||
|
|
@ -1412,7 +1412,7 @@ begin
|
|||
|
||||
WlxPlugins:=TWLXModuleList.Create;
|
||||
WlxPlugins.Assign(gWLXPlugins);
|
||||
DebugLn('WLX: Load - OK');
|
||||
DCDebug('WLX: Load - OK');
|
||||
|
||||
FFindDialog:=nil; // dialog is created in first use
|
||||
|
||||
|
|
@ -1629,7 +1629,7 @@ procedure TfrmViewer.miProcessClick(Sender: TObject);
|
|||
sViewCmd:String;
|
||||
sCurrName:String;}
|
||||
begin
|
||||
{ DebugLn('TfrmViewer.miProcessClick');
|
||||
{ DCDebug('TfrmViewer.miProcessClick');
|
||||
inherited;
|
||||
miEdit.Visible:=True;
|
||||
if not miProcess.Checked then
|
||||
|
|
@ -2105,4 +2105,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uMasks, Clipbrd, uLng, uShowMsg, uGlobs, uPixmapManager,
|
||||
LCLProc, uMasks, Clipbrd, uLng, uShowMsg, uGlobs, uPixmapManager, uDebug,
|
||||
uDCUtils, uOSUtils, math, fMain, fMaskInputDlg, uSearchTemplate,
|
||||
uInfoToolTip, dmCommonData,
|
||||
uFileSourceProperty,
|
||||
|
|
@ -520,7 +520,7 @@ begin
|
|||
FColumnsSorting.AddSorting(SortColumn, SortDirection);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
@ -1500,7 +1500,7 @@ var
|
|||
sSearchExt : UTF8String;
|
||||
begin
|
||||
if (edtSearch.Text='') or IsEmpty then Exit;
|
||||
//DebugLn('edtSearchChange: '+ edtSearch.Text);
|
||||
//DCDebug('edtSearchChange: '+ edtSearch.Text);
|
||||
|
||||
sSearchName := UTF8LowerCase(edtSearch.Text);
|
||||
|
||||
|
|
@ -1521,7 +1521,7 @@ begin
|
|||
sSearchName := sSearchName + '*';
|
||||
end;
|
||||
|
||||
DebugLn('sSearchName = ', sSearchName);
|
||||
DCDebug('sSearchName = ', sSearchName);
|
||||
|
||||
I := dgPanel.Row; // start search from current cursor position
|
||||
iPos := I; // save cursor position
|
||||
|
|
@ -2572,7 +2572,7 @@ end;
|
|||
|
||||
procedure TColumnsFileView.CreateDefault(AOwner: TWinControl);
|
||||
begin
|
||||
DebugLn('TColumnsFileView.Create components');
|
||||
DCDebug('TColumnsFileView.Create components');
|
||||
|
||||
dgPanel := nil;
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
uFileSourceListOperation;
|
||||
uDebug, uFileSourceListOperation;
|
||||
|
||||
{ TFileSource }
|
||||
|
||||
|
|
@ -372,12 +372,12 @@ begin
|
|||
// (in the Manager) is removed there.
|
||||
InterLockedDecrement(frefcount);
|
||||
|
||||
DebugLn('Creating ', ClassName);
|
||||
DCDebug('Creating ', ClassName);
|
||||
end;
|
||||
|
||||
destructor TFileSource.Destroy;
|
||||
begin
|
||||
DebugLn('Destroying ', ClassName, ' when refcount=', DbgS(refcount));
|
||||
DCDebug('Destroying ', ClassName, ' when refcount=', DbgS(refcount));
|
||||
|
||||
if RefCount <> 0 then
|
||||
begin
|
||||
|
|
@ -385,7 +385,7 @@ begin
|
|||
// in which case RefCount will be 1, so only issue warning if there was no exception.
|
||||
// This will check for any exception, but it's enough for a warning.
|
||||
if not Assigned(ExceptObject) then
|
||||
DebugLn('Error: RefCount <> 0 for ', Self.ClassName);
|
||||
DCDebug('Error: RefCount <> 0 for ', Self.ClassName);
|
||||
end;
|
||||
|
||||
if Assigned(FileSourceManager) then
|
||||
|
|
@ -406,7 +406,7 @@ begin
|
|||
// RefCount = 0 (back at the final value)
|
||||
end
|
||||
else
|
||||
DebugLn('Error: Cannot remove file source - manager already destroyed!');
|
||||
DCDebug('Error: Cannot remove file source - manager already destroyed!');
|
||||
|
||||
FreeThenNil(FReloadEventListeners);
|
||||
|
||||
|
|
@ -756,17 +756,17 @@ begin
|
|||
FAssignedOperation := nil;
|
||||
FOperationLock := TCriticalSection.Create;
|
||||
inherited Create;
|
||||
debugln('Creating connection ', ClassName);
|
||||
DCDebug('Creating connection ', ClassName);
|
||||
end;
|
||||
|
||||
destructor TFileSourceConnection.Destroy;
|
||||
begin
|
||||
if Assigned(FAssignedOperation) and (FAssignedOperation.State <> fsosStopped) then
|
||||
DebugLn('Error: Destroying connection ', ClassName, ' with active operation ', FAssignedOperation.ClassName);
|
||||
DCDebug('Error: Destroying connection ', ClassName, ' with active operation ', FAssignedOperation.ClassName);
|
||||
|
||||
inherited Destroy;
|
||||
|
||||
DebugLn('Destroying connection ', ClassName);
|
||||
DCDebug('Destroying connection ', ClassName);
|
||||
|
||||
if Assigned(FOperationLock) then
|
||||
FreeAndNil(FOperationLock);
|
||||
|
|
@ -850,7 +850,7 @@ var
|
|||
begin
|
||||
if FFileSources.Count > 0 then
|
||||
begin
|
||||
DebugLn('Warning: Destroying manager with existing file sources!');
|
||||
DCDebug('Warning: Destroying manager with existing file sources!');
|
||||
|
||||
for i := 0 to FFileSources.Count - 1 do
|
||||
begin
|
||||
|
|
@ -875,7 +875,7 @@ begin
|
|||
FFileSources.Add(aFileSource);
|
||||
end
|
||||
else
|
||||
DebugLn('Error: File source already exists in manager!');
|
||||
DCDebug('Error: File source already exists in manager!');
|
||||
end;
|
||||
|
||||
procedure TFileSourceManager.Remove(aFileSource: IFileSource);
|
||||
|
|
@ -911,4 +911,4 @@ finalization
|
|||
FreeAndNil(FileSourceManager);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -25,8 +25,7 @@ uses
|
|||
Classes, SysUtils, syncobjs, uLng,
|
||||
uFileSourceOperationOptionsUI,
|
||||
uFileSourceOperationTypes,
|
||||
uFileSourceOperationUI,
|
||||
LCLProc;
|
||||
uFileSourceOperationUI;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -388,7 +387,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
Forms, uFileSource, uFileSourceProperty, uExceptions
|
||||
Forms, uFileSource, uFileSourceProperty, uDebug, uExceptions
|
||||
{$IFNDEF fsoSynchronizeEvents}
|
||||
, uGuiMessageQueue
|
||||
{$ENDIF}
|
||||
|
|
@ -497,7 +496,7 @@ var
|
|||
begin
|
||||
try
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': Start operation ', ClassName);
|
||||
DCDebug('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': Start operation ', ClassName);
|
||||
{$ENDIF}
|
||||
|
||||
UpdateProgress(0);
|
||||
|
|
@ -542,13 +541,13 @@ begin
|
|||
UpdateState(fsosRunning);
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before main execute');
|
||||
DCDebug('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before main execute');
|
||||
{$ENDIF}
|
||||
|
||||
MainExecute;
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': After main execute');
|
||||
DCDebug('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': After main execute');
|
||||
{$ENDIF}
|
||||
|
||||
FOperationResult := fsorFinished;
|
||||
|
|
@ -568,7 +567,7 @@ begin
|
|||
UpdateState(fsosStopped);
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Operation finished ', ClassName);
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Operation finished ', ClassName);
|
||||
{$ENDIF}
|
||||
|
||||
{$IFNDEF fsoSynchronizeEvents}
|
||||
|
|
@ -577,7 +576,7 @@ begin
|
|||
RTLeventWaitFor(FNoEventsListenersCallsScheduledEvent);
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': After wait for events');
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': After wait for events');
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
|
@ -604,7 +603,7 @@ begin
|
|||
end;
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Updated state to ', IntToStr(Integer(NewState)));
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Updated state to ', IntToStr(Integer(NewState)));
|
||||
{$ENDIF}
|
||||
NotifyStateChanged(NewState);
|
||||
end;
|
||||
|
|
@ -870,7 +869,7 @@ begin
|
|||
end;
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before notify events');
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before notify events');
|
||||
{$ENDIF}
|
||||
|
||||
if GetCurrentThreadID <> MainThreadID then
|
||||
|
|
@ -902,7 +901,7 @@ begin
|
|||
on Exception do
|
||||
begin
|
||||
WriteExceptionToErrorFile;
|
||||
DebugLn(ExceptionToString);
|
||||
DCDebug(ExceptionToString);
|
||||
ShowExceptionDialog;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -918,7 +917,7 @@ begin
|
|||
end;
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': After notify events');
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': After notify events');
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
|
@ -935,7 +934,7 @@ var
|
|||
FunctionsCount: Integer = 0;
|
||||
begin
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before call events');
|
||||
DCDebug('Op: ', hexStr(self), ' ', FormatDateTime('nnss.zzzz', Now), ': Before call events');
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF fsoSynchronizeEvents}
|
||||
|
|
@ -987,7 +986,7 @@ begin
|
|||
{$ENDIF}
|
||||
|
||||
{$IFDEF debugFileSourceOperation}
|
||||
DebugLn('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': After call events');
|
||||
DCDebug('Op: ', hexStr(Self), ' ', FormatDateTime('nnss.zzzz', Now), ': After call events');
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function RenameFile(aFileSource: IFileSource; const aFile: TFile;
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, fFileExecuteYourSelf, uGlobs, uShellExecute, uFindEx,
|
||||
LCLProc, fFileExecuteYourSelf, uGlobs, uShellExecute, uFindEx, uDebug,
|
||||
uOSUtils, uShowMsg, uTypes, uLng, uDCUtils,
|
||||
uFileSourceOperation,
|
||||
uFileSourceSetFilePropertyOperation,
|
||||
|
|
@ -93,23 +93,23 @@ begin
|
|||
case Operation.ExecuteOperationResult of
|
||||
fseorError:
|
||||
// Show error message
|
||||
DebugLn('Execution error!');
|
||||
DCDebug('Execution error!');
|
||||
fseorYourSelf:
|
||||
begin
|
||||
// Copy out file to temp file system and execute
|
||||
if not ShowFileExecuteYourSelf(aFileView, aFile, False) then
|
||||
DebugLn('Execution error!');
|
||||
DCDebug('Execution error!');
|
||||
end;
|
||||
fseorWithAll:
|
||||
begin
|
||||
// Copy out all files to temp file system and execute chosen
|
||||
if not ShowFileExecuteYourSelf(aFileView, aFile, True) then
|
||||
DebugLn('Execution error!');
|
||||
DCDebug('Execution error!');
|
||||
end;
|
||||
fseorSymLink:
|
||||
begin
|
||||
// change directory to new path (returned in Operation.SymLinkPath)
|
||||
DebugLn('Change directory to ', Operation.SymLinkPath);
|
||||
DCDebug('Change directory to ', Operation.SymLinkPath);
|
||||
aFileView.CurrentPath:= Operation.SymLinkPath;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -243,4 +243,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ unit uFileSystemUtil;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, uDescr, uLog, uGlobs,
|
||||
Classes, SysUtils, uDescr, uLog, uGlobs,
|
||||
uFile,
|
||||
uFileSourceOperation,
|
||||
uFileSourceOperationOptions,
|
||||
|
|
@ -161,8 +161,8 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uOSUtils, uDCUtils, FileUtil, uFindEx, uClassesEx, uFileProcs, uLng, uTypes,
|
||||
uFileSource, uFileSystemFileSource, uFileProperty;
|
||||
uDebug, uOSUtils, uDCUtils, FileUtil, uFindEx, uClassesEx, uFileProcs, uLng,
|
||||
uTypes, uFileSource, uFileSystemFileSource, uFileProperty;
|
||||
|
||||
procedure SplitFileMask(const DestMask: String; out DestNameMask: String; out DestExtMask: String);
|
||||
begin
|
||||
|
|
@ -931,7 +931,7 @@ begin
|
|||
if aNode.SubNodesCount > 0 then
|
||||
begin
|
||||
aSubNode := aNode.SubNodes[0];
|
||||
//DebugLn('Link ' + aFile.FullPath + ' followed to '
|
||||
//DCDebug('Link ' + aFile.FullPath + ' followed to '
|
||||
// + (aSubNode.TheFile as TFileSystemFile).FullPath
|
||||
// + ' will be copied as: ' + AbsoluteTargetFileName);
|
||||
if aSubNode.TheFile.AttributesProperty.IsDirectory then
|
||||
|
|
@ -979,7 +979,7 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Error reading link');
|
||||
DCDebug('Error reading link');
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uOSUtils, uLng, uFindEx, uClassesEx, uFileSystemUtil, LCLProc, uTypes;
|
||||
uDebug, uOSUtils, uLng, uFindEx, uClassesEx, uFileSystemUtil, LCLProc, uTypes;
|
||||
|
||||
constructor TFileSystemWipeOperation.Create(aTargetFileSource: IFileSource;
|
||||
var theFilesToWipe: TFiles);
|
||||
|
|
@ -285,7 +285,7 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
files:= files+1;
|
||||
DebugLn('OK');
|
||||
DCDebug('OK');
|
||||
FEverythingOK:= True;
|
||||
end;
|
||||
|
||||
|
|
@ -303,19 +303,19 @@ begin
|
|||
//remove read-only attr
|
||||
try
|
||||
if not mbFileSetReadOnly(sPath + Search.Name, False) then
|
||||
DebugLn('wp: FAILED when trying to remove read-only attr on '+ sPath + Search.Name);
|
||||
DCDebug('wp: FAILED when trying to remove read-only attr on '+ sPath + Search.Name);
|
||||
except
|
||||
DebugLn('wp: FAILED when trying to remove read-only attr on '+ sPath + Search.Name);
|
||||
DCDebug('wp: FAILED when trying to remove read-only attr on '+ sPath + Search.Name);
|
||||
end;
|
||||
|
||||
if fpS_ISDIR(Search.Attr) then
|
||||
begin
|
||||
DebugLn('Entering '+ sPath + Search.Name);
|
||||
DCDebug('Entering '+ sPath + Search.Name);
|
||||
WipeDir(sPath + Search.Name);
|
||||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Wiping '+ sPath + Search.Name);
|
||||
DCDebug('Wiping '+ sPath + Search.Name);
|
||||
SecureDelete(gWipePassNumber, sPath + Search.Name);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -325,11 +325,11 @@ begin
|
|||
try
|
||||
if FEverythingOK then
|
||||
begin
|
||||
DebugLn('Wiping ' + dir);
|
||||
DCDebug('Wiping ' + dir);
|
||||
|
||||
if not mbRemoveDir(dir) then
|
||||
begin
|
||||
DebugLn('wp: error wiping directory ' + dir);
|
||||
DCDebug('wp: error wiping directory ' + dir);
|
||||
// write log -------------------------------------------------------------------
|
||||
LogMessage(Format(rsMsgLogError+rsMsgLogRmDir, [dir]), [log_dir_op, log_delete], lmtError);
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -337,14 +337,14 @@ begin
|
|||
else
|
||||
begin
|
||||
directories:= directories + 1;
|
||||
DebugLn('OK');
|
||||
DCDebug('OK');
|
||||
// write log -------------------------------------------------------------------
|
||||
LogMessage(Format(rsMsgLogSuccess+rsMsgLogRmDir, [dir]), [log_dir_op, log_delete], lmtSuccess);
|
||||
//------------------------------------------------------------------------------
|
||||
end;
|
||||
end;
|
||||
except
|
||||
on EInOutError do DebugLn('Couldn''t remove '+ dir);
|
||||
on EInOutError do DCDebug('Couldn''t remove '+ dir);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ begin
|
|||
Found:= FindFirstEx(filename,faReadOnly or faSysFile or faArchive or faHidden, SRec);
|
||||
if Found <> 0 then
|
||||
begin
|
||||
DebugLn('wp: file not found: ', filename);
|
||||
DCDebug('wp: file not found: ', filename);
|
||||
FErrors:= FErrors + 1;
|
||||
Exit;
|
||||
end;
|
||||
|
|
@ -368,15 +368,15 @@ begin
|
|||
//remove read-only attr
|
||||
try
|
||||
if not mbFileSetReadOnly(sPath + SRec.Name, False) then
|
||||
DebugLn('wp: FAILED when trying to remove read-only attr on '+ sPath + SRec.Name);
|
||||
DCDebug('wp: FAILED when trying to remove read-only attr on '+ sPath + SRec.Name);
|
||||
except
|
||||
DebugLn('wp: can''t wipe '+ sPath + SRec.Name + ', file might be in use.');
|
||||
DCDebug('wp: can''t wipe '+ sPath + SRec.Name + ', file might be in use.');
|
||||
FEverythingOK:= False;
|
||||
FErrors:= FErrors + 1;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
DebugLn('Wiping ' + sPath + SRec.Name);
|
||||
DCDebug('Wiping ' + sPath + SRec.Name);
|
||||
SecureDelete(gWipePassNumber, sPath + SRec.Name);
|
||||
// write log -------------------------------------------------------------------
|
||||
if FEverythingOK then
|
||||
|
|
@ -404,7 +404,7 @@ begin
|
|||
if gProcessComments then
|
||||
FDescription.DeleteDescription(FileName);
|
||||
except
|
||||
DebugLn('Can not wipe ', FileName);
|
||||
DCDebug('Can not wipe ', FileName);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -443,4 +443,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -369,7 +369,8 @@ implementation
|
|||
|
||||
uses
|
||||
Dialogs, LCLProc, Forms, strutils,
|
||||
uActs, uLng, uShowMsg, uFileSystemFileSource, uFileSourceUtil, uDCUtils, uGlobs;
|
||||
uActs, uDebug, uLng, uShowMsg, uFileSystemFileSource, uFileSourceUtil,
|
||||
uDCUtils, uGlobs;
|
||||
|
||||
constructor TFileView.Create(AOwner: TWinControl; AFileSource: IFileSource; APath: String);
|
||||
begin
|
||||
|
|
@ -437,7 +438,7 @@ begin
|
|||
|
||||
// Wait until all the workers finish.
|
||||
FWorkersThread.Finish;
|
||||
DebugLn('Waiting for workers thread ', hexStr(FWorkersThread));
|
||||
DCDebug('Waiting for workers thread ', hexStr(FWorkersThread));
|
||||
TFunctionThread.WaitForWithSynchronize(FWorkersThread);
|
||||
FWorkersThread := nil;
|
||||
end;
|
||||
|
|
@ -450,9 +451,9 @@ begin
|
|||
with FFileViewWorkers[i] do
|
||||
begin
|
||||
if Working then
|
||||
DebugLn('Error: Worker still working.')
|
||||
DCDebug('Error: Worker still working.')
|
||||
else if not CanBeDestroyed then
|
||||
DebugLn('Error: Worker cannot be destroyed.');
|
||||
DCDebug('Error: Worker cannot be destroyed.');
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -641,7 +642,7 @@ begin
|
|||
|
||||
{$IFDEF timeFileView}
|
||||
startTime := Now;
|
||||
DebugLn('---- Start ----');
|
||||
DCDebug('---- Start ----');
|
||||
{$ENDIF}
|
||||
|
||||
StopWorkers;
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ begin
|
|||
end;
|
||||
|
||||
{$IFDEF timeFileView}
|
||||
DebugLn('Loaded files : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
DCDebug('Loaded files : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
{$ENDIF}
|
||||
|
||||
if Aborted then
|
||||
|
|
@ -424,7 +424,7 @@ begin
|
|||
Exit;
|
||||
|
||||
{$IFDEF timeFileView}
|
||||
DebugLn('Sorted files : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
DCDebug('Sorted files : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
{$ENDIF}
|
||||
|
||||
// Make display file list from file source file list.
|
||||
|
|
@ -432,7 +432,7 @@ begin
|
|||
MakeDisplayFileList(FFileSource, FTmpFileSourceFiles, FTmpDisplayFiles, FFileFilter);
|
||||
|
||||
{$IFDEF timeFileView}
|
||||
DebugLn('Made disp. list: ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
DCDebug('Made disp. list: ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
{$ENDIF}
|
||||
|
||||
if Aborted then
|
||||
|
|
@ -442,12 +442,12 @@ begin
|
|||
TThread.Synchronize(Thread, @DoSetFilelist);
|
||||
|
||||
{$IFDEF timeFileView}
|
||||
DebugLn('Grid updated : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
DCDebug('Grid updated : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
{$ENDIF}
|
||||
|
||||
finally
|
||||
{$IFDEF timeFileView}
|
||||
DebugLn('Finished : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
DCDebug('Finished : ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
|
||||
{$ENDIF}
|
||||
|
||||
FreeThenNil(FTmpDisplayFiles);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uExceptions;
|
||||
LCLProc, uDebug, uExceptions;
|
||||
|
||||
constructor TFunctionThread.Create(CreateSuspended: Boolean);
|
||||
begin
|
||||
|
|
@ -164,7 +164,7 @@ begin
|
|||
FExceptionBackTrace := ExceptionToString;
|
||||
|
||||
if FExceptionBackTrace <> EmptyStr then
|
||||
DebugLn(FExceptionBackTrace);
|
||||
DCDebug(FExceptionBackTrace);
|
||||
|
||||
Synchronize(@ShowException);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uExceptions;
|
||||
uDebug, uExceptions;
|
||||
|
||||
const
|
||||
// How many functions maximum to call per one Synchronize.
|
||||
|
|
@ -188,7 +188,7 @@ begin
|
|||
on Exception do
|
||||
begin
|
||||
WriteExceptionToErrorFile;
|
||||
DebugLn(ExceptionToString);
|
||||
DCDebug(ExceptionToString);
|
||||
ShowExceptionDialog;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -214,14 +214,14 @@ end;
|
|||
|
||||
procedure InitializeGuiMessageQueue;
|
||||
begin
|
||||
DebugLn('Starting GuiMessageQueue');
|
||||
DCDebug('Starting GuiMessageQueue');
|
||||
GuiMessageQueue := TGuiMessageQueueThread.Create(False);
|
||||
end;
|
||||
|
||||
procedure FinalizeGuiMessageQueue;
|
||||
begin
|
||||
GuiMessageQueue.Terminate;
|
||||
DebugLn('Finishing GuiMessageQueue');
|
||||
DCDebug('Finishing GuiMessageQueue');
|
||||
WaitForThreadTerminate(GuiMessageQueue.ThreadID, 10000); // wait max 10 seconds
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uGlobs, LCLProc,
|
||||
uDebug, uGlobs,
|
||||
FileUtil, uMasks, uDCUtils,
|
||||
uMultiArchiveListOperation,
|
||||
uMultiArchiveCopyInOperation,
|
||||
|
|
@ -140,7 +140,7 @@ begin
|
|||
anArchiveFileName,
|
||||
aMultiArcItem);
|
||||
|
||||
DebugLn('Found registered addon "' + aMultiArcItem.FDescription + '" for archive ' + anArchiveFileName);
|
||||
DCDebug('Found registered addon "' + aMultiArcItem.FDescription + '" for archive ' + anArchiveFileName);
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -167,7 +167,7 @@ begin
|
|||
anArchiveFileName,
|
||||
aMultiArcItem);
|
||||
|
||||
DebugLn('Found registered addon "' + aMultiArcItem.FDescription + '" for archive ' + anArchiveFileName);
|
||||
DCDebug('Found registered addon "' + aMultiArcItem.FDescription + '" for archive ' + anArchiveFileName);
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -447,7 +447,7 @@ begin
|
|||
FAllDirsList := TStringHashList.Create(True);
|
||||
|
||||
try
|
||||
DebugLn('Get File List');
|
||||
DCDebug('Get File List');
|
||||
|
||||
FOutputParser.Prepare;
|
||||
FOutputParser.Execute;
|
||||
|
|
@ -526,4 +526,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -71,7 +71,8 @@ function FormatArchiverCommand(const Archiver, sCmd, anArchiveName: UTF8String;
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, FileUtil, StrUtils, uClassesEx, uDCUtils, uOSUtils, uDateTimeUtils;
|
||||
LCLProc, FileUtil, StrUtils, uClassesEx, uDCUtils, uOSUtils, uDateTimeUtils,
|
||||
uDebug;
|
||||
|
||||
function TOutputParser.FixPosition(const Str: String; Key: TKeyPos): LongInt;
|
||||
var
|
||||
|
|
@ -124,7 +125,7 @@ begin
|
|||
Position.Count := Position.Count - Position.Start;
|
||||
Position.Index := I;
|
||||
{$IFDEF DEBUG}
|
||||
DebugLn('Key: ', Key, ' Format: ', IntToStr(I), ' Start: ', IntToStr(Position.Start), ' Count: ', IntToStr(Position.Count));
|
||||
DCDebug('Key: ', Key, ' Format: ', IntToStr(I), ' Start: ', IntToStr(Position.Start), ' Count: ', IntToStr(Position.Count));
|
||||
{$ENDIF}
|
||||
Result := True;
|
||||
Break;
|
||||
|
|
@ -141,7 +142,7 @@ end;
|
|||
procedure TOutputParser.OnReadLn(str: string);
|
||||
begin
|
||||
if FMultiArcItem.FDebug then
|
||||
DebugLn(str);
|
||||
DCDebug(str);
|
||||
|
||||
if (str = EmptyStr) or (Trim(str) = EmptyStr) then Exit; // skip empty lines
|
||||
|
||||
|
|
@ -190,11 +191,11 @@ begin
|
|||
begin
|
||||
FFormatIndex := 0;
|
||||
{$IFDEF DEBUG}
|
||||
DebugLn('FileName: ', FArchiveItem.FileName);
|
||||
DebugLn('Size: ', IntToStr(FArchiveItem.UnpSize));
|
||||
DebugLn('Pack size: ', IntToStr(FArchiveItem.PackSize));
|
||||
DebugLn('Attributes: ', IntToStr(FArchiveItem.Attributes));
|
||||
DebugLn('-------------------------------------');
|
||||
DCDebug('FileName: ', FArchiveItem.FileName);
|
||||
DCDebug('Size: ', IntToStr(FArchiveItem.UnpSize));
|
||||
DCDebug('Pack size: ', IntToStr(FArchiveItem.PackSize));
|
||||
DCDebug('Attributes: ', IntToStr(FArchiveItem.Attributes));
|
||||
DCDebug('-------------------------------------');
|
||||
{$ENDIF}
|
||||
if Assigned(FOnGetArchiveItem) then
|
||||
FOnGetArchiveItem(FArchiveItem);
|
||||
|
|
@ -259,7 +260,7 @@ begin
|
|||
sCommandLine:= FormatArchiverCommand(FMultiArcItem.FArchiver,
|
||||
FMultiArcItem.FList, FArchiveName);
|
||||
if FMultiArcItem.FDebug then
|
||||
DebugLn(sCommandLine);
|
||||
DCDebug(sCommandLine);
|
||||
|
||||
FExProcess := TExProcess.Create(sCommandLine);
|
||||
FExProcess.OnReadLn := @OnReadLn;
|
||||
|
|
@ -597,4 +598,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uExceptions;
|
||||
uDebug, uExceptions;
|
||||
|
||||
constructor TOperationThread.Create(CreateSuspended: Boolean; Operation: TFileSourceOperation);
|
||||
begin
|
||||
|
|
@ -66,7 +66,7 @@ begin
|
|||
FExceptionBackTrace := ExceptionToString;
|
||||
|
||||
if FExceptionBackTrace <> EmptyStr then
|
||||
DebugLn(FExceptionBackTrace);
|
||||
DCDebug(FExceptionBackTrace);
|
||||
|
||||
Synchronize(@ShowException);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ end;
|
|||
|
||||
function ProcessDataProc(FileName: UTF8String; Size: LongInt): LongInt;
|
||||
begin
|
||||
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
//DCDebug('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
|
||||
Result := 1;
|
||||
|
||||
|
|
@ -125,12 +125,12 @@ begin
|
|||
|
||||
{ if Size = -100 then // File finished
|
||||
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;}
|
||||
//DebugLn('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
end
|
||||
else if (Size >= -1100) and (Size <= -1000) then // second percent bar
|
||||
begin
|
||||
DoneBytes := TotalBytes * Int64(-Size - 1000) div 100;
|
||||
//DebugLn('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ end;
|
|||
|
||||
function ProcessDataProc(FileName: UTF8String; Size: LongInt): LongInt;
|
||||
begin
|
||||
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
//DCDebug('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
|
||||
Result := 1;
|
||||
|
||||
|
|
@ -162,12 +162,12 @@ begin
|
|||
|
||||
if Size = -100 then // File finished
|
||||
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;
|
||||
//DebugLn('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
end
|
||||
else if (Size >= -1100) and (Size <= -1000) then // second percent bar
|
||||
begin
|
||||
DoneBytes := TotalBytes * Int64(-Size - 1000) div 100;
|
||||
//DebugLn('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ end;
|
|||
|
||||
function ProcessDataProc(FileName: UTF8String; Size: LongInt): LongInt;
|
||||
begin
|
||||
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
//DCDebug('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
|
||||
Result := 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uGlobs, LCLProc, uDCUtils,
|
||||
LCLProc, uDebug, uDCUtils, uGlobs,
|
||||
uDateTimeUtils,
|
||||
FileUtil, uCryptProc,
|
||||
uWcxArchiveListOperation,
|
||||
|
|
@ -297,7 +297,7 @@ begin
|
|||
WcxPlugin,
|
||||
gWCXPlugins.Flags[I]);
|
||||
|
||||
DebugLn('Found registered plugin ' + ModuleFileName + ' for archive ' + anArchiveFileName);
|
||||
DCDebug('Found registered plugin ' + ModuleFileName + ' for archive ' + anArchiveFileName);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ begin
|
|||
ModuleFileName,
|
||||
gWCXPlugins.Flags[I]);
|
||||
|
||||
DebugLn('Found registered plugin ' + ModuleFileName + ' for archive ' + anArchiveFileName);
|
||||
DCDebug('Found registered plugin ' + ModuleFileName + ' for archive ' + anArchiveFileName);
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -630,7 +630,7 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
|
||||
DebugLN('Open Archive');
|
||||
DCDebug('Open Archive');
|
||||
|
||||
(*Open Archive*)
|
||||
ArcHandle := WcxModule.OpenArchiveHandle(ArchiveFileName, PK_OM_LIST, lOpenResult);
|
||||
|
|
@ -645,7 +645,7 @@ begin
|
|||
WcxModule.WcxSetChangeVolProc(ArcHandle, nil, nil {ChangeVolProc});
|
||||
WcxModule.WcxSetProcessDataProc(ArcHandle, nil, nil {ProcessDataProc});
|
||||
|
||||
DebugLN('Get File List');
|
||||
DCDebug('Get File List');
|
||||
(*Get File List*)
|
||||
FArcFileList.Clear;
|
||||
ExistsDirList := TStringHashList.Create(True);
|
||||
|
|
@ -935,4 +935,4 @@ finalization
|
|||
FreeThenNil(WcxOperationsQueueLock);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ end;
|
|||
|
||||
function ProcessDataProc(FileName: UTF8String; Size: LongInt): LongInt;
|
||||
begin
|
||||
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
//DCDebug('Working ' + FileName + ' Size = ' + IntToStr(Size));
|
||||
|
||||
Result := 1;
|
||||
|
||||
|
|
@ -116,12 +116,12 @@ begin
|
|||
|
||||
if Size = -100 then // File finished
|
||||
DoneBytes := DoneBytes + WcxTestArchiveOperation.FCurrentFileSize;
|
||||
//DebugLn('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
|
||||
end
|
||||
else if (Size >= -1100) and (Size <= -1000) then // second percent bar
|
||||
begin
|
||||
DoneBytes := TotalBytes * Int64(-Size - 1000) div 100;
|
||||
//DebugLn('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
//DCDebug('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ function TWfxPluginCopyInOperation.UpdateProgress(SourceName,TargetName: UTF8Str
|
|||
begin
|
||||
Result := 0;
|
||||
|
||||
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
//DCDebug('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
|
||||
if State = fsosStopping then // Cancel operation
|
||||
Exit(1);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function TWfxPluginCopyOperation.UpdateProgress(SourceName, TargetName: UTF8Stri
|
|||
begin
|
||||
Result := 0;
|
||||
|
||||
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
//DCDebug('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
|
||||
if State = fsosStopping then // Cancel operation
|
||||
Exit(1);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function TWfxPluginCopyOutOperation.UpdateProgress(SourceName, TargetName: UTF8S
|
|||
begin
|
||||
Result := 0;
|
||||
|
||||
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
//DCDebug('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
|
||||
if State = fsosStopping then // Cancel operation
|
||||
Exit(1);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ implementation
|
|||
|
||||
uses
|
||||
LCLProc, FileUtil, StrUtils, {} LCLType, uShowMsg, {} uGlobs, uDCUtils, uLog,
|
||||
uLng, uCryptProc, uFileAttributes, uConnectionManager,
|
||||
uDebug, uLng, uCryptProc, uFileAttributes, uConnectionManager,
|
||||
uWfxPluginCopyInOperation, uWfxPluginCopyOutOperation, uWfxPluginMoveOperation,
|
||||
uWfxPluginExecuteOperation, uWfxPluginListOperation, uWfxPluginCreateDirectoryOperation,
|
||||
uWfxPluginDeleteOperation, uWfxPluginSetFilePropertyOperation, uWfxPluginCopyOperation;
|
||||
|
|
@ -129,7 +129,7 @@ var
|
|||
begin
|
||||
Result:= 0;
|
||||
|
||||
DebugLn('MainProgressProc ('+IntToStr(PluginNr)+','+SourceName+','+TargetName+','+IntToStr(PercentDone)+')=' ,IntTostr(Result));
|
||||
DCDebug('MainProgressProc ('+IntToStr(PluginNr)+','+SourceName+','+TargetName+','+IntToStr(PercentDone)+')=' ,IntTostr(Result));
|
||||
|
||||
CallbackDataClass:= TCallbackDataClass(WfxOperationList.Objects[PluginNr]);
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ Begin
|
|||
// write log info
|
||||
logWrite(sMsg + ', ' + logString, LogMsgType, True, bLogFile);
|
||||
|
||||
//DebugLn('MainLogProc ('+ sMsg + ',' + logString + ')');
|
||||
//DCDebug('MainLogProc ('+ sMsg + ',' + logString + ')');
|
||||
end;
|
||||
|
||||
procedure MainLogProcA(PluginNr, MsgType: Integer; LogString: PAnsiChar); stdcall;
|
||||
|
|
@ -286,7 +286,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
DebugLn('MainRequestProc ('+IntToStr(PluginNr)+','+sReq+','+CustomTitle+','+CustomText+','+ReturnedText+')', BoolToStr(Result, True));
|
||||
DCDebug('MainRequestProc ('+IntToStr(PluginNr)+','+sReq+','+CustomTitle+','+CustomText+','+ReturnedText+')', BoolToStr(Result, True));
|
||||
end;
|
||||
|
||||
function MainRequestProcA(PluginNr, RequestType: Integer; CustomTitle, CustomText, ReturnedText: PAnsiChar; MaxLen: Integer): Bool; stdcall;
|
||||
|
|
@ -755,7 +755,7 @@ begin
|
|||
sModuleFileName:= GetCmdDirFromEnvVar(sModuleFileName);
|
||||
Result:= TWfxPluginFileSource.Create(sModuleFileName, aRootName);
|
||||
|
||||
DebugLn('Found registered plugin ' + sModuleFileName + ' for file system ' + aRootName);
|
||||
DCDebug('Found registered plugin ' + sModuleFileName + ' for file system ' + aRootName);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -774,4 +774,4 @@ finalization
|
|||
if Assigned(WfxOperationList) then
|
||||
FreeAndNil(WfxOperationList);
|
||||
|
||||
end.
|
||||
end.
|
||||
|
|
@ -62,7 +62,7 @@ function TWfxPluginMoveOperation.UpdateProgress(SourceName, TargetName: UTF8Stri
|
|||
begin
|
||||
Result := 0;
|
||||
|
||||
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
//DCDebug('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
|
||||
|
||||
if State = fsosStopping then // Cancel operation
|
||||
Exit(1);
|
||||
|
|
|
|||
|
|
@ -340,8 +340,8 @@ begin
|
|||
sTargetFile := FRootTargetPath + ExtractDirLevel(aFiles.Path, aFile.Path);
|
||||
sTargetFile := sTargetFile + ApplyRenameMask(aFile, FRenameNameMask, FRenameExtMask);
|
||||
|
||||
//DebugLn('Source name == ' + aFile.FullPath);
|
||||
//DebugLn('Target name == ' + sTargetFile);
|
||||
//DCDebug('Source name == ' + aFile.FullPath);
|
||||
//DCDebug('Target name == ' + sTargetFile);
|
||||
|
||||
with FStatistics do
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ procedure FixFormIcon(Handle: LCLType.HWND);
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, FileUtil, uDCUtils, uGlobs
|
||||
FileUtil, uDebug, uDCUtils, uGlobs
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
, Windows, uNTFSLinks, uMyWindows, JwaWinNetWk, uShlObjAdditional
|
||||
{$ENDIF}
|
||||
|
|
@ -502,7 +502,7 @@ begin
|
|||
if fpLChown(PChar(sDst),StatInfo.st_uid, StatInfo.st_gid)=-1 then
|
||||
begin
|
||||
// development messages
|
||||
DebugLN(Format('chown (%s) failed',[sDst]));
|
||||
DCDebug(Format('chown (%s) failed',[sDst]));
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
|
@ -518,7 +518,7 @@ begin
|
|||
if fpChown(PChar(sDst),StatInfo.st_uid, StatInfo.st_gid)=-1 then
|
||||
begin
|
||||
// development messages
|
||||
DebugLN(Format('chown (%s) failed',[sDst]));
|
||||
DCDebug(Format('chown (%s) failed',[sDst]));
|
||||
end;
|
||||
// mod
|
||||
mode := StatInfo.st_mode;
|
||||
|
|
@ -527,7 +527,7 @@ begin
|
|||
if fpChmod(PChar(sDst), mode) = -1 then
|
||||
begin
|
||||
// development messages
|
||||
DebugLN(Format('chmod (%s) failed',[sDst]));
|
||||
DCDebug(Format('chmod (%s) failed',[sDst]));
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -591,7 +591,7 @@ begin
|
|||
end;
|
||||
|
||||
SplitCmdLine(sCmdLine, sFileName, sParams);
|
||||
DebugLn('File: ' + sFileName + ' Params: ' + sParams + ' WorkDir: ' + wWorkDir);
|
||||
DCDebug('File: ' + sFileName + ' Params: ' + sParams + ' WorkDir: ' + wWorkDir);
|
||||
wFileName:= UTF8Decode(sFileName);
|
||||
wParams:= UTF8Decode(sParams);
|
||||
Result := (ShellExecuteW(0, 'open', PWChar(wFileName), PWChar(wParams), PWChar(wWorkDir), SW_SHOW) > 32);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ implementation
|
|||
|
||||
uses
|
||||
{$IFDEF UNIX}
|
||||
Unix, uMyUnix, LCLProc
|
||||
Unix, uMyUnix, uDebug
|
||||
{$IFDEF BSD}
|
||||
, BSD, BaseUnix, StrUtils
|
||||
{$ENDIF}
|
||||
|
|
@ -200,7 +200,7 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Detecting devices through /etc/mtab.');
|
||||
DCDebug('Detecting devices through /etc/mtab.');
|
||||
TFileSystemWatcher.AddWatch('/etc', [wfFileNameChange], @FakeClass.OnWatcherNotifyEvent);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
|
@ -764,7 +764,7 @@ begin
|
|||
AddedMountPoints.Add(MountPoint);
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
DebugLn('Adding drive "' + DeviceFile + '" with mount point "' + MountPoint + '"');
|
||||
DCDebug('Adding drive "' + DeviceFile + '" with mount point "' + MountPoint + '"');
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
|
@ -965,7 +965,7 @@ end;
|
|||
|
||||
procedure TKQueueDriveEventWatcher.RaiseErrorEvent;
|
||||
begin
|
||||
DebugLn(Self.ErrorMsg);
|
||||
DCDebug(Self.ErrorMsg);
|
||||
if Assigned(Self.FOnError) then
|
||||
Self.FOnError(Self);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uExceptions, syncobjs, fgl
|
||||
LCLProc, uDebug, uExceptions, syncobjs, fgl
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
,Windows
|
||||
{$ELSEIF DEFINED(LINUX)}
|
||||
|
|
@ -171,7 +171,7 @@ class procedure TFileSystemWatcher.DestroyFileSystemWatcher;
|
|||
begin
|
||||
if Assigned(FileSystemWatcher) then
|
||||
begin
|
||||
DebugLn('Waiting for FileSystemWatcher thread');
|
||||
DCDebug('Waiting for FileSystemWatcher thread');
|
||||
FileSystemWatcher.Terminate;
|
||||
{$IF (fpc_version<2) or ((fpc_version=2) and (fpc_release<5))}
|
||||
If (MainThreadID=GetCurrentThreadID) then
|
||||
|
|
@ -225,14 +225,14 @@ type
|
|||
|
||||
procedure ShowError(const sErrMsg: String);
|
||||
begin
|
||||
DebugLn('FSWatcher: ' + sErrMsg + ': ' + SysErrorMessage(GetLastOSError));
|
||||
DCDebug('FSWatcher: ' + sErrMsg + ': ' + SysErrorMessage(GetLastOSError));
|
||||
end;
|
||||
|
||||
{ TFileSystemWatcherImpl }
|
||||
|
||||
procedure TFileSystemWatcherImpl.Execute;
|
||||
begin
|
||||
// DebugLn('FileSystemWatcher thread starting');
|
||||
DCDebug('FileSystemWatcher thread starting');
|
||||
try
|
||||
try
|
||||
ExecuteWatcher;
|
||||
|
|
@ -243,14 +243,14 @@ begin
|
|||
FExceptionBackTrace := ExceptionToString;
|
||||
|
||||
if FExceptionBackTrace <> EmptyStr then
|
||||
DebugLn(FExceptionBackTrace);
|
||||
DCDebug(FExceptionBackTrace);
|
||||
|
||||
Synchronize(@ShowException);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FFinished := True;
|
||||
//DebugLn('FileSystemWatcher thread finished');
|
||||
DCDebug('FileSystemWatcher thread finished');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -1007,4 +1007,4 @@ finalization
|
|||
TFileSystemWatcher.DestroyFileSystemWatcher;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ function CheckAttrMask(DefaultAttr : TFileAttrs; sAttr : String; Attr : TFileAtt
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc
|
||||
LCLProc, uDebug
|
||||
{$IFDEF UNIX}
|
||||
, uMyUnix, Unix
|
||||
{$ELSE}
|
||||
|
|
@ -122,7 +122,7 @@ end;
|
|||
var
|
||||
UnixFindData: PUnixFindData;
|
||||
begin
|
||||
//DebugLn('FindFirstEx with Path == ', Path);
|
||||
//DCDebug('FindFirstEx with Path == ', Path);
|
||||
{ Allocate UnixFindData }
|
||||
New(UnixFindData);
|
||||
FillChar(UnixFindData^, SizeOf(UnixFindData^), 0);
|
||||
|
|
@ -241,10 +241,10 @@ begin
|
|||
begin
|
||||
if Boolean(DefaultAttr and faDirectory) then
|
||||
Result := Result and fpS_ISDIR(Attr);
|
||||
DebugLn('Result do == ', BoolToStr(Result));
|
||||
DCDebug('Result do == ', BoolToStr(Result));
|
||||
if Boolean(DefaultAttr and faSymLink) then
|
||||
Result := Result and ((Attr and S_IFLNK) = S_IFLNK);
|
||||
DebugLn('Result after == ', BoolToStr(Result));
|
||||
DCDebug('Result after == ', BoolToStr(Result));
|
||||
end;
|
||||
if Length(sAttr) < 9 then Exit;
|
||||
|
||||
|
|
@ -273,4 +273,4 @@ end;
|
|||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, StrUtils, uDCUtils, uFindEx, uTypes, uOSUtils
|
||||
LCLProc, StrUtils, uDCUtils, uDebug, uFindEx, uTypes, uOSUtils
|
||||
{$IF DEFINED(UNIX) AND NOT DEFINED(DARWIN)}
|
||||
, uUnixIconTheme
|
||||
{$ENDIF}
|
||||
|
|
@ -239,7 +239,7 @@ begin
|
|||
// theme not found
|
||||
if Result = False then
|
||||
begin
|
||||
DebugLn('Theme ', FTheme, ' not found.');
|
||||
DCDebug('Theme ', FTheme, ' not found.');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ begin
|
|||
FThemeName:= IniFile.ReadString('Icon Theme', 'Name', EmptyStr);
|
||||
FComment:= IniFile.ReadString('Icon Theme', 'Comment', EmptyStr);
|
||||
|
||||
DebugLn('Loading icon theme ', FThemeName);
|
||||
DCDebug('Loading icon theme ', FThemeName);
|
||||
|
||||
// read theme directories
|
||||
sValue:= IniFile.ReadString('Icon Theme', 'Directories', EmptyStr);
|
||||
|
|
@ -382,7 +382,7 @@ begin
|
|||
else
|
||||
begin
|
||||
Dispose(Result);
|
||||
DebugLn('Theme directory "%s" has unsupported icon type "%s"', [sIconDirName, IconTypeStr]);
|
||||
DCDebug('Theme directory "%s" has unsupported icon type "%s"', [sIconDirName, IconTypeStr]);
|
||||
Exit(nil);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ var
|
|||
procedure PrintError(const sMessage: String; pError: PDBusError);
|
||||
begin
|
||||
if Assigned(pError) and (dbus_error_is_set(pError) <> 0) then
|
||||
DebugLn(sMessage + ': ' + pError^.name + ' ' + pError^.message)
|
||||
DCDebug(sMessage + ': ' + pError^.name + ' ' + pError^.message)
|
||||
else
|
||||
DebugLn(sMessage);
|
||||
DCDebug(sMessage);
|
||||
end;
|
||||
|
||||
procedure CheckBlockDev(ctx: PLibHalContext; const udi: PChar; const CreateArray: boolean = False);
|
||||
|
|
@ -118,7 +118,7 @@ begin
|
|||
libhal_free_string(cap);
|
||||
end;
|
||||
|
||||
//DebugLn(s);
|
||||
//DCDebug(s);
|
||||
end;
|
||||
|
||||
function CreateBlokDevArr: Boolean;
|
||||
|
|
@ -142,7 +142,7 @@ begin
|
|||
dbus_error_free(@DcDbusError);
|
||||
Exit;
|
||||
end;
|
||||
//DebugLn('Number of devices: ' + IntToStr(numDevices));
|
||||
//DCDebug('Number of devices: ' + IntToStr(numDevices));
|
||||
|
||||
// show info for all dev
|
||||
for i := 0 to numDevices - 1 do
|
||||
|
|
@ -163,14 +163,14 @@ var
|
|||
begin
|
||||
Result := False;
|
||||
|
||||
DebugLn('Initializing HAL');
|
||||
DCDebug('Initializing HAL');
|
||||
|
||||
// create new HAL
|
||||
DcHalCtx := libhal_ctx_new;
|
||||
|
||||
if DcHalCtx = nil then
|
||||
begin
|
||||
DebugLn('Cannot create HAL context');
|
||||
DCDebug('Cannot create HAL context');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ begin
|
|||
// Set dbus connection for the HAL context.
|
||||
if libhal_ctx_set_dbus_connection(DcHalCtx, DcDbus) = 0 then
|
||||
begin
|
||||
DebugLn('Cannot set DBUS connection for HAL context');
|
||||
DCDebug('Cannot set DBUS connection for HAL context');
|
||||
FreeHal;
|
||||
Exit;
|
||||
end;
|
||||
|
|
@ -212,22 +212,22 @@ begin
|
|||
HalConnectionOpen := True;
|
||||
|
||||
if libhal_ctx_set_device_added(DcHalCtx, @LibHalDeviceAdded) = 0 then
|
||||
DebugLn('Cannot register LibHalDeviceAdded');
|
||||
DCDebug('Cannot register LibHalDeviceAdded');
|
||||
|
||||
if libhal_ctx_set_device_removed(DcHalCtx, @LibHalDeviceRemoved) = 0 then
|
||||
DebugLn('Cannot register LibHalDeviceRemoved');
|
||||
DCDebug('Cannot register LibHalDeviceRemoved');
|
||||
|
||||
if libhal_ctx_set_device_new_capability(DcHalCtx, @LibHalDeviceNewCapability) = 0 then
|
||||
DebugLn('Cannot register LibHalDeviceNewCapability');
|
||||
DCDebug('Cannot register LibHalDeviceNewCapability');
|
||||
|
||||
if libhal_ctx_set_device_lost_capability(DcHalCtx, @LibHalDeviceLostCapability) = 0 then
|
||||
DebugLn('Cannot register LibHalDeviceLostCapability');
|
||||
DCDebug('Cannot register LibHalDeviceLostCapability');
|
||||
|
||||
if libhal_ctx_set_device_property_modified(DcHalCtx, @LibHalDevicePropertyModified) = 0 then
|
||||
DebugLn('Cannot register LibHalDevicePropertyModified');
|
||||
DCDebug('Cannot register LibHalDevicePropertyModified');
|
||||
|
||||
if libhal_ctx_set_device_condition(DcHalCtx, @LibHalDeviceCondition) = 0 then
|
||||
DebugLn('Cannot register LibHalDeviceCondition');
|
||||
DCDebug('Cannot register LibHalDeviceCondition');
|
||||
|
||||
// Watch all properties.
|
||||
dbus_error_init(@DcDbusError);
|
||||
|
|
@ -247,13 +247,13 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
|
||||
DebugLn('HAL initialized OK');
|
||||
DCDebug('HAL initialized OK');
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
procedure LibHalDeviceAdded(ctx: PLibHalContext; const udi: PChar); cdecl;
|
||||
begin
|
||||
DebugLn('HAL: new device added: ',udi);
|
||||
DCDebug('HAL: new device added: ',udi);
|
||||
// sleep(1500); // if we dont do it we don`t see new dev
|
||||
CheckBlockDev(ctx,udi); // it return value 2 time on one flash like /dev/sda /dev/sda1
|
||||
end;
|
||||
|
|
@ -267,14 +267,14 @@ begin
|
|||
// here we can know only UDI
|
||||
// UDI here don`t have mount point and dev name
|
||||
|
||||
// DebugLn('remove dev ', udi);
|
||||
// DCDebug('remove dev ', udi);
|
||||
if DeviceList.IndexOf(udi) > -1 then
|
||||
begin
|
||||
DeviceWasChanged := True;
|
||||
DeviceList.Delete(DeviceList.IndexOf(udi));
|
||||
//CreateBlokDevArr; or we can re create DeviceList
|
||||
end;
|
||||
DebugLn('HAL: Device was removed: ', udi);
|
||||
DCDebug('HAL: Device was removed: ', udi);
|
||||
end;
|
||||
|
||||
procedure LibHalDeviceNewCapability(ctx: PLibHalContext; const udi: PChar; const capability: PChar);cdecl;
|
||||
|
|
@ -329,7 +329,7 @@ begin
|
|||
begin
|
||||
if HalConnectionOpen then
|
||||
begin
|
||||
DebugLn('Shutting down HAL');
|
||||
DCDebug('Shutting down HAL');
|
||||
libhal_ctx_shutdown(DcHalCtx, nil);
|
||||
HalConnectionOpen := False;
|
||||
end;
|
||||
|
|
@ -340,7 +340,7 @@ begin
|
|||
begin
|
||||
if DBusConnectionOpen then
|
||||
begin
|
||||
DebugLn('Closing DBUS connection');
|
||||
DCDebug('Closing DBUS connection');
|
||||
dbus_connection_close(DcDbus);
|
||||
DBusConnectionOpen := False;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ function execl(__path:Pchar; __arg:Pchar):longint;cdecl;varargs;external clib na
|
|||
|
||||
implementation
|
||||
|
||||
uses
|
||||
uDebug;
|
||||
|
||||
{ TUnixConThread }
|
||||
|
||||
procedure TUnixConThread.WriteS(const s:UTF8String);
|
||||
|
|
@ -251,14 +254,14 @@ end;
|
|||
|
||||
procedure TUnixConThread.CSI_CaretTo(Y,X:integer); //хз x y или y x. Надо проверить.
|
||||
begin
|
||||
debugln(' Y: '+inttostr(Y)+' X: '+inttostr(X));
|
||||
DCDebug(' Y: '+inttostr(Y)+' X: '+inttostr(X));
|
||||
//Fout.OutY:=Y;
|
||||
//Fout.OutX:=X;
|
||||
end;
|
||||
|
||||
procedure TUnixConThread.CSIProc(NCode, Param:integer; ExParam:integer=0);
|
||||
begin
|
||||
//debugln('Code:'+Inttostr(NCode)+' Param: '+inttostr(Param));
|
||||
//DCDebug('Code:'+Inttostr(NCode)+' Param: '+inttostr(Param));
|
||||
case NCode of
|
||||
9:CSI_CaretTo(Param,ExParam);
|
||||
24:CSI_Colors(Param);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ implementation
|
|||
|
||||
uses
|
||||
LCLIntf, LCLType, LCLProc, Forms, uGlobsPaths, WcxPlugin,
|
||||
uGlobs, uDCUtils, uFileSystemFileSource, uReSample
|
||||
uGlobs, uDCUtils, uFileSystemFileSource, uReSample, uDebug
|
||||
{$IFDEF LCLGTK2}
|
||||
, uPixMapGtk, gdk2pixbuf, gdk2, glib2
|
||||
{$ENDIF}
|
||||
|
|
@ -349,7 +349,7 @@ begin
|
|||
begin
|
||||
if Assigned(ABitmap) then
|
||||
FreeAndNil(ABitmap);
|
||||
DebugLn(Format('Error: Cannot load pixmap [%s] : %s',[AIconFileName, e.Message]));
|
||||
DCDebug(Format('Error: Cannot load pixmap [%s] : %s',[AIconFileName, e.Message]));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -486,7 +486,7 @@ function TPixMapManager.CheckLoadPixmap(const AIconName: String): Graphics.TBitm
|
|||
begin
|
||||
if not mbFileExists(AIconName) then
|
||||
begin
|
||||
DebugLn(Format('Warning: pixmap [%s] not exists!',[AIconName]));
|
||||
DCDebug(Format('Warning: pixmap [%s] not exists!',[AIconName]));
|
||||
Exit(nil);
|
||||
end;
|
||||
LoadBitmap(AIconName, Result);
|
||||
|
|
@ -530,7 +530,7 @@ begin
|
|||
begin
|
||||
if not mbFileExists(AIconName) then
|
||||
begin
|
||||
DebugLn(Format('Warning: pixmap [%s] not exists!', [AIconName]));
|
||||
DCDebug(Format('Warning: pixmap [%s] not exists!', [AIconName]));
|
||||
Exit;
|
||||
end;
|
||||
{$IFDEF LCLGTK2}
|
||||
|
|
@ -541,7 +541,7 @@ begin
|
|||
FPixmapsFileNames.Add(AIconName, Pointer(Result));
|
||||
end
|
||||
else
|
||||
DebugLn(Format('Error: pixmap [%s] not loaded!', [AIconName]));
|
||||
DCDebug(Format('Error: pixmap [%s] not loaded!', [AIconName]));
|
||||
{$ELSE}
|
||||
if LoadBitmap(AIconName, bmpBitmap) then
|
||||
begin
|
||||
|
|
@ -1150,7 +1150,7 @@ begin
|
|||
iPixMap:= CheckAddPixmap(sPixMap, gIconsSize);
|
||||
if iPixMap < 0 then Continue;
|
||||
gExts.Items[I].IconIndex:= iPixMap;
|
||||
//DebugLn('sPixMap = ',sPixMap, ' Index = ', IntToStr(iPixMap));
|
||||
//DCDebug('sPixMap = ',sPixMap, ' Index = ', IntToStr(iPixMap));
|
||||
|
||||
// set pixmap index for all extensions
|
||||
for iekv := 0 to gExts.Items[I].Extensions.Count - 1 do
|
||||
|
|
@ -1739,7 +1739,7 @@ end;
|
|||
|
||||
procedure LoadPixMapManager;
|
||||
begin
|
||||
DebugLn('Creating PixmapManager');
|
||||
DCDebug('Creating PixmapManager');
|
||||
PixMapManager:=TPixMapManager.Create;
|
||||
PixMapManager.Load(gpCfgDir + 'pixmaps.txt');
|
||||
end;
|
||||
|
|
@ -1750,7 +1750,7 @@ finalization
|
|||
|
||||
if Assigned(PixMapManager) then
|
||||
begin
|
||||
DebugLn('Shutting down PixmapManager');
|
||||
DCDebug('Shutting down PixmapManager');
|
||||
FreeAndNil(PixMapManager);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ function DriveSupportsSymlinks(const fn: WideString): boolean;
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc;
|
||||
LCLProc, uDebug;
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
|
@ -126,14 +126,14 @@ begin
|
|||
hLib:= GetModuleHandle('kernel32.dll');
|
||||
if hLib = 0 then
|
||||
begin
|
||||
DebugLn('Can not load library "kernel32.dll"');
|
||||
DCDebug('Can not load library "kernel32.dll"');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CreateHardLinkW:= TCreateHardLinkW(GetProcAddress(hLib, 'CreateHardLinkW'));
|
||||
if not Assigned(CreateHardLinkW) then
|
||||
begin
|
||||
DebugLn('Can not get function address for "CreateHardLinkW"');
|
||||
DCDebug('Can not get function address for "CreateHardLinkW"');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
@ -341,14 +341,14 @@ begin
|
|||
hLib:= GetModuleHandle('kernel32.dll');
|
||||
if hLib = 0 then
|
||||
begin
|
||||
DebugLn('Can not load library "kernel32.dll"');
|
||||
DCDebug('Can not load library "kernel32.dll"');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CreateSymbolicLinkW:= TCreateSymbolicLinkW(GetProcAddress(hLib, 'CreateSymbolicLinkW'));
|
||||
if not Assigned(CreateSymbolicLinkW) then
|
||||
begin
|
||||
DebugLn('Can not get function address for "CreateSymbolicLinkW"');
|
||||
DCDebug('Can not get function address for "CreateSymbolicLinkW"');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
@ -469,7 +469,7 @@ begin
|
|||
|
||||
if h = INVALID_HANDLE_VALUE then
|
||||
begin
|
||||
DebugLn('CreateFileW failed');
|
||||
DCDebug('CreateFileW failed');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ begin
|
|||
|
||||
if not control then
|
||||
begin
|
||||
DebugLn('DeviceIoControl failed');
|
||||
DCDebug('DeviceIoControl failed');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, LCLProc, uGlobs, uMasks, uFileProperty;
|
||||
SysUtils, uDebug, uGlobs, uMasks, uFileProperty;
|
||||
|
||||
constructor TColorExt.Create;
|
||||
begin
|
||||
|
|
@ -287,7 +287,7 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
|
|
@ -316,4 +316,4 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
end.
|
||||
|
|
@ -16,7 +16,7 @@ procedure LoadPaths;
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, SysUtils, FileUtil, uOSUtils, uDCUtils;
|
||||
SysUtils, FileUtil, uDebug, uOSUtils, uDCUtils;
|
||||
|
||||
function GetAppName : String;
|
||||
begin
|
||||
|
|
@ -27,7 +27,7 @@ procedure LoadPaths;
|
|||
begin
|
||||
OnGetApplicationName := @GetAppName;
|
||||
gpExePath := ExtractFilePath(TryReadAllLinks(ParamStrUTF8(0)));
|
||||
DebugLn('Executable directory: ', gpExePath);
|
||||
DCDebug('Executable directory: ', gpExePath);
|
||||
|
||||
gpGlobalCfgDir := gpExePath;
|
||||
if gpCmdLineCfgDir <> EmptyStr then
|
||||
|
|
@ -42,7 +42,7 @@ begin
|
|||
gpCfgDir := GetAppConfigDir;
|
||||
if gpCfgDir = EmptyStr then
|
||||
begin
|
||||
DebugLn('Warning: Cannot get user config directory.');
|
||||
DCDebug('Warning: Cannot get user config directory.');
|
||||
gpCfgDir := gpGlobalCfgDir;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -56,4 +56,4 @@ begin
|
|||
mbSetEnvironmentVariable('commander_path', ExcludeTrailingBackslash(gpExePath));
|
||||
end;
|
||||
|
||||
end.
|
||||
end.
|
||||
|
|
@ -95,8 +95,8 @@ procedure InitDialogButtonWidth;
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLIntf, SysUtils, StdCtrls, Graphics, Math, LCLProc, typinfo,
|
||||
fMsg, uLng, Buttons, Controls, uLog, uGlobs;
|
||||
LCLIntf, SysUtils, StdCtrls, Graphics, Math, typinfo,
|
||||
fMsg, uLng, Buttons, Controls, uLog, uGlobs, uDebug;
|
||||
|
||||
const
|
||||
cMsgName = 'Double Commander';
|
||||
|
|
@ -502,7 +502,7 @@ begin
|
|||
begin
|
||||
// A reminder in case someone forgots to assign text.
|
||||
if cLngButton[I] = EmptyStr then
|
||||
DebugLn('Warning: MsgBox button ' + GetEnumName(TypeInfo(TMyMsgButton), Integer(I)) + ' caption not set.');
|
||||
DCDebug('Warning: MsgBox button ' + GetEnumName(TypeInfo(TMyMsgButton), Integer(I)) + ' caption not set.');
|
||||
|
||||
with Application.MainForm.Canvas do
|
||||
if TextWidth(cLngButton[I]) >= (cButtonWidth - 8) then
|
||||
|
|
@ -510,4 +510,4 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
end.
|
||||
|
|
@ -2117,7 +2117,6 @@ end;
|
|||
|
||||
procedure TActs.cm_Search(param:string);
|
||||
begin
|
||||
DebugLn('ShowFindDlg');
|
||||
ShowFindDlg(frmMain.ActiveFrame.CurrentPath);
|
||||
end;
|
||||
|
||||
|
|
@ -2889,4 +2888,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ unit uColumns;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, uClassesEx, LCLProc, Graphics, uFile, uFileSource,
|
||||
Classes, SysUtils, uClassesEx, Graphics, uFile, uFileSource,
|
||||
uXmlConfig, uFileFunctions;
|
||||
|
||||
type
|
||||
|
|
@ -215,7 +215,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uLng, uGlobs;
|
||||
uDebug, uLng, uGlobs;
|
||||
|
||||
function StrToAlign(str: String): TAlignment;
|
||||
begin
|
||||
|
|
@ -946,9 +946,9 @@ begin
|
|||
fSet.AddObject(Ini.ReadString('ColumnsSet', 'ColumnsSet' +
|
||||
IntToStr(I + 1) + 'Name', ''), TPanelColumnsClass.Create);
|
||||
TPanelColumnsClass(fSet.Objects[I]).Load(ini, fset[i]);
|
||||
DebugLn('FsetName=' + Fset[i]);
|
||||
DCDebug('FsetName=' + Fset[i]);
|
||||
end;
|
||||
DebugLn('FsetCount=' + IntToStr(fset.Count));
|
||||
DCDebug('FsetCount=' + IntToStr(fset.Count));
|
||||
end;
|
||||
|
||||
procedure TPanelColumnsList.Load(AConfig: TXmlConfig; ANode: TXmlNode);
|
||||
|
|
@ -974,7 +974,7 @@ begin
|
|||
AnObject.Load(AConfig, ANode);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
@ -1060,7 +1060,7 @@ end;
|
|||
|
||||
function TPanelColumnsList.GetColumnSet(const Index: Integer): TPanelColumnsClass;
|
||||
begin
|
||||
//DebugLn('FsetCount='+inttostr(fset.Count));
|
||||
//DCDebug('FsetCount='+inttostr(fset.Count));
|
||||
if (Index > -1) and (Index < Fset.Count) then
|
||||
Result := TPanelColumnsClass(Fset.Objects[Index])
|
||||
else
|
||||
|
|
@ -1076,7 +1076,7 @@ end;
|
|||
|
||||
function TPanelColumnsList.GetColumnSet(Setname: String): TPanelColumnsClass;
|
||||
begin
|
||||
//DebugLn('FsetCount='+inttostr(fset.Count));
|
||||
//DCDebug('FsetCount='+inttostr(fset.Count));
|
||||
if fset.IndexOf(Setname) > -1 then
|
||||
Result := TPanelColumnsClass(Fset.Objects[fset.IndexOf(Setname)])
|
||||
else
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, LCLType, Base64, BlowFish, md5, uShowMsg, uGlobsPaths, uLng;
|
||||
LCLProc, LCLType, Base64, BlowFish, md5, uShowMsg, uGlobsPaths, uLng, uDebug;
|
||||
|
||||
type
|
||||
TBlowFishKeyRec = record
|
||||
|
|
@ -214,7 +214,7 @@ begin
|
|||
try
|
||||
PasswordStore:= TPasswordStore.Create(gpCfgDir + 'pwd.ini', fmOpenReadWrite);
|
||||
except
|
||||
DebugLn('Can not create secure password store!');
|
||||
DCDebug('Can not create secure password store!');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -229,4 +229,4 @@ finalization
|
|||
FreeThenNil(PasswordStore);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -727,7 +727,7 @@ Begin
|
|||
End;
|
||||
sl.Free;
|
||||
End;
|
||||
//DebugLn('PathX ' , Result);
|
||||
//DCDebug('PathX ' , Result);
|
||||
if Canvas.TextWidth(Result) > MaxLen + Canvas.TextWidth('XXX') then
|
||||
begin
|
||||
while (Length(Result) > 0) and (Canvas.TextWidth(Result) > MaxLen) do
|
||||
|
|
|
|||
139
src/udebug.pas
Normal file
139
src/udebug.pas
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
Double Commander
|
||||
-------------------------------------------------------------------------
|
||||
This unit contains functions used for debugging.
|
||||
|
||||
Copyright (C) 2011 Przemysław Nagay (cobines@gmail.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit uDebug;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
|
||||
// Thread-safe calling DebugLn.
|
||||
// Still not fully safe because may conflict with DebugLn called by LCL,
|
||||
// so maybe redirect LCL to a file and use DCDebug as thread-safe write to console.
|
||||
// Or write directly with Writeln(StdOut, ...)
|
||||
procedure DCDebug(Args: array of const);
|
||||
procedure DCDebug(const S: String; Args: array of const);// similar to Format(s,Args)
|
||||
procedure DCDebug(const s: String);
|
||||
procedure DCDebug(const s1,s2: String);
|
||||
procedure DCDebug(const s1,s2,s3: String);
|
||||
procedure DCDebug(const s1,s2,s3,s4: String);
|
||||
procedure DCDebug(const s1,s2,s3,s4,s5: String);
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, syncobjs;
|
||||
|
||||
var
|
||||
DebugLnLock: TCriticalSection;
|
||||
|
||||
procedure DCDebug(Args: array of const);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(Args);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const S: String; Args: array of const);// similar to Format(s,Args)
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(S, Args);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s1,s2: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s1, s2);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s1,s2,s3: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s1, s2, s3);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s1,s2,s3,s4: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s1, s2, s3, s4);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s1,s2,s3,s4,s5: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s1, s2, s3, s4, s5);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DCDebug(const s1,s2,s3,s4,s5,s6: String);
|
||||
begin
|
||||
DebugLnLock.Acquire;
|
||||
try
|
||||
DebugLn(s1, s2, s3, s4, s5, s6);
|
||||
finally
|
||||
DebugLnLock.Release;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
DebugLnLock := TCriticalSection.Create;
|
||||
|
||||
finalization
|
||||
DebugLnLock.Free;
|
||||
|
||||
end.
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, LConvEncoding, uOSUtils;
|
||||
LConvEncoding, uDebug, uOSUtils;
|
||||
|
||||
{ TDescription }
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ begin
|
|||
end;
|
||||
except
|
||||
on E: Exception do
|
||||
DebugLn('TDescription.PrepareDescrFile - ' + E.Message);
|
||||
DCDebug('TDescription.PrepareDescrFile - ' + E.Message);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -172,15 +172,15 @@ var
|
|||
begin
|
||||
Result:= False;
|
||||
sFileName:= ExtractFileName(S);
|
||||
//DebugLn('#########################');
|
||||
//DebugLn('sFileName: '+ sFileName);
|
||||
//DCDebug('#########################');
|
||||
//DCDebug('sFileName: '+ sFileName);
|
||||
for iIndex:= Count - 1 downto 0 do
|
||||
begin
|
||||
sIndexString := Self[iIndex];
|
||||
//DebugLn('Self[I]: '+ sIndexString);
|
||||
//DebugLn('iIndex: '+ IntToStr(iIndex));
|
||||
//DebugLn('Count: '+ IntToStr(Count));
|
||||
//DebugLn('Pos(sFileName, Self[I]): '+ IntToStr(Pos(sFileName, sIndexString)));
|
||||
//DCDebug('Self[I]: '+ sIndexString);
|
||||
//DCDebug('iIndex: '+ IntToStr(iIndex));
|
||||
//DCDebug('Count: '+ IntToStr(Count));
|
||||
//DCDebug('Pos(sFileName, Self[I]): '+ IntToStr(Pos(sFileName, sIndexString)));
|
||||
|
||||
// File comment length
|
||||
iLength := Length(sIndexString);
|
||||
|
|
@ -369,7 +369,7 @@ begin
|
|||
PrepareDescrFile(FileNameFrom);
|
||||
if Find(FileNameFrom, I) then
|
||||
begin
|
||||
DebugLn(FileNameFrom, '=', DescrByIndex[I]);
|
||||
DCDebug(FileNameFrom, '=', DescrByIndex[I]);
|
||||
FDestDescr.WriteDescription(FileNameTo, DescrByIndex[I]);
|
||||
Result:= True;
|
||||
end;
|
||||
|
|
@ -383,7 +383,7 @@ begin
|
|||
PrepareDescrFile(FileNameFrom);
|
||||
if Find(FileNameFrom, I) then
|
||||
begin
|
||||
DebugLn(FileNameFrom, '=', DescrByIndex[I]);
|
||||
DCDebug(FileNameFrom, '=', DescrByIndex[I]);
|
||||
FDestDescr.WriteDescription(FileNameTo, DescrByIndex[I]);
|
||||
Delete(I);
|
||||
FModified:= True;
|
||||
|
|
@ -402,9 +402,9 @@ begin
|
|||
FDestDescr.SaveDescription;
|
||||
except
|
||||
on E: Exception do
|
||||
DebugLn('TDescription.SaveDescription - ' + E.Message);
|
||||
DCDebug('TDescription.SaveDescription - ' + E.Message);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -28,8 +28,8 @@ unit uDetectStr;
|
|||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, LCLProc, uMasks,
|
||||
uFile;
|
||||
SysUtils, Classes,
|
||||
uMasks, uFile;
|
||||
|
||||
type
|
||||
TMathtype=(mtnil,mtoperator,mtlbracket,mtrbracket,mtoperand);
|
||||
|
|
@ -86,7 +86,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uFileProperty, uFileSystemFileSource;
|
||||
uDebug, uFileProperty, uFileSystemFileSource;
|
||||
|
||||
function TParserControl.calculate(aFile: TFile; operand1,operand2,Aoperator:Tmathchar):string;
|
||||
var tmp:string;
|
||||
|
|
@ -160,7 +160,7 @@ var
|
|||
begin
|
||||
aFile:= TFileSystemFileSource.CreateFileFromFile(aFileName);
|
||||
try
|
||||
DebugLn('aFile.Extension = ' + aFile.Extension);
|
||||
DCDebug('aFile.Extension = ' + aFile.Extension);
|
||||
Result:= getresult(aFile);
|
||||
finally
|
||||
aFile.Free;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
uGlobs, uGlobsPaths;
|
||||
uDebug, uGlobs, uGlobsPaths;
|
||||
|
||||
const
|
||||
DsxIniFileName = 'dsx.ini';
|
||||
|
|
@ -272,7 +272,7 @@ begin
|
|||
ADsxModule.Descr := AConfig.GetValue(ANode, 'Description', '');
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ begin
|
|||
s[iIndex]:= LowerCase(s[iIndex]);
|
||||
end;
|
||||
|
||||
// DebugLn(sLine);
|
||||
// DCDebug(sLine);
|
||||
if Pos('name', s) = 1 then // File type name
|
||||
extCmd.Name := Copy(sLine, iIndex + 1, Length(sLine))
|
||||
else if Pos('icon', s) = 1 then // File type icon
|
||||
|
|
@ -259,7 +259,7 @@ begin
|
|||
if SectionIndex >= extFile.Count then Exit;
|
||||
|
||||
sLine := extFile.Strings[SectionIndex];
|
||||
//DebugLn('sLine = ', sLine);
|
||||
//DCDebug('sLine = ', sLine);
|
||||
until ((Pos('[', sLine)<>0) and (Pos(']', sLine)<>0)) or
|
||||
((Pos('#', sLine)<>0) and (Pos('[', extFile.Strings[SectionIndex+1])<>0) and
|
||||
(Pos(']', extFile.Strings[SectionIndex+1])<>0));
|
||||
|
|
@ -316,8 +316,8 @@ begin
|
|||
bExists := False;
|
||||
for J := 0 to Count - 1 do
|
||||
begin
|
||||
//DebugLn('sSectionName = ', sSectionName);
|
||||
//DebugLn('GetItems(J).SectionName = ', GetItems(J).SectionName);
|
||||
//DCDebug('sSectionName = ', sSectionName);
|
||||
//DCDebug('GetItems(J).SectionName = ', GetItems(J).SectionName);
|
||||
|
||||
if sSectionName = GetItems(J).SectionName then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ begin
|
|||
if RegExp and not ExecRegExpr(FilesMasks, sr.Name) then
|
||||
Exit(False);
|
||||
|
||||
//DebugLn('File = ', sr.Name);
|
||||
//DCDebug('File = ', sr.Name);
|
||||
if (not RegExp) and (not MatchesMaskList(UTF8UpperCase(sr.Name), FFileChecks.FilesMasks)) then
|
||||
Exit(False);
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ begin
|
|||
if (not Terminated) and (FCurrentDepth < FSearchTemplate.SearchDepth) then
|
||||
begin
|
||||
Path := sNewDir + PathDelim + '*';
|
||||
//DebugLn('Search in sub folders = ', Path);
|
||||
//DCDebug('Search in sub folders = ', Path);
|
||||
if not Terminated and (FindFirstEx(Path, faDirectory, sr) = 0) then
|
||||
repeat
|
||||
IsLink:= FPS_ISLNK(sr.Attr);
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ implementation
|
|||
|
||||
uses
|
||||
LCLProc, SysUtils, uGlobsPaths, uLng, uShowMsg, uFileProcs, uOSUtils,
|
||||
uDCUtils, fMultiRename, uFile, uDCVersion;
|
||||
uDCUtils, fMultiRename, uFile, uDCVersion, uDebug;
|
||||
|
||||
procedure LoadDefaultHotkeyBindings;
|
||||
begin
|
||||
|
|
@ -472,7 +472,7 @@ begin
|
|||
glsHotDir.Add(Name + '=' + Path);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(Node) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(Node) + '.');
|
||||
end;
|
||||
Node := Node.NextSibling;
|
||||
end;
|
||||
|
|
@ -826,7 +826,7 @@ begin
|
|||
end
|
||||
else
|
||||
// File is not readable - print warning and continue below to check config in user directory.
|
||||
DebugLn('Warning: Config file ' + gpGlobalCfgDir + 'doublecmd.xml' +
|
||||
DCDebug('Warning: Config file ' + gpGlobalCfgDir + 'doublecmd.xml' +
|
||||
' exists but is not readable.');
|
||||
end;
|
||||
|
||||
|
|
@ -840,7 +840,7 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Error: Cannot read config file ' + gpGlobalCfgDir + 'doublecmd.xml.');
|
||||
DCDebug('Error: Cannot read config file ' + gpGlobalCfgDir + 'doublecmd.xml.');
|
||||
Exit(False);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -865,7 +865,7 @@ begin
|
|||
end
|
||||
else
|
||||
begin
|
||||
DebugLn('Warning: Config file ' + gpGlobalCfgDir + 'doublecmd.ini' +
|
||||
DCDebug('Warning: Config file ' + gpGlobalCfgDir + 'doublecmd.ini' +
|
||||
' is not accessible for writing. Configuration will not be saved.');
|
||||
end;
|
||||
end;
|
||||
|
|
@ -903,7 +903,7 @@ begin
|
|||
if mbFileExists(gpCfgDir + 'doublecmd.xml') and
|
||||
(not mbFileAccess(gpCfgDir + 'doublecmd.xml', fmOpenWrite)) then
|
||||
begin
|
||||
DebugLn('Warning: Config file ' + gpCfgDir + 'doublecmd.xml' +
|
||||
DCDebug('Warning: Config file ' + gpCfgDir + 'doublecmd.xml' +
|
||||
' is not accessible for writing. Configuration will not be saved.');
|
||||
end
|
||||
else
|
||||
|
|
@ -921,7 +921,7 @@ begin
|
|||
if not OpenConfig then
|
||||
Exit;
|
||||
|
||||
DebugLn('Loading configuration...');
|
||||
DCDebug('Loading configuration...');
|
||||
SetDefaultConfigGlobs;
|
||||
if Assigned(gIni) then
|
||||
LoadIniConfig
|
||||
|
|
@ -929,7 +929,7 @@ begin
|
|||
LoadXmlConfig
|
||||
else
|
||||
begin
|
||||
DebugLn('Error: No config created.');
|
||||
DCDebug('Error: No config created.');
|
||||
Exit(False);
|
||||
end;
|
||||
|
||||
|
|
@ -1894,4 +1894,4 @@ initialization
|
|||
|
||||
finalization
|
||||
DestroyGlobs;
|
||||
end.
|
||||
end.
|
||||
|
|
@ -395,9 +395,10 @@ procedure lngLoadLng(const sFileName:String);
|
|||
procedure DoLoadLng;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
Classes, SysUtils, StrUtils, GetText, Translations, uGlobs, uGlobsPaths, uTranslator,
|
||||
LCLProc, uFileProcs, uDCUtils, uOSUtils;
|
||||
uDebug, uFileProcs, uDCUtils, uOSUtils;
|
||||
|
||||
function GetLanguageName(poFileName : String) : String;
|
||||
var
|
||||
|
|
@ -471,7 +472,7 @@ begin
|
|||
end;
|
||||
if mbFileExists(gpLngDir + gPOFileName) then
|
||||
begin
|
||||
DebugLn('Loading lng file: ' + gpLngDir + gPOFileName);
|
||||
DCDebug('Loading lng file: ' + gpLngDir + gPOFileName);
|
||||
TranslateLCL(gPOFileName);
|
||||
Translations.TranslateUnitResourceStrings('uLng', gpLngDir + gPOFileName);
|
||||
LRSTranslator := TTranslator.Create(gpLngDir + gPOFileName);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ procedure logWrite(Thread: TThread; const sText: String; LogMsgType: TLogMsgType
|
|||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, LCLProc, Forms, fMain, uGlobs, uFileProcs, uOSUtils;
|
||||
SysUtils, Forms, fMain, uDebug, uGlobs, uFileProcs, uOSUtils;
|
||||
|
||||
procedure ShowLogWindow(bShow: Boolean);
|
||||
begin
|
||||
|
|
@ -119,12 +119,12 @@ begin
|
|||
FileSeek(hLogFile, 0, soFromEnd);
|
||||
FileWriteLn(hLogFile, Format('%s %s', [DateTimeToStr(Now), FMsg]));
|
||||
|
||||
DebugLn(Format('%s %s',[DateTimeToStr(Now), FMsg]));
|
||||
DCDebug(Format('%s %s',[DateTimeToStr(Now), FMsg]));
|
||||
|
||||
FileClose(hLogFile);
|
||||
except
|
||||
on E: Exception do
|
||||
DebugLn('Error writing to log: ' + E.Message);
|
||||
DCDebug('Error writing to log: ' + E.Message);
|
||||
end; // gLogWriteFile
|
||||
end;
|
||||
|
||||
|
|
@ -148,4 +148,4 @@ begin
|
|||
TThread.Synchronize(FThread, @LogWriteInTheThread);
|
||||
end;
|
||||
|
||||
end.
|
||||
end.
|
||||
|
|
@ -192,7 +192,7 @@ var
|
|||
mcChar:
|
||||
begin
|
||||
if CharIndex > L then Exit;
|
||||
//DebugLn('Match ' + S[CharIndex] + '<?>' + FMask.Chars[I].CharValue);
|
||||
//DCDebug('Match ' + S[CharIndex] + '<?>' + FMask.Chars[I].CharValue);
|
||||
if S[CharIndex] <> FMask.Chars[I].CharValue then Exit;
|
||||
Inc(CharIndex);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, FileUtil, uOSUtils, uFileProcs, uDCUtils, uReSample, uGlobsPaths,
|
||||
LCLProc, FileUtil, uDebug, uOSUtils, uFileProcs, uDCUtils, uReSample, uGlobsPaths,
|
||||
uGlobs, uPixmapManager, URIParser, md5, uFileSystemFileSource;
|
||||
|
||||
const
|
||||
|
|
@ -269,7 +269,7 @@ begin
|
|||
WriteMetaData(aFile, fsFileStream);
|
||||
except
|
||||
on e: EStreamError do
|
||||
DebugLn(['Cannot save thumbnail to file "', sThumbFileName, '": ', e.Message]);
|
||||
DCDebug(['Cannot save thumbnail to file "', sThumbFileName, '": ', e.Message]);
|
||||
end;
|
||||
finally
|
||||
FreeThenNil(fsFileStream);
|
||||
|
|
@ -293,4 +293,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
|
@ -67,12 +67,12 @@ begin
|
|||
if Instance.InheritsFrom(TForm) then
|
||||
begin
|
||||
FFormClassName := Instance.ClassName;
|
||||
//DebugLn(UpperCase(FFormClassName + '.'+PropInfo^.Name) + '=' + Content);
|
||||
//DCDebug(UpperCase(FFormClassName + '.'+PropInfo^.Name) + '=' + Content);
|
||||
Content := FPOFile.Translate(UpperCase(FFormClassName + '.' + PropInfo^.Name), Content);
|
||||
end
|
||||
else
|
||||
begin
|
||||
//DebugLn(UpperCase(FFormClassName + '.'+Instance.GetNamePath + '.' + PropInfo^.Name) + '=' + Content);
|
||||
//DCDebug(UpperCase(FFormClassName + '.'+Instance.GetNamePath + '.' + PropInfo^.Name) + '=' + Content);
|
||||
Content := FPOFile.Translate(UpperCase(FFormClassName + '.'+Instance.GetNamePath + '.'+ PropInfo^.Name), Content);
|
||||
end;
|
||||
// convert UTF8 to current local
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ Type
|
|||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, LCLProc, uLng, fDialogBox, uGlobsPaths, FileUtil, uOSUtils,
|
||||
uDateTimeUtils;
|
||||
SysUtils, uLng, fDialogBox, uGlobsPaths, FileUtil, uOSUtils,
|
||||
uDateTimeUtils, uDebug;
|
||||
|
||||
const
|
||||
WcxIniFileName = 'wcx.ini';
|
||||
|
|
@ -320,7 +320,7 @@ begin
|
|||
if FModuleHandle = 0 then
|
||||
Exit(False);
|
||||
|
||||
DebugLn('WCX module loaded ' + sName + ' at ' + hexStr(Pointer(FModuleHandle)));
|
||||
DCDebug('WCX module loaded ' + sName + ' at ' + hexStr(Pointer(FModuleHandle)));
|
||||
|
||||
// Mandatory functions
|
||||
OpenArchive:= TOpenArchive(GetProcAddress(FModuleHandle,'OpenArchive'));
|
||||
|
|
@ -629,7 +629,7 @@ begin
|
|||
Enabled[I] := AConfig.GetAttr(ANode, 'Enabled', True);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
StrUtils, uGlobs, uGlobsPaths, FileUtil;
|
||||
StrUtils, uGlobs, uGlobsPaths, FileUtil, uDebug;
|
||||
|
||||
const
|
||||
WdxIniFileName = 'wdx.ini';
|
||||
|
|
@ -325,7 +325,7 @@ begin
|
|||
tmp := Ini.ReadString('Content Plugins', 'Plugin' + IntToStr(I + 1) + 'Name', '');
|
||||
// читать FileName - читать расширение и создавать нужный обьект
|
||||
tp := GetCmdDirFromEnvVar(Ini.ReadString('Content Plugins', 'Plugin' + IntToStr(I + 1) + 'Path', ''));
|
||||
DebugLn('WDX:LOAD:' + tp);
|
||||
DCDebug('WDX:LOAD:' + tp);
|
||||
if upcase(ExtractFileExt(tp)) = '.WDX' then
|
||||
Flist.AddObject(UpCase(tmp), TPluginWDX.Create)
|
||||
else {иначе проверка на скрипт}
|
||||
|
|
@ -359,7 +359,7 @@ begin
|
|||
begin
|
||||
// Create a correct object based on plugin file extension.
|
||||
APath := GetCmdDirFromEnvVar(APath);
|
||||
DebugLn('WDX: LOAD: ' + APath);
|
||||
DCDebug('WDX: LOAD: ' + APath);
|
||||
if UpCase(ExtractFileExt(APath)) = '.WDX' then
|
||||
AWdxModule := TPluginWDX.Create
|
||||
else if UpCase(ExtractFileExt(APath)) = '.LUA' then
|
||||
|
|
@ -373,7 +373,7 @@ begin
|
|||
Flist.AddObject(UpCase(AName), AWdxModule);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
@ -993,7 +993,7 @@ begin
|
|||
Index := 0;
|
||||
repeat
|
||||
Rez := WdxLuaContentGetSupportedField(Index, xFieldName, xUnits);
|
||||
DebugLn('WDX:CallGetSupFields:' + IntToStr(Rez));
|
||||
DCDebug('WDX:CallGetSupFields:' + IntToStr(Rez));
|
||||
if Rez <> ft_nomorefields then
|
||||
begin
|
||||
tmp := FFieldsList.AddObject(xFieldName, TWdxField.Create);
|
||||
|
|
|
|||
|
|
@ -185,8 +185,8 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, uLng, FileUtil, uGlobsPaths, uDCUtils, uOSUtils, uWfxPluginUtil,
|
||||
fDialogBox;
|
||||
uLng, FileUtil, uGlobsPaths, uDCUtils, uOSUtils, uWfxPluginUtil,
|
||||
fDialogBox, uDebug;
|
||||
|
||||
const
|
||||
WfxIniFileName = 'wfx.ini';
|
||||
|
|
@ -461,7 +461,7 @@ begin
|
|||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then Exit(False);
|
||||
|
||||
DebugLn('WFX module loaded ' + sName + ' at ' + hexStr(Pointer(FModuleHandle)));
|
||||
DCDebug('WFX module loaded ' + sName + ' at ' + hexStr(Pointer(FModuleHandle)));
|
||||
|
||||
FModuleFileName:= sName;
|
||||
{ Mandatory }
|
||||
|
|
@ -744,7 +744,7 @@ begin
|
|||
Enabled[I] := AConfig.GetAttr(ANode, 'Enabled', True);
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
FileUtil, uOSUtils, uGlobsPaths, uGlobs;
|
||||
FileUtil, uDebug, uOSUtils, uGlobsPaths, uGlobs;
|
||||
|
||||
const
|
||||
WlxIniFileName = 'wlx.ini';
|
||||
|
|
@ -218,7 +218,7 @@ end;
|
|||
|
||||
function TWLXModule.LoadModule: Boolean;
|
||||
begin
|
||||
// DebugLn('WLXM LoadModule entered');
|
||||
// DCDebug('WLXM LoadModule entered');
|
||||
FModuleHandle := mbLoadLibrary(Self.FileName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
|
|
@ -241,7 +241,7 @@ begin
|
|||
ListSearchTextW:= TListSearchTextW(GetProcAddress(FModuleHandle, 'ListSearchTextW'));
|
||||
ListPrintW:= TListPrintW(GetProcAddress(FModuleHandle, 'ListPrintW'));
|
||||
ListGetPreviewBitmapW:= TListGetPreviewBitmapW(GetProcAddress(FModuleHandle, 'ListGetPreviewBitmapW'));
|
||||
//DebugLn('WLXM LoadModule Leaved');
|
||||
//DCDebug('WLXM LoadModule Leaved');
|
||||
end;
|
||||
|
||||
procedure TWLXModule.UnloadModule;
|
||||
|
|
@ -304,19 +304,19 @@ end;
|
|||
procedure TWLXModule.CallListCloseWindow;
|
||||
begin
|
||||
if not Assigned(ListCloseWindow) then Exit;
|
||||
// DebugLn('Try to call ListCloseWindow');
|
||||
// DCDebug('Try to call ListCloseWindow');
|
||||
try
|
||||
ListCloseWindow(FPluginWindow);
|
||||
finally
|
||||
FPluginWindow:=0;
|
||||
end;
|
||||
// DebugLn('Call ListCloseWindow success');
|
||||
// DCDebug('Call ListCloseWindow success');
|
||||
end;
|
||||
|
||||
function TWLXModule.CallListGetDetectString: string;
|
||||
var pc:Pchar;
|
||||
begin
|
||||
//DebugLn('GetDetectstr Entered');
|
||||
//DCDebug('GetDetectstr Entered');
|
||||
if assigned(ListGetDetectString) then
|
||||
begin
|
||||
GetMem(pc,MAX_PATH);
|
||||
|
|
@ -326,7 +326,7 @@ begin
|
|||
end
|
||||
else
|
||||
Result:='';
|
||||
//DebugLn('GetDetectStr Leaved');
|
||||
//DCDebug('GetDetectStr Leaved');
|
||||
end;
|
||||
|
||||
function TWLXModule.CallListSearchText(SearchString: string;
|
||||
|
|
@ -367,8 +367,8 @@ end;}
|
|||
function TWLXModule.FileParamVSDetectStr(AFileName: String): boolean;
|
||||
begin
|
||||
FParser.DetectStr:=Self.DetectStr;
|
||||
DebugLn('DetectStr = '+FParser.DetectStr);
|
||||
DebugLn('AFileName = '+AFileName);
|
||||
DCDebug('DetectStr = '+FParser.DetectStr);
|
||||
DCDebug('AFileName = '+AFileName);
|
||||
Result:=FParser.TestFileResult(AFileName);
|
||||
end;
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ begin
|
|||
AWlxModule.DetectStr := AConfig.GetValue(ANode, 'DetectString', '');
|
||||
end
|
||||
else
|
||||
DebugLn('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
DCDebug('Invalid entry in configuration: ' + AConfig.GetPathFromNode(ANode) + '.');
|
||||
end;
|
||||
ANode := ANode.NextSibling;
|
||||
end;
|
||||
|
|
@ -549,7 +549,7 @@ end;
|
|||
function TWLXModuleList.Add(FileName: string): integer;
|
||||
var s:string;
|
||||
begin
|
||||
// DebugLn('WLXLIST Add entered');
|
||||
// DCDebug('WLXLIST Add entered');
|
||||
s:=ExtractFileName(FileName);
|
||||
if pos('.',s)>0 then
|
||||
delete(s,pos('.',s),length(s));
|
||||
|
|
@ -561,7 +561,7 @@ begin
|
|||
TWLXModule(Flist.Objects[Result]).DetectStr:=TWLXModule(Flist.Objects[Result]).CallListGetDetectString;
|
||||
TWLXModule(Flist.Objects[Result]).UnloadModule;
|
||||
end;
|
||||
// DebugLn('WLXLIST ADD Leaved');
|
||||
// DCDebug('WLXLIST ADD Leaved');
|
||||
end;
|
||||
|
||||
function TWLXModuleList.Add(AName, FileName, DetectStr: string): integer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue