Fix separator.

This commit is contained in:
Black Hat 2018-10-20 15:25:17 +08:00
parent 2e4fed72fe
commit f53bdaae89
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,8 @@
#include "manager.h" #include "manager.h"
#include "wintoastlib.h" #include "wintoastlib.h"
#include <QDir>
using namespace WinToastLib; using namespace WinToastLib;
class CustomHandler : public IWinToastHandler { class CustomHandler : public IWinToastHandler {
@ -62,8 +64,9 @@ void NotificationsManager::postNotification(
WinToastTemplate::FirstLine); WinToastTemplate::FirstLine);
templ.setTextField(QString("%1").arg(text).toStdWString(), templ.setTextField(QString("%1").arg(text).toStdWString(),
WinToastTemplate::SecondLine); WinToastTemplate::SecondLine);
templ.setImagePath( templ.setImagePath(
reinterpret_cast<const wchar_t *>(iconPath.toLocalFile().utf16())); reinterpret_cast<const wchar_t *>(QDir::toNativeSeparators(iconPath.toLocalFile()).utf16()));
count++; count++;
CustomHandler *customHandler = new CustomHandler(count, this); CustomHandler *customHandler = new CustomHandler(count, this);

View File

@ -83,13 +83,11 @@ void RoomListModel::connectRoomSignals(SpectralRoom* room) {
User* sender = room->user(event->senderId()); User* sender = room->user(event->senderId());
if (sender == room->localUser()) return; if (sender == room->localUser()) return;
QUrl _url = room->avatarUrl(); QUrl _url = room->avatarUrl();
qDebug() << QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
"/avatar/" + _url.authority() + '_' + _url.fileName() + ".png";
emit newMessage( emit newMessage(
room->id(), event->id(), room->displayName(), sender->displayname(), room->id(), event->id(), room->displayName(), sender->displayname(),
event->contentJson().value("body").toString(), room->avatar(128), event->contentJson().value("body").toString(), room->avatar(128),
QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
"/avatar/" + _url.authority() + '_' + _url.fileName() + ".png"); "/avatar/" + _url.authority() + '_' + _url.fileName() + ".png"));
}); });
} }