diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-01-18 20:10:44 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-01-18 20:27:37 (GMT) |
commit | 0d3d7579032959203c5c52f5ced9de5494c7b0bf (patch) | |
tree | 1e166cbae3dac23e8f815bc32f856b6c0a666fbd /SwifTools | |
parent | c2580661a20e30abaa23c61808d6370a575665c1 (diff) | |
download | swift-contrib-0d3d7579032959203c5c52f5ced9de5494c7b0bf.zip swift-contrib-0d3d7579032959203c5c52f5ced9de5494c7b0bf.tar.bz2 |
Cleaned up some code.
Diffstat (limited to 'SwifTools')
-rw-r--r-- | SwifTools/Application/UnixApplicationPathProvider.cpp | 3 | ||||
-rw-r--r-- | SwifTools/Idle/IdleDetector.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/SwifTools/Application/UnixApplicationPathProvider.cpp b/SwifTools/Application/UnixApplicationPathProvider.cpp index c5a2782..06fa977 100644 --- a/SwifTools/Application/UnixApplicationPathProvider.cpp +++ b/SwifTools/Application/UnixApplicationPathProvider.cpp @@ -25,7 +25,8 @@ UnixApplicationPathProvider::UnixApplicationPathProvider(const String& name) : A } boost::filesystem::path UnixApplicationPathProvider::getHomeDir() const { - return boost::filesystem::path(getenv("HOME")); + char* home = getenv("HOME"); + return home ? boost::filesystem::path(home) : boost::filesystem::path(); } boost::filesystem::path UnixApplicationPathProvider::getDataDir() const { diff --git a/SwifTools/Idle/IdleDetector.h b/SwifTools/Idle/IdleDetector.h index 051facc..746e281 100644 --- a/SwifTools/Idle/IdleDetector.h +++ b/SwifTools/Idle/IdleDetector.h @@ -12,7 +12,7 @@ namespace Swift { class IdleDetector { public: - IdleDetector() : idle(false) {} + IdleDetector() : idle(false), idleTimeSeconds(300) {} virtual ~IdleDetector(); void setIdleTimeSeconds(int time) { @@ -38,7 +38,7 @@ namespace Swift { } private: - int idleTimeSeconds; bool idle; + int idleTimeSeconds; }; } |