mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Code Cleanup
- Used File object inside Sensor.
This commit is contained in:
parent
8543bd457b
commit
98f3e6e61d
1 changed files with 3 additions and 6 deletions
|
@ -26,7 +26,8 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "Sensor.h"
|
#include <File.h>
|
||||||
|
#include <Sensor.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Sensor::Sensor ()
|
Sensor::Sensor ()
|
||||||
|
@ -83,11 +84,7 @@ void Sensor::fileDeletion (const std::string&)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
time_t Sensor::getModification ()
|
time_t Sensor::getModification ()
|
||||||
{
|
{
|
||||||
struct stat s = {0};
|
return File (_file).mtime ();
|
||||||
if (0 == stat (_file.c_str (), &s))
|
|
||||||
return s.st_mtime;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue