Refactoring. Rename method.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-17 19:42:48 +03:00
parent 09c67a099a
commit d6898af23e
3 changed files with 9 additions and 9 deletions

View File

@ -1523,7 +1523,7 @@ void MainWindow::LoadIndividual()
watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath())); watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath()));
} }
ui->actionUnloadMeasurements->setEnabled(true); ui->actionUnloadMeasurements->setEnabled(true);
doc->SetPath(RelativeMPath(qApp->GetPPath(), mPath)); doc->SetMPath(RelativeMPath(qApp->GetPPath(), mPath));
watcher->addPath(mPath); watcher->addPath(mPath);
PatternChangesWereSaved(false); PatternChangesWereSaved(false);
ui->actionEditCurrent->setEnabled(true); ui->actionEditCurrent->setEnabled(true);
@ -1572,7 +1572,7 @@ void MainWindow::LoadMultisize()
watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath())); watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath()));
} }
ui->actionUnloadMeasurements->setEnabled(true); ui->actionUnloadMeasurements->setEnabled(true);
doc->SetPath(RelativeMPath(qApp->GetPPath(), mPath)); doc->SetMPath(RelativeMPath(qApp->GetPPath(), mPath));
watcher->addPath(mPath); watcher->addPath(mPath);
PatternChangesWereSaved(false); PatternChangesWereSaved(false);
ui->actionEditCurrent->setEnabled(true); ui->actionEditCurrent->setEnabled(true);
@ -1609,7 +1609,7 @@ void MainWindow::UnloadMeasurements()
if (doc->ListMeasurements().isEmpty()) if (doc->ListMeasurements().isEmpty())
{ {
watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath())); watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath()));
doc->SetPath(QString()); doc->SetMPath(QString());
PatternChangesWereSaved(false); PatternChangesWereSaved(false);
ui->actionEditCurrent->setEnabled(false); ui->actionEditCurrent->setEnabled(false);
ui->actionUnloadMeasurements->setDisabled(true); ui->actionUnloadMeasurements->setDisabled(true);
@ -3387,7 +3387,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
const QString mPath = AbsoluteMPath(qApp->GetPPath(), doc->MPath()); const QString mPath = AbsoluteMPath(qApp->GetPPath(), doc->MPath());
if (not mPath.isEmpty() && qApp->GetPPath() != fileName) if (not mPath.isEmpty() && qApp->GetPPath() != fileName)
{ {
doc->SetPath(RelativeMPath(fileName, mPath)); doc->SetMPath(RelativeMPath(fileName, mPath));
} }
const bool result = doc->SaveDocument(fileName, error); const bool result = doc->SaveDocument(fileName, error);
@ -3403,7 +3403,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
} }
else else
{ {
doc->SetPath(mPath); doc->SetMPath(mPath);
qCDebug(vMainWindow, "Could not save file %s. %s.", qUtf8Printable(fileName), qUtf8Printable(error)); qCDebug(vMainWindow, "Could not save file %s. %s.", qUtf8Printable(fileName), qUtf8Printable(error));
} }
return result; return result;
@ -4207,7 +4207,7 @@ bool MainWindow::LoadPattern(const QString &fileName, const QString& customMeasu
doc->setXMLContent(converter.Convert()); doc->setXMLContent(converter.Convert());
if (!customMeasureFile.isEmpty()) if (!customMeasureFile.isEmpty())
{ {
doc->SetPath(RelativeMPath(fileName, customMeasureFile)); doc->SetMPath(RelativeMPath(fileName, customMeasureFile));
} }
qApp->setPatternUnit(doc->MUnit()); qApp->setPatternUnit(doc->MUnit());
const QString path = AbsoluteMPath(fileName, doc->MPath()); const QString path = AbsoluteMPath(fileName, doc->MPath());
@ -4679,7 +4679,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS
CheckRequiredMeasurements(m.data()); CheckRequiredMeasurements(m.data());
doc->SetPath(RelativeMPath(patternPath, mPath)); doc->SetMPath(RelativeMPath(patternPath, mPath));
PatternChangesWereSaved(false); PatternChangesWereSaved(false);
qApp->setPatternType(patternType); qApp->setPatternType(patternType);
return mPath; return mPath;

View File

@ -789,7 +789,7 @@ QString VAbstractPattern::MPath() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::SetPath(const QString &path) void VAbstractPattern::SetMPath(const QString &path)
{ {
if (setTagText(TagMeasurements, path)) if (setTagText(TagMeasurements, path))
{ {

View File

@ -121,7 +121,7 @@ public:
QVector<VToolRecord> getLocalHistory() const; QVector<VToolRecord> getLocalHistory() const;
QString MPath() const; QString MPath() const;
void SetPath(const QString &path); void SetMPath(const QString &path);
quint32 SiblingNodeId(const quint32 &nodeId) const; quint32 SiblingNodeId(const quint32 &nodeId) const;