Permalink
Browse files

sync: fix stop search

  • Loading branch information...
1 parent d792fc4 commit 16e6c993072f4fdcdc39e4e9753527665fbc724a @genywind genywind committed Jul 12, 2011
@@ -131,7 +131,7 @@ public boolean getBoolProperty(Integer nSrcID, String szPropName)
int getState(){ return m_syncState; }
boolean isSearch(){ return m_bIsSearch; }
boolean isContinueSync(){ return m_syncState != esExit && m_syncState != esStop; }
- boolean isSyncing(){ return m_syncState == esSyncAllSources || m_syncState == esSyncSource; }
+ boolean isSyncing(){ return m_syncState == esSyncAllSources || m_syncState == esSyncSource || m_syncState == esSearch; }
void stopSync()
{
if (isContinueSync())
@@ -315,6 +315,8 @@ public static void stopSync()throws Exception
if ( getSyncEngine().isSyncing() )
{
+ LOG.INFO("STOP sync in progress.");
+
getSyncEngine().stopSyncByUser();
getInstance().stopWait();
@@ -82,7 +82,7 @@ class CSyncEngine : public net::IRhoSession
ESyncState getState()const{ return m_syncState; }
boolean isSearch()const{ return m_bIsSearch; }
boolean isContinueSync()const{ return m_syncState != esExit && m_syncState != esStop; }
- boolean isSyncing()const{ return m_syncState == esSyncAllSources || m_syncState == esSyncSource; }
+ boolean isSyncing()const{ return m_syncState == esSyncAllSources || m_syncState == esSyncSource || m_syncState == esSearch; }
void stopSync(){ if (isContinueSync()){ setState(esStop); m_NetRequest.cancel();m_NetRequestClientID.cancel();} }
void stopSyncByUser(){ m_bStopByUser = true; stopSync(); }
void exitSync(){ setState(esExit); m_NetRequest.cancel(); m_NetRequestClientID.cancel();}

0 comments on commit 16e6c99

Please sign in to comment.