Code style

This commit is contained in:
Patrick von Reth 2015-08-27 23:08:42 +02:00
parent c940e44b63
commit 7347abbac5
2 changed files with 7 additions and 9 deletions

View File

@ -29,18 +29,19 @@ private Q_SLOTS:
void displayTestPlain();
private:
void testString(QString message){
void testString(QString message)
{
qDebug() << Utils::normalizeMarkup(message, Utils::NO_MARKUP);
SnoreCore &snore = SnoreCore::instance();
QStringList backends = snore.pluginNames(SnorePlugin::BACKEND);
auto notify = [&backends, &snore, &message, this](Notification n){
auto notify = [&backends, &snore, &message, this](Notification n) {
qDebug() << n << "closed";
qDebug() << backends.size();
if(backends.empty()) {
if (backends.empty()) {
return;
}
QString old = snore.primaryNotificationBackend();
while(snore.primaryNotificationBackend() == old) {
while (snore.primaryNotificationBackend() == old) {
QString p = backends.takeLast();
snore.setSettingsValue(QLatin1String("PrimaryBackend"), p, LOCAL_SETTING);
SnoreCorePrivate::instance()->syncSettings();
@ -60,21 +61,18 @@ private:
}
};
void DisplayTest::displayTest()
{
app.hints().setValue("use-markup", true);
testString(QLatin1String("<b>Test&#937;</b>&#x1f4a9;&#x1f600;"));
}
void DisplayTest::displayTestPlain()
{
app.hints().setValue("use-markup", false);
testString(QString::fromWCharArray(L"Test\u03A9\U0001F4A9\U0001F600"));
}
QTEST_MAIN(DisplayTest)
#include "display_test.moc"

View File

@ -34,8 +34,8 @@ NotifyWidget::NotifyWidget(int pos, const SnoreNotifier *parent) :
QString font = qApp->font().family();
#ifdef Q_OS_WIN
switch(QSysInfo::windowsVersion()){
case QSysInfo::WV_WINDOWS8:
switch (QSysInfo::windowsVersion()) {
case QSysInfo::WV_WINDOWS8:
font = QLatin1String("Segoe UI Symbol");
break;
#if QT_VERSION_CHECK(5,5,0)