Changeset View
Changeset View
Standalone View
Standalone View
src/runnercontext.cpp
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Line(s) | 199 | } else { | |||
---|---|---|---|---|---|
202 | // anything else. We do not want that. | 202 | // anything else. We do not want that. | ||
203 | if (url.scheme() == QLatin1String("http")) { | 203 | if (url.scheme() == QLatin1String("http")) { | ||
204 | if (!term.startsWith(QLatin1String("http"))) { | 204 | if (!term.startsWith(QLatin1String("http"))) { | ||
205 | url.setScheme(QString()); | 205 | url.setScheme(QString()); | ||
206 | } | 206 | } | ||
207 | } | 207 | } | ||
208 | const bool hasProtocol = !url.scheme().isEmpty(); | 208 | const bool hasProtocol = !url.scheme().isEmpty(); | ||
209 | const bool isLocalProtocol = hasProtocol && KProtocolInfo::protocolClass(url.scheme()) == QLatin1String(":local"); | 209 | const bool isLocalProtocol = hasProtocol && KProtocolInfo::protocolClass(url.scheme()) == QLatin1String(":local"); | ||
210 | if (hasProtocol && | 210 | if ((hasProtocol && | ||
211 | ((!isLocalProtocol && !url.host().isEmpty()) || | 211 | ((!isLocalProtocol && !url.host().isEmpty()) || | ||
212 | (isLocalProtocol && url.scheme() != QLatin1String("file")))) { | 212 | (isLocalProtocol && url.scheme() != QLatin1String("file")))) | ||
213 | || term.startsWith(QLatin1String("\\\\"))) { | ||||
213 | // we either have a network protocol with a host, so we can show matches for it | 214 | // we either have a network protocol with a host, so we can show matches for it | ||
214 | // or we have a non-file url that may be local so a host isn't required | 215 | // or we have a non-file url that may be local so a host isn't required | ||
216 | // or we have an UNC path (\\foo\bar) | ||||
215 | type = RunnerContext::NetworkLocation; | 217 | type = RunnerContext::NetworkLocation; | ||
216 | } else if (isLocalProtocol) { | 218 | } else if (isLocalProtocol) { | ||
217 | // at this point in the game, we assume we have a path, | 219 | // at this point in the game, we assume we have a path, | ||
218 | // but if a path doesn't have any slashes | 220 | // but if a path doesn't have any slashes | ||
219 | // it's too ambiguous to be sure we're in a filesystem context | 221 | // it's too ambiguous to be sure we're in a filesystem context | ||
220 | path = QDir::cleanPath(url.toLocalFile()); | 222 | path = QDir::cleanPath(url.toLocalFile()); | ||
221 | //qCDebug(KRUNNER)<< "slash check" << path; | 223 | //qCDebug(KRUNNER)<< "slash check" << path; | ||
222 | if (hasProtocol || ((path.indexOf(QLatin1Char('/')) != -1 || path.indexOf(QLatin1Char('\\')) != -1))) { | 224 | if (hasProtocol || ((path.indexOf(QLatin1Char('/')) != -1 || path.indexOf(QLatin1Char('\\')) != -1))) { | ||
▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines |