Commit 37e45462 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Modified Control::copyToNewProjectRoot so that control networks are treated as...

Modified Control::copyToNewProjectRoot so that control networks are treated as simple binary files during the copying process, instead of being recreated.  Fixes #5212

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@8295 41f8697f-d340-4b68-9986-7bafba869bb8
parent 9c16aebf
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -226,10 +226,16 @@ namespace Isis {
  void Control::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) {
    if (FileName(newProjectRoot) != FileName(project->projectRoot())) {

      FileName newCnetFileName(project->cnetRoot(newProjectRoot.toString()) + "/" +
          FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name());
      controlNet()->Write(newCnetFileName.toString());
      QString newNetworkPath =  project->cnetRoot(newProjectRoot.toString()) + "/" +
                  FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name();

      QString oldNetworkPath = project->cnetRoot(project->projectRoot()) + "/" +
                  FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name();

      if (!QFile::copy(oldNetworkPath,newNetworkPath) ) {
        throw IException(IException::Io, "Error saving control net.", _FILEINFO_);
      }
    }//end outer-if

  }

+4 −0
Original line number Diff line number Diff line
@@ -59,6 +59,10 @@ namespace Isis {
   *                           track whether this step has happened Fixes #5026
   *   @history 2017-08-11 Cole Neuabuer - Added try catch throw to make it so importing an invalid
   *                           control net throws some type of error/warning Fixes #5064
   *   @history 2017-11-09 Tyler Wilson - Modified the copyToNewProjectRoot function so that the 
   *                           control net is copied to it's new location like a binary file,
   *                           instead of being recreated from scratch by calling it's write method.
   *                           Fixes #5212.
   */
  class Control : public QObject {
    Q_OBJECT