Browse Source

Don't display the context menu in 'Content' and 'HTTP Sources' buttons when no torrent is selected. It prevents crashes. Closes #1906, #1900.

adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
94fc2f9c3d
  1. 4
      src/properties/propertieswidget.cpp

4
src/properties/propertieswidget.cpp

@ -466,6 +466,8 @@ void PropertiesWidget::openFolder(const QModelIndex &index, bool containing_fold
} }
void PropertiesWidget::displayFilesListMenu(const QPoint&) { void PropertiesWidget::displayFilesListMenu(const QPoint&) {
if (!h.is_valid())
return;
QMenu myFilesLlistMenu; QMenu myFilesLlistMenu;
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0); QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
QAction *actOpen = 0; QAction *actOpen = 0;
@ -521,6 +523,8 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&) {
} }
void PropertiesWidget::displayWebSeedListMenu(const QPoint&) { void PropertiesWidget::displayWebSeedListMenu(const QPoint&) {
if (!h.is_valid())
return;
QMenu seedMenu; QMenu seedMenu;
QModelIndexList rows = listWebSeeds->selectionModel()->selectedRows(); QModelIndexList rows = listWebSeeds->selectionModel()->selectedRows();
QAction *actAdd = seedMenu.addAction(IconProvider::instance()->getIcon("list-add"), tr("New Web seed")); QAction *actAdd = seedMenu.addAction(IconProvider::instance()->getIcon("list-add"), tr("New Web seed"));

Loading…
Cancel
Save