KiCad PCB EDA Suite
FILE_HISTORY Class Reference

#include <pgm_base.h>

Inheritance diagram for FILE_HISTORY:

Public Member Functions

 FILE_HISTORY (size_t aMaxFiles, int aBaseFileId)
 
void SetMaxFiles (size_t aMaxFiles)
 

Detailed Description

Definition at line 80 of file pgm_base.h.

Constructor & Destructor Documentation

FILE_HISTORY::FILE_HISTORY ( size_t  aMaxFiles,
int  aBaseFileId 
)

Definition at line 72 of file pgm_base.cpp.

72  :
73  wxFileHistory( std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE ) )
74 {
75  SetBaseId( aBaseFileId );
76 }
#define MAX_FILE_HISTORY_SIZE
Definition: pgm_base.h:59
#define min(a, b)
Definition: auxiliary.h:85

Member Function Documentation

void FILE_HISTORY::SetMaxFiles ( size_t  aMaxFiles)

Definition at line 79 of file pgm_base.cpp.

References MAX_FILE_HISTORY_SIZE, and min.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged(), KICAD_MANAGER_FRAME::CommonSettingsChanged(), and GERBVIEW_FRAME::GERBVIEW_FRAME().

80 {
81  m_fileMaxFiles = std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE );
82 
83  size_t numFiles = m_fileHistory.size();
84 
85  while( numFiles > m_fileMaxFiles )
86  RemoveFileFromHistory( --numFiles );
87 }
#define MAX_FILE_HISTORY_SIZE
Definition: pgm_base.h:59
#define min(a, b)
Definition: auxiliary.h:85

The documentation for this class was generated from the following files: