From 33a33ef0511edf8789fae876f11411e8d0e0cc06 Mon Sep 17 00:00:00 2001 From: tux3 Date: Wed, 10 Jun 2015 01:42:51 +0200 Subject: [PATCH] Rebase on master --- qtox.pro | 2 +- src/persistence/settings.cpp | 4 ++-- src/widget/circlewidget.cpp | 6 +++--- src/widget/friendlistwidget.cpp | 4 ++-- src/widget/genericchatitemwidget.cpp | 8 +++----- src/widget/genericchatroomwidget.cpp | 5 ++++- src/widget/genericchatroomwidget.h | 5 +---- src/widget/groupwidget.h | 2 -- src/widget/tool/croppinglabel.h | 1 - 9 files changed, 16 insertions(+), 21 deletions(-) diff --git a/qtox.pro b/qtox.pro index b750191d2..9ae5334ba 100644 --- a/qtox.pro +++ b/qtox.pro @@ -38,7 +38,7 @@ FORMS += \ CONFIG += c++11 -QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti +QMAKE_CXXFLAGS += -fno-exceptions # Rules for creating/updating {ts|qm}-files include(translations/i18n.pri) diff --git a/src/persistence/settings.cpp b/src/persistence/settings.cpp index c3607e9ee..aeaf83cf5 100644 --- a/src/persistence/settings.cpp +++ b/src/persistence/settings.cpp @@ -1369,7 +1369,7 @@ QString Settings::getCircleName(int id) const void Settings::setCircleName(int id, const QString &name) { circleLst[id].name = name; - save(); + savePersonal(); } int Settings::addCircle(const QString &name) @@ -1390,7 +1390,7 @@ bool Settings::getCircleExpanded(int id) const void Settings::setCircleExpanded(int id, bool expanded) { circleLst[id].expanded = expanded; - save(); + savePersonal(); } int Settings::removeCircle(int id) diff --git a/src/widget/circlewidget.cpp b/src/widget/circlewidget.cpp index 2dcff7729..30a877632 100644 --- a/src/widget/circlewidget.cpp +++ b/src/widget/circlewidget.cpp @@ -13,14 +13,14 @@ */ #include "circlewidget.h" -#include "src/misc/style.h" -#include "src/misc/settings.h" +#include "src/widget/style.h" +#include "src/persistence/settings.h" #include "src/friendlist.h" #include "src/friend.h" #include "friendwidget.h" #include "friendlistlayout.h" #include "friendlistwidget.h" -#include "croppinglabel.h" +#include "src/widget/tool/croppinglabel.h" #include "widget.h" #include #include diff --git a/src/widget/friendlistwidget.cpp b/src/widget/friendlistwidget.cpp index c477ac028..f4d3fedc4 100644 --- a/src/widget/friendlistwidget.cpp +++ b/src/widget/friendlistwidget.cpp @@ -21,7 +21,7 @@ #include "friendlistlayout.h" #include "src/friend.h" #include "src/friendlist.h" -#include "src/misc/settings.h" +#include "src/persistence/settings.h" #include "friendwidget.h" #include "groupwidget.h" #include "circlewidget.h" @@ -123,7 +123,7 @@ void FriendListWidget::renameCircleWidget(const QString &newName) { assert(sender() != nullptr); - CircleWidget* circleWidget = dynamic_cast(sender()); + CircleWidget* circleWidget = static_cast(sender()); assert(circleWidget != nullptr); // Rename after removing so you can find it successfully. diff --git a/src/widget/genericchatitemwidget.cpp b/src/widget/genericchatitemwidget.cpp index 44272d990..f37057e38 100644 --- a/src/widget/genericchatitemwidget.cpp +++ b/src/widget/genericchatitemwidget.cpp @@ -13,9 +13,9 @@ */ #include "genericchatitemwidget.h" -#include "src/misc/style.h" -#include "src/misc/settings.h" -#include "croppinglabel.h" +#include "src/widget/style.h" +#include "src/persistence/settings.h" +#include "src/widget/tool/croppinglabel.h" #include GenericChatItemWidget::GenericChatItemWidget(QWidget *parent) @@ -24,7 +24,6 @@ GenericChatItemWidget::GenericChatItemWidget(QWidget *parent) setProperty("compact", Settings::getInstance().getCompactLayout()); nameLabel = new CroppingLabel(this); - nameLabel->setObjectName("name"); nameLabel->setTextFormat(Qt::PlainText); } @@ -36,7 +35,6 @@ bool GenericChatItemWidget::isCompact() const void GenericChatItemWidget::setCompact(bool compact) { this->compact = compact; - Style::repolish(this); } QString GenericChatItemWidget::getName() const diff --git a/src/widget/genericchatroomwidget.cpp b/src/widget/genericchatroomwidget.cpp index 8aec7812c..0b4acd2bf 100644 --- a/src/widget/genericchatroomwidget.cpp +++ b/src/widget/genericchatroomwidget.cpp @@ -25,7 +25,7 @@ #include GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) - : QFrame(parent), compact{Settings::getInstance().getCompactLayout()}, + : GenericChatItemWidget(parent), compact{Settings::getInstance().getCompactLayout()}, active{false} { // avatar @@ -39,6 +39,9 @@ GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) statusMessageLabel->setTextFormat(Qt::PlainText); statusMessageLabel->setForegroundRole(QPalette::WindowText); + nameLabel->setTextFormat(Qt::PlainText); + nameLabel->setForegroundRole(QPalette::WindowText); + setAutoFillBackground(true); reloadTheme(); setCompact(compact); diff --git a/src/widget/genericchatroomwidget.h b/src/widget/genericchatroomwidget.h index 9ee607f8a..d202072cc 100644 --- a/src/widget/genericchatroomwidget.h +++ b/src/widget/genericchatroomwidget.h @@ -31,12 +31,11 @@ namespace Ui { class MainWindow; } -class GenericChatroomWidget : public QFrame +class GenericChatroomWidget : public GenericChatItemWidget { Q_OBJECT public: GenericChatroomWidget(QWidget *parent = 0); - void mouseReleaseEvent (QMouseEvent* event); virtual void setAsActiveChatroom(){;} virtual void setAsInactiveChatroom(){;} @@ -51,7 +50,6 @@ public: void setName(const QString& name); void setStatusMsg(const QString& status); - QString getName() const; QString getStatusMsg() const; void reloadTheme(); @@ -60,7 +58,6 @@ public: public slots: void setCompact(bool compact); - void onCompactChanged(bool compact); signals: void chatroomWidgetClicked(GenericChatroomWidget* widget); diff --git a/src/widget/groupwidget.h b/src/widget/groupwidget.h index 5a678bf28..8165bfd62 100644 --- a/src/widget/groupwidget.h +++ b/src/widget/groupwidget.h @@ -48,8 +48,6 @@ protected: virtual void dragEnterEvent(QDragEnterEvent* ev) override; virtual void dragLeaveEvent(QDragLeaveEvent* ev); virtual void dropEvent(QDropEvent* ev) override; - virtual void keyPressEvent(QKeyEvent* ev); - virtual void keyReleaseEvent(QKeyEvent* ev); public: int groupId; diff --git a/src/widget/tool/croppinglabel.h b/src/widget/tool/croppinglabel.h index a411ccd91..b06978204 100644 --- a/src/widget/tool/croppinglabel.h +++ b/src/widget/tool/croppinglabel.h @@ -51,7 +51,6 @@ protected: virtual QSize sizeHint() const final override; virtual QSize minimumSizeHint() const final override; virtual void mouseReleaseEvent(QMouseEvent *e) final override; - virtual bool eventFilter(QObject *obj, QEvent *e) final override; private slots: void finishTextEdit();