summaryrefslogtreecommitdiffstats
path: root/src/app/system_linux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/system_linux.cpp')
-rw-r--r--src/app/system_linux.cpp68
1 files changed, 21 insertions, 47 deletions
diff --git a/src/app/system_linux.cpp b/src/app/system_linux.cpp
index 492af7d..6fbfb05 100644
--- a/src/app/system_linux.cpp
+++ b/src/app/system_linux.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * 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/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * 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://gnu.org/licenses
+ */
#include "app/system_linux.h"
@@ -25,7 +27,7 @@
void CSystemUtilsLinux::Init()
{
m_zenityAvailable = true;
- if (system("zenity --version") != 0)
+ if (system("zenity --version 1> /dev/null 2> /dev/null") != 0)
{
m_zenityAvailable = false;
GetLogger()->Warn("Zenity not available, will fallback to console users dialogs.\n");
@@ -95,34 +97,7 @@ long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemT
(after->clockTime.tv_sec - before->clockTime.tv_sec) * 1000000000ll;
}
-std::string CSystemUtilsLinux::GetProfileFileLocation()
-{
- std::string profileFile;
-
- // Determine profileFile according to XDG Base Directory Specification
- char* envXDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME");
- if (envXDG_CONFIG_HOME == NULL)
- {
- char *envHOME = getenv("HOME");
- if (envHOME == NULL)
- {
- profileFile = "colobot.ini";
- }
- else
- {
- profileFile = std::string(envHOME) + "/.config/colobot.ini";
- }
- }
- else
- {
- profileFile = std::string(envXDG_CONFIG_HOME) + "/colobot.ini";
- }
- GetLogger()->Trace("Profile configuration is %s\n", profileFile.c_str());
-
- return profileFile;
-}
-
-std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
+std::string CSystemUtilsLinux::GetSaveDir()
{
std::string savegameDir;
@@ -133,7 +108,7 @@ std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
char *envHOME = getenv("HOME");
if (envHOME == NULL)
{
- savegameDir = "/tmp/colobot-savegame";
+ savegameDir = "/tmp/colobot-save";
}
else
{
@@ -148,4 +123,3 @@ std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
return savegameDir;
}
-