summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-18 20:10:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-18 20:27:37 (GMT)
commit0d3d7579032959203c5c52f5ced9de5494c7b0bf (patch)
tree1e166cbae3dac23e8f815bc32f856b6c0a666fbd /SwifTools
parentc2580661a20e30abaa23c61808d6370a575665c1 (diff)
downloadswift-contrib-0d3d7579032959203c5c52f5ced9de5494c7b0bf.zip
swift-contrib-0d3d7579032959203c5c52f5ced9de5494c7b0bf.tar.bz2
Cleaned up some code.
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/Application/UnixApplicationPathProvider.cpp3
-rw-r--r--SwifTools/Idle/IdleDetector.h4
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;
};
}