mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-02-14 06:24:02 +00:00
closes: #1374 . Use SPDX short-form identifiers instead of lengthy copyright header to document per-file license and copyright. This commit updates all files under src/ directory where applicable as well as org.flameshot.Flameshot.metainfo.xml.
63 lines
1.4 KiB
C++
63 lines
1.4 KiB
C++
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors
|
|
|
|
#pragma once
|
|
|
|
#include <QIcon>
|
|
#include <QMap>
|
|
#include <QStringList>
|
|
|
|
class QDir;
|
|
class QString;
|
|
class QTextStream;
|
|
|
|
struct DesktopAppData
|
|
{
|
|
DesktopAppData()
|
|
: showInTerminal()
|
|
{}
|
|
|
|
DesktopAppData(const QString& name,
|
|
const QString& description,
|
|
const QString& exec,
|
|
QIcon icon)
|
|
: name(name)
|
|
, description(description)
|
|
, exec(exec)
|
|
, icon(icon)
|
|
, showInTerminal(false)
|
|
{}
|
|
|
|
bool operator==(const DesktopAppData& other) const
|
|
{
|
|
return name == other.name;
|
|
}
|
|
|
|
QString name;
|
|
QString description;
|
|
QString exec;
|
|
QStringList categories;
|
|
QIcon icon;
|
|
bool showInTerminal;
|
|
};
|
|
|
|
struct DesktopFileParser
|
|
{
|
|
DesktopFileParser();
|
|
DesktopAppData parseDesktopFile(const QString& fileName, bool& ok) const;
|
|
int processDirectory(const QDir& dir);
|
|
|
|
QVector<DesktopAppData> getAppsByCategory(const QString& category);
|
|
QMap<QString, QVector<DesktopAppData>> getAppsByCategory(
|
|
const QStringList& categories);
|
|
|
|
private:
|
|
QString m_localeName;
|
|
QString m_localeDescription;
|
|
QString m_localeNameShort;
|
|
QString m_localeDescriptionShort;
|
|
|
|
QIcon m_defaultIcon;
|
|
QVector<DesktopAppData> m_appList;
|
|
};
|