3 Commits

Autor SHA1 Mensaje Fecha
8a47838d94 EntryProvider: Support broken .desktop files that don't start with [Desktop Entry] 2022-07-15 18:26:02 +02:00
89c9cc573e Add more reasonable screenshots 2021-10-30 16:22:43 +02:00
7c15d7b145 Window: executeConfig: Fix after refactoring for Qt 5.15
Refactoring for 5.15 broke this (d9b0be5063),
so fix it.
2021-05-08 20:54:19 +02:00
Se han modificado 6 ficheros con 8 adiciones y 6 borrados

Ver fichero

@ -30,15 +30,17 @@ EntryConfig EntryProvider::readFromDesktopFile(const QString &path)
QTextStream stream(&file);
// There should be nothing preceding this group in the desktop entry file but possibly one or more comments.
// https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s03.html#group-header
QString firstLine;
// Ignore that as there some that violate that in the wild
const QString startSection = "[Desktop Entry]";
QString line;
do
{
firstLine = stream.readLine().trimmed();
} while(!stream.atEnd() && (firstLine.isEmpty() || firstLine[0] == '#'));
line = stream.readLine().trimmed();
} while(!stream.atEnd() && line != startSection);
if(firstLine != "[Desktop Entry]")
if(line != startSection)
{
throw ConfigFormatException(".desktop file does not start with [Desktop Entry]: " + path.toStdString());
throw ConfigFormatException(".desktop file does not contain [Desktop Entry] section: " + path.toStdString());
}
while(!stream.atEnd())

BIN
screenshots/calc.png Archivo normal

Archivo binario no mostrado.

Después

Anchura:  |  Altura:  |  Tamaño: 31 KiB

Archivo binario no mostrado.

Después

Anchura:  |  Altura:  |  Tamaño: 48 KiB

Archivo binario no mostrado.

Antes

Anchura:  |  Altura:  |  Tamaño: 112 KiB

BIN
screenshots/startview.png Archivo normal

Archivo binario no mostrado.

Después

Anchura:  |  Altura:  |  Tamaño: 205 KiB

Ver fichero

@ -125,7 +125,7 @@ void Window::executeConfig(const EntryConfig &config)
QString cmd = settingsProvider->getTerminalCommand();
cmd.replace("%c", config.command);
QStringList args = QProcess::splitCommand(cmd);
QProcess::startDetached(cmd, args);
QProcess::startDetached(args[0], args);
}
else
{