From 221a2fb6460b43512a3102c76c4eed2154d5865b Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 12 Jul 2017 10:57:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=94=EB=A6=AC=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=EC=97=90=20=EB=8B=A4=EA=B5=AD=EC=96=B4=20=EC=A7=80=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gui/oven_control/cookbook.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/gui/oven_control/cookbook.cpp b/app/gui/oven_control/cookbook.cpp index eb1213e..d655de8 100644 --- a/app/gui/oven_control/cookbook.cpp +++ b/app/gui/oven_control/cookbook.cpp @@ -3,6 +3,8 @@ #include #include +#include "config.h" + static QErrorMessage *errorDialog = NULL; static void showError(QString errorMessage) { @@ -54,6 +56,23 @@ CookBook::CookBook(Define::CookType type) return; } + int cookNameSection; + Define::language_type lang = (Define::language_type) Config::getConfigValue(Define::config_language).d32; + switch (lang) + { + case Define::language_kr: + cookNameSection = 1; + break; + case Define::language_en: + cookNameSection = 2; + break; + case Define::language_ch: + cookNameSection = 3; + break; + default: + cookNameSection = 1; + } + int lineCount = 0; while (!file.atEnd()) { @@ -75,7 +94,7 @@ CookBook::CookBook(Define::CookType type) continue; } - QString cookname = line.section(',', 1, 1).trimmed(); + QString cookname = line.section(',', cookNameSection, cookNameSection).trimmed(); if (cookname.isEmpty()) { showError(errorMessage.arg("Cook name is missed")); -- 2.1.4