mirror of https://github.com/vitalif/grive2
fixed uninitialized change stamp
parent
935ac608ff
commit
cbf40e9b90
|
@ -160,10 +160,10 @@ int main( int argc, char **argv )
|
|||
OAuth2 token( refresh_token, client_id, client_secret ) ;
|
||||
Drive drive( token, options ) ;
|
||||
|
||||
// drive.Update() ;
|
||||
// drive.SaveState() ;
|
||||
//
|
||||
// config.Save() ;
|
||||
drive.Update() ;
|
||||
drive.SaveState() ;
|
||||
|
||||
config.Save() ;
|
||||
}
|
||||
catch ( gr::Exception& e )
|
||||
{
|
||||
|
|
|
@ -91,12 +91,15 @@ Drive::Drive( OAuth2& auth, const Json& options ) :
|
|||
} while ( feed.GetNext( &http, m_http_hdr ) ) ;
|
||||
|
||||
// pull the changes feed
|
||||
boost::format changes_uri( "https://docs.google.com/feeds/default/private/changes?start-index=%1%" ) ;
|
||||
http::ResponseLog log2( "changes-", ".xml", &xrsp ) ;
|
||||
http.Get( (changes_uri%(prev_stamp+1)).str(), &log2, m_http_hdr ) ;
|
||||
|
||||
Feed changes( xrsp.Response() ) ;
|
||||
std::for_each( changes.begin(), changes.end(), boost::bind( &Drive::FromChange, this, _1 ) ) ;
|
||||
if ( prev_stamp != -1 )
|
||||
{
|
||||
boost::format changes_uri( "https://docs.google.com/feeds/default/private/changes?start-index=%1%" ) ;
|
||||
http::ResponseLog log2( "changes-", ".xml", &xrsp ) ;
|
||||
http.Get( (changes_uri%(prev_stamp+1)).str(), &log2, m_http_hdr ) ;
|
||||
|
||||
Feed changes( xrsp.Response() ) ;
|
||||
std::for_each( changes.begin(), changes.end(), boost::bind( &Drive::FromChange, this, _1 ) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void Drive::FromRemote( const Entry& entry )
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
|
||||
namespace gr {
|
||||
|
||||
State::State( const fs::path& filename, const Json& options )
|
||||
State::State( const fs::path& filename, const Json& options ) :
|
||||
m_cstamp( -1 )
|
||||
{
|
||||
Read( filename ) ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue