File indexing completed on 2024-05-12 15:42:13
0001 /* 0002 localdomainurifilter.h 0003 0004 This file is part of the KDE project 0005 SPDX-FileCopyrightText: 2002 Lubos Lunak <llunak@suse.cz> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef LOCALDOMAINURIFILTER_H 0011 #define LOCALDOMAINURIFILTER_H 0012 0013 #include <KUriFilter> 0014 0015 #include <QRegularExpression> 0016 0017 class QHostInfo; 0018 class QEventLoop; 0019 0020 /** 0021 This filter takes care of hostnames in the local search domain. 0022 If you're in domain domain.org which has a host intranet.domain.org 0023 and the typed URI is just intranet, check if there's a host 0024 intranet.domain.org and if yes, it's a network URI. 0025 */ 0026 class LocalDomainUriFilter : public KUriFilterPlugin 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 LocalDomainUriFilter(QObject *parent, const QVariantList &args); 0032 bool filterUri(KUriFilterData &data) const override; 0033 0034 private: 0035 bool exists(const QString &) const; 0036 0037 QRegularExpression m_hostPortPattern; 0038 }; 0039 0040 #endif