mirror of https://github.com/vitalif/grive2
Revert unneeded and code style changes
parent
c192d530e8
commit
33c39a5c6e
|
@ -45,7 +45,6 @@
|
|||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
const std::string client_id = "22314510474.apps.googleusercontent.com" ;
|
||||
const std::string client_secret = "bl4ufi89h-9MkFlypcI7R785" ;
|
||||
|
||||
|
@ -184,7 +183,6 @@ int Main( int argc, char **argv )
|
|||
config.Save() ;
|
||||
}
|
||||
|
||||
|
||||
std::string refresh_token ;
|
||||
try
|
||||
{
|
||||
|
@ -221,7 +219,6 @@ int Main( int argc, char **argv )
|
|||
drive.Update() ;
|
||||
pb->SetShowProgressBar( false ) ;
|
||||
|
||||
drive.UpdateChangeStamp();
|
||||
drive.SaveState() ;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -92,8 +92,8 @@ void Drive::DetectChanges()
|
|||
m_state.ResolveEntry() ;
|
||||
}
|
||||
|
||||
|
||||
size_t Drive::getTotalChanges() {
|
||||
size_t Drive::getTotalChanges()
|
||||
{
|
||||
return m_state.getTotalChanges();
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,8 @@ void Drive::Update()
|
|||
{
|
||||
Log( "Synchronizing files", log::info ) ;
|
||||
m_state.Sync( m_syncer, m_options ) ;
|
||||
|
||||
UpdateChangeStamp( ) ;
|
||||
}
|
||||
|
||||
void Drive::DryRun()
|
||||
|
|
|
@ -44,7 +44,6 @@ public :
|
|||
void Update() ;
|
||||
void DryRun() ;
|
||||
void SaveState() ;
|
||||
void UpdateChangeStamp() ;
|
||||
|
||||
struct Error : virtual Exception {} ;
|
||||
|
||||
|
@ -54,6 +53,7 @@ private :
|
|||
void ReadChanges() ;
|
||||
void FromRemote( const Entry& entry ) ;
|
||||
void FromChange( const Entry& entry ) ;
|
||||
void UpdateChangeStamp( ) ;
|
||||
|
||||
private :
|
||||
Syncer *m_syncer ;
|
||||
|
|
|
@ -81,7 +81,8 @@ void State::FromLocal( const fs::path& p )
|
|||
FromLocal( p, m_res.Root(), m_st.Item( "tree" ) ) ;
|
||||
}
|
||||
|
||||
size_t State::getTotalChanges() {
|
||||
size_t State::getTotalChanges()
|
||||
{
|
||||
return m_res.Root()->size();
|
||||
}
|
||||
|
||||
|
@ -209,7 +210,6 @@ void State::FromChange( const Entry& e )
|
|||
m_res.Update( res, e ) ;
|
||||
}
|
||||
|
||||
|
||||
bool State::Update( const Entry& e )
|
||||
{
|
||||
assert( !e.IsChange() ) ;
|
||||
|
|
|
@ -66,12 +66,9 @@ void Entry2::Update( const Val& item )
|
|||
m_is_removed = file["labels"]["trashed"].Bool() ;
|
||||
|
||||
if ( file.Has( "fileSize" ) )
|
||||
{
|
||||
m_size = file["fileSize"].U64() ;
|
||||
} else
|
||||
{
|
||||
else
|
||||
m_size = 0;
|
||||
}
|
||||
|
||||
if ( !m_is_dir )
|
||||
{
|
||||
|
|
|
@ -140,8 +140,6 @@ std::string to_string( uint64_t n )
|
|||
return s.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Syncer2::Upload( Resource *res, bool new_rev )
|
||||
{
|
||||
Val meta;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "Agent.hh"
|
||||
#include "Header.hh"
|
||||
#include "util/StringStream.hh"
|
||||
#include <iostream>
|
||||
|
||||
namespace gr {
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include "util/File.hh"
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
@ -144,7 +142,6 @@ std::size_t CurlAgent::HeaderCallback( void *ptr, size_t size, size_t nmemb, Cur
|
|||
std::size_t CurlAgent::Receive( void* ptr, size_t size, size_t nmemb, CurlAgent *pthis )
|
||||
{
|
||||
assert( pthis != 0 ) ;
|
||||
|
||||
if ( pthis->m_log.get() )
|
||||
pthis->m_log->Write( (const char*)ptr, size*nmemb );
|
||||
|
||||
|
@ -163,14 +160,12 @@ std::size_t CurlAgent::Receive( void* ptr, size_t size, size_t nmemb, CurlAgent
|
|||
return pthis->m_pimpl->dest->Write( static_cast<char*>(ptr), size * nmemb ) ;
|
||||
}
|
||||
|
||||
|
||||
int CurlAgent::progress_callback( void *ptr, curl_off_t totalDownloadSize, curl_off_t finishedDownloadSize, curl_off_t totalToUpload, curl_off_t finishedUploaded )
|
||||
{
|
||||
((CurlAgent*)ptr)->m_pb->PrintProgressBar(totalDownloadSize, finishedDownloadSize, totalToUpload, finishedUploaded);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
long CurlAgent::ExecCurl(
|
||||
const std::string& url,
|
||||
DataStream *dest,
|
||||
|
@ -229,7 +224,6 @@ long CurlAgent::Request(
|
|||
const Header& hdr,
|
||||
const long downloadFileBytes )
|
||||
{
|
||||
|
||||
Trace("HTTP %1% \"%2%\"", method, url ) ;
|
||||
|
||||
Init() ;
|
||||
|
|
Loading…
Reference in New Issue