void Presenter::run(){ m_kino.reset(new ParserKino); m_kino->SetOption(m_option); QObject::connect(m_kino.get(), &ParserKino::SignalStatus, m_windoww, &WindowParser::LoadSlot, Qt::DirectConnection); QObject::connect(m_kino.get(), &ParserKino::StatisticReady, m_windoww, &WindowParser::WriteStatistic, Qt::DirectConnection); QObject::connect(m_kino.get(), &ParserKino::setopti,this, &Presenter::SetOpt, Qt::DirectConnection); m_kino->RunThread();}void ParserKino::RunThread(){ QtConcurrent::run(this, &ParserKino::StartParsing);}void ParserKino::StartParsing(){ ReadOption(); QString statistic = ReadFile(PATH_STATISTIC); SetLink(m_option->m_link); int period = m_option->m_periodDo - m_option->m_periodOt; if(m_option->m_periodDo == m_option->m_periodOt) period = 1; else period +=1; if(!m_option->m_neObnovlat) { Updating(); AfterUpdating(); }void ParserKino::ReadOption(){ QString strBuff = ReadFile(PATH_OPTION); QStringList list = strBuff.split(","); QString time; for(int i = 0; i < list.length(); i++) { strBuff = list.at(i); switch (i) { case 0: m_option->m_link = strBuff; break; case 1: m_option->m_maxIdInLink = strBuff.toInt(); break; case 2: m_option->m_maxColContent = strBuff.toInt(); break; case 3: m_option->m_periodOt = strBuff.toInt(); break; case 4: m_option->m_periodDo = strBuff.toInt(); break; case 5: m_option->m_neObnovlat = strBuff.toInt(); break; case 6: m_option->m_perezapisDanih = strBuff.toInt(); break; case 7: m_option->m_pervichnoeDobavlenie = strBuff.toInt(); break; case 8: m_option->m_typeContent = strBuff.toStdString().c_str(); break; case 9: time = strBuff; break; default: break; } }
C++ (Qt)m_option->m_link = list[0];m_option->m_maxIdInLink = list[1].toInt();m_option->m_maxColContent = list[2].toInt();
void ParserKino::StartParsing(){ ReadOption(); QString statistic = ReadFile(PATH_STATISTIC); SetLink(m_option->m_link);// Ошибка вылетает на строке if()void ParserKino::SetLink(const QString & link){ m_link = link; m_host = link; if(m_link[m_link.length() - 1] == "/")