chatgui: add diagnostic logging for Windows emoji animation bug investigation
This commit is contained in:
1 parent
e071a9e2f8
commit
fe18c454e2
3 files changed
+19
-1
No files matched your search
@@ -16,6 +16,7 @@
|
||||
#include <QScrollBar>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
@@ -104,11 +105,18 @@ MessageList::MessageList(DbManager* db, QWidget *parent)
|
||||
if (e.type == EmojiType::Animation && !e.animPath.isEmpty()) {
|
||||
QFile f(e.animPath);
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
auto icon = std::make_unique<LottieIcon>(f.readAll());
|
||||
QByteArray raw = f.readAll();
|
||||
auto icon = std::make_unique<LottieIcon>(raw);
|
||||
fprintf(stderr, "[DIAG register] path=%s fileOpen=1 rawSize=%d iconPtr=%p iconValid=%d\n",
|
||||
qPrintable(e.animPath), (int)raw.size(),
|
||||
(void*)icon.get(), (int)icon->isValid());
|
||||
if (icon->isValid()) {
|
||||
AnimTimer::instance()->registerIcon(e.animPath, icon.get());
|
||||
s_icons.push_back(std::move(icon));
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "[DIAG register] path=%s fileOpen=0\n",
|
||||
qPrintable(e.animPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user