Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 535d9352 authored by Laurent Montel's avatar Laurent Montel 😁

Remove duplicate code

parent 0a743b61
......@@ -99,7 +99,7 @@ LanguageToolConfigWidget::~LanguageToolConfigWidget()
void LanguageToolConfigWidget::refreshListOfLanguages()
{
LanguageToolGetListOfLanguageJob *job = new LanguageToolGetListOfLanguageJob(this);
job->setUrl(mInstancePath->text() + QStringLiteral("/languages"));
job->setUrl(LanguageToolManager::convertToLanguagePath(mInstancePath->text()));
job->setNetworkAccessManager(LanguageToolManager::self()->networkAccessManager());
connect(job, &LanguageToolGetListOfLanguageJob::finished, this, &LanguageToolConfigWidget::slotGetLanguagesFinished);
connect(job, &LanguageToolGetListOfLanguageJob::error, this, &LanguageToolConfigWidget::slotGetLanguagesError);
......
......@@ -58,7 +58,12 @@ QString LanguageToolManager::languageToolLanguagesPath() const
if (mLanguageToolPath.isEmpty()) {
return {};
}
return mLanguageToolPath + QStringLiteral("/languages");
return convertToLanguagePath(mLanguageToolPath);
}
QString LanguageToolManager::convertToLanguagePath(const QString &path)
{
return path + QStringLiteral("/languages");
}
QString LanguageToolManager::languageToolPath() const
......
......@@ -48,6 +48,8 @@ public:
Q_REQUIRED_RESULT QString languageToolCheckPath() const;
Q_REQUIRED_RESULT QString languageToolLanguagesPath() const;
static QString convertToLanguagePath(const QString &path);
private:
Q_DISABLE_COPY(LanguageToolManager)
QString mLanguage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment