Skip to content

Commit

Permalink
code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Dec 13, 2022
1 parent da615d1 commit 5723f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/qcheckgmail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ void qCheckGMail::getAccessToken( int counter,

m_logWindow.update( logWindow::TYPE::REQUEST,m ) ;

this->networkAccess( { counter,false,request,acc,UrlLabel } ) ;
this->networkAccess( request,{ counter,false,acc,UrlLabel } ) ;
}
}else{
if( reply.timeOut() ){
Expand Down Expand Up @@ -1169,9 +1169,9 @@ qCheckGMail::GMailError qCheckGMail::gmailError( const QByteArray& msg )
return { code,QObject::tr( "Unknown GMail Error" ) } ;
}

void qCheckGMail::networkAccess( const networkAccessContext& ctx )
void qCheckGMail::networkAccess( const QNetworkRequest& request,networkAccessContext ctx )
{
m_manager.get( ctx.request,[ this,ctx = ctx ]( const utils::network::reply& reply ){
m_manager.get( request,[ this,ctx = std::move( ctx ) ]( const utils::network::reply& reply ){

if( ctx.counter != m_counter ){

Expand Down Expand Up @@ -1418,7 +1418,7 @@ void qCheckGMail::checkMail( int counter,const accounts& acc,const QString& UrlL

m_logWindow.update( logWindow::TYPE::REQUEST,m ) ;

this->networkAccess( { counter,retrying,s,acc,UrlLabel } ) ;
this->networkAccess( s,{ counter,retrying,acc,UrlLabel } ) ;
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/qcheckgmail.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ private slots:
{
int counter ;
bool retrying ;
const QNetworkRequest& request ;
const accounts& acc ;
const QString& label ;
} ;
Expand All @@ -130,7 +129,7 @@ private slots:
QString txt ;
QString accName ;
} ;
void networkAccess( const networkAccessContext& ) ;
void networkAccess( const QNetworkRequest&,networkAccessContext ) ;

void getGMailAccountInfoWithoutToken( const QString&,addaccount::GmailAccountInfo ) ;
void getGMailAccountInfoWithToken( const QString&,addaccount::GmailAccountInfo ) ;
Expand Down

0 comments on commit 5723f3a

Please sign in to comment.