if (strcmp(view.GetViewId(), "kumibutton") == 0)\r
{\r
// printf("join click\n");\r
- const std::string jsonPath = "/user/res/clocks/KUMI.json";\r
+ const std::string jsonPath = "/user/res/clocks/dialconfig/KUMI.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
}\r
if (strcmp(view.GetViewId(), "flowerbudbutton") == 0)\r
{\r
// printf("join click\n");\r
- const std::string jsonPath = "/user/res/clocks/flowerbud.json";\r
+ const std::string jsonPath = "/user/res/clocks/dialconfig/flowerbud.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
}\r
if (strcmp(view.GetViewId(), "maomaobutton") == 0)\r
{\r
// printf("join click\n");\r
- const std::string jsonPath = "/user/res/clocks/maomao.json";\r
+ const std::string jsonPath = "/user/res/clocks/dialconfig/maomao.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
}\r
if (strcmp(view.GetViewId(), "momobutton") == 0)\r
{\r
// printf("join click\n");\r
- const std::string jsonPath = "/user/res/clocks/momo.json";\r
+ const std::string jsonPath = "/user/res/clocks/dialconfig/momo.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
}\r
if (strcmp(view.GetViewId(), "maliaobutton") == 0)\r
{\r
// printf("join click\n");\r
- const std::string jsonPath = "/user/res/clocks/maliao.json";\r
+ const std::string jsonPath = "/user/res/clocks/dialconfig/maliao.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
}\r
*/
void Digital_clockView::setJsonFilePath(const std::string &filePath)
{
- std::string defaultFile = "/user/res/clocks/default.json";
+ std::string defaultFile = "/user/res/clocks/dialconfig/default.json";
std::ifstream sourceFile(filePath, std::ios::binary); // 打开源文件
std::ofstream targetFile(defaultFile, std::ios::binary | std::ios::trunc); // 打开目标文件,使用trunc标志来覆盖目标文件
//("%s|%s\n", defaultFile.c_str(), filePath.c_str()); // 使用c_str()将std::string转换为C风格字符串