Changeset View
Changeset View
Standalone View
Standalone View
src/urifilters/localdomain/localdomainurifilter.h
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef LOCALDOMAINURIFILTER_H | 21 | #ifndef LOCALDOMAINURIFILTER_H | ||
22 | #define LOCALDOMAINURIFILTER_H | 22 | #define LOCALDOMAINURIFILTER_H | ||
23 | 23 | | |||
24 | #include <KUriFilter> | 24 | #include <KUriFilter> | ||
25 | 25 | | |||
26 | #include <QRegExp> | 26 | #include <QRegularExpression> | ||
27 | 27 | | |||
28 | class QHostInfo; | 28 | class QHostInfo; | ||
29 | class QEventLoop; | 29 | class QEventLoop; | ||
30 | 30 | | |||
31 | /** | 31 | /** | ||
32 | This filter takes care of hostnames in the local search domain. | 32 | This filter takes care of hostnames in the local search domain. | ||
33 | If you're in domain domain.org which has a host intranet.domain.org | 33 | If you're in domain domain.org which has a host intranet.domain.org | ||
34 | and the typed URI is just intranet, check if there's a host | 34 | and the typed URI is just intranet, check if there's a host | ||
35 | intranet.domain.org and if yes, it's a network URI. | 35 | intranet.domain.org and if yes, it's a network URI. | ||
36 | */ | 36 | */ | ||
37 | class LocalDomainUriFilter : public KUriFilterPlugin | 37 | class LocalDomainUriFilter : public KUriFilterPlugin | ||
38 | { | 38 | { | ||
39 | Q_OBJECT | 39 | Q_OBJECT | ||
40 | 40 | | |||
41 | public: | 41 | public: | ||
42 | LocalDomainUriFilter(QObject *parent, const QVariantList &args); | 42 | LocalDomainUriFilter(QObject *parent, const QVariantList &args); | ||
43 | bool filterUri(KUriFilterData &data) const override; | 43 | bool filterUri(KUriFilterData &data) const override; | ||
44 | 44 | | |||
45 | private: | 45 | private: | ||
46 | bool exists(const QString &) const; | 46 | bool exists(const QString &) const; | ||
47 | 47 | | |||
48 | QRegExp m_hostPortPattern; | 48 | QRegularExpression m_hostPortPattern; | ||
49 | }; | 49 | }; | ||
50 | 50 | | |||
51 | #endif | 51 | #endif |