diff options
author | Tobias Markmann <tm@ayena.de> | 2016-07-29 14:46:41 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2016-08-02 11:43:07 (GMT) |
commit | dbd57ffd259b9dba6990de0b02b450fa2a59a563 (patch) | |
tree | e34502cd609ca16715957c043cc2c812964635e5 /Swift/QtUI/EventViewer | |
parent | 5eeb7327e4d5b713feb26f8d59f417f653705b48 (diff) | |
download | swift-dbd57ffd259b9dba6990de0b02b450fa2a59a563.zip swift-dbd57ffd259b9dba6990de0b02b450fa2a59a563.tar.bz2 |
Fix notice sometimes showing empty popup dialog on activation
Test-Information:
Tried editing a contact on a server prohibiting contact
editing. Previously the first double-click on the notice
showed an empty popup. Now the correct popup text is shown.
Change-Id: I996cf5b654e866ec6dd3f5198b694ae564018695
Diffstat (limited to 'Swift/QtUI/EventViewer')
-rw-r--r-- | Swift/QtUI/EventViewer/QtEventWindow.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/EventViewer/QtEventWindow.h | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Swift/QtUI/EventViewer/QtEventWindow.cpp b/Swift/QtUI/EventViewer/QtEventWindow.cpp index e77699b..c8d1f0c 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.cpp +++ b/Swift/QtUI/EventViewer/QtEventWindow.cpp @@ -9,12 +9,13 @@ #include <QBoxLayout> #include <QMessageBox> #include <QPushButton> -#include <QtDebug> +#include <QTreeView> #include <Swiften/Base/Platform.h> #include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h> #include <Swift/Controllers/UIEvents/RequestChatUIEvent.h> +#include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/XMPPEvents/ErrorEvent.h> #include <Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h> #include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h> @@ -99,7 +100,7 @@ void QtEventWindow::handleItemActivated(const QModelIndex& item) { errorEvent->conclude(); } QMessageBox msgBox; - msgBox.setText(model_->data(item, Qt::DisplayRole).toString()); + msgBox.setText(event->data(Qt::DisplayRole).toString()); msgBox.exec(); } diff --git a/Swift/QtUI/EventViewer/QtEventWindow.h b/Swift/QtUI/EventViewer/QtEventWindow.h index bad20e4..7ae33ec 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.h +++ b/Swift/QtUI/EventViewer/QtEventWindow.h @@ -8,9 +8,6 @@ #include <memory> -#include <QTreeView> - -#include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/UIInterfaces/EventWindow.h> #include <Swift/QtUI/EventViewer/EventDelegate.h> @@ -18,8 +15,11 @@ #include <Swift/QtUI/EventViewer/EventView.h> class QPushButton; +class QTreeView; namespace Swift { + class UIEventStream; + class QtEventWindow : public QWidget, public EventWindow { Q_OBJECT public: @@ -27,12 +27,15 @@ namespace Swift { ~QtEventWindow(); void addEvent(std::shared_ptr<StanzaEvent> event, bool active); void removeEvent(std::shared_ptr<StanzaEvent> event); + signals: void onNewEventCountUpdated(int count); + private slots: void handleItemActivated(const QModelIndex& item); void handleItemClicked(const QModelIndex& item); void handleReadClicked(); + private: EventModel* model_; EventDelegate* delegate_; |