Sort data recovery sessions by date/time

This commit is contained in:
David Capello 2016-12-02 18:42:01 -03:00
parent 42b8d04e46
commit afd71377f9

View File

@ -16,6 +16,8 @@
#include "base/fs.h"
#include "base/time.h"
#include <algorithm>
namespace app {
namespace crash {
@ -50,6 +52,12 @@ DataRecovery::DataRecovery(doc::Context* ctx)
}
}
// Sort sessions from the most recent one to the oldest one
std::sort(m_sessions.begin(), m_sessions.end(),
[](const SessionPtr& a, const SessionPtr& b) {
return a->name() > b->name();
});
// Create a new session
base::pid pid = base::get_current_process_id();
std::string newSessionDir;