Browse Source

Style fixes

pull/1467/head
Dubslow 11 years ago
parent
commit
27f58c9ca6
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
  1. 2
      src/friend.h
  2. 2
      src/widget/form/settings/generalsettings.ui
  3. 10
      src/widget/friendlistwidget.cpp
  4. 12
      src/widget/widget.cpp

2
src/friend.h

@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
struct FriendWidget;
class ChatForm;
struct Friend : QObject
class Friend : public QObject
{
Q_OBJECT
public:

2
src/widget/form/settings/generalsettings.ui

@ -391,7 +391,7 @@ will be sent to them when they appear online to you.</string> @@ -391,7 +391,7 @@ will be sent to them when they appear online to you.</string>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="2" column="1">
<widget class="QCheckBox" name="cbGroupchatPosition">
<property name="toolTip">
<string comment="toolTip for groupchat positioning">If checked, groupchats will be placed at the top of the friends list, otherwise, they'll be placed below online friends.</string>

10
src/widget/friendlistwidget.cpp

@ -42,7 +42,7 @@ FriendListWidget::FriendListWidget(QWidget *parent, bool groupchatPosition) : @@ -42,7 +42,7 @@ FriendListWidget::FriendListWidget(QWidget *parent, bool groupchatPosition) :
layouts[static_cast<int>(s)] = l;
}
if(groupchatPosition)
if (groupchatPosition)
{
mainLayout->addLayout(groupLayout, 0, 0);
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
@ -75,7 +75,7 @@ void FriendListWidget::onGroupchatPositionChanged(bool top) @@ -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<int>(Status::Online)], 1, 0);
@ -92,13 +92,13 @@ void FriendListWidget::moveWidget(QWidget *w, Status s, int hasNewEvents) @@ -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<FriendWidget*>(w)->friendId);
for(int i = 0; i < l->count(); i++)
for (int i = 0; i < l->count(); i++)
{
FriendWidget* w1 = dynamic_cast<FriendWidget*>(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;

12
src/widget/widget.cpp

@ -226,7 +226,7 @@ void Widget::setTranslation() @@ -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<QWindowStateChangeEvent*>(event);
if (windowState() & Qt::WindowMinimized)
@ -426,7 +426,7 @@ void Widget::confirmExecutableOpen(const QFileInfo file) @@ -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) @@ -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());
}

Loading…
Cancel
Save