From 27f58c9ca6922b322892a89d9287b130d3f2419e Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 25 Mar 2015 11:27:33 -0500 Subject: [PATCH] Style fixes --- src/friend.h | 2 +- src/widget/form/settings/generalsettings.ui | 2 +- src/widget/friendlistwidget.cpp | 10 +++++----- src/widget/widget.cpp | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/friend.h b/src/friend.h index 944a078ee..b6ce04a89 100644 --- a/src/friend.h +++ b/src/friend.h @@ -24,7 +24,7 @@ struct FriendWidget; class ChatForm; -struct Friend : QObject +class Friend : public QObject { Q_OBJECT public: diff --git a/src/widget/form/settings/generalsettings.ui b/src/widget/form/settings/generalsettings.ui index 56d72f191..fc8b53bde 100644 --- a/src/widget/form/settings/generalsettings.ui +++ b/src/widget/form/settings/generalsettings.ui @@ -391,7 +391,7 @@ will be sent to them when they appear online to you. - + If checked, groupchats will be placed at the top of the friends list, otherwise, they'll be placed below online friends. diff --git a/src/widget/friendlistwidget.cpp b/src/widget/friendlistwidget.cpp index 5ba9f2598..ad665666a 100644 --- a/src/widget/friendlistwidget.cpp +++ b/src/widget/friendlistwidget.cpp @@ -42,7 +42,7 @@ FriendListWidget::FriendListWidget(QWidget *parent, bool groupchatPosition) : layouts[static_cast(s)] = l; } - if(groupchatPosition) + if (groupchatPosition) { mainLayout->addLayout(groupLayout, 0, 0); mainLayout->addLayout(layouts[static_cast(Status::Online)], 1, 0); @@ -75,7 +75,7 @@ void FriendListWidget::onGroupchatPositionChanged(bool top) { mainLayout->removeItem(groupLayout); mainLayout->removeItem(getFriendLayout(Status::Online)); - if(top) + if (top) { mainLayout->addLayout(groupLayout, 0, 0); mainLayout->addLayout(layouts[static_cast(Status::Online)], 1, 0); @@ -92,13 +92,13 @@ void FriendListWidget::moveWidget(QWidget *w, Status s, int hasNewEvents) QVBoxLayout* l = getFriendLayout(s); l->removeWidget(w); Friend* g = FriendList::findFriend(dynamic_cast(w)->friendId); - for(int i = 0; i < l->count(); i++) + for (int i = 0; i < l->count(); i++) { FriendWidget* w1 = dynamic_cast(l->itemAt(i)->widget()); - if(w1 != NULL) + if (w1 != NULL) { Friend* f = FriendList::findFriend(w1->friendId); - if(f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0) + if (f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0) { l->insertWidget(i,w); return; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 1d4b3f5c8..0ee2fac2f 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -226,7 +226,7 @@ void Widget::setTranslation() bool Widget::eventFilter(QObject *obj, QEvent *event) { - if(event->type() == QEvent::WindowStateChange && obj != NULL) + if (event->type() == QEvent::WindowStateChange && obj != NULL) { QWindowStateChangeEvent * ce = static_cast(event); if (windowState() & Qt::WindowMinimized) @@ -426,7 +426,7 @@ void Widget::confirmExecutableOpen(const QFileInfo file) if (dangerousExtensions.contains(file.suffix())) { - if(!GUI::askQuestion(tr("Executable file", "popup title"), tr("You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file?", "popup text"), false, true)) + if (!GUI::askQuestion(tr("Executable file", "popup title"), tr("You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file?", "popup text"), false, true)) { return; } @@ -626,16 +626,16 @@ void Widget::onFriendStatusChanged(int friendId, Status status) Friend* f = FriendList::findFriend(friendId); if (!f) return; - + bool isActualChange = f->getStatus() != status; - if(isActualChange) + if (isActualChange) { - if(f->getStatus() == Status::Offline) + if (f->getStatus() == Status::Offline) { contactListWidget->moveWidget(f->getFriendWidget(), Status::Online, f->getEventFlag()); } - else if(status == Status::Offline) + else if (status == Status::Offline) { contactListWidget->moveWidget(f->getFriendWidget(), Status::Offline, f->getEventFlag()); }