mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 10:49:53 +02:00
Unhardcode APPVENDOR here and there
This should have been done in a674498a96
.
This commit is contained in:
@@ -102,7 +102,11 @@ elif host_platform == 'linux'
|
|||||||
embedded_files += [
|
embedded_files += [
|
||||||
[ 'icon_exe_png', rendered_icons['icon_exe'] ],
|
[ 'icon_exe_png', rendered_icons['icon_exe'] ],
|
||||||
[ 'icon_cps_png', rendered_icons['icon_cps'] ],
|
[ 'icon_cps_png', rendered_icons['icon_cps'] ],
|
||||||
[ 'save_xml', files('save.xml') ],
|
[ 'save_xml', configure_file(
|
||||||
|
input: 'save.template.xml',
|
||||||
|
output: 'save.xml',
|
||||||
|
configuration: conf_data,
|
||||||
|
) ],
|
||||||
[ 'powder_desktop', configure_file(
|
[ 'powder_desktop', configure_file(
|
||||||
input: 'powder.template.desktop',
|
input: 'powder.template.desktop',
|
||||||
output: 'powder.desktop',
|
output: 'powder.desktop',
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Name=@APPNAME@
|
Name=@APPNAME@
|
||||||
Type=Application
|
Type=Application
|
||||||
Comment=@APPCOMMENT@
|
Comment=@APPCOMMENT@
|
||||||
MimeType=application/vnd.powdertoy.save;x-scheme-handler/ptsave;
|
MimeType=application/vnd.@APPVENDOR@.save;x-scheme-handler/ptsave;
|
||||||
Categories=Game;Simulation;
|
Categories=Game;Simulation;
|
||||||
Exec=@APPEXE@ %u
|
Exec=@APPEXE@ %u
|
||||||
Icon=@APPVENDOR@-@APPEXE@
|
Icon=@APPVENDOR@-@APPEXE@
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
<mime-type type="application/vnd.powdertoy.save">
|
<mime-type type="application/vnd.@APPVENDOR@.save">
|
||||||
<comment>Powder Toy save</comment>
|
<comment>Powder Toy save</comment>
|
||||||
<glob pattern="*.cps"/>
|
<glob pattern="*.cps"/>
|
||||||
<glob pattern="*.stm"/>
|
<glob pattern="*.stm"/>
|
@@ -2,12 +2,13 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include "common/String.h"
|
#include "common/String.h"
|
||||||
|
#include "Config.h"
|
||||||
|
|
||||||
class GameSave;
|
class GameSave;
|
||||||
|
|
||||||
namespace Clipboard
|
namespace Clipboard
|
||||||
{
|
{
|
||||||
const ByteString clipboardFormatName = "application/vnd.powdertoy.save";
|
const ByteString clipboardFormatName = "application/vnd." + ByteString(APPVENDOR) + ".save";
|
||||||
void SetClipboardData(std::unique_ptr<GameSave> data);
|
void SetClipboardData(std::unique_ptr<GameSave> data);
|
||||||
const GameSave *GetClipboardData();
|
const GameSave *GetClipboardData();
|
||||||
void Init();
|
void Init();
|
||||||
|
@@ -142,7 +142,7 @@ bool Install()
|
|||||||
ByteString file = ByteString::Build(APPVENDOR, "-", APPID, ".desktop");
|
ByteString file = ByteString::Build(APPVENDOR, "-", APPID, ".desktop");
|
||||||
ok = ok && Platform::WriteFile(desktopData, file);
|
ok = ok && Platform::WriteFile(desktopData, file);
|
||||||
ok = ok && Run("installing desktop file", { "xdg-desktop-menu", "install", file }, true);
|
ok = ok && Run("installing desktop file", { "xdg-desktop-menu", "install", file }, true);
|
||||||
ok = ok && Run("associating save MIME type with desktop file", { "xdg-mime", "default", file, "application/vnd.powdertoy.save" }, true);
|
ok = ok && Run("associating save MIME type with desktop file", { "xdg-mime", "default", file, "application/vnd.", APPVENDOR, ".save" }, true);
|
||||||
ok = ok && Run("associating ptsave URL scheme with desktop file", { "xdg-mime", "default", file, "x-scheme-handler/ptsave" }, true);
|
ok = ok && Run("associating ptsave URL scheme with desktop file", { "xdg-mime", "default", file, "x-scheme-handler/ptsave" }, true);
|
||||||
Platform::RemoveFile(file);
|
Platform::RemoveFile(file);
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ bool Install()
|
|||||||
{
|
{
|
||||||
ByteString file = ByteString(APPVENDOR) + "-cps.png";
|
ByteString file = ByteString(APPVENDOR) + "-cps.png";
|
||||||
ok = ok && Platform::WriteFile(icon_cps_png.AsCharSpan(), file);
|
ok = ok && Platform::WriteFile(icon_cps_png.AsCharSpan(), file);
|
||||||
ok = ok && Run("providing file icons for saves and stamps", { "xdg-icon-resource", "install", "--noupdate", "--context", "mimetypes", "--size", "64", file, "application-vnd.powdertoy.save" }, true);
|
ok = ok && Run("providing file icons for saves and stamps", { "xdg-icon-resource", "install", "--noupdate", "--context", "mimetypes", "--size", "64", file, "application-vnd.", APPVENDOR, ".save" }, true);
|
||||||
Platform::RemoveFile(file);
|
Platform::RemoveFile(file);
|
||||||
}
|
}
|
||||||
if (ok)
|
if (ok)
|
||||||
|
Reference in New Issue
Block a user