From 25e1c02d7e0b084edced3bd28da50f823d17bcde Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 10 Apr 2010 17:58:50 +0000 Subject: [PATCH] 2010-04-10 19:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbide/ideobject.prg * contrib/hbide/idefunctions.prg * contrib/hbide/idefindreplace.prg * contrib/hbide/idesources.prg * contrib/hbide/idethemes.prg * contrib/hbide/ideeditor.prg * contrib/hbide/hbide.prg * contrib/hbide/idemisc.prg * contrib/hbide/idesaveload.prg * contrib/hbide/ideshortcuts.prg * contrib/hbide/ideprojmanager.prg ! Replaced static hbide_dbg() function call with HB_TRACE( HB_TR_ALWAYS, ... ) calls. This should also fix excessive permanently enabled debug messages when using HBIDE. Pls keep it that way. BTW, probably HB_TR_ALWAYS should be changed to some lower priority. --- harbour/ChangeLog | 17 +++++++++++++ harbour/contrib/hbide/hbide.prg | 32 ++++++++++++------------ harbour/contrib/hbide/ideeditor.prg | 15 ++++++----- harbour/contrib/hbide/idefindreplace.prg | 2 +- harbour/contrib/hbide/idefunctions.prg | 2 +- harbour/contrib/hbide/idemisc.prg | 8 +----- harbour/contrib/hbide/ideobject.prg | 8 +++--- harbour/contrib/hbide/ideprojmanager.prg | 12 ++++----- harbour/contrib/hbide/idesaveload.prg | 2 +- harbour/contrib/hbide/ideshortcuts.prg | 3 +-- harbour/contrib/hbide/idesources.prg | 10 +++----- harbour/contrib/hbide/idethemes.prg | 4 +-- 12 files changed, 61 insertions(+), 54 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9092c66b61..e4adf344a3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,23 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-10 19:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbide/ideobject.prg + * contrib/hbide/idefunctions.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/idesources.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/hbide.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/ideshortcuts.prg + * contrib/hbide/ideprojmanager.prg + ! Replaced static hbide_dbg() function call with HB_TRACE( HB_TR_ALWAYS, ... ) + calls. This should also fix excessive permanently enabled debug + messages when using HBIDE. Pls keep it that way. + BTW, probably HB_TR_ALWAYS should be changed to some lower priority. + 2010-04-10 19:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbqt.ch - Deleted unused HBQT_DEBUG() macro. Pls use diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 56b409cd4c..c48a46a4cd 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -95,10 +95,10 @@ PROCEDURE Main( ... ) /* Testing paths */ #ifdef __TESTING_PATHS__ -hbide_dbg( hbmk2_PathMakeRelative( "C:\dev_projects", "C:\dev_sources\vouch\myfile.prg", .f. ) ) -hbide_dbg( hbmk2_PathMakeRelative( "C:\dev_projects", "C:\dev_sources\vouch\myfile.prg", .t. ) ) -hbide_dbg( hbmk2_PathMakeRelative( "C:/dev_projects", "C:/dev_sources/vouch/myfile.prg", .t. ) ) -hbide_dbg( hbmk2_PathMakeRelative( "C:\dev_projects", "C:/dev_sources/vouch/myfile.prg", .t. ) ) +HB_TRACE( HB_TR_ALWAYS, hbmk2_PathMakeRelative( "C:\dev_projects", "C:\dev_sources\vouch\myfile.prg", .f. ) ) +HB_TRACE( HB_TR_ALWAYS, hbmk2_PathMakeRelative( "C:\dev_projects", "C:\dev_sources\vouch\myfile.prg", .t. ) ) +HB_TRACE( HB_TR_ALWAYS, hbmk2_PathMakeRelative( "C:/dev_projects", "C:/dev_sources/vouch/myfile.prg", .t. ) ) +HB_TRACE( HB_TR_ALWAYS, hbmk2_PathMakeRelative( "C:\dev_projects", "C:/dev_sources/vouch/myfile.prg", .t. ) ) #endif SET CENTURY ON @@ -330,7 +330,7 @@ METHOD HbIde:new( aParams ) METHOD HbIde:create( aParams ) LOCAL qPixmap, qSplash, n -hbide_dbg( "HbIde:create( cProjIni )", "#Params=" ) +HB_TRACE( HB_TR_ALWAYS, "HbIde:create( cProjIni )", "#Params=" ) qPixmap := QPixmap():new( hb_dirBase() + "resources" + hb_osPathSeparator() + "hbidesplash.png" ) qSplash := QSplashScreen():new() @@ -519,17 +519,17 @@ hbide_dbg( "HbIde:create( cProjIni )", "#Params=" ) ::nEvent := AppEvent( @::mp1, @::mp2, @::oXbp ) IF ::nEvent == xbeP_Quit - hbide_dbg( "----------------- xbeP_Quit" ) + HB_TRACE( HB_TR_ALWAYS, "----------------- xbeP_Quit" ) hbide_saveINI( Self ) EXIT ENDIF IF ::nEvent == xbeP_Close - hbide_dbg( "================ xbeP_Close" ) + HB_TRACE( HB_TR_ALWAYS, "================ xbeP_Close" ) hbide_saveINI( Self ) - hbide_dbg( "================ xbeP_Close", "after: hbide_saveINI( Self )" ) + HB_TRACE( HB_TR_ALWAYS, "================ xbeP_Close", "after: hbide_saveINI( Self )" ) ::oSM:closeAllSources() - hbide_dbg( "================ xbeP_Close", "after: ::oSM:closeAllSources()" ) + HB_TRACE( HB_TR_ALWAYS, "================ xbeP_Close", "after: ::oSM:closeAllSources()" ) EXIT ELSEIF ::nEvent == xbeP_Keyboard @@ -570,9 +570,9 @@ hbide_dbg( "HbIde:create( cProjIni )", "#Params=" ) ENDDO /* Very important - destroy resources */ - hbide_dbg( "======================================================" ) - hbide_dbg( "Before ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) - hbide_dbg( " " ) + HB_TRACE( HB_TR_ALWAYS, "======================================================" ) + HB_TRACE( HB_TR_ALWAYS, "Before ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) + HB_TRACE( HB_TR_ALWAYS, " " ) ::oTM:destroy() ::oSK:destroy() @@ -595,9 +595,9 @@ hbide_dbg( "HbIde:create( cProjIni )", "#Params=" ) ::qCursor := NIL ::oFont := NIL - hbide_dbg( " " ) - hbide_dbg( "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) - hbide_dbg( "======================================================" ) + HB_TRACE( HB_TR_ALWAYS, " " ) + HB_TRACE( HB_TR_ALWAYS, "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) + HB_TRACE( HB_TR_ALWAYS, "======================================================" ) RETURN self @@ -1389,7 +1389,7 @@ METHOD HbIde:setCodec( cCodec ) METHOD HbIde:testPainter( qPainter ) LOCAL qP := QPainter():from( qPainter ) - hbide_dbg( "qPainter:isActive()", qP:isActive() ) + HB_TRACE( HB_TR_ALWAYS, "qPainter:isActive()", qP:isActive() ) qP:setPen_2( Qt_red ) qP:drawEllipse_2( 100,300,100,150 ) diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 2a02c5685d..e95606174d 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -1149,7 +1149,7 @@ METHOD IdeEditor:destroy() ::oIde:lDockRVisible := .f. ENDIF ENDIF -//hbide_dbg( "IdeEditor:destroy()", 1, "-------------------------------------" ) +//HB_TRACE( HB_TR_ALWAYS, "IdeEditor:destroy()", 1, "-------------------------------------" ) RETURN Self /*----------------------------------------------------------------------*/ @@ -1639,12 +1639,12 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) EXIT CASE textChanged - //hbide_dbg( "textChanged()" ) + //HB_TRACE( HB_TR_ALWAYS, "textChanged()" ) ::oEditor:setTabImage( qEdit ) EXIT CASE selectionChanged - //hbide_dbg( "selectionChanged()" ) + //HB_TRACE( HB_TR_ALWAYS, "selectionChanged()" ) ::oEditor:qCqEdit := qEdit ::oEditor:qCoEdit := oEdit @@ -1663,7 +1663,7 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) EXIT CASE cursorPositionChanged - // hbide_dbg( "cursorPositionChanged()", ::nProtoLine, ::nProtoCol, ::isSuspended, ::getLineNo(), ::getColumnNo(), ::cProto ) + // HB_TRACE( HB_TR_ALWAYS, "cursorPositionChanged()", ::nProtoLine, ::nProtoCol, ::isSuspended, ::getLineNo(), ::getColumnNo(), ::cProto ) ::oEditor:dispEditInfo( qEdit ) ::handlePreviousWord( ::lUpdatePrevWord ) ::handleCurrentIndent() @@ -1700,13 +1700,13 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) #if 0 CASE modificationChanged - //hbide_dbg( "modificationChanged(bool)", p ) + //HB_TRACE( HB_TR_ALWAYS, "modificationChanged(bool)", p ) EXIT CASE redoAvailable - //hbide_dbg( "redoAvailable(bool)", p ) + //HB_TRACE( HB_TR_ALWAYS, "redoAvailable(bool)", p ) EXIT CASE undoAvailable - //hbide_dbg( "undoAvailable(bool)", p ) + //HB_TRACE( HB_TR_ALWAYS, "undoAvailable(bool)", p ) EXIT CASE updateRequest EXIT @@ -2573,4 +2573,3 @@ FUNCTION hbide_formatProto( cProto ) RETURN cProto /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index 03fed88777..147604dcf0 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -704,7 +704,7 @@ METHOD IdeFindInFiles:buildUI() ::oUI:signal( "editResults" , "copyAvailable(bool)" , {|l| ::execEvent( "editResults", l ) } ) ::oUI:signal( "editResults" , "customContextMenuRequested(QPoint)", {|p| ::execEvent( "editResults-contextMenu", p ) } ) -hbide_dbg( "-------------------------", 1 ) +HB_TRACE( HB_TR_ALWAYS, "-------------------------", 1 ) RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idefunctions.prg b/harbour/contrib/hbide/idefunctions.prg index c1b875bf06..25cf1fa046 100644 --- a/harbour/contrib/hbide/idefunctions.prg +++ b/harbour/contrib/hbide/idefunctions.prg @@ -361,7 +361,7 @@ METHOD IdeFunctions:openFunction( lCheckDuplicates ) oEdit:centerCursor() lOpened := .t. ELSE - hbide_dbg( "IdeFunctions:openFunction()", "It should not happen." ) + HB_TRACE( HB_TR_ALWAYS, "IdeFunctions:openFunction()", "It should not happen." ) ENDIF ENDIF ENDIF diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index b6905ae88d..526fb35b92 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -933,12 +933,6 @@ FUNCTION hbide_exchangeMeta( cKey ) ENDSWITCH RETURN cKey -/*----------------------------------------------------------------------*/ - -FUNCTION hbide_dbg( ... ) - HB_TRACE( HB_TR_ALWAYS, ... ) - RETURN nil - /*----------------------------------------------------------------------*/ /* * Return the next untitled filename available. @@ -1711,7 +1705,7 @@ FUNCTION hbide_syncRoot( cRoot, cPath ) hb_fNameSplit( cPath, @cPth, @cFile, @cExt ) -//hbide_dbg( "hbide_syncRoot( cRoot, cPath )", cPathProc, hbide_pathToOSpath( cPathProc + "/" + cFile + cExt ) ) +//HB_TRACE( HB_TR_ALWAYS, "hbide_syncRoot( cRoot, cPath )", cPathProc, hbide_pathToOSpath( cPathProc + "/" + cFile + cExt ) ) RETURN hbide_pathToOSpath( cPathProc + "/" + cFile + cExt ) diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index 086c41012b..75195cccf0 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -230,10 +230,10 @@ CLASS IdeObject METHOD IdeObject:connect( qWidget, cSlot, bBlock ) IF !( Qt_Slots_Connect( ::pSlots, qWidget, cSlot, bBlock ) ) - hbide_dbg( "Connection FAILED:", cSlot ) + HB_TRACE( HB_TR_ALWAYS, "Connection FAILED:", cSlot ) RETURN .f. ELSE -// hbide_dbg( "Connection SUCCEEDED:", cSlot ) +// HB_TRACE( HB_TR_ALWAYS, "Connection SUCCEEDED:", cSlot ) ENDIF RETURN .t. @@ -243,10 +243,10 @@ METHOD IdeObject:connect( qWidget, cSlot, bBlock ) METHOD IdeObject:disConnect( qWidget, cSlot ) IF !( Qt_Slots_disConnect( ::pSlots, qWidget, cSlot ) ) - hbide_dbg( "Dis-Connection FAILED:", cSlot ) + HB_TRACE( HB_TR_ALWAYS, "Dis-Connection FAILED:", cSlot ) RETURN .f. ELSE -// hbide_dbg( "Dis-Connection SUCCEEDED:", cSlot ) +// HB_TRACE( HB_TR_ALWAYS, "Dis-Connection SUCCEEDED:", cSlot ) ENDIF RETURN .t. diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index 861a42041a..9041ecfed0 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -462,7 +462,7 @@ METHOD IdeProjManager:pullHbpData( cHbp ) /* PRJ_PRP_FLAGS */ FOR EACH s IN aOptns -//hbide_dbg( "FLAGS ", s ) +//HB_TRACE( HB_TR_ALWAYS, "FLAGS ", s ) IF !empty( s ) aadd( a2_0, s ) ENDIF @@ -470,7 +470,7 @@ METHOD IdeProjManager:pullHbpData( cHbp ) /* PRJ_PRP_SOURCES */ FOR EACH s IN aFiles -//hbide_dbg( "SOURCE ", s ) +//HB_TRACE( HB_TR_ALWAYS, "SOURCE ", s ) aadd( a3_0, s ) NEXT @@ -1291,7 +1291,7 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) cT := ".exe" // Chr( 13 ) n1 := hb_at( cT, cTmp, n + len( cTkn ) ) cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + len( cT ) ) -hbide_dbg( 1, cTkn, cExe ) +HB_TRACE( HB_TR_ALWAYS, 1, cTkn, cExe ) ENDIF ENDIF IF empty( cExe ) @@ -1300,7 +1300,7 @@ hbide_dbg( 1, cTkn, cExe ) cT := ".exe" // Chr( 13 ) n1 := hb_at( cT, cTmp, n + len( cTkn ) ) cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + len( cT ) ) -hbide_dbg( 2, cTkn, cExe ) +HB_TRACE( HB_TR_ALWAYS, 2, cTkn, cExe ) ENDIF ENDIF @@ -1368,8 +1368,8 @@ METHOD IdeProjManager:launchProject( cProject, cExe ) #else ::oProcess := HbpProcess():new() - ::oProcess:output := {|s| hbide_dbg( s ) } - ::oProcess:finished := {|n,nn| hbide_dbg( "Finished", n, nn ) } + ::oProcess:output := {|s| HB_TRACE( HB_TR_ALWAYS, s ) } + ::oProcess:finished := {|n,nn| HB_TRACE( HB_TR_ALWAYS, "Finished", n, nn ) } ::oProcess:start( cTargetFN ) #endif diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 4a53109e1b..aa8f595651 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -89,7 +89,7 @@ FUNCTION hbide_restSettings( oIde ) FUNCTION hbide_saveINI( oIde ) LOCAL j, nTab, pTab, n, txt_, qHScr, qVScr, oEdit, qCursor, nTabs, nn, s -hbide_dbg( "hbide_saveINI( oIde )", 0, oIde:nRunMode, oIde:cProjIni ) +HB_TRACE( HB_TR_ALWAYS, "hbide_saveINI( oIde )", 0, oIde:nRunMode, oIde:cProjIni ) IF oIde:nRunMode != HBIDE_RUN_MODE_INI RETURN Nil ENDIF diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg index e5ee1cbcb7..ebaaaf08c1 100644 --- a/harbour/contrib/hbide/ideshortcuts.prg +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -545,7 +545,7 @@ METHOD IdeShortcuts:evalMacro( cString ) bBlock := &( cBlock ) -hbide_dbg( cBlock ) +HB_TRACE( HB_TR_ALWAYS, cBlock ) BEGIN SEQUENCE eval( bBlock, self ) RECOVER USING oErr @@ -601,4 +601,3 @@ METHOD IdeShortcuts:getText() RETURN ::oEM:getText() /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbide/idesources.prg b/harbour/contrib/hbide/idesources.prg index fc475d4896..b169167153 100644 --- a/harbour/contrib/hbide/idesources.prg +++ b/harbour/contrib/hbide/idesources.prg @@ -277,7 +277,7 @@ METHOD IdeSourcesManager:closeSource( nTab, lCanCancel, lCanceled ) LOCAL lSave, n, oEditor DEFAULT nTab TO ::oEM:getTabCurrent() -//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 0 ) +//HB_TRACE( HB_TR_ALWAYS, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 0 ) IF !empty( oEditor := ::oEM:getEditorByTabPosition( nTab ) ) DEFAULT lCanCancel TO .F. @@ -304,9 +304,9 @@ METHOD IdeSourcesManager:closeSource( nTab, lCanCancel, lCanceled ) RETURN .F. ENDIF ENDIF -//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 1, "before: oEditor:destroy()" ) +//HB_TRACE( HB_TR_ALWAYS, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 1, "before: oEditor:destroy()" ) oEditor:destroy() -//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 2, "after: oEditor:destroy()" ) +//HB_TRACE( HB_TR_ALWAYS, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 2, "after: oEditor:destroy()" ) ::oIde:updateTitleBar() ENDIF @@ -496,7 +496,7 @@ METHOD IdeSourcesManager:selectSource( cMode, cFile, cTitle ) oDlg:quit := {|| MsgBox( "Quitting the Dialog" ), 1 } cFile := oDlg:saveAs( "myfile.dbf" ) IF !empty( cFile ) - hbide_dbg( cFile ) + HB_TRACE( HB_TR_ALWAYS, cFile ) ENDIF ENDIF @@ -504,5 +504,3 @@ METHOD IdeSourcesManager:selectSource( cMode, cFile, cTitle ) RETURN cFile /*----------------------------------------------------------------------*/ - - diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index e9c2593796..e3aa285e1f 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -225,7 +225,7 @@ METHOD IdeThemes:create( oIde, cIniFile ) METHOD IdeThemes:destroy() - hbide_dbg( "-------------------------------------- Theme Manager 0 ------------------------------------------" ) + HB_TRACE( HB_TR_ALWAYS, "-------------------------------------- Theme Manager 0 ------------------------------------------" ) IF !empty( ::oSL ) ::disConnect( ::oSL:qObj[ "listOptions" ], "doubleClicked(QModelIndex)" ) ::disConnect( ::oSL:qObj[ "buttonOk" ], "clicked()" ) @@ -242,7 +242,7 @@ METHOD IdeThemes:destroy() ::oUI:destroy() ENDIF ENDIF - hbide_dbg( "-------------------------------------- Theme Manager 1 ------------------------------------------" ) + HB_TRACE( HB_TR_ALWAYS, "-------------------------------------- Theme Manager 1 ------------------------------------------" ) RETURN Self /*----------------------------------------------------------------------*/