From 7aa4b1755f25fc68fcb697a0b9ddeebcf756972d Mon Sep 17 00:00:00 2001
From: Dave Chamberlin-Kidd <dave@flamangoes.co.uk>
Date: Sat, 16 May 2020 23:42:01 +0100
Subject: [PATCH 06/43] Refactor: Extract command setup

---
 src/sessionbutton.cpp | 18 +++++++++++-------
 src/sessionbutton.h   |  1 +
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp
index 0fb03f4..6073460 100644
--- a/src/sessionbutton.cpp
+++ b/src/sessionbutton.cpp
@@ -81,13 +81,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
 
     sid=id;
 
-    cmd=new QLabel ( this );
-    cmd->setMouseTracking ( true );
-    cmdIcon=new QLabel ( this );
-    cmdIcon->setMouseTracking ( true );
-    cmdBox=new QComboBox ( this );
-    cmdBox->setMouseTracking ( true );
-    cmdBox->setFrame ( false );
+    setupCommand();
 
     geomBox=createGeometryBox();
     geom=new QLabel ( this );
@@ -294,6 +288,16 @@ QComboBox* SessionButton::createGeometryBox()
     return geomBox;
 }
 
+void SessionButton::setupCommand(){
+    cmd=new QLabel ( this );
+    cmd->setMouseTracking ( true );
+    cmdIcon=new QLabel ( this );
+    cmdIcon->setMouseTracking ( true );
+    cmdBox=new QComboBox ( this );
+    cmdBox->setMouseTracking ( true );
+    cmdBox->setFrame ( false );
+}
+
 void SessionButton::slotClicked()
 {
     emit sessionSelected ( this );
diff --git a/src/sessionbutton.h b/src/sessionbutton.h
index e82d279..6fca921 100644
--- a/src/sessionbutton.h
+++ b/src/sessionbutton.h
@@ -90,6 +90,7 @@ private:
     bool updated;
 
     void setupOptionsPalette ( QPalette &cpal );
+    void setupCommand();
     QComboBox* createGeometryBox();
 
 private slots:
-- 
2.27.0

