diff options
Diffstat (limited to 'Swift/QtUI/QtChatTheme.cpp')
-rw-r--r-- | Swift/QtUI/QtChatTheme.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/QtChatTheme.cpp b/Swift/QtUI/QtChatTheme.cpp index 5a9bc44..a7628d9 100644 --- a/Swift/QtUI/QtChatTheme.cpp +++ b/Swift/QtUI/QtChatTheme.cpp @@ -1,20 +1,19 @@ /* - * Copyright (c) 2010 Isode Limited.. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#include "QtChatTheme.h" +#include <Swift/QtUI/QtChatTheme.h> #include <QFile> -#include <qdebug.h> namespace Swift { /** * Load Adium themes, as http://trac.adium.im/wiki/CreatingMessageStyles */ -QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath.isEmpty()), themePath_(qrc_ ? ":/themes/Default/" : themePath + "/Contents/Resources/") { +QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath[0] == ':'), themePath_(qrc_ ? themePath : themePath + "/Contents/Resources/") { QString fileNames[EndMarker]; fileNames[Header] = "Header.html"; fileNames[Footer] = "Footer.html"; @@ -32,6 +31,7 @@ QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath.isEmpty()), fileNames[OutgoingNextContext] = "Outgoing/NextContext.html"; fileNames[Template] = "Template.html"; fileNames[MainCSS] = "main.css"; + fileNames[Unread] = "Unread.html"; fileNames[TemplateDefault] = ":/themes/Template.html"; for (int i = 0; i < EndMarker; i++) { QString source; @@ -64,4 +64,8 @@ QString QtChatTheme::getBase() const { return qrc_ ? "qrc" + themePath_ : "file://" + themePath_; } +QString QtChatTheme::getUnread() const { + return fileContents_[Unread].isEmpty() ? "<hr/>" : fileContents_[Unread]; +} + } |