]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Sun, 21 Sep 2008 09:11:21 +0000 (09:11 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 21 Sep 2008 09:11:21 +0000 (09:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26473 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/PanelStack.cpp
src/frontends/qt4/PanelStack.h

index 596096715bbb66bff329d2a4e687eecf6db98a97..d85c93c38cb4732ea1aa11ba30b1b9525c123755 100644 (file)
 #include "support/debug.h"
 
 #include <QFontMetrics>
-#include <QStackedWidget>
-#include <QTreeWidget>
 #include <QHBoxLayout>
 #include <QHeaderView>
+#include <QStackedWidget>
+#include <QTreeWidget>
 
 #include "support/lassert.h"
 
-#include <iostream>
-
 using namespace std;
 
 namespace lyx {
@@ -40,13 +38,9 @@ PanelStack::PanelStack(QWidget * parent)
 
        list_->setRootIsDecorated(false);
        list_->setColumnCount(1);
-       // Hide the pointless list header
        list_->header()->hide();
-//     QStringList HeaderLabels;
-//     HeaderLabels << QString("Category");
-//     list_->setHeaderLabels(HeaderLabels);
 
-       connect(list_, SIGNAL(currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
+       connect(list_, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
                this, SLOT(switchPanel(QTreeWidgetItem *, QTreeWidgetItem*)));
        connect(list_, SIGNAL(itemClicked (QTreeWidgetItem*, int)),
                this, SLOT(itemSelected(QTreeWidgetItem *, int)));
@@ -83,8 +77,7 @@ void PanelStack::addCategory(QString const & name, QString const & parent)
        QFontMetrics fm(list_->font());
                
        // calculate the real size the current item needs in the listview
-       int itemsize = fm.width(name) + 10
-               + list_->indentation() * depth;
+       int itemsize = fm.width(name) + 10 + list_->indentation() * depth;
        // adjust the listview width to the max. itemsize
        if (itemsize > list_->minimumWidth())
                list_->setMinimumWidth(itemsize);
@@ -104,7 +97,7 @@ void PanelStack::addPanel(QWidget * panel, QString const & name, QString const &
 void PanelStack::setCurrentPanel(QString const & name)
 {
        QTreeWidgetItem * item = panel_map_.value(name, 0);
-       LASSERT(item, /**/);
+       LASSERT(item, return);
 
        // force on first set
        if (list_->currentItem() == item)
@@ -128,9 +121,9 @@ void PanelStack::switchPanel(QTreeWidgetItem * item,
                if (previous && previous->parent() != item)
                        switchPanel( item->child(0), previous );
        }
-       else
-               if (QWidget * w = widget_map_.value(item, 0))
-                       stack_->setCurrentWidget(w);
+       else if (QWidget * w = widget_map_.value(item, 0)) {
+               stack_->setCurrentWidget(w);
+       }
 }
 
 
index fa32a54e44bbc507a8816677c564ae32b716e87b..7d06e6d596712fbf7a4a5ff246b4742d78782040 100644 (file)
@@ -9,6 +9,7 @@
  *
  * Full author contact details are available in file CREDITS.
  */
+
 #ifndef PANELSTACK_H
 #define PANELSTACK_H