mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-15 05:40:49 -05:00
Fix RsTextBrowser::loadRessource on Windows.
When current style use images (like bubble).
This commit is contained in:
parent
b8158a47dc
commit
accd3ca734
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
@ -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.
|
// 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.scheme().compare("file",Qt::CaseInsensitive)==0 && type == QTextDocument::ImageResource) {
|
||||||
if (name.path().startsWith(QString::fromUtf8(RsAccounts::ConfigDirectory().c_str()).prepend("/"),Qt::CaseInsensitive)
|
if (name.path().startsWith(QDir(QString::fromUtf8(RsAccounts::ConfigDirectory().c_str())).absolutePath().prepend("/"),Qt::CaseInsensitive)
|
||||||
|| name.path().startsWith(QString::fromUtf8(RsAccounts::DataDirectory().c_str()).prepend("/"),Qt::CaseInsensitive))
|
|| name.path().startsWith(QDir(QString::fromUtf8(RsAccounts::DataDirectory().c_str())).absolutePath().prepend("/"),Qt::CaseInsensitive))
|
||||||
return QTextBrowser::loadResource(type, name);
|
return QTextBrowser::loadResource(type, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue