This makes it possible to translate it.remotes/origin/Falkon/3.0
parent
4a1d807fec
commit
9db6745ee5
15 changed files with 154 additions and 56 deletions
@ -0,0 +1,55 @@ |
||||
/* ============================================================
|
||||
* Falkon - Qt web browser |
||||
* Copyright (C) 2018 David Rosca <nowrep@gmail.com> |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */ |
||||
#include "desktopfile.h" |
||||
|
||||
DesktopFile::DesktopFile(const QString &filePath) |
||||
: m_settings(filePath, QSettings::IniFormat) |
||||
{ |
||||
m_settings.beginGroup(QSL("Desktop Entry")); |
||||
} |
||||
|
||||
QString DesktopFile::name(const QString &locale) const |
||||
{ |
||||
return value(QSL("Name"), locale).toString(); |
||||
} |
||||
|
||||
QString DesktopFile::comment(const QString &locale) const |
||||
{ |
||||
return value(QSL("Comment"), locale).toString(); |
||||
} |
||||
|
||||
QString DesktopFile::type() const |
||||
{ |
||||
return value(QSL("Type")).toString(); |
||||
} |
||||
|
||||
QString DesktopFile::icon() const |
||||
{ |
||||
return value(QSL("Icon")).toString(); |
||||
} |
||||
|
||||
QVariant DesktopFile::value(const QString &key, const QString &locale) const |
||||
{ |
||||
if (!locale.isEmpty()) { |
||||
const QString localeKey = QSL("%1[%2]").arg(key, locale); |
||||
if (m_settings.contains(localeKey)) { |
||||
return m_settings.value(localeKey); |
||||
} |
||||
} |
||||
return m_settings.value(key); |
||||
} |
||||
@ -0,0 +1,37 @@ |
||||
/* ============================================================
|
||||
* Falkon - Qt web browser |
||||
* Copyright (C) 2018 David Rosca <nowrep@gmail.com> |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */ |
||||
#pragma once |
||||
|
||||
#include <QSettings> |
||||
|
||||
#include "qzcommon.h" |
||||
|
||||
class FALKON_EXPORT DesktopFile |
||||
{ |
||||
public: |
||||
explicit DesktopFile(const QString &filePath); |
||||
|
||||
QString name(const QString &locale = QString()) const; |
||||
QString comment(const QString &locale = QString()) const; |
||||
QString type() const; |
||||
QString icon() const; |
||||
QVariant value(const QString &key, const QString &locale = QString()) const; |
||||
|
||||
private: |
||||
QSettings m_settings; |
||||
}; |
||||
@ -0,0 +1,10 @@ |
||||
[Desktop Entry] |
||||
Name=Chrome |
||||
Comment=Chrome like theme for Falkon based on Firefox Chromifox theme |
||||
|
||||
Icon=theme.png |
||||
Type=Service |
||||
|
||||
X-Falkon-Author=David Rosca |
||||
X-Falkon-Email=nowrep@gmail.com |
||||
X-Falkon-License=license.txt |
||||
@ -1,4 +0,0 @@ |
||||
Name: Chrome |
||||
Author: David Rosca |
||||
Short Description: Chrome like theme |
||||
Long Description: Chrome like theme for Falkon based on Firefox Chromifox theme |
||||
@ -0,0 +1,10 @@ |
||||
[Desktop Entry] |
||||
Name=Linux |
||||
Comment=Default simple theme for Linux using native widget style and some basic icons from desktop icon set |
||||
|
||||
Icon=theme.png |
||||
Type=Service |
||||
|
||||
X-Falkon-Author=David Rosca |
||||
X-Falkon-Email=nowrep@gmail.com |
||||
X-Falkon-License=GPLv3 |
||||
@ -1,4 +0,0 @@ |
||||
Name: Linux Default |
||||
Author: David Rosca |
||||
Short Description: Native theme |
||||
Long Description: Default simple theme for Linux using native widget style and some basic icons from desktop icon set |
||||
@ -0,0 +1,10 @@ |
||||
[Desktop Entry] |
||||
Name=Mac |
||||
Comment=Mac like theme for Falkon based on Firefox Mac OS X theme |
||||
|
||||
Icon=theme.png |
||||
Type=Service |
||||
|
||||
X-Falkon-Author=David Rosca |
||||
X-Falkon-Email=nowrep@gmail.com |
||||
X-Falkon-License=license.txt |
||||
@ -1,4 +0,0 @@ |
||||
Name: Mac |
||||
Author: David Rosca |
||||
Short Description: Mac like theme |
||||
Long Description: Mac like theme for Falkon based on Firefox Mac OS X theme |
||||
@ -0,0 +1,10 @@ |
||||
[Desktop Entry] |
||||
Name=Windows |
||||
Comment=Windows like theme based on Material design |
||||
|
||||
Icon=theme.png |
||||
Type=Service |
||||
|
||||
X-Falkon-Author=David Rosca |
||||
X-Falkon-Email=nowrep@gmail.com |
||||
X-Falkon-License=GPLv3 |
||||
@ -1,4 +0,0 @@ |
||||
Name: Windows |
||||
Author: David Rosca |
||||
Short Description: Windows default theme |
||||
Long Description: Windows default theme for Falkon based on Firefox Strata Aero theme. This theme supports transparent background on Windows 7 |
||||
Loading…
Reference in new issue