Fixed RoutingPanel & UserInfoPanel to use ImageButton properly (due to recent changes...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Fri, 20 Aug 2010 09:57:54 +0000 (12:57 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Fri, 20 Aug 2010 09:57:54 +0000 (12:57 +0300)
Added missing referencies to TabbedPanel unit test.

src/ui/routingpanel.cpp
src/ui/userinfopanel.cpp
tests/ui/tabbedpanel/tabbedpanel.pro
tests/ui/tabbedpanel/testtabbedpanel.cpp

index 017c10e..20ef5f7 100644 (file)
@@ -29,8 +29,9 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
                                        PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
 
-    ImageButton *searchLocationButton = new ImageButton(0, ":/res/images/search.png",
-                                                             ":/res/images/search_s.png");
+    ImageButton *searchLocationButton = new ImageButton(":/res/images/search.png",
+                                                        ":/res/images/search_s.png",
+                                                        "", this);
 
     m_contextButtonList.append(searchLocationButton);
 
index db35d46..c1ed2b1 100644 (file)
@@ -79,10 +79,12 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
     connect(this, SIGNAL(clearUpdateLocationDialogData()),
             m_userInfo, SLOT(clearUpdateLocationDialogData()));
 
-    ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
-                                                             ":/res/images/refresh_s.png");
-    ImageButton *updateStatusMessageButton = new ImageButton(this, ":/res/images/send_position.png",
-                                                                   ":/res/images/send_position_s.png");
+    ImageButton *updateFriendsButton = new ImageButton(":/res/images/refresh.png",
+                                                       ":/res/images/refresh_s.png",
+                                                       "", this);
+    ImageButton *updateStatusMessageButton = new ImageButton(":/res/images/send_position.png",
+                                                             ":/res/images/send_position_s.png",
+                                                             "", this);
 
     m_contextButtonList.append(updateFriendsButton);
     m_contextButtonList.append(updateStatusMessageButton);
index 7d71204..1b298f8 100644 (file)
@@ -5,13 +5,17 @@ SOURCES += \
     testtabbedpanel.cpp \
     ../../../src/ui/tabbedpanel.cpp \
     ../../../src/ui/panelbar.cpp \
+    ../../../src/ui/panelbase.cpp \
     ../../../src/ui/panelcontentstack.cpp \
+    ../../../src/ui/panelcontextbuttonbar.cpp \
     ../../../src/ui/paneltab.cpp \
     ../../../src/ui/paneltabbar.cpp
 HEADERS += \
     ../../../src/ui/tabbedpanel.h \
     ../../../src/ui/panelbar.h \
+    ../../../src/ui/panelbase.h \
     ../../../src/ui/panelcontentstack.h \
+    ../../../src/ui/panelcontextbuttonbar.h \
     ../../../src/ui/paneltab.h \
     ../../../src/ui/paneltabbar.h \
     ../../../src/ui/panelcommon.h
index 63df118..1827f10 100644 (file)
@@ -22,8 +22,8 @@
 
 #include <QtTest/QtTest>
 #include <QtCore>
-#include <QWidget>
 
+#include "ui/panelbase.h"
 #include "ui/tabbedpanel.h"
 
 class TestTabbedPanel : public QObject
@@ -36,10 +36,10 @@ private slots:
 
 void TestTabbedPanel::testPanelToggling()
 {
-    TabbedPanel *testPanel = new TabbedPanel();
+    TabbedPanel *testTabbedPanel = new TabbedPanel;
 
-    QWidget *testWidget = new QWidget();
-    testPanel->addTab(testWidget, QIcon(":/res/images/user_info.png"));
+    PanelBase *testPanel = new PanelBase;
+    testTabbedPanel->addTab(testPanel, QIcon(":/res/images/user_info.png"));
 
     QSignalSpy closedSpy(testPanel, SIGNAL(panelClosed()));
     QSignalSpy openedSpy(testPanel, SIGNAL(panelOpened()));
@@ -56,7 +56,7 @@ void TestTabbedPanel::testPanelToggling()
     QCOMPARE(toggleSpy.count(), 0);
 
     // Try to close the panel. As the panel is closed, no signals should be sent.
-    testPanel->closePanel();
+    testTabbedPanel->closePanel();
     QTest::qWait(1);
     QCOMPARE(closedSpy.count(), 0);
     QCOMPARE(openedSpy.count(), 0);
@@ -67,7 +67,7 @@ void TestTabbedPanel::testPanelToggling()
     QCOMPARE(toggleSpy.count(), 0);
 
     // Now try to open the panel, only toggleState and panelOpened signals should be sent
-    testPanel->showPanel(testWidget);
+    testTabbedPanel->showPanel(testPanel);
     QTest::qWait(1);
     QCOMPARE(closedSpy.count(), 0);
     QCOMPARE(openedSpy.count(), 0);
@@ -78,7 +78,7 @@ void TestTabbedPanel::testPanelToggling()
     QCOMPARE(toggleSpy.count(), 1);
 
     // Now try to open the panel again. As the panel is already open, no signals should not be sent.
-    testPanel->showPanel(testWidget);
+    testTabbedPanel->showPanel(testPanel);
     QTest::qWait(1);
     QCOMPARE(closedSpy.count(), 0);
     QCOMPARE(openedSpy.count(), 1);
@@ -89,7 +89,7 @@ void TestTabbedPanel::testPanelToggling()
     QCOMPARE(toggleSpy.count(), 1);
 
     //Now try to close the panel, only toggleState and panelClosed signals should be sent
-    testPanel->closePanel();
+    testTabbedPanel->closePanel();
     QTest::qWait(1);
     QCOMPARE(closedSpy.count(), 0);
     QCOMPARE(openedSpy.count(), 1);
@@ -99,8 +99,8 @@ void TestTabbedPanel::testPanelToggling()
     QCOMPARE(openedSpy.count(), 1);
     QCOMPARE(toggleSpy.count(), 2);
 
-    delete testWidget;
     delete testPanel;
+    delete testTabbedPanel;
 }
 
 QTEST_MAIN(TestTabbedPanel)