diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 099739cea3..baaaaaeb00 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-17 11:23 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbtip/encqp.prg + * contrib/hbtip/hbtip.hbx + + added two new functions: + TIP_QPENCODE(), TIP_QPDECODE() + formerly only accessible via OOP code + + * utils/hbmk2/hbmk2.prg + % merged FindInPath() and __hbshell_FindInPath() into one + 2012-06-16 18:06 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbpdialog.prg + Added: Main application windows object name as "PleseDoNotDelete" @@ -28,14 +38,14 @@ ! Fixed: a couple of potential memory leaks. * contrib/hbqt/qtcore/hbqt_bind.cpp - + Implemented: Thread safe global list. Now objects are released + + Implemented: Thread safe global list. Now objects are released in a proper manner. - + Added: a hack not to delete a QMainWindow if its name is - "PleaseDoNotDelete". It is scheduled to be removed - once it is resolved that why on certain circumstances, if + + Added: a hack not to delete a QMainWindow if its name is + "PleaseDoNotDelete". It is scheduled to be removed + once it is resolved that why on certain circumstances, if a QMainWindow is deleted, it results in GPF. - + 2012-06-17 02:51 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbrun/hbrun.hbp * restored to embed headers in hbrun diff --git a/harbour/contrib/hbtip/encqp.prg b/harbour/contrib/hbtip/encqp.prg index c24aa1eec9..a95c62f1cd 100644 --- a/harbour/contrib/hbtip/encqp.prg +++ b/harbour/contrib/hbtip/encqp.prg @@ -63,6 +63,12 @@ METHOD New() CLASS TIPEncoderQP RETURN Self METHOD Encode( cData ) CLASS TIPEncoderQP + RETURN TIP_QPEncode( cData ) + +METHOD Decode( cData ) CLASS TIPEncoderQP + RETURN TIP_QPDecode( cData ) + +FUNCTION TIP_QPEncode( cData ) LOCAL nPos LOCAL c LOCAL nLen @@ -93,7 +99,7 @@ METHOD Encode( cData ) CLASS TIPEncoderQP RETURN cString -METHOD Decode( cData ) CLASS TIPEncoderQP +FUNCTION TIP_QPDecode( cData ) LOCAL nPos LOCAL c LOCAL nLen diff --git a/harbour/contrib/hbtip/hbtip.hbx b/harbour/contrib/hbtip/hbtip.hbx index 79277dc52f..386baa12c3 100644 --- a/harbour/contrib/hbtip/hbtip.hbx +++ b/harbour/contrib/hbtip/hbtip.hbx @@ -66,6 +66,8 @@ DYNAMIC TIP_GETRAWEMAIL DYNAMIC TIP_HTMLSPECIALCHARS DYNAMIC TIP_JSONSPECIALCHARS DYNAMIC TIP_MIMETYPE +DYNAMIC TIP_QPDECODE +DYNAMIC TIP_QPENCODE DYNAMIC TIP_SSL DYNAMIC TIP_TIMESTAMP DYNAMIC TIP_URLDECODE diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 6a7cf6c977..c9f629b157 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -8974,56 +8974,66 @@ STATIC FUNCTION FindInPathPlugIn( /* @ */ cFileName ) RETURN FindInPath( cFileName ) -STATIC FUNCTION FindInPath( cFileName, xPath ) +STATIC FUNCTION FindInPath( cFileName, xPath, aExtDef ) LOCAL cDir LOCAL cName LOCAL cExt + LOCAL aExt hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) - IF Empty( cExt ) - cExt := ".exe" - ENDIF + hb_default( @aExtDef, { ".exe" } ) + #else + hb_default( @aExtDef, { cExt } ) #endif + aExt := iif( Empty( cExt ), aExtDef, { cExt } ) - /* Check original filename (in supplied path or current dir) */ - IF hb_FileExists( cFileName := hb_FNameMerge( cDir, cName, cExt ) ) - RETURN cFileName - ENDIF - - /* Check in the dir of this executable. */ - IF ! Empty( hb_DirBase() ) - IF hb_FileExists( cFileName := hb_FNameMerge( hb_DirBase(), cName, cExt ) ) + FOR EACH cExt IN aExt + /* Check original filename (in supplied path or current dir) */ + IF hb_FileExists( cFileName := hb_FNameMerge( cDir, cName, cExt ) ) RETURN cFileName ENDIF - ENDIF - - IF ! HB_ISSTRING( xPath ) .AND. ; - ! HB_ISARRAY( xPath ) - xPath := GetEnv( "PATH" ) - ENDIF - - IF HB_ISSTRING( xPath ) - #if defined( __PLATFORM__WINDOWS ) .OR. ; - defined( __PLATFORM__DOS ) .OR. ; - defined( __PLATFORM__OS2 ) - xPath := hb_ATokens( xPath, hb_osPathListSeparator(), .T., .T. ) - #else - xPath := hb_ATokens( xPath, hb_osPathListSeparator() ) - #endif - ENDIF - - /* Check in the PATH. */ - FOR EACH cDir IN xPath - IF ! Empty( cDir ) - IF hb_FileExists( cFileName := hb_FNameMerge( hb_DirSepAdd( StrStripQuote( cDir ) ), cName, cExt ) ) - RETURN cFileName - ENDIF - ENDIF NEXT + IF Empty( cDir ) + /* Check in the dir of this executable. */ + IF ! Empty( cDir := hb_DirBase() ) + FOR EACH cExt IN aExt + IF hb_FileExists( cFileName := hb_FNameMerge( cDir, cName, cExt ) ) + RETURN cFileName + ENDIF + NEXT + ENDIF + + IF ! HB_ISSTRING( xPath ) .AND. ; + ! HB_ISARRAY( xPath ) + xPath := GetEnv( "PATH" ) + ENDIF + + IF HB_ISSTRING( xPath ) + #if defined( __PLATFORM__WINDOWS ) .OR. ; + defined( __PLATFORM__DOS ) .OR. ; + defined( __PLATFORM__OS2 ) + xPath := hb_ATokens( xPath, hb_osPathListSeparator(), .T., .T. ) + #else + xPath := hb_ATokens( xPath, hb_osPathListSeparator() ) + #endif + ENDIF + + FOR EACH cExt IN aExt + /* Check in the PATH. */ + FOR EACH cDir IN xPath + IF ! Empty( cDir := StrStripQuote( cDir ) ) + IF hb_FileExists( cFileName := hb_FNameMerge( hb_DirSepAdd( cDir ), cName, cExt ) ) + RETURN cFileName + ENDIF + ENDIF + NEXT + NEXT + ENDIF + RETURN NIL STATIC FUNCTION ArrayJoinNoClone( arraySrc1, arraySrc2 ) @@ -12250,7 +12260,7 @@ STATIC PROCEDURE __hbshell( cFile, ... ) IF !( cFile == "." ) .AND. ; ! Empty( hb_FNameName( cFile ) ) .AND. ; - ! Empty( cFile := __hbshell_FindInPath( cFile ) ) + ! Empty( cFile := FindInPath( cFile,, { ".hb", ".hrb" } ) ) cExt := Lower( hb_FNameExt( cFile ) ) @@ -12264,11 +12274,11 @@ STATIC PROCEDURE __hbshell( cFile, ... ) CASE ".hb" /* NOTE: Assumptions: - - one dynamic libs belongs to one .hbc file (true for dynamic builds in contrib) + - one dynamic lib belongs to one .hbc file (true for dynamic builds in contrib) - dynamic libs will reference and automatically load all their dependencies (true on all systems so far) - hbrun/hbmk2 is located in well known place inside the Harbour dir tree. - - contribs/addons are also located in well-known place inside the Harbour dir tree + - contribs/addons are located in well-known place inside the Harbour dir tree - 3rd party addons can be loaded, too if they are installed into the Harbour dir tree and built the same way as contribs. - dynamic libs are installed into bin dir. @@ -12323,65 +12333,6 @@ STATIC PROCEDURE __hbshell( cFile, ... ) RETURN -STATIC FUNCTION __hbshell_FindInPath( cFileName, xPath ) - LOCAL cDir - LOCAL cName - LOCAL cExt - LOCAL cFullName - LOCAL aExt - - hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) - aExt := iif( Empty( cExt ), { ".hb", ".hrb" }, { cExt } ) - - FOR EACH cExt IN aExt - /* Check original filename (in supplied path or current dir) */ - IF hb_FileExists( cFullName := hb_FNameMerge( cDir, cName, cExt ) ) - RETURN cFullName - ENDIF - NEXT - - IF Empty( cDir ) - IF ! Empty( cDir := hb_DirBase() ) - /* Check in the dir of this executable. */ - FOR EACH cExt IN aExt - IF hb_FileExists( cFullName := hb_FNameMerge( cDir, cName, cExt ) ) - RETURN cFullName - ENDIF - NEXT - ENDIF - - IF ! HB_ISSTRING( xPath ) .AND. ; - ! HB_ISARRAY( xPath ) - xPath := GetEnv( "PATH" ) - ENDIF - - IF HB_ISSTRING( xPath ) - #if defined( __PLATFORM__WINDOWS ) .OR. ; - defined( __PLATFORM__DOS ) .OR. ; - defined( __PLATFORM__OS2 ) - xPath := hb_ATokens( xPath, hb_osPathListSeparator(), .T., .T. ) - #else - xPath := hb_ATokens( xPath, hb_osPathListSeparator() ) - #endif - ENDIF - - FOR EACH cExt IN aExt - /* Check in the PATH. */ - FOR EACH cDir IN xPath - IF Left( cDir, 1 ) == '"' .AND. Right( cDir, 1 ) == '"' - cDir := SubStr( cDir, 2, Len( cDir ) - 2 ) - ENDIF - IF ! Empty( cDir ) - IF hb_FileExists( cFullName := hb_FNameMerge( cDir, cName, cExt ) ) - RETURN cFullName - ENDIF - ENDIF - NEXT - NEXT - ENDIF - - RETURN NIL - STATIC FUNCTION __hbshell_FileSig( cFile ) LOCAL hFile LOCAL cBuff, cSig, cExt