Skip to content

Commit

Permalink
this commit marks a release point for version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Sep 29, 2015
1 parent c7bac26 commit 2c11733
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if( QT5 )

include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
add_definitions( ${Qt5Widgets_DEFINITIONS} )

QT5_WRAP_CPP( MOC src/mainwindow.h src/task.h )
QT5_WRAP_UI( UI src/mainwindow.ui )
QT5_ADD_RESOURCES( ICON icons/icons.qrc )
Expand Down
29 changes: 14 additions & 15 deletions src/gsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ static void _callback( GSM_StateMachine *,GSM_USSDMessage *,void * ) ;

static QByteArray _QByteArray( decltype(( GSM_USSDMessage::Text )) buffer )
{
return QByteArray( ( const char * )buffer,int( sizeof( buffer ) ) ) ;
return QByteArray( reinterpret_cast< const char * >( buffer ),int( sizeof( buffer ) ) ) ;
}

class gsm::pimpl
{
public:
pimpl( GSM_StateMachine * g,std::function< void( const gsm::USSDMessage& ) > f ) :
m_gsm( g ),m_function( std::move( f ) )
pimpl( GSM_StateMachine * g,std::function< void( const gsm::USSDMessage& ) > function ) :
m_gsm( g ),m_function( std::move( function ) )
{
}
~pimpl()
Expand Down Expand Up @@ -149,6 +149,9 @@ class gsm::pimpl
* to work just fine with my modem.
*/

/*
* DecodeUnicodeString() is provided by libgammu
*/
switch( m->Coding ){

case SMS_Coding_Unicode_No_Compression:
Expand Down Expand Up @@ -227,7 +230,7 @@ class gsm::pimpl

m_status = GSM_GetNextSMS( m_gsm,&sms,false ) ;

if( m_status == ERR_EMPTY ){
if( m_status.errEmpty() ){

m_status = ERR_NONE ;

Expand All @@ -241,7 +244,7 @@ class gsm::pimpl
}
}

}else if( m_status == ERR_EMPTY ){
}else if( m_status.errEmpty() ){

m_status = ERR_NONE ;
}
Expand All @@ -252,23 +255,19 @@ class gsm::pimpl
class gsm_error
{
public:
gsm_error& operator =( GSM_Error err )
gsm_error& operator=( GSM_Error err )
{
m_error = err ;
return *this ;
}
bool operator ==( GSM_Error err )
bool errEmpty()
{
return m_error == err ;
return m_error == ERR_EMPTY ;
}
operator bool()
{
return m_error == ERR_NONE ;
}
GSM_Error error()
{
return m_error ;
}
const char * errorString()
{
return GSM_ErrorString( m_error ) ;
Expand Down Expand Up @@ -296,11 +295,11 @@ const char * gsm::decodeUnicodeString( const QByteArray& e )
/*
* DecodeUnicodeString() is provided by libgammu
*/
return DecodeUnicodeString( ( const unsigned char * )e.constData() ) ;
return DecodeUnicodeString( reinterpret_cast< const unsigned char * >( e.constData() ) ) ;
}

gsm::gsm( std::function< void( const gsm::USSDMessage& ussd ) > f ) :
m_pimpl( new gsm::pimpl( GSM_AllocStateMachine(),std::move( f ) ) )
gsm::gsm( std::function< void( const gsm::USSDMessage& ussd ) > function ) :
m_pimpl( new gsm::pimpl( GSM_AllocStateMachine(),std::move( function ) ) )
{
}

Expand Down
1 change: 1 addition & 0 deletions src/gsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QByteArray>
#include <QVector>

#include <functional>
#include <memory>

class gsm
Expand Down
2 changes: 1 addition & 1 deletion ussd-gui.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.4.2, 2015-09-28T11:02:28. -->
<!-- Written by QtCreator 3.4.2, 2015-09-29T10:04:03. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down

0 comments on commit 2c11733

Please sign in to comment.