---
scribo/ChangeLog | 5 +++++
scribo/demo/viewer/runner.cc | 9 +++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index eafcc32..70d963f 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * demo/viewer/runner.cc: Make detection of scribo-xml2doc more
+ robust.
+
2011-12-06 Guillaume Lazzara <z(a)lrde.epita.fr>
* scribo/text/recognition.hh: Restore previous locale.
diff --git a/scribo/demo/viewer/runner.cc b/scribo/demo/viewer/runner.cc
index da2f3bf..05ddac5 100644
--- a/scribo/demo/viewer/runner.cc
+++ b/scribo/demo/viewer/runner.cc
@@ -37,14 +37,23 @@ static
QString get_pathto(const QString& file,
const QString localdirsuffix = QString())
{
+ // Not installed ?
QFile f(SCRIBO_LOCAL_DEMODIR "/" + localdirsuffix + "/" + file);
if (f.exists())
return SCRIBO_LOCAL_DEMODIR "/" + localdirsuffix;
+ // Installed in a specific path ?
f.setFileName(SCRIBO_PREFIX_LIBEXECDIR "/" + file);
if (f.exists())
return SCRIBO_PREFIX_LIBEXECDIR;
+ // Installed in a specific path but moved elsewhere ?
+ QDir dir(QCoreApplication::applicationDirPath());
+ dir.cdUp(); // move from prefix/bin to prefix/
+ f.setFileName(dir.currentPath() + "/libexec/scribo" + file);
+ if (f.exists())
+ return dir.currentPath() + "/libexec/scribo";
+
qDebug() << "FATAL ERROR: Can't locate file: " + file;
return "";
--
1.7.2.5