1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

更新protocol manager,添加实例变动通知

This commit is contained in:
tianduanrui 2018-06-01 19:01:50 +08:00
parent 5c31576969
commit f74902e389
4 changed files with 42 additions and 4 deletions

View File

@ -1,3 +1,12 @@
<EFBFBD>ٶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>https://pan.baidu.com/s/1FPPkTUnk2XBL4rpnZsAGmw <20><><EFBFBD>룺hotz
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK<EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>룬Multi-environ Manager<65><72><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>æ<EFBFBD><C3A6>MeM<65><4D><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>genmake<6B><65><EFBFBD>ߵȵı<C8B5><C4B1><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߡ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>㹻ǿ<EFBFBD>Ķ<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@ -73,6 +73,14 @@ signals:
* @param message
*/
void notifyToProtocolManager ( const QQtProtocol* self, const QQtMessage* message );
signals:
//句柄被使用和废弃不用都会发射状态改变信号。
//status
//0 detach
//1 attach
void statusChanged ( int status );
/*
*
*/
@ -80,10 +88,17 @@ signals:
* Socket和这个Protocol关联
*/
public:
void detach() { mIsDetached = true; }
void attach() { mIsDetached = false; }
bool detached() { return mIsDetached; }
private:
virtual void detach() {
mIsDetached = true;
statusChanged ( 0 );
}
virtual void attach() {
mIsDetached = false;
statusChanged ( 1 );
}
virtual bool detached() { return mIsDetached; }
protected:
bool mIsDetached;
};

View File

@ -30,6 +30,16 @@ QQtProtocol* QQtProtocolManager::createProtocol()
QQtProtocol* QQtProtocolManager::findDetachedInstance()
{
QListIterator<QQtProtocol*> itor0 ( m_protocol_list );
int index = 0;
while ( itor0.hasNext() )
{
QQtProtocol* p = itor0.next();
if ( p->detached() )
index++;
}
emit remanentProtocolChanged ( index );
QListIterator<QQtProtocol*> itor ( m_protocol_list );
while ( itor.hasNext() )
{

View File

@ -78,6 +78,10 @@ public:
return true;
}
signals:
//内部每次协议句柄列表发生变动都会发射这个信号。
void remanentProtocolChanged ( int num );
/**
*
*/