Commit 99b2b2c2 authored by Adam Goins's avatar Adam Goins
Browse files

Fixed the segfault that was happening when left clicking a view then clicking...

Fixed the segfault that was happening when left clicking a view then clicking the project tree. Fixes #5111

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@8286 41f8697f-d340-4b68-9986-7bafba869bb8
parent 0abe9274
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -148,7 +148,16 @@ namespace Isis {
   * @return @b ProjectItem* The current item.
   */
  ProjectItem *ProjectItemModel::currentItem() {
    return itemFromIndex( selectionModel()->currentIndex() );

    ProjectItem *item = itemFromIndex( selectionModel()->currentIndex() );

    // We do this because if the user was in a footprint or cubeDN view, then
    // There is no valid currentIndex(). In that case, we grab whichever item
    // was right clicked that triggered this call.
    if (item == NULL) {
      item = selectedItems().at(0);
    }
    return item;
  }


+5 −1
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ namespace Isis {
   *                           signal sent by Project. Fixes #5086.
   *   @history 2017-08-14 Summer Stapleton - Updated icons/images to properly licensed or open
   *                           source images. Fixes #5105.
   *   @history 2017-10-30 Adam Goins - Modified currentItem() to return the first selected item
                               in the project tree if there is no valid currentIndex. This would
                               happen if the user was interacting with a cubeDN or footprint view
                               and then tried right clicking on the project tree. Fixes #5111.
   */
  class ProjectItemModel : public QStandardItemModel {