QString LogLoader::createDefaultLogConfig() { QString initPath = ""; #ifdef Q_OS_WIN initPath = QDir::homePath() + "/AppData/Local/Blizzard/Hearthstone/log.config"; #endif #ifdef Q_OS_MAC initPath = QDir::homePath() + "/Library/Preferences/Blizzard/Hearthstone/log.config"; #endif #ifdef Q_OS_LINUX #endif if(initPath.isEmpty()) return ""; QFileInfo logConfigFI(initPath); if(logConfigFI.exists()) { return initPath; } else { QString hsDir = logConfigFI.absolutePath(); logConfigFI = QFileInfo(hsDir); if(logConfigFI.exists() && logConfigFI.isDir()) { return initPath; } } return ""; }
QString LogLoader::createDefaultLogConfig() { QString initPath = ""; #ifdef Q_OS_WIN initPath = QDir::homePath() + "/AppData/Local/Blizzard/Hearthstone/log.config"; #endif #ifdef Q_OS_MAC initPath = QDir::homePath() + "/Library/Preferences/Blizzard/Hearthstone/log.config"; #endif #ifdef Q_OS_LINUX #endif if(initPath.isEmpty()) return ""; QFileInfo logConfigFI(initPath); if(logConfigFI.exists()) { return initPath; } else { QString hsDir = logConfigFI.absolutePath(); logConfigFI = QFileInfo(hsDir); if(logConfigFI.exists() && logConfigFI.isDir()) { //Creamos log.config QFile logConfigFile(initPath); if(!logConfigFile.open(QIODevice::WriteOnly | QIODevice::Text)) { emit pDebug("Cannot create default log.config", Error); emit pLog(tr("Log: ERROR: Cannot create default log.config")); return ""; } logConfigFile.close(); return initPath; } } return ""; }