Fix SIGSEGV on startup if ClutsDirectory is empty by always creating a model.
This commit is contained in:
@@ -143,16 +143,15 @@ ClutComboBox::ClutColumns::ClutColumns()
|
|||||||
add( clutFilename );
|
add( clutFilename );
|
||||||
}
|
}
|
||||||
|
|
||||||
int ClutComboBox::fillFromDir( Glib::ustring path )
|
int ClutComboBox::fillFromDir (const Glib::ustring& path)
|
||||||
{
|
{
|
||||||
int result = 0;
|
m_model = Gtk::TreeStore::create (m_columns);
|
||||||
|
set_model (m_model);
|
||||||
|
|
||||||
if ( !path.empty() ) {
|
const auto result = parseDir (path, nullptr);
|
||||||
m_model.clear();
|
|
||||||
m_model = Gtk::TreeStore::create( m_columns );
|
if (result > 0) {
|
||||||
set_model( m_model );
|
pack_start (m_columns.label, false);
|
||||||
result = parseDir( path, 0 );
|
|
||||||
pack_start( m_columns.label, false );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
class ClutComboBox : public MyComboBox
|
class ClutComboBox : public MyComboBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int fillFromDir( Glib::ustring path );
|
int fillFromDir (const Glib::ustring& path);
|
||||||
Glib::ustring getSelectedClut();
|
Glib::ustring getSelectedClut();
|
||||||
void setSelectedClut( Glib::ustring filename );
|
void setSelectedClut( Glib::ustring filename );
|
||||||
void addUnchangedEntry();
|
void addUnchangedEntry();
|
||||||
|
Reference in New Issue
Block a user