mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
更新protocol manager,添加实例变动通知
This commit is contained in:
parent
5c31576969
commit
f74902e389
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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() )
|
||||
{
|
||||
|
@ -78,6 +78,10 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
signals:
|
||||
//内部每次协议句柄列表发生变动都会发射这个信号。
|
||||
void remanentProtocolChanged ( int num );
|
||||
|
||||
/**
|
||||
* 以下和用户无关
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user