Commit dd32c31a by NitefullWind

1. 部分指针做判空处理。

parent e058078b
......@@ -20,12 +20,12 @@ public:
void doTask(const QByteArray &reqData, QByteArray &rspData);
private:
QMutex mutex;
QWaitCondition condition;
// QMutex mutex;
// QWaitCondition condition;
// QByteArray reqData;
// QByteArray rspData;
QTimer *_posSocketTimer;
// QTimer *_posSocketTimer;
FMTask *fmTask;
FMPVipServer *server;
......
......@@ -146,7 +146,7 @@ bool FMTask::sendToServer(bool isShowMsg)
bool isOk = (error() == FM_API_SUCCESS);
if(!isOk && isShowMsg)
{
FMMsgWnd::FailureWnd(errorString(), _window);
FMMsgWnd::FailureWnd(errorString());
}
return isOk;
......
......@@ -53,26 +53,34 @@ void FMMsgWnd::show(InfoType type, const QString &info)
void FMMsgWnd::FailureWnd(const QString &info, QDialog *parent)
{
FMMsgWnd window(parent);
window.setGeometry(parent->geometry());
if(parent != nullptr) {
window.setGeometry(parent->geometry());
}
window.show(FMMsgWnd::T_Failure, info);
}
void FMMsgWnd::WarningWnd(const QString &info, QDialog *parent)
{
FMMsgWnd window(parent);
window.setGeometry(parent->geometry());
if(parent != nullptr) {
window.setGeometry(parent->geometry());
}
window.show(FMMsgWnd::T_Warning, info);
}
void FMMsgWnd::SuccessWnd(const QString &info, QDialog *parent)
{
FMMsgWnd window(parent);
window.setGeometry(parent->geometry());
if(parent != nullptr) {
window.setGeometry(parent->geometry());
}
window.show(FMMsgWnd::T_Success, info);
}
void FMMsgWnd::LoginSuccess(const QString &account, const QString &name, const QString &birthday, QDialog *parent)
{
FMMsgWnd window(parent);
window.setGeometry(parent->geometry());
if(parent != nullptr) {
window.setGeometry(parent->geometry());
}
QString info = QString::fromLocal8Bit("账号:%1\n姓名:%2\n生日:%3").arg(account).arg(name).arg(birthday);
window.show(FMMsgWnd::T_LoginSuccess, info);
}
......
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