# HG changeset patch
# User koda
# Date 1363946922 -3600
# Node ID ce153d705fff305cf75b4b0ea0561ab6292649f4
# Parent 988901d27abf25dcb3d08720f302a63d03b6b470
scheme association for linux (although it stops during connection)
diff -r 988901d27abf -r ce153d705fff QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp Thu Mar 21 15:01:27 2013 +0100
+++ b/QTfrontend/hwform.cpp Fri Mar 22 11:08:42 2013 +0100
@@ -1928,7 +1928,7 @@
registry_hkcr.setValue("Hedgewars.Save/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hwengine.exe\" " + arguments + " %1");
// custom url scheme(s)
- registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Protocol\"");
+ registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Scheme\"");
registry_hkcr.setValue("hwplay/URL Protocol", "");
registry_hkcr.setValue("hwplay/DefaultIcon/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\",0");
registry_hkcr.setValue("hwplay/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\" %1");
@@ -1947,8 +1947,10 @@
if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share");
if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share/applications");
if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars-mimeinfo.xml "+QDir::home().absolutePath()+"/.local/share/mime/packages").toLocal8Bit().constData())==0;
+ if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hwengine.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
if (success) success = system(("update-mime-database "+QDir::home().absolutePath()+"/.local/share/mime").toLocal8Bit().constData())==0;
+ if (success) success = system("xdg-mime default hedgewars.desktop x-scheme-handler/hwplay")==0;
if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-demo")==0;
if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0;
// hack to add user's settings to hwengine. might be better at this point to read in the file, append it, and write it out to its new home. This assumes no spaces in the data dir path
diff -r 988901d27abf -r ce153d705fff misc/hedgewars.desktop
--- a/misc/hedgewars.desktop Thu Mar 21 15:01:27 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-[Desktop Entry]
-Type=Application
-Version=1.0
-Encoding=UTF-8
-Name=Hedgewars
-GenericName=Fighting Hedgehogs
-GenericName[de]=Kämpfende Igel
-GenericName[es]=Batallas entre erizos
-GenericName[fr]=Bataille de hérissons
-GenericName[ko]=고슴도치 싸우기
-GenericName[ja]=ファイチングハリネズミ
-GenericName[it]=Ricci combattenti
-GenericName[pl]=Walczące jeże
-GenericName[pt]=Batalhas entre ouriços
-GenericName[ru]=Битвы ежей
-GenericName[sk]=Bojujúci ježkovia
-GenericName[cs]=Bojující ježci
-GenericName[sv]=Stridande igelkottar
-Icon=hedgewars.png
-Exec=hedgewars
-Terminal=false
-StartupNotify=false
-Categories=Application;Game;StrategyGame;
diff -r 988901d27abf -r ce153d705fff share/hedgewars/Data/misc/hedgewars-mimeinfo.xml
--- a/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml Thu Mar 21 15:01:27 2013 +0100
+++ b/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml Fri Mar 22 11:08:42 2013 +0100
@@ -45,4 +45,14 @@
+
+
+
+ Hedgewars ServerAccess Scheme
+
+
+
+
+
+
diff -r 988901d27abf -r ce153d705fff share/hedgewars/Data/misc/hedgewars.desktop
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/misc/hedgewars.desktop Fri Mar 22 11:08:42 2013 +0100
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Encoding=UTF-8
+Name=Hedgewars
+GenericName=Fighting Hedgehogs
+GenericName[de]=Kämpfende Igel
+GenericName[es]=Batallas entre erizos
+GenericName[fr]=Bataille de hérissons
+GenericName[ko]=고슴도치 싸우기
+GenericName[ja]=ファイチングハリネズミ
+GenericName[it]=Ricci combattenti
+GenericName[pl]=Walczące jeże
+GenericName[pt]=Batalhas entre ouriços
+GenericName[ru]=Битвы ежей
+GenericName[sk]=Bojujúci ježkovia
+GenericName[cs]=Bojující ježci
+GenericName[sv]=Stridande igelkottar
+Icon=hedgewars.png
+Exec=hedgewars %U
+Terminal=false
+StartupNotify=false
+Categories=Application;Game;StrategyGame;
+MimeType=x-scheme-handler/hwplay