Update singleapplication_p.cpp

This commit is contained in:
Itay Grudev 2021-09-20 16:32:42 +03:00 committed by GitHub
parent a8aa298aa1
commit cc96fea921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,7 @@ void SingleApplicationPrivate::genBlockServerName()
if( ! (options & SingleApplication::Mode::ExcludeAppPath) ){
#ifdef Q_OS_WIN
appData.addData( SingleApplication::app_t::applicationFilePath().toLower().toUtf8() );
#else
#elseif 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" );
@ -154,7 +154,9 @@ void SingleApplicationPrivate::genBlockServerName()
appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() );
} else { // Running as AppImage: Use absolute path to AppImage file
appData.addData( appImagePath );
}
};
#else
appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() );
#endif
}