From accd3ca734ab1dbfd5944b86c1f80790a5be5983 Mon Sep 17 00:00:00 2001 From: Phenom Date: Mon, 15 Aug 2016 19:05:00 +0200 Subject: [PATCH] Fix RsTextBrowser::loadRessource on Windows. When current style use images (like bubble). --- retroshare-gui/src/gui/common/RSTextBrowser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index edeaa473e..3b9ef9ded 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -1,5 +1,6 @@ #include +#include #include #include @@ -84,8 +85,8 @@ QVariant RSTextBrowser::loadResource(int type, const QUrl &name) // case 2: always trust the image if it comes from local Config or Data directories. if(name.scheme().compare("file",Qt::CaseInsensitive)==0 && type == QTextDocument::ImageResource) { - if (name.path().startsWith(QString::fromUtf8(RsAccounts::ConfigDirectory().c_str()).prepend("/"),Qt::CaseInsensitive) - || name.path().startsWith(QString::fromUtf8(RsAccounts::DataDirectory().c_str()).prepend("/"),Qt::CaseInsensitive)) + if (name.path().startsWith(QDir(QString::fromUtf8(RsAccounts::ConfigDirectory().c_str())).absolutePath().prepend("/"),Qt::CaseInsensitive) + || name.path().startsWith(QDir(QString::fromUtf8(RsAccounts::DataDirectory().c_str())).absolutePath().prepend("/"),Qt::CaseInsensitive)) return QTextBrowser::loadResource(type, name); }