Skip to content

Commit

Permalink
code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Oct 31, 2022
1 parent 9c03166 commit 259e363
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/qcheckgmail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,11 @@ void qCheckGMail::getAccessToken( int counter,

auto m = "qCheckGMail: Empty Responce Received Unexectedly" ;

m_logWindow.update( logWindow::TYPE::RESPONCE,m ) ;
m_logWindow.update( logWindow::TYPE::RESPONCE,m,true ) ;
}else{
auto m = "qCheckGMail: Below JSON Data Was Expected To Contain \"access_token\" Key But It Does Not\n" ;

m_logWindow.update( logWindow::TYPE::RESPONCE,m + _hideSecret( data ) ) ;
m_logWindow.update( logWindow::TYPE::RESPONCE,m + _hideSecret( data ),true ) ;
}

this->reportOnAllAccounts( counter,{},tr( "Unexpected Data Received" ) ) ;
Expand Down Expand Up @@ -980,7 +980,7 @@ void qCheckGMail::networkAccess( int counter,const QNetworkRequest& request )
}else{
auto error = reply.error() ;

if( error == QNetworkReply::NoError ){
if( error == QNetworkReply::NoError || error == QNetworkReply::AuthenticationRequiredError ){

auto content = reply.data() ;

Expand All @@ -999,18 +999,11 @@ void qCheckGMail::networkAccess( int counter,const QNetworkRequest& request )
this->reportOnAllAccounts( counter,content,qc::success ) ;
}
}else{
if( error == QNetworkReply::AuthenticationRequiredError ){

m_logWindow.update( logWindow::TYPE::ERROR,reply.data(),true ) ;

this->reportOnAllAccounts( counter,{},tr( "Authentication Required" ) ) ;
}else{
auto err = this->errorMessage( reply ) ;
auto err = this->errorMessage( reply ) ;

m_logWindow.update( logWindow::TYPE::ERROR,err.unTranslated,true ) ;
m_logWindow.update( logWindow::TYPE::ERROR,err.unTranslated,true ) ;

this->reportOnAllAccounts( counter,{},err.translated ) ;
}
this->reportOnAllAccounts( counter,{},err.translated ) ;
}
}
} ) ;
Expand Down

0 comments on commit 259e363

Please sign in to comment.