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 97 of file pgm_base.h.

Constructor & Destructor Documentation

◆ FILE_HISTORY()

FILE_HISTORY::FILE_HISTORY ( size_t  aMaxFiles,
int  aBaseFileId 
)

Definition at line 113 of file pgm_base.cpp.

113  :
114  wxFileHistory( std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE ) )
115 {
116  SetBaseId( aBaseFileId );
117 }
#define MAX_FILE_HISTORY_SIZE
Definition: id.h:70
#define min(a, b)
Definition: auxiliary.h:85

Member Function Documentation

◆ SetMaxFiles()

void FILE_HISTORY::SetMaxFiles ( size_t  aMaxFiles)

Definition at line 120 of file pgm_base.cpp.

121 {
122  m_fileMaxFiles = std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE );
123 
124  size_t numFiles = m_fileHistory.size();
125 
126  while( numFiles > m_fileMaxFiles )
127  RemoveFileFromHistory( --numFiles );
128 }
#define MAX_FILE_HISTORY_SIZE
Definition: id.h:70
#define min(a, b)
Definition: auxiliary.h:85

References MAX_FILE_HISTORY_SIZE, and min.

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


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