QTfrontend/hwform.cpp
changeset 4091 f89b8d0afbe1
parent 4090 4b165832d232
child 4232 3a7862405c36
--- a/QTfrontend/hwform.cpp	Mon Nov 01 23:30:33 2010 +0100
+++ b/QTfrontend/hwform.cpp	Mon Nov 01 19:13:00 2010 -0400
@@ -1135,6 +1135,7 @@
     success = false;
     // TODO; also reenable button in pages.cpp
 #else
+    // this is a little silly due to all the system commands below anyway - just use mkdir -p ?  Does have the advantage of the alert I guess
     if (success) success = checkForDir(QDir::home().absolutePath() + "/.local");
     if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share");
     if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share/mime");
@@ -1145,6 +1146,8 @@
     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/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 hwengine.desktop application/x-hedgewars-demo")==0;
+    if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0;
 #endif
     if (success) QMessageBox::information(0, "", QMessageBox::tr("All file associations have been set."));
     else QMessageBox::information(0, "", QMessageBox::tr("File association failed."));