Browse Source
Merge pull request #170 from dragotin/master
Fix: Check if desktop file from first argument really exists
master
TheAssassin
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
tools/linuxdeployqt/main.cpp
|
|
@ -88,6 +88,12 @@ int main(int argc, char **argv) |
|
|
|
* to do when using linuxdeployqt. */ |
|
|
|
if (firstArgument.endsWith(".desktop")){ |
|
|
|
qDebug() << "Desktop file as first argument:" << firstArgument; |
|
|
|
|
|
|
|
/* Check if the desktop file really exists */ |
|
|
|
if (! QFile::exists(firstArgument)) { |
|
|
|
LogError() << "Desktop file in first argument does not exist!"; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
QSettings * settings = 0; |
|
|
|
settings = new QSettings(firstArgument, QSettings::IniFormat); |
|
|
|
desktopExecEntry = settings->value("Desktop Entry/Exec", "r").toString().split(' ').first().split('/').last().trimmed(); |
|
|
|