From cc63fa9f8462ca364c98483fcb0681c3099e3d79 Mon Sep 17 00:00:00 2001
From: byloveletter <byloveletter@falinux.com>
Date: Fri, 16 Jun 2017 13:48:34 +0900
Subject: [PATCH] =?UTF-8?q?=EB=8D=B0=EB=AA=A8=EB=AA=A8=EB=93=9C=20?=
 =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=B0=8F=20=ED=8C=8C=EC=9D=BC=20=EB=B3=B5?=
 =?UTF-8?q?=EC=82=AC=20=EA=B8=B0=EB=8A=A5=20=EA=B0=9C=EC=84=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

  - 버그 수정
---
 app/gui/oven_control/configinfodlg.cpp  |  6 +++---
 app/gui/oven_control/configwindow.h     |  4 ++--
 app/gui/oven_control/fileprocessdlg.cpp | 24 ++++++++++++++++++++++--
 3 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/app/gui/oven_control/configinfodlg.cpp b/app/gui/oven_control/configinfodlg.cpp
index 2809bfe..047ffa6 100644
--- a/app/gui/oven_control/configinfodlg.cpp
+++ b/app/gui/oven_control/configinfodlg.cpp
@@ -8,7 +8,7 @@
 
 #define MODEL_INFO_FILE_NAME "/prime/config/model_info.txt"
 #define CHEF_INFO_FILE_NAME "/prime/config/chef_info.txt"
-#define SERVICE_INFO_FILE_NAME "/prime/config/hotline_info.txt"
+#define SERVICE_INFO_FILE_NAME "/prime/config/service_info.txt"
 
 static const char* g_strModelTypeName[] ={
     QT_TRANSLATE_NOOP("ConfigInfoDlg", "전기식 10단"),
@@ -127,7 +127,7 @@ void ConfigInfoDlg::loadHotlineChefInfo(){
     QLabel* label;
 
 
-
+//Default Value;
     mapInfos[tr("연 락 처")] = "010-3004-6517";
     mapInfos[tr("이       름")] = "김성우";
     mapInfos[tr("위치정보")] ="인천광역시 남동구 남동동로 34번길 56";
@@ -150,7 +150,7 @@ void ConfigInfoDlg::loadHotlineServiceInfo(){
     QMap<QString , QString> mapInfos;
     QLabel* label;
 
-
+//Default Value
     mapInfos[tr("연 락 처")] = "1644-9533";
     mapInfos[tr("위치정보")] ="인천광역시 남동구 남동동로 34번길 56";
 
diff --git a/app/gui/oven_control/configwindow.h b/app/gui/oven_control/configwindow.h
index 1a6e7c1..7659a87 100644
--- a/app/gui/oven_control/configwindow.h
+++ b/app/gui/oven_control/configwindow.h
@@ -32,7 +32,7 @@ class ConfigWindow : public QMainWindow
 
 private:
     const uint16_t m_arrMaxMenuCount[7] ={
-        6,8,8,2,3,0,6
+        6,8,8,2,3,0,5
     };
    const Define::ConfigType m_arrConfigListInfos[7][20] = {
        {config_language,config_datetime, config_temptype,config_backlight, config_time_type,config_resttime_format,},
@@ -41,7 +41,7 @@ private:
        {config_set_half_energy,config_set_auto_darkness,},
        {config_duty_wash,config_loading_door_monitoring,config_cooking_door_monitoring},
        {config_invalid,},
-       {config_software_info,config_hotline_chef,config_hotline_service,config_steam_wash,config_demo_mode,config_enter_engineer_mode}
+       {config_software_info,config_hotline_chef,config_hotline_service,config_steam_wash,config_enter_engineer_mode}
    };
 
    void nextFocus();
diff --git a/app/gui/oven_control/fileprocessdlg.cpp b/app/gui/oven_control/fileprocessdlg.cpp
index b02fd15..d8f2c37 100644
--- a/app/gui/oven_control/fileprocessdlg.cpp
+++ b/app/gui/oven_control/fileprocessdlg.cpp
@@ -116,9 +116,13 @@ void ProgramCopyWorker::workerMain(){
                 foreach(QFileInfo finfo, strFileInfolist){
                     srcFilepath = finfo.absoluteFilePath();
                     destFilePath = QString("%1/%2").arg(QString(strDir).replace(srcpath,targetpath)).arg(finfo.fileName());
+                    if(QFile::copy(srcFilepath, destFilePath)==false){
+                        qDebug() << srcFilepath << " file copy fail! dest file path info is " << destFilePath;
+                    }
                     nCpyFileSize += finfo.size();
                     nCurProgress = (nCpyFileSize *100) / nTotalFileSize;
                     nRemainSec = (nTotalFileSize-nCpyFileSize)/200000;
+
                     //qDebug() << srcFilepath << destFilePath << "total size " << nTotalFileSize << "nCpyFileSize " << nCpyFileSize;
                     emit progressed(nCurProgress,nRemainSec);
                     if(QThread::currentThread()->isInterruptionRequested()){
@@ -169,6 +173,22 @@ void ProgramCopyWorker::workerMain(){
         }
     }
     else{
+        sync();
+        foreach(QString strinfo, m_arrSrcFileList){
+            QString filepath = strinfo.left(strinfo.indexOf(',',0));
+            QString destfiledir = strinfo.right(strinfo.size() - (strinfo.indexOf(',',0)+1));
+            QDir destdir(destfiledir);
+            QFileInfo finfo(filepath);
+            srcFilepath = filepath;
+            destFilePath = QString("%1/%2.bak").arg(destfiledir).arg(finfo.fileName());
+            qDebug() << destFilePath;
+            if(QFile::exists(destFilePath)){
+                if(QFile(destFilePath).remove()==false){
+                    qDebug() << destFilePath << "delete fail";
+                }
+            }
+            else qDebug() << "file not found error";
+        }
         foreach(QString srcpath, m_arrSrcDirList){
             qDebug() << "src dir : " << srcpath;
             QDir srcdir(srcpath);
@@ -548,7 +568,7 @@ void FileProcessDlg::programDownload(){
     QString strSrcPath;
 
     if(FileProcessor::detectUSB(strDescPath)){
-        worker.setDestPath(QString("%1").arg(strDescPath));
+        worker.setDestPath(QString("%1/prime").arg(strDescPath));
         worker.addSrcDir("/prime/cookbook");
         worker.moveToThread(&programCopyThd);
 
@@ -605,7 +625,7 @@ void FileProcessDlg::programUpload(){
         //worker.addSrcFile(QString("%1/prime/falinux/superdaemon,/falinux").arg(strSrcPath));
         //worker.addSrcFile(QString("%1/prime/falinux/superdaemon.ini,/falinux").arg(strSrcPath));
        worker.setDestPath("/prime");
-        worker.addSrcDir(QString("%1/%2").arg(strSrcPath,"cookbook"));
+        worker.addSrcDir(QString("%1/%2").arg(strSrcPath,"prime/cookbook"));
         worker.moveToThread(&programCopyThd);
 
         connect(&programCopyThd,SIGNAL(started()), &worker, SLOT(workerMain()));
-- 
2.1.4