summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp36
-rw-r--r--Swift/QtUI/UserSearch/UserSearchDelegate.cpp16
-rw-r--r--Swift/QtUI/UserSearch/UserSearchDelegate.h11
3 files changed, 34 insertions, 29 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index cff34d8..737196a 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -1,36 +1,38 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include "Swift/QtUI/UserSearch/QtUserSearchWindow.h"
+#include <Swift/QtUI/UserSearch/QtUserSearchWindow.h>
+
+#include <boost/bind.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <QItemDelegate>
#include <QModelIndex>
-#include <QWizardPage>
#include <QMovie>
-#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <QWizardPage>
+#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
-#include <Swift/Controllers/UIEvents/UIEventStream.h>
-#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h>
+
#include <Swift/Controllers/UIEvents/AddContactUIEvent.h>
#include <Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h>
#include <Swift/Controllers/UIEvents/InviteToMUCUIEvent.h>
-#include <Swift/QtUI/UserSearch/UserSearchModel.h>
-#include <Swift/QtUI/UserSearch/UserSearchDelegate.h>
-#include <Swift/QtUI/QtSwiftUtil.h>
+#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h>
+#include <Swift/Controllers/UIEvents/UIEventStream.h>
+
#include <Swift/QtUI/QtFormResultItemModel.h>
-#include <Swift/QtUI/UserSearch/QtUserSearchFirstPage.h>
-#include <Swift/QtUI/UserSearch/QtUserSearchFirstMultiJIDPage.h>
+#include <Swift/QtUI/QtSwiftUtil.h>
+#include <Swift/QtUI/UserSearch/QtContactListWidget.h>
+#include <Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h>
#include <Swift/QtUI/UserSearch/QtUserSearchFieldsPage.h>
+#include <Swift/QtUI/UserSearch/QtUserSearchFirstMultiJIDPage.h>
+#include <Swift/QtUI/UserSearch/QtUserSearchFirstPage.h>
#include <Swift/QtUI/UserSearch/QtUserSearchResultsPage.h>
-#include <Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h>
-#include <Swift/QtUI/UserSearch/QtContactListWidget.h>
-
-#include <Swiften/Base/Log.h>
+#include <Swift/QtUI/UserSearch/UserSearchDelegate.h>
+#include <Swift/QtUI/UserSearch/UserSearchModel.h>
namespace Swift {
@@ -53,7 +55,7 @@ QtUserSearchWindow::QtUserSearchWindow(UIEventStream* eventStream, UserSearchWin
}
setWindowTitle(title);
- delegate_ = new UserSearchDelegate();
+ delegate_ = new UserSearchDelegate(this);
setFirstPage(title);
setSecondPage();
diff --git a/Swift/QtUI/UserSearch/UserSearchDelegate.cpp b/Swift/QtUI/UserSearch/UserSearchDelegate.cpp
index 35793f4..1ac9eb3 100644
--- a/Swift/QtUI/UserSearch/UserSearchDelegate.cpp
+++ b/Swift/QtUI/UserSearch/UserSearchDelegate.cpp
@@ -1,24 +1,24 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include <QPen>
+#include <Swift/QtUI/UserSearch/UserSearchDelegate.h>
+
+#include <QFontMetrics>
+#include <QModelIndex>
#include <QPainter>
+#include <QPen>
#include <QStyleOptionViewItem>
-#include <QModelIndex>
-#include <QFontMetrics>
-#include "Swift/QtUI/UserSearch/UserSearchDelegate.h"
-//#include "Swift/QtUI/Roster/GroupItemDelegate.h"
#include <Swift/Controllers/Chat/UserSearchController.h>
+
#include <Swift/QtUI/UserSearch/UserSearchModel.h>
-//#include "Swift/QtUI/MUCSearch/MUCSearchServiceItem.h"
namespace Swift {
-UserSearchDelegate::UserSearchDelegate() {
+UserSearchDelegate::UserSearchDelegate(QObject* parent) : QStyledItemDelegate(parent) {
}
diff --git a/Swift/QtUI/UserSearch/UserSearchDelegate.h b/Swift/QtUI/UserSearch/UserSearchDelegate.h
index 41c20dc..92fa0e8 100644
--- a/Swift/QtUI/UserSearch/UserSearchDelegate.h
+++ b/Swift/QtUI/UserSearch/UserSearchDelegate.h
@@ -1,22 +1,25 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <QStyledItemDelegate>
#include <QPainter>
#include <QStyleOptionViewItem>
+#include <QStyledItemDelegate>
#include <Swift/QtUI/Roster/DelegateCommons.h>
namespace Swift {
class UserSearchDelegate : public QStyledItemDelegate {
+ Q_OBJECT
+
public:
- UserSearchDelegate();
- ~UserSearchDelegate();
+ UserSearchDelegate(QObject* parent = 0);
+ virtual ~UserSearchDelegate();
+
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index ) const;
private: