platform/shared/common/RhodesApp.cpp in rhodes-2.4.1 vs platform/shared/common/RhodesApp.cpp in rhodes-3.0.0.beta.1

- old
+ new

@@ -216,10 +216,15 @@ { if ( m_pInstance != null) return (CRhodesApp*)m_pInstance; m_pInstance = new CRhodesApp(strRootPath); + + String push_pin = RHOCONF().getString("push_pin"); + if(!push_pin.empty()) + rho::sync::CClientRegister::Create(push_pin.c_str()); + return (CRhodesApp*)m_pInstance; } /*static*/void CRhodesApp::Destroy() { @@ -651,12 +656,15 @@ return m_strRhoMessage; } void CRhodesApp::initHttpServer() { - String strAppRootPath = getRhoRootPath() + "apps"; - + String strAppRootPath = getRhoRootPath(); +#ifndef RHODES_EMULATOR + strAppRootPath += "apps"; +#endif + m_httpServer = new net::CHttpServer(atoi(getFreeListeningPort()), strAppRootPath); 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); @@ -786,11 +794,11 @@ void CRhodesApp::initAppUrls() { CRhodesAppBase::initAppUrls(); m_currentTabIndex = 0; -#if defined( OS_WINCE ) || defined( OS_WINDOWS ) +#if defined( OS_WINCE ) m_strHomeUrl = "http://localhost:"; #else m_strHomeUrl = "http://127.0.0.1:"; #endif m_strHomeUrl += getFreeListeningPort(); @@ -1265,9 +1273,14 @@ } const char* rho_rhodesapp_getblobsdirpath() { return RHODESAPP().getBlobsDirPath().c_str(); +} + +const char* rho_rhodesapp_getdbdirpath() +{ + return RHODESAPP().getDBDirPath().c_str(); } const char* rho_rhodesapp_getapprootpath() { return RHODESAPP().getAppRootPath().c_str(); }