Commit f07039be authored by Kristin Berry's avatar Kristin Berry
Browse files

Fixed qnet error that occurred when using relative paths by reverting to...

Fixed qnet error that occurred when using relative paths by reverting to storing relative paths for Cube Viewports. Fixes #5177

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@8256 41f8697f-d340-4b68-9986-7bafba869bb8
parent 85b0405e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1779,11 +1779,12 @@ namespace Isis {
             QApplication::keyboardModifiers() &&
             Qt::ControlModifier) {

        QString fileName = p_cube->fileName();
      //QString fileName = p_cube->fileName();
      QFileInfo fileName = p_cube->fileName();

      // Grabs the clipboard and copies the file name into it.
      QClipboard *clipboard = QApplication::clipboard();
        clipboard->setText(fileName);
      clipboard->setText(fileName.absoluteFilePath());
    }
    else {
      QAbstractScrollArea::keyPressEvent(e);
+5 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include <QAction>
#include <QApplication>
#include <QFileDialog>
#include <QFileInfo>
#include <QImage>
#include <QMenu>
#include <QMessageBox>
@@ -871,8 +872,10 @@ namespace Isis {

          CubeViewport* cubeViewport = openCubes.value(i);

          QString cubeFileName(cubeViewport->cube()->fileName());
          cubeFilePaths.append(cubeFileName);
//          QString cubeFileName(cubeViewport->cube()->fileName());
          QFileInfo cubeFileName(cubeViewport->cube()->fileName());

          cubeFilePaths.append(cubeFileName.absoluteFilePath());
      }

      QString fileName = QFileDialog::getSaveFileName((QWidget *) parent(),
+5 −1
Original line number Diff line number Diff line
@@ -327,6 +327,9 @@ namespace Isis {
   *                          file as input to qview, parse out the .cub files from the
   *                          cubelist and then attempt to add each one into their own
   *                          viewport.
   *  @history 2017-10-12 Kristin Berry - Reverted to using relative instead of full file paths,
   *                          as this caused errors when working with cubelists that contained
   *                          relative paths. Fixes # 5177
   */
  void Workspace::addCubeViewport(QString cubename) {
    
@@ -336,7 +339,8 @@ namespace Isis {

    // If the file is a cub file, we add the path to it to our list of cubes to open.
    if ( cubeFileName.suffix() == "cub" || cubeFileName.suffix() == "cube" ) {
        cubesToOpen.append(cubeFileName.absoluteFilePath());
       // cubesToOpen.append(cubeFileName.absoluteFilePath());
       cubesToOpen.append(cubeFileName.filePath());
    }
    else {
      // If the file received isn't a .cub, it has to be a cubelist. We read every cube in the cubelist