Loading isis/src/qisis/objs/Control/Control.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ namespace Isis { /** * @description Write control net to disk. This method is used instead of calling * ControlNet::Write directly so that Control knows the modification state of the control net. * Note that if there is not a control net opened, there should no be any changes to write. * * @return @b bool Returns false if there is not a control net open to write * Loading Loading @@ -283,17 +284,35 @@ namespace Isis { * will be copied. */ void Control::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) { if (FileName(newProjectRoot).toString() != FileName(project->projectRoot()).toString()) { QString newNetworkPath = project->cnetRoot(newProjectRoot.toString()) + "/" + FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name(); // If there is active control & it has been modified, write to disk instead of copying // Leave control net at old location in unmodified state if (isModified()) { controlNet()->Write(newNetworkPath); setModified(false); } else { 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 } } // Project "Save" to current location, if active control exists & is modified, write to disk // Note: It does not look like this code is ever executed. If project is saved with a // "Save" this method is not called. else { if (isModified()) { write(); setModified(false); } } } Loading isis/src/qisis/objs/Control/Control.h +4 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,10 @@ namespace Isis { * track of the modification state of the control net. Add write method * to write the control net to disk. This write method should be called * by ipce classes instead of calling the ControlNet::Write directly so * that control knows the state of the control net. * that control knows the state of the control net. If a project * is performing a "Save As", and there is a modified active control,the * cnet is written out to the new location, it is not save in the old * project location. */ class Control : public QObject { Q_OBJECT Loading Loading
isis/src/qisis/objs/Control/Control.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ namespace Isis { /** * @description Write control net to disk. This method is used instead of calling * ControlNet::Write directly so that Control knows the modification state of the control net. * Note that if there is not a control net opened, there should no be any changes to write. * * @return @b bool Returns false if there is not a control net open to write * Loading Loading @@ -283,17 +284,35 @@ namespace Isis { * will be copied. */ void Control::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) { if (FileName(newProjectRoot).toString() != FileName(project->projectRoot()).toString()) { QString newNetworkPath = project->cnetRoot(newProjectRoot.toString()) + "/" + FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name(); // If there is active control & it has been modified, write to disk instead of copying // Leave control net at old location in unmodified state if (isModified()) { controlNet()->Write(newNetworkPath); setModified(false); } else { 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 } } // Project "Save" to current location, if active control exists & is modified, write to disk // Note: It does not look like this code is ever executed. If project is saved with a // "Save" this method is not called. else { if (isModified()) { write(); setModified(false); } } } Loading
isis/src/qisis/objs/Control/Control.h +4 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,10 @@ namespace Isis { * track of the modification state of the control net. Add write method * to write the control net to disk. This write method should be called * by ipce classes instead of calling the ControlNet::Write directly so * that control knows the state of the control net. * that control knows the state of the control net. If a project * is performing a "Save As", and there is a modified active control,the * cnet is written out to the new location, it is not save in the old * project location. */ class Control : public QObject { Q_OBJECT Loading