<div dir="ltr">Hi everyone :)<div><br></div><div>I was thinking about implementing my idea <a href="https://forum.kde.org/viewtopic.php?f=83&t=126352">https://forum.kde.org/viewtopic.php?f=83&t=126352</a> .</div><div>While digging sources i've understand that my idea was incorrect, and there is nothing to do with kio_magnet.</div><div><br></div><div>My second thought was to store any additional info in mimeinfo while detecting it from url, but after more digging i came to mime subclasses.</div><div>In fact, i understand that x-scheme-handler is very simple in the way how it determines, but i've tried to add subclass for it ad it works like for any other mime-types.</div><div><br></div><div>The only problem is: KRun dosn't looking into mime-database when working with x-scheme-handlers. So i came here with the following proposition.</div><div><br></div><div>Extend schemeHandler function of KRun.</div><div>1) we are looking for all mime-types that statrs with x-scheme-handler and has base handler in a parentMimeTypes. </div><div>2)If we found such mime-type - check url against <span style="color:rgb(0,0,0)">globPatterns of found mime-type.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><font color="#000000">3) So, if we found subclassed mime-type for our url - try to find preferred service for it. if no preferred service was found - looking for preferred service for our base mime-type (as it was done before)</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">So, it will be something like this: <a href="http://pastebin.com/Wgni5iBP">http://pastebin.com/Wgni5iBP</a></font></div><div><font color="#000000">I'm not a c++ coder, so this isn't most optimized solution, but it shows the idea.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div>Next step:</div><div>Just ship xml with magnet url subclass with ktorrent:</div><div><a href="http://pastebin.com/4crCJRLZ">http://pastebin.com/4crCJRLZ</a><br></div><div><br></div><div>And add x-scheme-handler/x-magnet-btih to ktorrent.desktop MimeType list.</div><div><br></div><div>Doing similar with other magnet handlers (like dcpp) will allow us to separate magnet handling by appropriate application.</div><div><br></div><div><br></div><div>So, what do u think? Is this idea wrong? Any other ideas?</div>
</div>