Commit 2dcc14a0 authored by jpbl's avatar jpbl

added some comments for PhoneLineManagerImpl

parent 8add3e0c
......@@ -35,9 +35,11 @@ void
PhoneLineManagerImpl::initialize()
{
QMutexLocker guard(&mIsInitializedMutex);
mIsInitialized = true;
mSession = new Session();
mAccount = new Account(mSession->getDefaultAccount());
if(!mIsInitialized) {
mIsInitialized = true;
mSession = new Session();
mAccount = new Account(mSession->getDefaultAccount());
}
}
void PhoneLineManagerImpl::isInitialized()
......@@ -49,7 +51,7 @@ void PhoneLineManagerImpl::isInitialized()
}
void
PhoneLineManagerImpl::start()
PhoneLineManagerImpl::startSession()
{
isInitialized();
......
......@@ -46,8 +46,20 @@ signals:
void selected(unsigned int);
public slots:
/**
* You need to call this function once. It must be
* call before doing anything in this class.
*
* NOTE: You need to set the creator to SessionIOFactory
* before calling this function.
*/
void initialize();
void start();
/**
* This will send all the command needed when a
* connection has just been established.
*/
void startSession();
void sendKey(Qt::Key c);
......
......@@ -12,7 +12,7 @@ TCPSessionIOCreator::create()
{
TCPSessionIO *t = new TCPSessionIO(mHostname, mPort);
QObject::connect(t, SIGNAL(connected()),
&PhoneLineManager::instance(), SLOT(start()));
&PhoneLineManager::instance(), SLOT(startSession()));
t->connect();
return t;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment