Skip to content

Commit

Permalink
Correct some fractal url
Browse files Browse the repository at this point in the history
  • Loading branch information
kanurag94 committed Aug 16, 2020
1 parent 4ccb96b commit 4d1d515
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,19 @@ static void ui_download(struct uih_context */*uih*/)

static void ui_fractalinfo(struct uih_context *uih)
{
printf("%s", uih->fcontext->currentformula->shortname);
QString fractalname = uih->fcontext->currentformula->shortname;
bool higherpower = false;
for (auto c : fractalname) {
if(c >= '0' and c <= '9') {
fractalname.remove(c);
higherpower = true;
}
}
QMap<QString, QString> map;

// Dictionary of fractaltype and corresponding wiki hypertext link
map["mandel"] = "mandelbrot";
map["mandel"] = higherpower ? "higher-power-mandelbrots" : "mandelbrot";
map["octal"] = "octo";
fractalname = map.find(fractalname) != map.end() ? map[fractalname] : fractalname;

QDesktopServices::openUrl(QUrl(FRACTALINFO_URL + fractalname));
Expand Down

0 comments on commit 4d1d515

Please sign in to comment.