Add tool bars to list windows on Symbian.
[dorian] / widgets / mainbase.cpp
index 1869d14..54343b6 100755 (executable)
@@ -46,21 +46,14 @@ QAction *MainBase::addToolBarAction(QObject *receiver,
     TRACE;\r
     qDebug() << "icon" << iconName << "text" << text;\r
     QAction *action;\r
-#ifndef Q_OS_SYMBIAN\r
-    Q_UNUSED(important);\r
-    action = toolBar->addAction(QIcon(Platform::instance()->icon(iconName)),\r
-                                text, receiver, member);\r
-#else\r
-    if (!toolBar && important) {\r
-        // Create tool bar if needed\r
-        toolBar = new QToolBar("", this);\r
-        // toolBar->setFixedHeight(63);\r
-        toolBar->setStyleSheet("margin:0; border:0; padding:0");\r
-        toolBar->setSizePolicy(QSizePolicy::MinimumExpanding,\r
-                               QSizePolicy::Maximum);\r
-        addToolBar(Qt::BottomToolBarArea, toolBar);\r
-    }\r
+#ifdef Q_OS_SYMBIAN\r
     if (important) {\r
+        if (!toolBar) {\r
+            // Create tool bar if needed\r
+            toolBar = new QToolBar("", this);\r
+            toolBar->setStyleSheet("margin:0; border:0; padding:0");\r
+            addToolBar(Qt::BottomToolBarArea, toolBar);\r
+        }\r
         // Add tool bar action\r
         QPushButton *button = new QPushButton(this);\r
         button->setIconSize(QSize(60, 60));\r
@@ -72,14 +65,15 @@ QAction *MainBase::addToolBarAction(QObject *receiver,
         toolBar->addWidget(button);\r
     }\r
     // Add menu action, too\r
-    action = new QAction(text, this);\r
-    menuBar()->addAction(action);\r
+    action = menuBar()->addAction(text);\r
     connect(action, SIGNAL(triggered()), receiver, member);\r
+#else\r
+    Q_UNUSED(important);\r
+    action = toolBar->addAction(QIcon(Platform::instance()->icon(iconName)),\r
+                                text, receiver, member);\r
 #endif\r
 \r
-    action->setText("");\r
     action->setToolTip("");\r
-\r
     return action;\r
 }\r
 \r