Commit 127043f0 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

PROG: Copy control net rather than reading, then writing.

parent 1aaf3b4f
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -123,10 +123,9 @@ namespace Isis {
      QStringList internalData;

      Control *control = NULL;

      // See if there are any other control lists in the project and give these to the user as
      // choices for control nets they can export.


      if (project()) {

        Project *proj = project();
@@ -137,7 +136,6 @@ namespace Isis {
          WorkOrder::setData(l);
          control = controlList()->first();
        }

        else {

          QMap<Control *, QString> cnetChoices;
@@ -156,8 +154,6 @@ namespace Isis {

          control = cnetChoices.key(choice);
          internalData.append(control->id());


        }
      }

@@ -201,11 +197,9 @@ namespace Isis {
      control = controlList()->first();
    }

    try {
      control->controlNet()->Write(destination);
    }
    catch (IException &e) {
      m_warning = e.toString();
    QString currentLocation = control->fileName();
    if (!QFile::copy(currentLocation, destination) ) {
      m_warning = "Error saving control net.";
    }
  }

+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ namespace Isis {
   *                           isExecutable to prevent potential seg faults.  References #4760.
   *   @history 2018-03-13 Tracie Sucharski - Added Undo text to prevent runtime warning. Also
   *                           correct redmine ticket number in previous history entry.
   *   @history 2018-03-30 Tracie Sucharski - Copy the control net instead of writing.  This will
   *                           be faster and will prevent another control net from being read into
   *                           memory.
   */
  class ExportControlNetWorkOrder : public WorkOrder {
      Q_OBJECT