Commit 2f3c5e7a authored by Jacobo Aragunde Perez's avatar Jacobo Aragunde Perez Committed by jean-pierre charras

Eeschema: fix Bug #1102381 <eeschema: -cache.lib file not created the first...

Eeschema: fix Bug #1102381 <eeschema: -cache.lib file not created the first time you save a schematic>
parent 273244a1
......@@ -166,7 +166,10 @@ void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event )
break;
case ID_SAVE_ONE_SHEET_UNDER_NEW_NAME:
SaveEEFile( NULL, true );
if( SaveEEFile( NULL, true ) )
{
CreateArchiveLibraryCacheFile();
}
break;
}
}
......@@ -377,10 +380,7 @@ void SCH_EDIT_FRAME::OnSaveProject( wxCommandEvent& aEvent )
for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
SaveEEFile( screen );
wxString cachename = fn.GetName() + wxT( "-cache" );
fn.SetName( cachename );
fn.SetExt( SchematicLibraryFileExtension );
CreateArchiveLibrary( fn.GetFullPath() );
CreateArchiveLibraryCacheFile();
}
......
......@@ -40,6 +40,21 @@
#include <protos.h>
#include <class_library.h>
#include <sch_component.h>
#include <sch_sheet.h>
#include <wildcards_and_files_ext.h>
bool SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile()
{
wxFileName fn;
SCH_SCREENS ScreenList;
fn = ScreenList.GetFirst()->GetFileName();
fn.SetName( fn.GetName() + wxT( "-cache" ) );
fn.SetExt( SchematicLibraryFileExtension );
return CreateArchiveLibrary( fn.GetFullPath() );
}
bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName )
......
......@@ -1167,6 +1167,15 @@ public:
*/
void LoadLibraries( void );
/**
* Function CreateArchiveLibraryCacheFile
* creates a library file with the name of the root document plus the '-cache' suffix,
* That file will contain all components used in the current schematic.
*
* @return True if the file was written successfully.
*/
bool CreateArchiveLibraryCacheFile( void );
/**
* Function CreateArchiveLibrary
* creates a library \a aFileName that contains all components used in the current schematic.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment