diff --git a/saoriview.cpp b/saoriview.cpp
index bfe1d0e..42b396a 100644
--- a/saoriview.cpp
+++ b/saoriview.cpp
@@ -133,9 +133,9 @@
result += "
";
}
if (rebloged) {
- result += "
";
+ result += ") />";
result += tr("boosted by: %1").arg(json["account"].toObject()["display_name"].toString());
} else {
result += accountParser(json["account"].toObject());
@@ -166,9 +166,9 @@
if (json.isEmpty()) return QString();
result += "
";
result += "
";
- result += "";
+ result += ") style=\"float:left;\" />";
result += "
";
result += json["display_name"].toString();
result += " @";
@@ -193,7 +193,7 @@
result += json["url"].toString();
result += "\">";
}
- result += "";
if (json["type"].toString() == "image") {
diff --git a/saoriviewentry.cpp b/saoriviewentry.cpp
index 61ef611..dc71f11 100644
--- a/saoriviewentry.cpp
+++ b/saoriviewentry.cpp
@@ -28,6 +28,7 @@
#include "saoriapplication.h"
#include "saoricache.h"
#include
+#include
#include
SaoriViewEntry::SaoriViewEntry(qlonglong id, QWidget *parent) :
@@ -48,14 +49,20 @@
void SaoriViewEntry::setContent(const QString content)
{
m_original = content;
+ document()->clear();
QStringList imgs;
- for(int i = 0;(i = m_original.indexOf("cache()->fileCache(QUrl(i));
+ int p = i.indexOf(':');
+ m_urlmap[i] = SaoriApplication::saori()->cache()->fileCache(QUrl(i.mid(p + 1)));
+ QImage img(m_urlmap[i]);
+ imageResizer(i.left(p),img);
+ document()->addResource(QTextDocument::ImageResource,QUrl("img:" + m_urlmap[i]),QVariant(img));
}
+ qDebug() << designedText();
setText(designedText());
// QTextBrowserのサイズを確定させるトリック。
QResizeEvent e(size(),size());
@@ -89,15 +96,35 @@
QString result = m_original;
for (auto k:m_urlmap.keys()) {
result.replace(QString("cache()->fileCache(url);
- setText(designedText());
+ setContent(m_original);
for (auto i:m_urlmap) {
if (i.indexOf(":/")) return;
}
diff --git a/saoriviewentry.h b/saoriviewentry.h
index 89941de..737e5a2 100644
--- a/saoriviewentry.h
+++ b/saoriviewentry.h
@@ -44,6 +44,7 @@
virtual void resizeEvent(QResizeEvent *e);
const QString designedText();
const QString imageReplacer();
+ void imageResizer(const QString type,QImage &image);
protected:
qlonglong m_id;