Hi there !<div><br></div><div>I faced a bug with imagePathFromUrl (some websnaps doesn't get printed in my speed dial) so I checked it out and I found a the quick'n'dirty imagePathFromUrl() method, which removes some chars in order to make them suitable as filenames. I also saw the comment about "do something better, learn regular expressions".</div>
<div>I don't believe we need someone knowing regular expression to do that (I can do regular expressions but we don't really need those in that case and with QString). So here is what I came up with, it's easy, not as clean as it could be, but it should do the trick :</div>
<div><br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
QStringList toReplace, replacers;</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<br></blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
toReplace << "%" << "/" << "&" << "," << "+" << "$" << ":" << ";" << "=" << "?" << "@" << "#" << "\\" << "|";</blockquote>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
replacers << "%25" << "%2F" << "%26" << "%2C" << "%2B" << "%24" << "%3A" << "%3B" << "%3D" << "%3F" << "%40" << "%23" << "%5C" << "%7C";</blockquote>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
while (!(toReplace.empty()) && !(replacers.empty()))</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
name.replace(toReplace.takeFirst(), replacers.takeFirst());</blockquote></blockquote><div><div><br></div><div>I joined a diff file to the mail.</div><div>Hope I've been helpfull : I have some issues with kdelibs4-dev so I can't test it right now, but I believe this should compile and work out-of-the-box.</div>
<div><br></div><div>+++++++++++++++++</div><div> <span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; ">Michaël Martín Moro</span></div><div> Epitech 2013</div><div>+++++++++++++++++</div>
</div>