Sonnet

hspellclient.cpp
1/*
2 * kspell_hspellclient.cpp
3 *
4 * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
5 * SPDX-FileCopyrightText: 2005 Mashrab Kuvatov <kmashrab@uni-bremen.de>
6 *
7 * SPDX-License-Identifier: LGPL-2.1-or-later
8 */
9#include "hspellclient.h"
10
11#include "hspell.h"
12#include "hspelldict.h"
13
14#include <QFileInfo>
15#include <QUrl>
16
17using namespace Sonnet;
18
19HSpellClient::HSpellClient(QObject *parent)
20 : Client(parent)
21{
22}
23
24HSpellClient::~HSpellClient()
25{
26}
27
28SpellerPlugin *HSpellClient::createSpeller(const QString &language)
29{
30 HSpellDict *ad = new HSpellDict(language);
31 return ad;
32}
33
34QStringList HSpellClient::languages() const
35{
36 QString dictPath(QString::fromUtf8(hspell_get_dictionary_path()));
37 if (QUrl(dictPath).isLocalFile() && QFileInfo::exists(dictPath)) {
38 return {QStringLiteral("he")};
39 }
40 return {};
41}
42
43#include "moc_hspellclient.cpp"
The sonnet namespace.
bool exists() const const
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.