Merge pull request #77 from madjar/master

Fixed a bug where grive crashed on the first run.
pull/40/head
Nestal Wan 2012-06-27 07:12:16 -07:00
commit dc89aee613
1 changed files with 11 additions and 2 deletions

View File

@ -188,8 +188,17 @@ void Drive::UpdateChangeStamp( http::Agent *http )
http::XmlResponse xrsp ;
// get changed feed
boost::format changes_uri( "https://docs.google.com/feeds/default/private/changes?start-index=%1%" ) ;
http->Get( (changes_uri%(m_state.ChangeStamp()+1)).str(), &xrsp, m_http_hdr ) ;
std::string url;
if (m_state.ChangeStamp() != -1)
{
boost::format changes_uri( "https://docs.google.com/feeds/default/private/changes?start-index=%1%" ) ;
url = (changes_uri%(m_state.ChangeStamp()+1)).str();
}
else
{
url = "https://docs.google.com/feeds/default/private/changes";
}
http->Get( url, &xrsp, m_http_hdr ) ;
// we should go through the changes to see if it was really Grive to made that change
// maybe by recording the updated timestamp and compare it?