Roll back last 2 commits meant for the other resolver only.
Fixes: lp:1772255 * https://bugs.launchpad.net/kicad/+bug/1772255
This commit is contained in:
parent
cdde4c4b40
commit
6a2dc8d4eb
|
@ -36,7 +36,6 @@
|
|||
#include "kicadpcb.h"
|
||||
|
||||
#include "3d_resolver.h"
|
||||
#include "../../../include/trace_helpers.h"
|
||||
|
||||
// configuration file version
|
||||
#define CFGFILE_VERSION 1
|
||||
|
@ -345,10 +344,10 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName )
|
|||
// first attempt to use the name as specified:
|
||||
wxString tname = aFileName;
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
// translate from KiCad's internal UNIX-like path to MSWin paths
|
||||
tname.Replace( "/", "\\" );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Note: variable expansion must preferably be performed via a
|
||||
// threadsafe wrapper for the getenv() system call. If we allow the
|
||||
|
@ -399,8 +398,7 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName )
|
|||
wxString errmsg = "[3D File Resolver] No such path; ensure the environment var is defined";
|
||||
errmsg.append( "\n" );
|
||||
errmsg.append( tname );
|
||||
errmsg.append( "\n" );
|
||||
wxLogTrace( tracePathsAndFiles, errmsg );
|
||||
wxLogMessage( "%s\n", errmsg.ToUTF8() );
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
|
@ -477,8 +475,7 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName )
|
|||
wxString errmsg = "[3D File Resolver] No such path";
|
||||
errmsg.append( "\n" );
|
||||
errmsg.append( tname );
|
||||
errmsg.append( "\n" );
|
||||
wxLogTrace( tracePathsAndFiles, errmsg );
|
||||
wxLogTrace( MASK_3D_RESOLVER, "%s\n", errmsg.ToUTF8() );
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
|
@ -515,8 +512,7 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName )
|
|||
wxString errmsg = "[3D File Resolver] No such path; ensure the path alias is defined";
|
||||
errmsg.append( "\n" );
|
||||
errmsg.append( tname.substr( 1 ) );
|
||||
errmsg.append( "\n" );
|
||||
wxLogTrace( tracePathsAndFiles, errmsg );
|
||||
wxLogTrace( MASK_3D_RESOLVER, "%s\n", errmsg.ToUTF8() );
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
|
@ -532,13 +528,13 @@ bool S3D_RESOLVER::addPath( const S3D_ALIAS& aPath )
|
|||
|
||||
S3D_ALIAS tpath = aPath;
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
while( tpath.m_pathvar.EndsWith( "\\" ) )
|
||||
tpath.m_pathvar.erase( tpath.m_pathvar.length() - 1 );
|
||||
#else
|
||||
#else
|
||||
while( tpath.m_pathvar.EndsWith( "/" ) && tpath.m_pathvar.length() > 1 )
|
||||
tpath.m_pathvar.erase( tpath.m_pathvar.length() - 1 );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
wxFileName path( tpath.m_pathvar, "" );
|
||||
path.Normalize();
|
||||
|
@ -548,11 +544,10 @@ bool S3D_RESOLVER::addPath( const S3D_ALIAS& aPath )
|
|||
// suppress the message if the missing pathvar is the legacy KISYS3DMOD variable
|
||||
if( aPath.m_pathvar != "${KISYS3DMOD}" && aPath.m_pathvar != "$(KISYS3DMOD)" )
|
||||
{
|
||||
wxString errmsg = _( "The given path does not exist" );
|
||||
errmsg.append( "\n" );
|
||||
errmsg.append( tpath.m_pathvar );
|
||||
errmsg.append( "\n" );
|
||||
wxLogTrace( tracePathsAndFiles, errmsg );
|
||||
wxString msg = _( "The given path does not exist" );
|
||||
msg.append( "\n" );
|
||||
msg.append( tpath.m_pathvar );
|
||||
wxLogMessage( "%s\n", msg.ToUTF8() );
|
||||
}
|
||||
|
||||
tpath.m_pathexp.clear();
|
||||
|
@ -561,13 +556,13 @@ bool S3D_RESOLVER::addPath( const S3D_ALIAS& aPath )
|
|||
{
|
||||
tpath.m_pathexp = path.GetFullPath();
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
while( tpath.m_pathexp.EndsWith( "\\" ) )
|
||||
tpath.m_pathexp.erase( tpath.m_pathexp.length() - 1 );
|
||||
#else
|
||||
#else
|
||||
while( tpath.m_pathexp.EndsWith( "/" ) && tpath.m_pathexp.length() > 1 )
|
||||
tpath.m_pathexp.erase( tpath.m_pathexp.length() - 1 );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString pname = path.GetPath();
|
||||
|
@ -925,10 +920,10 @@ wxString S3D_RESOLVER::ShortenPath( const wxString& aFullPathName )
|
|||
{
|
||||
fname = fname.substr( fps.size() );
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
// ensure only the '/' separator is used in the internal name
|
||||
fname.Replace( "\\", "/" );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if( sL->m_alias.StartsWith( "${" ) || sL->m_alias.StartsWith( "$(" ) )
|
||||
{
|
||||
|
@ -1107,7 +1102,7 @@ bool S3D_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAlias )
|
|||
size_t pos0 = aFileName.find( ':' );
|
||||
|
||||
// ensure that the file separators suit the current platform
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef __WINDOWS__
|
||||
filename.Replace( "/", "\\" );
|
||||
|
||||
// if we see the :\ pattern then it must be a drive designator
|
||||
|
@ -1122,9 +1117,9 @@ bool S3D_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAlias )
|
|||
if( pos1 != wxString::npos )
|
||||
pos0 = wxString::npos;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
filename.Replace( "\\", "/" );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// names may not end with ':'
|
||||
if( pos0 == aFileName.length() -1 )
|
||||
|
|
Loading…
Reference in New Issue