mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
FIX: PrinterFileSystem crash when switch file type
Change-Id: I25b0659d7a33bda5bb1157c967dac300b41696a9 Github: 2633
This commit is contained in:
parent
a004356fdc
commit
92ba240173
2 changed files with 8 additions and 3 deletions
|
@ -92,8 +92,12 @@ void Slic3r::GUI::ImageGrid::SetFileType(int type, std::string const &storage)
|
||||||
|
|
||||||
void Slic3r::GUI::ImageGrid::SetGroupMode(int mode)
|
void Slic3r::GUI::ImageGrid::SetGroupMode(int mode)
|
||||||
{
|
{
|
||||||
if (!m_file_sys || m_file_sys->GetCount() == 0)
|
if (!m_file_sys)
|
||||||
return;
|
return;
|
||||||
|
if (m_file_sys->GetCount() == 0) {
|
||||||
|
m_file_sys->SetGroupMode((PrinterFileSystem::GroupMode) mode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
wxSize size = GetClientSize();
|
wxSize size = GetClientSize();
|
||||||
int index = (m_row_offset + 1 < m_row_count || m_row_count == 0)
|
int index = (m_row_offset + 1 < m_row_count || m_row_count == 0)
|
||||||
? m_row_offset / 4 * m_col_count
|
? m_row_offset / 4 * m_col_count
|
||||||
|
|
|
@ -91,6 +91,7 @@ void PrinterFileSystem::SetFileType(FileType type, std::string const &storage)
|
||||||
m_file_list.swap(m_file_list_cache[{m_file_type, m_file_storage}]);
|
m_file_list.swap(m_file_list_cache[{m_file_type, m_file_storage}]);
|
||||||
m_lock_start = m_lock_end = 0;
|
m_lock_start = m_lock_end = 0;
|
||||||
BuildGroups();
|
BuildGroups();
|
||||||
|
UpdateGroupSelect();
|
||||||
SendChangedEvent(EVT_FILE_CHANGED);
|
SendChangedEvent(EVT_FILE_CHANGED);
|
||||||
if (type == F_INVALID_TYPE)
|
if (type == F_INVALID_TYPE)
|
||||||
return;
|
return;
|
||||||
|
@ -515,10 +516,10 @@ void PrinterFileSystem::Stop(bool quit)
|
||||||
|
|
||||||
void PrinterFileSystem::BuildGroups()
|
void PrinterFileSystem::BuildGroups()
|
||||||
{
|
{
|
||||||
if (m_file_list.empty())
|
|
||||||
return;
|
|
||||||
m_group_year.clear();
|
m_group_year.clear();
|
||||||
m_group_month.clear();
|
m_group_month.clear();
|
||||||
|
if (m_file_list.empty())
|
||||||
|
return;
|
||||||
wxDateTime t = wxDateTime((time_t) m_file_list.front().time);
|
wxDateTime t = wxDateTime((time_t) m_file_list.front().time);
|
||||||
m_group_year.push_back(0);
|
m_group_year.push_back(0);
|
||||||
m_group_month.push_back(0);
|
m_group_month.push_back(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue