diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/QtUI/QtChatTheme.cpp | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/QtUI/QtChatTheme.cpp')
-rw-r--r-- | Swift/QtUI/QtChatTheme.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/Swift/QtUI/QtChatTheme.cpp b/Swift/QtUI/QtChatTheme.cpp index a7628d9..e73f8ac 100644 --- a/Swift/QtUI/QtChatTheme.cpp +++ b/Swift/QtUI/QtChatTheme.cpp @@ -14,58 +14,58 @@ namespace Swift { * Load Adium themes, as http://trac.adium.im/wiki/CreatingMessageStyles */ 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"; - fileNames[Content] = "Content.html"; - fileNames[Status] = "Status.html"; - fileNames[Topic] = "Topic.html"; - fileNames[FileTransferRequest] = "FileTransferRequest.html"; - fileNames[IncomingContent] = "Incoming/Content.html"; - fileNames[IncomingNextContent] = "Incoming/NextContent.html"; - fileNames[IncomingContext] = "Incoming/Context.html"; - fileNames[IncomingNextContext] = "Incoming/NextContext.html"; - fileNames[OutgoingContent] = "Outgoing/Content.html"; - fileNames[OutgoingNextContent] = "Outgoing/NextContent.html"; - fileNames[OutgoingContext] = "Outgoing/Context.html"; - 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; - QFile sourceFile((i != TemplateDefault ? themePath_ : "") + fileNames[i]); - if (sourceFile.exists() && sourceFile.open(QIODevice::ReadOnly)) { - source = sourceFile.readAll(); - sourceFile.close(); - } else { - //qWarning() << "Couldn't load file " << sourceFile.fileName(); - } - fileContents_.append(source); - } + QString fileNames[EndMarker]; + fileNames[Header] = "Header.html"; + fileNames[Footer] = "Footer.html"; + fileNames[Content] = "Content.html"; + fileNames[Status] = "Status.html"; + fileNames[Topic] = "Topic.html"; + fileNames[FileTransferRequest] = "FileTransferRequest.html"; + fileNames[IncomingContent] = "Incoming/Content.html"; + fileNames[IncomingNextContent] = "Incoming/NextContent.html"; + fileNames[IncomingContext] = "Incoming/Context.html"; + fileNames[IncomingNextContext] = "Incoming/NextContext.html"; + fileNames[OutgoingContent] = "Outgoing/Content.html"; + fileNames[OutgoingNextContent] = "Outgoing/NextContent.html"; + fileNames[OutgoingContext] = "Outgoing/Context.html"; + 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; + QFile sourceFile((i != TemplateDefault ? themePath_ : "") + fileNames[i]); + if (sourceFile.exists() && sourceFile.open(QIODevice::ReadOnly)) { + source = sourceFile.readAll(); + sourceFile.close(); + } else { + //qWarning() << "Couldn't load file " << sourceFile.fileName(); + } + fileContents_.append(source); + } - /* Fallbacks */ - if (fileContents_[Template].isEmpty()) fileContents_[Template] = fileContents_[TemplateDefault]; - if (fileContents_[Status].isEmpty()) fileContents_[Status] = fileContents_[Content]; - if (fileContents_[IncomingContent].isEmpty()) fileContents_[IncomingContent] = fileContents_[Content]; - if (fileContents_[IncomingNextContent].isEmpty()) fileContents_[IncomingNextContent] = fileContents_[IncomingContent]; - if (fileContents_[FileTransferRequest].isEmpty()) fileContents_[FileTransferRequest] = fileContents_[Status]; - if (fileContents_[IncomingContext].isEmpty()) fileContents_[IncomingContext] = fileContents_[IncomingContent]; - if (fileContents_[IncomingNextContext].isEmpty()) fileContents_[IncomingNextContext] = fileContents_[IncomingNextContent]; - if (fileContents_[OutgoingContent].isEmpty()) fileContents_[OutgoingContent] = fileContents_[IncomingContent]; - if (fileContents_[OutgoingContext].isEmpty()) fileContents_[OutgoingContext] = fileContents_[OutgoingContent]; - if (fileContents_[OutgoingNextContent].isEmpty()) fileContents_[OutgoingNextContent] = fileContents_[OutgoingContent]; - if (fileContents_[OutgoingNextContext].isEmpty()) fileContents_[OutgoingNextContext] = fileContents_[OutgoingNextContent]; + /* Fallbacks */ + if (fileContents_[Template].isEmpty()) fileContents_[Template] = fileContents_[TemplateDefault]; + if (fileContents_[Status].isEmpty()) fileContents_[Status] = fileContents_[Content]; + if (fileContents_[IncomingContent].isEmpty()) fileContents_[IncomingContent] = fileContents_[Content]; + if (fileContents_[IncomingNextContent].isEmpty()) fileContents_[IncomingNextContent] = fileContents_[IncomingContent]; + if (fileContents_[FileTransferRequest].isEmpty()) fileContents_[FileTransferRequest] = fileContents_[Status]; + if (fileContents_[IncomingContext].isEmpty()) fileContents_[IncomingContext] = fileContents_[IncomingContent]; + if (fileContents_[IncomingNextContext].isEmpty()) fileContents_[IncomingNextContext] = fileContents_[IncomingNextContent]; + if (fileContents_[OutgoingContent].isEmpty()) fileContents_[OutgoingContent] = fileContents_[IncomingContent]; + if (fileContents_[OutgoingContext].isEmpty()) fileContents_[OutgoingContext] = fileContents_[OutgoingContent]; + if (fileContents_[OutgoingNextContent].isEmpty()) fileContents_[OutgoingNextContent] = fileContents_[OutgoingContent]; + if (fileContents_[OutgoingNextContext].isEmpty()) fileContents_[OutgoingNextContext] = fileContents_[OutgoingNextContent]; } QString QtChatTheme::getBase() const { - return qrc_ ? "qrc" + themePath_ : "file://" + themePath_; + return qrc_ ? "qrc" + themePath_ : "file://" + themePath_; } QString QtChatTheme::getUnread() const { - return fileContents_[Unread].isEmpty() ? "<hr/>" : fileContents_[Unread]; + return fileContents_[Unread].isEmpty() ? "<hr/>" : fileContents_[Unread]; } } |