mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-04-01 01:52:39 +08:00
Merge pull request #139 from mklein-de/appimage-executable-path
Added support for _AppImage_ dynamic executable paths. - _Michael Klein_
This commit is contained in:
commit
5fec2df7a3
@ -4,6 +4,11 @@ Changelog
|
|||||||
If by accident I have forgotten to credit someone in the CHANGELOG, email me and I will fix it.
|
If by accident I have forgotten to credit someone in the CHANGELOG, email me and I will fix it.
|
||||||
|
|
||||||
|
|
||||||
|
__3.3.1__
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Added support for _AppImage_ dynamic executable paths. - _Michael Klein_
|
||||||
|
|
||||||
__3.3.0__
|
__3.3.0__
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
@ -144,8 +144,17 @@ void SingleApplicationPrivate::genBlockServerName()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( ! (options & SingleApplication::Mode::ExcludeAppPath) ){
|
if( ! (options & SingleApplication::Mode::ExcludeAppPath) ){
|
||||||
#ifdef Q_OS_WIN
|
#if defined(Q_OS_WIN)
|
||||||
appData.addData( SingleApplication::app_t::applicationFilePath().toLower().toUtf8() );
|
appData.addData( SingleApplication::app_t::applicationFilePath().toLower().toUtf8() );
|
||||||
|
#elif defined(Q_OS_LINUX)
|
||||||
|
// If the application is running as an AppImage then the APPIMAGE env var should be used
|
||||||
|
// instead of applicationPath() as each instance is launched with its own executable path
|
||||||
|
const QByteArray appImagePath = qgetenv( "APPIMAGE" );
|
||||||
|
if( appImagePath.isEmpty() ){ // Not running as AppImage: use path to executable file
|
||||||
|
appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() );
|
||||||
|
} else { // Running as AppImage: Use absolute path to AppImage file
|
||||||
|
appData.addData( appImagePath );
|
||||||
|
};
|
||||||
#else
|
#else
|
||||||
appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() );
|
appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user