33
44#include " cloud_session_combo_box.h"
55
6- CloudSessionComboBox::CloudSessionComboBox (RCloudSessionManager *session , QWidget *parent)
6+ CloudSessionComboBox::CloudSessionComboBox (RCloudSessionManager *cloudSessionManager , QWidget *parent)
77 : QWidget{parent}
8- , session{session }
8+ , cloudSessionManager{cloudSessionManager }
99{
1010 QHBoxLayout *mainLayout = new QHBoxLayout;
1111 mainLayout->setContentsMargins (0 ,0 ,0 ,0 );
@@ -15,18 +15,18 @@ CloudSessionComboBox::CloudSessionComboBox(RCloudSessionManager *session, QWidge
1515 mainLayout->addWidget (label);
1616
1717 this ->comboBox = new QComboBox;
18- QStringList sessionNames = this ->session ->getSessionNames ();
18+ QStringList sessionNames = this ->cloudSessionManager ->getSessionNames ();
1919 for (const QString &name : std::as_const (sessionNames))
2020 {
2121 this ->comboBox ->addItem (name);
2222 }
23- this ->comboBox ->setCurrentText (this ->session ->findActiveSessionName ());
23+ this ->comboBox ->setCurrentText (this ->cloudSessionManager ->findActiveSessionName ());
2424 mainLayout->addWidget (this ->comboBox );
2525
26- QObject::connect (this ->session ,&RCloudSessionManager::activeSessionChanged,this ,&CloudSessionComboBox::onActiveSessionChanged);
27- QObject::connect (this ->session ,&RCloudSessionManager::sessionInserted,this ,&CloudSessionComboBox::onSessionInserted);
28- QObject::connect (this ->session ,&RCloudSessionManager::sessionRenamed,this ,&CloudSessionComboBox::onSessionRenamed);
29- QObject::connect (this ->session ,&RCloudSessionManager::sessionRemoved,this ,&CloudSessionComboBox::onSessionRemoved);
26+ QObject::connect (this ->cloudSessionManager ,&RCloudSessionManager::activeSessionChanged,this ,&CloudSessionComboBox::onActiveSessionChanged);
27+ QObject::connect (this ->cloudSessionManager ,&RCloudSessionManager::sessionInserted,this ,&CloudSessionComboBox::onSessionInserted);
28+ QObject::connect (this ->cloudSessionManager ,&RCloudSessionManager::sessionRenamed,this ,&CloudSessionComboBox::onSessionRenamed);
29+ QObject::connect (this ->cloudSessionManager ,&RCloudSessionManager::sessionRemoved,this ,&CloudSessionComboBox::onSessionRemoved);
3030 QObject::connect (this ->comboBox ,&QComboBox::currentTextChanged,this ,&CloudSessionComboBox::onComboBoxCurrentTextChanged);
3131
3232}
@@ -46,7 +46,7 @@ void CloudSessionComboBox::onSessionInserted(const QString &sessionName)
4646 bool signalsBlockedSaved = this ->comboBox ->signalsBlocked ();
4747 this ->comboBox ->blockSignals (true );
4848 this ->comboBox ->addItem (sessionName);
49- this ->comboBox ->setCurrentText (this ->session ->findActiveSessionName ());
49+ this ->comboBox ->setCurrentText (this ->cloudSessionManager ->findActiveSessionName ());
5050 this ->comboBox ->blockSignals (signalsBlockedSaved);
5151 }
5252}
@@ -76,5 +76,5 @@ void CloudSessionComboBox::onSessionRemoved(const QString &sessionName)
7676
7777void CloudSessionComboBox::onComboBoxCurrentTextChanged (const QString &text)
7878{
79- this ->session ->setActiveSessionName (text);
79+ this ->cloudSessionManager ->setActiveSessionName (text);
8080}
0 commit comments