HTML export progress

Tomaz Canabrava tcanabrava at kde.org
Tue Jun 3 09:33:42 PDT 2014


On Tue, Jun 3, 2014 at 1:23 PM, Gehad Elrobey <gehadelrobey at gmail.com> wrote:
> Thanks tomaz I will fix this.
>
> Also I am not sure if this will work on other platforms.
>
> +    QDir dir(filename);
> +   if (!dir.exists()) {
> +        QDir::home().mkpath(filename);
> +    }
>
> I think QDir::home() in windows is c:/ which may be false as a root
> directory for the chosen folder.
> I don't know if this .

it works, QDir::home() is correctly mapped to c:\Users\username or the
old file structure. but it works.

> On 06/03/2014 06:31 PM, Tomaz Canabrava wrote:
>
> On Tue, Jun 3, 2014 at 11:51 AM, Miika Turkia <miika.turkia at gmail.com>
> wrote:
>
> A quick questions to people familiar with Qt. Will the following work on all
> our supported platforms? I suspect that export_HTML will not be able to open
> the file given as parameter (with fopen), but how about QFile functions, do
> they take care of the Windows directory separator by themselves?
>
> +       QString json_dive_data = filename + QDir::separator() + "file.json";
> +       QString json_settings = filename + QDir::separator() +
> "settings.json";
>
> +
> +       exportHTMLsettings(json_settings);
> +       export_HTML(json_dive_data.toUtf8().data(),
> ui->exportSelectedDives->isChecked());
> +
> +       QString searchPath = getSubsurfaceDataPath("theme");
> +
> +       if (searchPath == "") {
> +               return;
> +       }
> +
> +       QFile *tmpFile;
> +
>
> +       tmpFile = new QFile(searchPath + QDir::separator() +
> "dive_export.html");
> +       tmpFile->copy(filename + QDir::separator() + "dive_export.html");
>
> +       delete tmpFile;
>
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
> --
> Regards,
> Gehad Elrobey


More information about the subsurface mailing list