Changeset View
Changeset View
Standalone View
Standalone View
plugins/searchbar/opensearch/OpenSearchEngine.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 76 | { | |||
---|---|---|---|---|---|
77 | return m_searchUrlTemplate; | 77 | return m_searchUrlTemplate; | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | void OpenSearchEngine::setSearchUrlTemplate(const QString &searchUrlTemplate) | 80 | void OpenSearchEngine::setSearchUrlTemplate(const QString &searchUrlTemplate) | ||
81 | { | 81 | { | ||
82 | m_searchUrlTemplate = searchUrlTemplate; | 82 | m_searchUrlTemplate = searchUrlTemplate; | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | KUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const | 85 | QUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const | ||
86 | { | 86 | { | ||
87 | if (m_searchUrlTemplate.isEmpty()) { | 87 | if (m_searchUrlTemplate.isEmpty()) { | ||
88 | return KUrl(); | 88 | return QUrl(); | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | KUrl retVal = KUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8()); | 91 | QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8()); | ||
92 | 92 | | |||
93 | QList<Parameter>::const_iterator end = m_searchParameters.constEnd(); | 93 | QList<Parameter>::const_iterator end = m_searchParameters.constEnd(); | ||
94 | QList<Parameter>::const_iterator i = m_searchParameters.constBegin(); | 94 | QList<Parameter>::const_iterator i = m_searchParameters.constBegin(); | ||
95 | for (; i != end; ++i) { | 95 | for (; i != end; ++i) { | ||
96 | retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); | 96 | retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | return retVal; | 99 | return retVal; | ||
Show All 9 Lines | 108 | { | |||
109 | return m_suggestionsUrlTemplate; | 109 | return m_suggestionsUrlTemplate; | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | void OpenSearchEngine::setSuggestionsUrlTemplate(const QString &suggestionsUrlTemplate) | 112 | void OpenSearchEngine::setSuggestionsUrlTemplate(const QString &suggestionsUrlTemplate) | ||
113 | { | 113 | { | ||
114 | m_suggestionsUrlTemplate = suggestionsUrlTemplate; | 114 | m_suggestionsUrlTemplate = suggestionsUrlTemplate; | ||
115 | } | 115 | } | ||
116 | 116 | | |||
117 | KUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const | 117 | QUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const | ||
118 | { | 118 | { | ||
119 | if (m_suggestionsUrlTemplate.isEmpty()) { | 119 | if (m_suggestionsUrlTemplate.isEmpty()) { | ||
120 | return KUrl(); | 120 | return QUrl(); | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | KUrl retVal = KUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8()); | 123 | QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8()); | ||
124 | 124 | | |||
125 | QList<Parameter>::const_iterator end = m_suggestionsParameters.constEnd(); | 125 | QList<Parameter>::const_iterator end = m_suggestionsParameters.constEnd(); | ||
126 | QList<Parameter>::const_iterator i = m_suggestionsParameters.constBegin(); | 126 | QList<Parameter>::const_iterator i = m_suggestionsParameters.constBegin(); | ||
127 | for (; i != end; ++i) { | 127 | for (; i != end; ++i) { | ||
128 | retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); | 128 | retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); | ||
129 | } | 129 | } | ||
130 | 130 | | |||
131 | return retVal; | 131 | return retVal; | ||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |