1/*
2 SPDX-FileCopyrightText: 2000-2001, 2003, 2010 Dawit Alemayehu <adawit at kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#include "kurifilter.h"
7#include <QMap>
8
9class KUriFilterDataPrivate
10{
11public:
12 explicit KUriFilterDataPrivate(const QUrl &u, const QString &typedUrl)
13 : checkForExecs(true)
14 , wasModified(true)
15 , uriType(KUriFilterData::Unknown)
16 , searchFilterOptions(KUriFilterData::SearchFilterOptionNone)
17 , url(u.adjusted(options: QUrl::NormalizePathSegments))
18 , typedString(typedUrl)
19 {
20 }
21
22 ~KUriFilterDataPrivate()
23 {
24 }
25
26 static QString lookupIconNameFor(const QUrl &url, KUriFilterData::UriTypes type);
27
28 void setData(const QUrl &u, const QString &typedUrl)
29 {
30 checkForExecs = true;
31 wasModified = true;
32 uriType = KUriFilterData::Unknown;
33 searchFilterOptions = KUriFilterData::SearchFilterOptionNone;
34
35 url = u.adjusted(options: QUrl::NormalizePathSegments);
36 typedString = typedUrl;
37
38 errMsg.clear();
39 iconName.clear();
40 absPath.clear();
41 args.clear();
42 searchTerm.clear();
43 searchProvider.clear();
44 searchTermSeparator = QChar();
45 alternateDefaultSearchProvider.clear();
46 alternateSearchProviders.clear();
47 searchProviderMap.clear();
48 defaultUrlScheme.clear();
49 }
50
51 KUriFilterDataPrivate(KUriFilterDataPrivate *data)
52 {
53 wasModified = data->wasModified;
54 checkForExecs = data->checkForExecs;
55 uriType = data->uriType;
56 searchFilterOptions = data->searchFilterOptions;
57
58 url = data->url;
59 typedString = data->typedString;
60
61 errMsg = data->errMsg;
62 iconName = data->iconName;
63 absPath = data->absPath;
64 args = data->args;
65 searchTerm = data->searchTerm;
66 searchTermSeparator = data->searchTermSeparator;
67 searchProvider = data->searchProvider;
68 alternateDefaultSearchProvider = data->alternateDefaultSearchProvider;
69 alternateSearchProviders = data->alternateSearchProviders;
70 searchProviderMap = data->searchProviderMap;
71 defaultUrlScheme = data->defaultUrlScheme;
72 }
73
74 bool checkForExecs;
75 bool wasModified;
76 KUriFilterData::UriTypes uriType;
77 KUriFilterData::SearchFilterOptions searchFilterOptions;
78
79 QUrl url;
80 QString typedString;
81 QString errMsg;
82 QString iconName;
83 QString absPath;
84 QString args;
85 QString searchTerm;
86 QString searchProvider;
87 QString alternateDefaultSearchProvider;
88 QString defaultUrlScheme;
89 QChar searchTermSeparator;
90
91 QStringList alternateSearchProviders;
92 QStringList searchProviderList;
93 QMap<QString, KUriFilterSearchProvider *> searchProviderMap;
94};
95

source code of kio/src/gui/kurifilterdata_p.h