Skip to content

Commit

Permalink
修复了登录过程中点击取消按钮程序死掉的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
arjide committed Nov 12, 2014
1 parent d472072 commit abcd4ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions qml/Api/QQApi.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ QQ{
return 2
}

Component.onCompleted: {
clientid = getClientid()//设置clientid
}

onStateChanged: {
editUserState()//改变在线状态
}
Expand Down Expand Up @@ -110,6 +106,7 @@ QQ{
var url = "http://d.web2.qq.com/channel/login2"
ptwebqq = utility.getCookie("ptwebqq")//储存cookie
list_hash = getHash()//储存hash
clientid = getClientid()//设置clientid
var data = 'r={"status":"'+myqq.stateToString+'","ptwebqq":"'+ptwebqq+'","passwd_sig":"","clientid":"'+clientid+'","psessionid":null}&clientid='+clientid+'&psessionid=null'
data = encodeURI(data)
utility.httpPost(login2Finished, url, data)
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,5 @@ int main(int argc, char *argv[])
engine->rootContext ()->setContextProperty ("systemTray", systemTray);//将程序托盘注册过去
qqapi->loadLoginWindow ();//加载登录窗口


return app.exec();
}
6 changes: 3 additions & 3 deletions src/qqstars/qqstars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,10 @@ QQItemInfo *QQCommand::createQQItemInfo(const QString& uin, const QString& typeS
void QQCommand::setLoginStatus(QQCommand::LoginStatus arg)
{
if (m_loginStatus != arg) {
m_loginStatus = arg;
if(arg == WaitLogin){//如果登录状态变为离线
if(arg == WaitLogin&&m_loginStatus==LoginFinished){//如果登录状态变为离线
poll2_timer->stop ();//停止计算请求是否超时的计时器
reply->abort ();//停止心跳包
closeChatWindow();//关闭和好友聊天的窗口
closeChatWindow();//关闭好友聊天的窗口
clearQQItemInfos();//清空所有的好友信息
chatImageID = 0;//chatImageID回到缺省值
map_imageUrl.clear ();//情况image的id和url值对
Expand All @@ -732,6 +731,7 @@ void QQCommand::setLoginStatus(QQCommand::LoginStatus arg)
window_login->deleteLater ();
loadMainPanelWindow ();//加载主面板窗口
}
m_loginStatus = arg;
emit loginStatusChanged();
}
}
Expand Down

0 comments on commit abcd4ab

Please sign in to comment.