Fix SQL fall down bug
This commit is contained in:
@@ -85,6 +85,12 @@ QString getFullScanJson(QObject* obj)
|
||||
|
||||
void DeviceManager::initDevice()
|
||||
{
|
||||
if(!AppGlobalValues::DBconnected().toBool())
|
||||
{
|
||||
emitErrorCallback("Fail to connect to DB!Reboot device to try!");
|
||||
emit initializeFinished();
|
||||
return;
|
||||
}
|
||||
dmsmq_init();
|
||||
|
||||
// empty scan
|
||||
|
||||
@@ -91,7 +91,11 @@ int main(int argc, char* argv[])
|
||||
int ret = 0;
|
||||
KeyboardManager::getInstance();
|
||||
UserOperationLog::cleanHistoryLog();
|
||||
|
||||
bool sqlConnected= SQLHelper::Open();
|
||||
if (sqlConnected)
|
||||
{
|
||||
AppGlobalValues::setDBconnected(true);
|
||||
}
|
||||
w.showFullScreen();
|
||||
DeviceManager::Default()->initDevice();
|
||||
|
||||
|
||||
@@ -162,17 +162,11 @@ void LoginDialog::clearInputData()
|
||||
void LoginDialog::doLogin()
|
||||
{
|
||||
if (!(AppGlobalValues::DBconnected().toBool())){
|
||||
bool sqlConnected= SQLHelper::Open();
|
||||
if (sqlConnected)
|
||||
{
|
||||
AppGlobalValues::setDBconnected(true);
|
||||
}
|
||||
else{
|
||||
|
||||
mErrorMessage->setText(QString(tr("Can't connect db. Please reboot the device and retry, or call for the service help.")).arg(LOGIN_LOCK_MINUTIES));
|
||||
mErrorMessage->setVisible(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(mLoginFailedCount >= LOGIN_LOCK_COUNT)
|
||||
{
|
||||
mErrorMessage->setText(QString(tr("Login locked. Please retry after %1 minutes.")).arg(LOGIN_LOCK_MINUTIES));
|
||||
|
||||
@@ -35,7 +35,6 @@ MainWindow::MainWindow(QWidget* aParent)
|
||||
, mInitializWidget(new InitializeWidget(this))
|
||||
, mShutdownWidget(new ShutdownWidget(nullptr))
|
||||
, mAdminTabIndex(-1)
|
||||
, mThread(nullptr)
|
||||
, mTabInited(false)
|
||||
{
|
||||
mUI->setupUi(this);
|
||||
@@ -76,8 +75,6 @@ MainWindow::MainWindow(QWidget* aParent)
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
mThread->terminate();
|
||||
mThread->deleteLater();
|
||||
delete mUI;
|
||||
delete mShutdownWidget;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ private:
|
||||
ShutdownWidget* mShutdownWidget;
|
||||
|
||||
int mAdminTabIndex;
|
||||
QThread* mThread;
|
||||
bool mTabInited;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user