]> Shamusworld >> Repos - architektonas/blobdiff - src/forms/cadtoolbar.cpp
Merged QC_GraphicView into QG_GraphicView...
[architektonas] / src / forms / cadtoolbar.cpp
index 4bfe299ab4c4a50bd25d75b361d179b2806cb9c4..ec5929dec3a5a824c2a7f53c1755b164bc8d599f 100644 (file)
@@ -36,7 +36,7 @@ CadToolBar::CadToolBar(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
        tbSelect(NULL), tbPolylines(NULL)
 {
        ui.setupUi(this);
-//hm. here maybe?
+//hm. here maybe? Yesh!
 if (parent)
        ((QToolBar *)parent)->addWidget(this);
 }
@@ -66,7 +66,7 @@ void CadToolBar::back()
  */
 void CadToolBar::forceNext()
 {
-       if (currentTb != NULL && currentTb == tbSelect)
+       if (currentTb && currentTb == tbSelect)
                tbSelect->runNextAction();
 }
 
@@ -94,6 +94,7 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah)
        actionHandler = ah;
        tbMain = new CadToolBarMain(this);
        tbMain->setCadToolBar(this);
+       currentTb = tbMain;
 
        tbPoints = new CadToolBarPoints(this);
        tbPoints->setCadToolBar(this);
@@ -119,11 +120,9 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah)
        tbSplines->setCadToolBar(this);
        tbSplines->hide();
 
-//#ifdef RS_PROF
        tbPolylines = new CadToolBarPolylines(this);
        tbPolylines->setCadToolBar(this);
        tbPolylines->hide();
-//#endif
 
        tbDim = new CadToolBarDim(this);
        tbDim->setCadToolBar(this);
@@ -144,8 +143,6 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah)
        tbSelect = new CadToolBarSelect(this);
        tbSelect->setCadToolBar(this);
        tbSelect->hide();
-
-       //showToolBarMain();
 }
 
 void CadToolBar::showToolBar(int id)
@@ -173,11 +170,9 @@ void CadToolBar::showToolBar(int id)
        case RS2::ToolBarSplines:
                newTb = tbSplines;
                break;
-//#ifdef RS_PROF
        case RS2::ToolBarPolylines:
                newTb = tbPolylines;
                break;
-//#endif
        case RS2::ToolBarCircles:
                newTb = tbCircles;
                break;
@@ -201,12 +196,12 @@ void CadToolBar::showToolBar(int id)
        if (currentTb == newTb)
                return;
 
-       if (currentTb != NULL)
+       if (currentTb)
                currentTb->hide();
 
        currentTb = newTb;
 
-       if (currentTb != NULL)
+       if (currentTb)
                currentTb->show();
 }