aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/AutoReloadHelper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/AutoReloadHelper.cc')
-rw-r--r--src/FbTk/AutoReloadHelper.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/FbTk/AutoReloadHelper.cc b/src/FbTk/AutoReloadHelper.cc
index e3c1d59..17124d4 100644
--- a/src/FbTk/AutoReloadHelper.cc
+++ b/src/FbTk/AutoReloadHelper.cc
@@ -40,19 +40,19 @@ void AutoReloadHelper::checkReload() {
40 } 40 }
41} 41}
42 42
43void AutoReloadHelper::setMainFile(std::string file) { 43void AutoReloadHelper::setMainFile(const std::string& file) {
44 file = StringUtil::expandFilename(file); 44 std::string expanded_file = StringUtil::expandFilename(file);
45 if (file == m_main_file) 45 if (expanded_file == m_main_file)
46 return; 46 return;
47 m_main_file = file; 47 m_main_file = expanded_file;
48 reload(); 48 reload();
49} 49}
50 50
51void AutoReloadHelper::addFile(std::string file) { 51void AutoReloadHelper::addFile(const std::string& file) {
52 if (file.empty()) 52 if (file.empty())
53 return; 53 return;
54 file = StringUtil::expandFilename(file); 54 std::string expanded_file = StringUtil::expandFilename(file);
55 m_timestamps[file] = FileUtil::getLastStatusChangeTimestamp(file.c_str()); 55 m_timestamps[expanded_file] = FileUtil::getLastStatusChangeTimestamp(expanded_file.c_str());
56} 56}
57 57
58void AutoReloadHelper::reload() { 58void AutoReloadHelper::reload() {