mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 17:40:01 +00:00
Save "ver" file in the session directory to know which Aseprite version was used
This commit is contained in:
parent
21a57ff793
commit
2ee6df8038
@ -104,19 +104,26 @@ void Session::create(base::pid pid)
|
||||
m_pid = pid;
|
||||
|
||||
#ifdef _WIN32
|
||||
std::ofstream of(base::from_utf8(pidFilename()));
|
||||
std::ofstream pidf(base::from_utf8(pidFilename()));
|
||||
std::ofstream verf(base::from_utf8(verFilename()));
|
||||
#else
|
||||
std::ofstream of(pidFilename());
|
||||
std::ofstream pidf(pidFilename());
|
||||
std::ofstream verf(verFilename());
|
||||
#endif
|
||||
of << m_pid;
|
||||
|
||||
pidf << m_pid;
|
||||
verf << VERSION;
|
||||
}
|
||||
|
||||
void Session::removeFromDisk()
|
||||
{
|
||||
if (base::is_file(pidFilename()))
|
||||
base::delete_file(pidFilename());
|
||||
|
||||
try {
|
||||
if (base::is_file(pidFilename()))
|
||||
base::delete_file(pidFilename());
|
||||
|
||||
if (base::is_file(verFilename()))
|
||||
base::delete_file(verFilename());
|
||||
|
||||
base::remove_directory(m_path);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
@ -204,6 +211,11 @@ std::string Session::pidFilename() const
|
||||
return base::join_path(m_path, "pid");
|
||||
}
|
||||
|
||||
std::string Session::verFilename() const
|
||||
{
|
||||
return base::join_path(m_path, "ver");
|
||||
}
|
||||
|
||||
void Session::deleteDirectory(const std::string& dir)
|
||||
{
|
||||
ASSERT(!dir.empty());
|
||||
|
@ -57,6 +57,7 @@ namespace crash {
|
||||
private:
|
||||
void loadPid();
|
||||
std::string pidFilename() const;
|
||||
std::string verFilename() const;
|
||||
void deleteDirectory(const std::string& dir);
|
||||
|
||||
base::pid m_pid;
|
||||
|
Loading…
Reference in New Issue
Block a user