void MainWindow::doGenerator() { if (!doCheckOption()){ QMessageBox::critical(this,QString("Error Message"),QString("Error , can not generator files!")); return ; } switch(m_dbType){ case MYSQL: if (createIniFile()==true) QMessageBox::about(this,tr("Create file"), tr("Create file success")); else QMessageBox::about(this,tr("Create file"), tr("Create file fail")); break; case XML: if (ui->tbMain->currentIndex() == 0){ if (createIniFile()==true) QMessageBox::about(this,tr("Create file"), tr("Create file success")); else QMessageBox::about(this,tr("Create file"), tr("Create file fail")); } else{ if (createXmlFile()==true) QMessageBox::about(this,tr("Create file"), tr("Create file success")); else QMessageBox::about(this,tr("Create file"), tr("Create file fail")); } } }
//------------------------------------------------------------------------------ void BibleQuoteModule::parseModule(QString pathToModule) { // myDebug() << "Parse module: " << pathToModule; MetaInfo parseInfo = readInfo(pathToModule); loadBibleData(1, pathToModule); // myDebug() << readInfo(pathToModule).name() << readInfo(pathToModule).shortName(); QDir d; d = QDir(QString(Config::configuration()->getDataPath() + GL_MODULE_PATH + "%1/" + parseInfo.shortName()).arg(m_typeModule.toLower())); if (!d.exists()) { // emit SIGNAL_CreateFolderForModule(parseInfo.shortName()); QDir dir; dir.mkpath(QString(Config::configuration()->getDataPath() + GL_MODULE_PATH + "%1/" + parseInfo.shortName()).arg(m_typeModule.toLower())); if (createIniFile(parseInfo)) { createBookFiles(pathToModule); if (!m_bibleType) { addToListBookModule(parseInfo.shortName()); } else { addToListBibleModule(parseInfo.shortName()); } } else { myWarning() << "this module is created"; } } else { // myDebug() << "This module is exist"; } }