Commit 46bdb024 authored by Guillaume Lazzara's avatar Guillaume Lazzara Committed by Roland Levillain
Browse files

demo/viewer/runner.cc: Make xml2doc binary lookup more robust.


Signed-off-by: Roland Levillain's avatarRoland Levillain <roland@lrde.epita.fr>
parent 8a887c76
2012-05-22 Guillaume Lazzara <z@lrde.epita.fr>
* demo/viewer/runner.cc: Make xml2doc binary lookup more robust.
2011-12-07 Guillaume Lazzara <z@lrde.epita.fr> 2011-12-07 Guillaume Lazzara <z@lrde.epita.fr>
* demo/viewer/runner.cc: Make detection of scribo-xml2doc more * demo/viewer/runner.cc: Make detection of scribo-xml2doc more
......
// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory // Copyright (C) 2010, 2011, 2012 EPITA Research and Development
// (LRDE) // Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -50,9 +50,15 @@ QString get_pathto(const QString& file, ...@@ -50,9 +50,15 @@ QString get_pathto(const QString& file,
// Installed in a specific path but moved elsewhere ? // Installed in a specific path but moved elsewhere ?
QDir dir(QCoreApplication::applicationDirPath()); QDir dir(QCoreApplication::applicationDirPath());
dir.cdUp(); // move from prefix/bin to prefix/ dir.cdUp(); // move from prefix/bin to prefix/
f.setFileName(dir.currentPath() + "/libexec/scribo" + file);
const char *path[] = { "lib", "libexec", 0 };
for (int i = 0; path[i]; ++i)
{
f.setFileName(dir.currentPath() + QString("/%1/scribo").arg(path[i]) + file);
if (f.exists()) if (f.exists())
return dir.currentPath() + "/libexec/scribo"; return dir.currentPath() + QString("/%1/scribo").arg(path[i]);
}
qDebug() << "FATAL ERROR: Can't locate file: " + file; qDebug() << "FATAL ERROR: Can't locate file: " + file;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment