platform/shared/common/RhodesApp.cpp in rhodes-3.3.1 vs platform/shared/common/RhodesApp.cpp in rhodes-3.3.2.beta.1

- old
+ new

@@ -258,16 +258,16 @@ // m_expected = (callback_t)(type + 1); } m_commands.clear(); } -/*static*/ CRhodesApp* CRhodesApp::Create(const String& strRootPath) +/*static*/ CRhodesApp* CRhodesApp::Create(const String& strRootPath, const String& strUserPath) { if ( m_pInstance != null) return (CRhodesApp*)m_pInstance; - m_pInstance = new CRhodesApp(strRootPath); + m_pInstance = new CRhodesApp(strRootPath, strUserPath); String push_pin = RHOCONF().getString("push_pin"); if(!push_pin.empty()) rho::sync::CClientRegister::Create(push_pin.c_str()); @@ -283,12 +283,12 @@ } -CRhodesApp::CRhodesApp(const String& strRootPath) - :CRhodesAppBase(strRootPath) +CRhodesApp::CRhodesApp(const String& strRootPath, const String& strUserPath) + :CRhodesAppBase(strRootPath, strUserPath) { m_bExit = false; m_bDeactivationMode = false; m_bRestartServer = false; m_bSendingLog = false; @@ -771,15 +771,16 @@ } void CRhodesApp::initHttpServer() { String strAppRootPath = getRhoRootPath(); + String strAppUserPath = getRhoUserPath(); #ifndef RHODES_EMULATOR strAppRootPath += "apps"; #endif - m_httpServer = new net::CHttpServer(atoi(getFreeListeningPort()), strAppRootPath); + m_httpServer = new net::CHttpServer(atoi(getFreeListeningPort()), strAppRootPath, strAppUserPath); m_httpServer->register_uri("/system/geolocation", rubyext::CGeoLocation::callback_geolocation); m_httpServer->register_uri("/system/syncdb", callback_syncdb); m_httpServer->register_uri("/system/redirect_to", callback_redirect_to); m_httpServer->register_uri("/system/map", callback_map); m_httpServer->register_uri("/system/shared", callback_shared); @@ -1399,13 +1400,19 @@ return (n); } void rho_rhodesapp_create(const char* szRootPath) { - rho::common::CRhodesApp::Create(szRootPath); + rho::common::CRhodesApp::Create(szRootPath, szRootPath); } +void rho_rhodesapp_create_with_separate_user_path(const char* szRootPath, const char* szUserPath) +{ + rho::common::CRhodesApp::Create(szRootPath, szUserPath); +} + + void rho_rhodesapp_start() { RHODESAPP().startApp(); } @@ -1451,9 +1458,15 @@ const char* rho_rhodesapp_getblobsdirpath() { return RHODESAPP().getBlobsDirPath().c_str(); } + +const char* rho_rhodesapp_getuserrootpath() +{ + return RHODESAPP().getRhoUserPath().c_str(); +} + const char* rho_rhodesapp_getdbdirpath() { return RHODESAPP().getDBDirPath().c_str(); }