Skip to content

Commit

Permalink
Kde-connect share integration (flameshot-org#2551) (flameshot-org#2802)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElTh0r0 authored Jul 17, 2022
1 parent 1052337 commit 6f6945e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/desktopfileparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ DesktopAppData DesktopFileParser::parseDesktopFile(const QString& fileName,
bool nameLocaleSet = false;
bool descriptionLocaleSet = false;
bool isApplication = false;
bool isService = false;
QTextStream in(&file);
// enter the desktop entry definition
while (!in.atEnd() && in.readLine() != QLatin1String("[Desktop Entry]")) {
Expand Down Expand Up @@ -77,6 +78,9 @@ DesktopAppData DesktopFileParser::parseDesktopFile(const QString& fileName,
if (line.contains(QLatin1String("Application"))) {
isApplication = true;
}
if (line.contains(QLatin1String("Service"))) {
isService = true;
}
} else if (line.startsWith(QLatin1String("Categories"))) {
res.categories = line.mid(line.indexOf(QLatin1String("=")) + 1)
.split(QStringLiteral(";"));
Expand All @@ -92,7 +96,8 @@ DesktopAppData DesktopFileParser::parseDesktopFile(const QString& fileName,
}
}
file.close();
if (res.exec.isEmpty() || res.name.isEmpty() || !isApplication) {
if (res.exec.isEmpty() || res.name.isEmpty() ||
(!isApplication && !isService)) {
ok = false;
}
return res;
Expand Down

0 comments on commit 6f6945e

Please sign in to comment.