| 209 | } |
| 210 | |
| 211 | void addSession( Session* s ) |
| 212 | { |
| 213 | if (Core::self()->setupFlags() & Core::NoUi) { |
| 214 | sessionActions[s] = nullptr; |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | auto* a = new QAction( grp ); |
| 219 | a->setText( s->description() ); |
| 220 | a->setToolTip(s->description()); |
| 221 | a->setCheckable( false ); |
| 222 | a->setData(QVariant::fromValue<Session*>(s)); |
| 223 | |
| 224 | sessionActions[s] = a; |
| 225 | q->actionCollection()->addAction(QLatin1String("session_") + s->id().toString(), a); |
| 226 | connect( s, &Session::sessionUpdated, this, &SessionControllerPrivate::sessionUpdated ); |
| 227 | sessionUpdated( s ); |
| 228 | } |
| 229 | |
| 230 | SessionController* const q; |
| 231 |
no test coverage detected