Rename CopyFile() to KiCopyFile() to avoid name colliding with a windows header.
Using CopyFile() that can collide with a windows header create hard to understand errors, including link errors. Renaming this function avoids these strange errors.
This commit is contained in:
parent
8c783687a9
commit
b38cef409b
|
@ -27,7 +27,6 @@
|
|||
* @file gestfich.cpp
|
||||
* @brief Functions for file management
|
||||
*/
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <wx/mimetype.h>
|
||||
#include <wx/filename.h>
|
||||
|
@ -349,7 +348,7 @@ bool CanPrintFile( const wxString& file )
|
|||
}
|
||||
|
||||
|
||||
void CopyFile( const wxString& aSrcPath, const wxString& aDestPath, wxString& aErrors )
|
||||
void KiCopyFile( const wxString& aSrcPath, const wxString& aDestPath, wxString& aErrors )
|
||||
{
|
||||
if( !wxCopyFile( aSrcPath, aDestPath ) )
|
||||
{
|
||||
|
|
|
@ -387,7 +387,7 @@ public:
|
|||
wxLogTrace( traceSettings, "Copying %s to %s", aSrcFilePath, file.GetFullPath() );
|
||||
|
||||
// For now, just copy everything
|
||||
CopyFile( aSrcFilePath, file.GetFullPath(), m_errors );
|
||||
KiCopyFile( aSrcFilePath, file.GetFullPath(), m_errors );
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
|
|
@ -326,19 +326,19 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
|
|||
// entire tree with several projects within it), so we leave this as an exercise
|
||||
// to the author.
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "sym" )
|
||||
{
|
||||
// Symbols are not project-specific. Keep their source names.
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "lib" || ext == "dcm" || ext == "kicad_sym" )
|
||||
{
|
||||
if( destFile.GetName() == aProjectName + "-cache" )
|
||||
destFile.SetName( aNewProjectName + "-cache" );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "net" )
|
||||
{
|
||||
|
|
|
@ -161,7 +161,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
|
|||
destFile.SetName( destFileName );
|
||||
}
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "gbrjob" )
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
|
|||
// detect the file format: old (deprecated) gerber format or official JSON format
|
||||
if( !data.Contains( "{" ) )
|
||||
{
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
|
|||
|
||||
destFile.SetName( destFileName );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -61,11 +61,11 @@ bool CanPrintFile( const wxString& file );
|
|||
|
||||
/**
|
||||
* Function CopyFile
|
||||
* @param aSrcPath
|
||||
* @param aDestPath
|
||||
* @param aSrcPath is the full filename of the source
|
||||
* @param aDestPath is the full filename of the target
|
||||
* @param aErrors a wxString to *append* any errors to
|
||||
*/
|
||||
void CopyFile( const wxString& aSrcPath, const wxString& aDestPath, wxString& aErrors );
|
||||
void KiCopyFile( const wxString& aSrcPath, const wxString& aDestPath, wxString& aErrors );
|
||||
|
||||
/**
|
||||
* Function EDA_FILE_SELECTOR
|
||||
|
|
|
@ -373,7 +373,7 @@ public:
|
|||
|
||||
// Currently all paths in the settings file are relative, so we can just do a
|
||||
// straight copy
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), m_errors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), m_errors );
|
||||
}
|
||||
else if( ext == "kicad_sch"
|
||||
|| ext == "kicad_sch-bak"
|
||||
|
@ -432,7 +432,7 @@ public:
|
|||
if( destName == m_projectName )
|
||||
destFile.SetName( m_newProjectName );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), m_errors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), m_errors );
|
||||
}
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
|
|
|
@ -159,7 +159,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcPr
|
|||
if( destFile.GetName() == aSrcProjectName )
|
||||
destFile.SetName( aNewProjectName );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -417,19 +417,19 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcPr
|
|||
if( destFile.GetName() == aSrcProjectName )
|
||||
destFile.SetName( aNewProjectName );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "brd" )
|
||||
{
|
||||
if( destFile.GetName() == aSrcProjectName )
|
||||
destFile.SetName( aNewProjectName );
|
||||
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "mod" || ext == "kicad_mod" )
|
||||
{
|
||||
// Footprints are not project-specific. Keep their source names.
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( ext == "cmp" )
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcPr
|
|||
// any non-deterministic cases in the save-as algorithm, we don't want to certify
|
||||
// the result with the source's DRC report. Therefore copy it under the old
|
||||
// name.
|
||||
CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
|
||||
}
|
||||
else if( destFile.GetName() == "fp-lib-table" )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue