Browse Source

code improvement

pull/44/head
ink 4 years ago
parent
commit
269e185f46
  1. 1
      .gitignore
  2. 9
      src/networkAccessManager.hpp
  3. 8
      src/utility.cpp

1
.gitignore

@ -0,0 +1 @@
CMakeLists.txt.*

9
src/networkAccessManager.hpp

@ -28,6 +28,9 @@
* SUCH DAMAGE.
*/
#ifndef NetworkAccessManager_H
#define NetworkAccessManager_H
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
@ -65,6 +68,10 @@ public:
m_QNetworkReply = nullptr ;
return e ;
}
QNetworkReply& handle()
{
return *m_QNetworkReply ;
}
~NetworkReply()
{
if( m_QNetworkReply ){
@ -198,3 +205,5 @@ private:
QVector< std::pair< QNetworkReply *,function_t > > m_entries ;
QNetworkAccessManager m_manager ;
};
#endif

8
src/utility.cpp

@ -156,12 +156,12 @@ void utility::Task::execute( const QString& exe,int waitTime,
if( polkit && utility::useZuluPolkit() ){
auto _report_error = [ this ](){
auto _report_error = [ this ]( const char * msg ){
m_finished = true ;
m_exitCode = -1 ;
m_exitStatus = -1 ;
m_stdError = "SiriKali: Failed To Connect To Polkit Backend" ;
m_stdError = msg ;
//m_stdOut = "" ;
} ;
@ -177,7 +177,7 @@ void utility::Task::execute( const QString& exe,int waitTime,
}else if( i == 3 ){
_report_error() ;
_report_error( "SiriKali: Failed To Connect To Polkit Backend" ) ;
utility::debug() << "ERROR: Failed To Start Helper Application" ;
return ;
@ -214,7 +214,7 @@ void utility::Task::execute( const QString& exe,int waitTime,
}catch( ... ){
_report_error() ;
_report_error( "SiriKali: Failed To Parse Polkit Backend Output" ) ;
}
}else{
p.start( exe ) ;

Loading…
Cancel
Save