Skip to content

Commit

Permalink
Don't do anything in Apply when nothing selected, fixes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
daf committed Feb 11, 2017
1 parent 126b73e commit f29f9b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/NWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ void NWindow::sighandle_click_apply (void) {
void NWindow::apply_bg () {

// find out which image is currently selected
Gtk::TreeModel::iterator iter = view.get_selected ();
Gtk::TreeModel::iterator iter = view.get_selected();
if (!iter)
return;

Gtk::TreeModel::Row row = *iter;
Glib::ustring file = row[view.record.Filename];
bool saveToConfig = this->set_bg(file);
Expand Down
3 changes: 3 additions & 0 deletions src/Thumbview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ Gtk::TreeModel::iterator Thumbview::get_selected()
if (m_curmode == ICON)
{
std::list<Gtk::TreePath> selected = iview.get_selected_items();
if (selected.size() == 0)
return store->children().end();

return store->get_iter(*(selected.begin()));
}
else
Expand Down

0 comments on commit f29f9b8

Please sign in to comment.