Commit 5a6eba9b authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

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

parent 127043f0
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -276,17 +276,22 @@ namespace Isis {
    Control *control = NULL;
    try {
      QString cnetFileName = cnetFileNameAndProgress.first.original();
      ControlNet *cnet = new ControlNet();
      cnet->SetMutex(m_project->mutex());
      cnet->ReadControl(cnetFileName, cnetFileNameAndProgress.second);
//    ControlNet *cnet = new ControlNet();
//    cnet->SetMutex(m_project->mutex());

//      cnet->ReadControl(cnetFileName, cnetFileNameAndProgress.second);

      QString baseFilename = FileName(cnetFileName).name();
      QString destination = m_destinationFolder.canonicalPath() + "/" + baseFilename;

      cnet->Write(destination);
      if (!QFile::copy(cnetFileName, destination) ) {
        //m_warning = "Error saving control net.";
      }

//      cnet->Write(destination);

      delete cnet;
      cnet = NULL;
//    delete cnet;
//    cnet = NULL;

      control = new Control(m_project, destination);
      control->closeControlNet();
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ namespace Isis {
   *                           Control is created Fixes #5026
   *   @histroy 2017-10-24 Adam Goins - Removed the undoStack() call that occurred when a
   *                           Failed cnet is imported. Fixes #5186
   *   @history 2018-03-30 Tracie Sucharski - Copy the control net instead of writing.
   */
  class ImportControlNetWorkOrder : public WorkOrder {
      Q_OBJECT