mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Export the XSLT based exports in a new thread.
The XSLT based exports can consume long time while applying the xml format. This time can make the GUI unresponsive. Simply call the export functions in a new Thread. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b01f14efab
commit
ad60ca84ee
2 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QtConcurrent>
|
||||||
|
|
||||||
#include "divelogexportdialog.h"
|
#include "divelogexportdialog.h"
|
||||||
#include "diveshareexportdialog.h"
|
#include "diveshareexportdialog.h"
|
||||||
|
@ -310,7 +311,7 @@ void DiveLogExportDialog::on_buttonBox_accepted()
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
// the non XSLT exports are called directly above, the XSLT based ons are called here
|
// the non XSLT exports are called directly above, the XSLT based ons are called here
|
||||||
if (!stylesheet.isEmpty())
|
if (!stylesheet.isEmpty())
|
||||||
export_dives_xslt(filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8());
|
future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QFuture>
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "statistics.h"
|
#include "statistics.h"
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ slots:
|
||||||
void on_exportGroup_buttonClicked(QAbstractButton *);
|
void on_exportGroup_buttonClicked(QAbstractButton *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QFuture<int> future;
|
||||||
Ui::DiveLogExportDialog *ui;
|
Ui::DiveLogExportDialog *ui;
|
||||||
void showExplanation();
|
void showExplanation();
|
||||||
void exportHtmlInit(const QString &filename);
|
void exportHtmlInit(const QString &filename);
|
||||||
|
|
Loading…
Add table
Reference in a new issue