1 | /* |
2 | fixhosturifilter.h |
3 | |
4 | This file is part of the KDE project |
5 | SPDX-FileCopyrightText: 2007 Lubos Lunak <llunak@suse.cz> |
6 | |
7 | SPDX-License-Identifier: GPL-2.0-or-later |
8 | */ |
9 | |
10 | #ifndef FIXHOSTURIFILTER_H |
11 | #define FIXHOSTURIFILTER_H |
12 | |
13 | #include "kurifilterplugin_p.h" |
14 | #include <KUriFilter> |
15 | |
16 | /** |
17 | This filter tries to automatically prepend www. to http URLs that need it. |
18 | */ |
19 | class FixHostUriFilter : public KUriFilterPlugin |
20 | { |
21 | Q_OBJECT |
22 | |
23 | public: |
24 | using KUriFilterPlugin::KUriFilterPlugin; |
25 | bool filterUri(KUriFilterData &data) const override; |
26 | |
27 | private: |
28 | bool exists(const QString &host) const; |
29 | bool isResolvable(const QString &host) const; |
30 | }; |
31 | |
32 | #endif |
33 | |