diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index dd4d5e7..e9c3177 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -230,7 +230,7 @@ m_predictor = predictors.at(0); m_multi = new MultiConvertor(_scim_config,this); - m_multi->connect(); +// m_multi->connect(); // ������ء� init(); @@ -1250,6 +1250,7 @@ if (!m_convertor->connect()) { update_aux_string(utf8_mbstowcs(String(_("could not connect to server.")))); show_aux_string(); + m_convertor = m_def_convertor; return; } } @@ -1258,6 +1259,7 @@ if (m_convertor->ren_conversion() == -1) { update_aux_string(utf8_mbstowcs(String(_("could not connect to server.")))); show_aux_string(); + m_convertor = m_def_convertor; return; } m_convList.kouho.clear(); diff --git a/honoka/src/multiconvertor.cpp b/honoka/src/multiconvertor.cpp index d626083..0fd362b 100644 --- a/honoka/src/multiconvertor.cpp +++ b/honoka/src/multiconvertor.cpp @@ -48,6 +48,7 @@ bool MultiConvertor::isConnected() { for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; if (!instance->convertors[i]->isConnected()) return false; } @@ -56,17 +57,21 @@ void MultiConvertor::reset(){ for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; instance->convertors[i]->reset(); } } void MultiConvertor::setYomiText(WideString yomi) { for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; instance->convertors[i]->setYomiText(yomi); } } int MultiConvertor::ren_conversion() { + if (nuc.find(instance->m_def_convertor) != nuc.end()) return -1; + def = instance->m_def_convertor; texts.clear(); int b = instance->m_def_convertor->ren_conversion(); @@ -75,6 +80,7 @@ texts.push_back(l.kouho[0].kanji); } for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; if (instance->m_def_convertor != instance->convertors[i]) { instance->convertors[i]->ren_conversion(); for(unsigned int j = 0;j < b;j ++) { @@ -99,6 +105,7 @@ int MultiConvertor::setPos(int p){ int cp = instance->m_def_convertor->setPos(p); for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; if (instance->m_def_convertor != instance->convertors[i]) instance->convertors[i]->setPos(cp); } @@ -122,6 +129,7 @@ m.convertor = instance->m_def_convertor; results.push_back(m); for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; if (instance->convertors[i] != instance->m_def_convertor) { m.list = instance->convertors[i]->getResultList(instance->m_def_convertor->getPos(),kt); m.convertor = instance->convertors[i]; @@ -175,6 +183,7 @@ } instance->m_def_convertor->setPos(p); for(unsigned int i = 0;i < instance->convertors.size();i ++) { + if (nuc.find(instance->convertors[i]) != nuc.end()) continue; if (instance->m_def_convertor != instance->convertors[i]) { for(unsigned int j = 0;j < texts.size();j ++) { int bl = s[j]; @@ -193,8 +202,10 @@ } bool MultiConvertor::connect() { + nuc.clear(); for(unsigned int i = 0;i < instance->convertors.size();i ++) { - instance->convertors[i]->connect(); + if (!instance->convertors[i]->connect()) + nuc.insert(instance->convertors[i]); } return true; } diff --git a/honoka/src/multiconvertor.h b/honoka/src/multiconvertor.h index 311aac8..4c85036 100644 --- a/honoka/src/multiconvertor.h +++ b/honoka/src/multiconvertor.h @@ -21,6 +21,7 @@ #define MULTICONVERTOR_H #include +#include #include #include @@ -67,6 +68,7 @@ ResultList result; vector texts; Convertor *def; + set nuc; }; #endif