Skip to content

Commit

Permalink
make it possible to show git version
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed May 13, 2024
1 parent 41cc60f commit e7ba0f1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ endif()

file( WRITE ${PROJECT_BINARY_DIR}/version.h "
#ifndef THIS_VERSION
#define THIS_VERSION \"${PGR_VERSION}\"
#define THIS_VERSION \"${PGR_VERSION}.git_tag\"
#endif
\n
#ifndef SIRIKALI_VERSION
#define SIRIKALI_VERSION
#define VERSION_STRING \"Version : ${PGR_VERSION} (Compiled with Qt ${QTVERSION})\\nCopyright: ${COPYRIGHT_YEARS} Francis Banyikwa,mhogomchungu@gmail.com\\nLicense : GPLv2+\"
#define VERSION_STRING \"Version : ${PGR_VERSION}.git_tag (Compiled with Qt ${QTVERSION})\\nCopyright: ${COPYRIGHT_YEARS} Francis Banyikwa,mhogomchungu@gmail.com\\nLicense : GPLv2+\"
#endif
\n" )

Expand Down
19 changes: 16 additions & 3 deletions src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,18 @@ void utility::openPath( const QString& path,const QString& opener,
}
}

static QString _version_string()
{
QString s = VERSION_STRING ;

s.replace( ".git_tag","" ) ;

return s ;
}

static bool _help()
{
utility::debug::cout() << VERSION_STRING << QObject::tr( "\n\
utility::debug::cout() << _version_string() << QObject::tr( "\n\
options:\n\
-d Path to where a volume to be auto unlocked/mounted is located.\n\
-m Tool to use to open a default file manager(default tool is xdg-open).\n\
Expand Down Expand Up @@ -685,7 +694,7 @@ This program is distributed in the hope that it will be useful,\
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \
GNU General Public License for more details.\n\
" ).arg( VERSION_STRING ) ;
" ).arg( _version_string() ) ;

DialogMsg( parent,nullptr ).ShowUIInfo( QObject::tr( "about SiriKali" ),true,license ) ;
}
Expand Down Expand Up @@ -1475,7 +1484,11 @@ utility::logger& utility::logger::enableDebug()

QString utility::SiriKaliVersion()
{
return THIS_VERSION ;
QString s = THIS_VERSION ;

s.replace( ".git_tag","" ) ;

return s ;
}

#ifdef Q_OS_WIN
Expand Down

0 comments on commit e7ba0f1

Please sign in to comment.