MigratorBase::MigratorBase(const QString &identifier, const QString &configFile, const QString &logFile, QObject *parent) : QObject(parent), mIdentifier(identifier), mMigrationState(None) { if (!configFile.isEmpty()) { mConfig.reset(new KConfig(configFile)); } setLogfile(logFile); connect(this, &MigratorBase::message, this, &MigratorBase::logMessage); loadState(); }
SWIGEXPORT void JNICALL Java_com_omtinez_pocketsphinx_pocketsphinxJNI_setLogfile(JNIEnv *jenv, jclass jcls, jstring jarg1) { char *arg1 = (char *) 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); if (!arg1) return ; } setLogfile((char const *)arg1); if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); }
MigratorBase::MigratorBase(const QString &identifier, QObject *parent) : QObject(parent), mIdentifier(identifier), mMigrationState(None), mConfig(new KConfig(Akonadi::ServerManager::addNamespace(QStringLiteral("akonadi-migrationrc")))) { const QString logFileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QCoreApplication::applicationName() + QStringLiteral("/") + identifier + QStringLiteral("migration.log"); QFileInfo fileInfo(logFileName); QDir().mkpath(fileInfo.absolutePath()); setLogfile(logFileName); connect(this, &MigratorBase::message, this, &MigratorBase::logMessage); loadState(); }