Hi all, Attached is a patch to fix bug 221371 (man: and info: syntax no longer working) which is caused by a strengthening of the syntax checks done in RunnerContext in kdelibs/plasma. It used to be that near the end of the chain of checks if a context hadn't been defined that a KUrl would be constructed and made either a network path or a local path.
This was changed a few weeks ago to only assume a path if there was a slash or backslash, but this was done before the network check was made to. This caused the context passed to the location runner to change from a NetworkContext to an UnknownContext which stopped any matches from being emitted (since these URLs don't match the possibilities allowed in LocationRunner for UnknownContext URLs). The attached patch changes the ambiguity test to be performed after the network URL check to restore the old behavior while still not ambiguously assuming local paths. Note that it was always possible to workaround with man:/foo and info:/foo, but the other style is frequently used as examples of "cool things you can do in KDE" and are valid URLs anyways so I'd like that syntax to also work. I'd also like to get this in before 4.4 so I would appreciate a prompt review if possible so I can contact release-team. Thanks! Regards, - Michael Pyne
Index: plasma/runnercontext.cpp =================================================================== --- plasma/runnercontext.cpp (revision 1070191) +++ plasma/runnercontext.cpp (working copy) @@ -188,16 +188,17 @@ // that it has arguments! type = (space > 0) ? RunnerContext::ShellCommand : RunnerContext::Executable; - } else if (path.indexOf('/') == -1 && path.indexOf('\\') == -1 ) { - //if a path doesn't have any slashes is a single word or - //sentence: is too ambiguous to be sure we're in a filesystem context - return; } else { KUrl url(term); QString correctCasePath; + // check if we have a network location first, otherwise assume a path, + // but if a path doesn't have any slashes is a single word or + // sentence: it's too ambiguous to be sure we're in a filesystem context if (!url.protocol().isEmpty() && !url.isLocalFile()) { type = RunnerContext::NetworkLocation; - } else if (correctPathCase(path, correctCasePath)) { + } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) && + correctPathCase(path, correctCasePath)) + { // multiline if, drop opening brace to make scope clear path = correctCasePath; QFileInfo info(path);
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel