Pass correct path to measurements in a pattern file.
--HG-- branch : develop
This commit is contained in:
parent
1cbc5195c2
commit
640202da5f
|
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
for (size_t i=0, sz = args.size(); i < sz;++i)
|
||||
{
|
||||
bool loaded = w.LoadPattern(args.at(static_cast<int>(i)), app.CommandLine()->OptMeasurePath());
|
||||
const bool loaded = w.LoadPattern(args.at(static_cast<int>(i)), app.CommandLine()->OptMeasurePath());
|
||||
if (app.CommandLine()->IsExportEnabled())
|
||||
{
|
||||
if (loaded)
|
||||
|
|
|
@ -341,7 +341,7 @@ QString MainWindow::RelativeMPath(const QString &patternPath, const QString &abs
|
|||
return absoluteMPath;
|
||||
}
|
||||
|
||||
if (absoluteMPath.isEmpty())
|
||||
if (absoluteMPath.isEmpty() || QFileInfo(absoluteMPath).isRelative())
|
||||
{
|
||||
return absoluteMPath;
|
||||
}
|
||||
|
@ -359,6 +359,11 @@ QString MainWindow::AbsoluteMPath(const QString &patternPath, const QString &rel
|
|||
}
|
||||
else
|
||||
{
|
||||
if (QFileInfo(relativeMPath).isAbsolute())
|
||||
{
|
||||
return relativeMPath;
|
||||
}
|
||||
|
||||
return QFileInfo(QFileInfo(patternPath).absoluteDir(), relativeMPath).absoluteFilePath();
|
||||
}
|
||||
}
|
||||
|
@ -3159,15 +3164,15 @@ bool MainWindow::LoadPattern(const QString &fileName, const QString& customMeasu
|
|||
doc->setXMLContent(fileName);
|
||||
if (!customMeasureFile.isEmpty())
|
||||
{
|
||||
doc->SetPath(customMeasureFile);
|
||||
doc->SetPath(RelativeMPath(fileName, customMeasureFile));
|
||||
}
|
||||
qApp->setPatternUnit(doc->MUnit());
|
||||
QString path = doc->MPath();
|
||||
QString path = AbsoluteMPath(fileName, doc->MPath());
|
||||
|
||||
if (not path.isEmpty())
|
||||
{
|
||||
// Check if exist
|
||||
path = CheckPathToMeasurements(fileName, AbsoluteMPath(fileName, path));
|
||||
path = CheckPathToMeasurements(fileName, path);
|
||||
if (path.isEmpty())
|
||||
{
|
||||
Clear();
|
||||
|
|
Loading…
Reference in New Issue
Block a user