QTfrontend/hwform.cpp
changeset 8639 33d29ed99faa
parent 8613 82c649dfc7c3
child 8643 e4d1c21f8db0
equal deleted inserted replaced
8638:0a6837edb278 8639:33d29ed99faa
  1917     if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hwengine.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
  1917     if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hwengine.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
  1918     if (success) success = system(("update-mime-database "+QDir::home().absolutePath()+"/.local/share/mime").toLocal8Bit().constData())==0;
  1918     if (success) success = system(("update-mime-database "+QDir::home().absolutePath()+"/.local/share/mime").toLocal8Bit().constData())==0;
  1919     if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-demo")==0;
  1919     if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-demo")==0;
  1920     if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0;
  1920     if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0;
  1921     // 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
  1921     // 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
  1922     if (success) success = system(("sed -i 's/^\\(Exec=.*\\) \\([^ ]* %f\\)/\\1 \\2 "+arguments+"/' "+QDir::home().absolutePath()+"/.local/share/applications/hwengine.desktop").toLocal8Bit().constData())==0;
  1922     if (success) success = system(("sed -i 's|^\\(Exec=.*\\) \\(%f\\)|\\1 \\2 "+arguments+"|' "+QDir::home().absolutePath()+"/.local/share/applications/hwengine.desktop").toLocal8Bit().constData())==0;
  1923 #endif
  1923 #endif
  1924     if (success)
  1924     if (success)
  1925     {
  1925     {
  1926         QMessageBox infoMsg(this);
  1926         QMessageBox infoMsg(this);
  1927         infoMsg.setIcon(QMessageBox::Information);
  1927         infoMsg.setIcon(QMessageBox::Information);