From 8b6f6ab21f2b8ffb4cff335b90d3fd82cde14ff2 Mon Sep 17 00:00:00 2001 From: plyatov Date: Thu, 6 Mar 2008 19:57:06 +0000 Subject: [PATCH] Eliminated bug - help files not found. --- change_log.txt | 6 ++++++ common/gestfich.cpp | 38 +++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/change_log.txt b/change_log.txt index e6194c471b..c1dbf8ed44 100644 --- a/change_log.txt +++ b/change_log.txt @@ -5,6 +5,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2008-Feb-18 UPDATE Igor Plyatov +================================================================================ ++help + Eliminated bug "help files not found!". + + 2008-Mar-3 UPDATE Dick Hollenbeck ================================================================================ +pcbnew diff --git a/common/gestfich.cpp b/common/gestfich.cpp index 564f77c9ec..a4afe34e99 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -36,13 +36,13 @@ // Path list for online help static wxString s_HelpPathList[] = { #ifdef __WINDOWS__ - wxT( "c:/kicad/doc/help" ), - wxT( "d:/kicad/doc/help" ), - wxT( "c:/Program Files/kicad/doc/help" ), - wxT( "d:/Program Files/kicad/doc/help" ), + wxT( "c:/kicad/doc/help/" ), + wxT( "d:/kicad/doc/help/" ), + wxT( "c:/Program Files/kicad/doc/help/" ), + wxT( "d:/Program Files/kicad/doc/help/" ), #else - wxT( "/usr/share/doc/kicad/help" ), - wxT( "/usr/local/share/doc/kicad/help" ), + wxT( "/usr/share/doc/kicad/help/" ), + wxT( "/usr/local/share/doc/kicad/help/" ), wxT( "/usr/local/kicad/share/doc/kicad/" ), // TODO: must be removed #endif wxT( "end_list" ) // End of list symbol, do not change @@ -57,8 +57,8 @@ static wxString s_KicadDataPathList[] = { wxT( "d:/kicad/share/" ), wxT( "c:/Program Files/kicad/" ), // TODO: must be removed wxT( "d:/Program Files/kicad/" ), // TODO: must be removed - wxT( "c:/Program Files/kicad/share" ), - wxT( "d:/Program Files/kicad/share" ), + wxT( "c:/Program Files/kicad/share/" ), + wxT( "d:/Program Files/kicad/share/" ), #else wxT( "/usr/share/kicad/" ), wxT( "/usr/local/share/kicad/" ), @@ -75,10 +75,10 @@ static wxString s_KicadBinaryPathList[] = { wxT( "d:/kicad/bin/" ), wxT( "c:/kicad/winexe/" ), // TODO: must be removed wxT( "d:/kicad/winexe/" ), // TODO: must be removed - wxT( "c:/Program Files/kicad/bin" ), - wxT( "d:/Program Files/kicad/bin" ), - wxT( "c:/Program Files/kicad/winexe" ), // TODO: must be removed - wxT( "d:/Program Files/kicad/winexe" ), // TODO: must be removed + wxT( "c:/Program Files/kicad/bin/" ), + wxT( "d:/Program Files/kicad/bin/" ), + wxT( "c:/Program Files/kicad/winexe/" ), // TODO: must be removed + wxT( "d:/Program Files/kicad/winexe/" ), // TODO: must be removed #else wxT( "/usr/bin/" ), wxT( "/usr/local/bin/" ), @@ -353,7 +353,8 @@ wxString FindKicadHelpPath() * from BinDir * else from environment variable KICAD * else from one of s_HelpPathList - * typically c:\kicad\doc\help or /usr/local/kicad/doc/help or /usr/share/doc/kicad/help + * typically c:\kicad\doc\help or /usr/share/doc/kicad/help + * or /usr/local/share/doc/kicad/help * (must have kicad in path name) * * xx = iso639-1 language id (2 letters (generic) or 4 letters): @@ -370,15 +371,14 @@ wxString FindKicadHelpPath() wxString FullPath, LangFullPath, tmp; wxString LocaleString; bool PathFound = FALSE; - /* find kicad/help/ */ tmp = g_EDA_Appl->m_BinDir; if( tmp.Last() == '/' ) tmp.RemoveLast(); - FullPath = tmp.BeforeLast( '/' ); // Idem cd .. + FullPath = tmp.BeforeLast( '/' ); // cd .. FullPath += wxT( "/help/" ); LocaleString = g_EDA_Appl->m_Locale->GetCanonicalName(); - + wxString path_tmp = FullPath; #ifdef __WINDOWS__ path_tmp.MakeLower(); @@ -397,9 +397,7 @@ wxString FindKicadHelpPath() PathFound = TRUE; } - /* find kicad/help/ from default path list: - * /usr/local/kicad/help or c:/kicad/help - * (see s_HelpPathList) */ + /* find kicad/help/ from "s_HelpPathList" */ int ii = 0; while( !PathFound ) { @@ -410,11 +408,9 @@ wxString FindKicadHelpPath() PathFound = TRUE; } - if( PathFound ) { LangFullPath = FullPath + LocaleString + UNIX_STRING_DIR_SEP; - if( wxDirExists( LangFullPath ) ) return LangFullPath;