| 150 | } |
| 151 | |
| 152 | void TestSessionController::cloneSession() |
| 153 | { |
| 154 | QString sessionName = QStringLiteral("CloneableSession"); |
| 155 | QString testgrp = QStringLiteral("TestGroup"); |
| 156 | QString testentry = QStringLiteral("TestEntry"); |
| 157 | QString testval = QStringLiteral("TestValue"); |
| 158 | int sessionCount = m_sessionCtrl->sessionNames().count(); |
| 159 | m_sessionCtrl->createSession( sessionName ); |
| 160 | Session* s = m_sessionCtrl->session( sessionName ); |
| 161 | s->config()->group( testgrp ).writeEntry( testentry, testval ); |
| 162 | s->config()->sync(); |
| 163 | QCOMPARE( sessionCount+1, m_sessionCtrl->sessionNames().count() ); |
| 164 | QVERIFY( m_sessionCtrl->session( sessionName ) ); |
| 165 | |
| 166 | QString newSession = m_sessionCtrl->cloneSession( sessionName ); |
| 167 | QVERIFY( m_sessionCtrl->session( newSession ) ); |
| 168 | QCOMPARE( sessionCount+2, m_sessionCtrl->sessionNames().count() ); |
| 169 | Session* news = m_sessionCtrl->session( newSession ); |
| 170 | QCOMPARE( testval, news->config()->group( testgrp ).readEntry( testentry, "" ) ); |
| 171 | QCOMPARE( i18n( "Copy of %1", sessionName ), news->name() ); |
| 172 | |
| 173 | verifySessionDir( news ); |
| 174 | |
| 175 | |
| 176 | } |
| 177 | |
| 178 | void TestSessionController::readFromConfig() |
| 179 | { |
nothing calls this directly
no test coverage detected