summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogexportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-12-11 11:00:41 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-12-11 20:26:22 +0100
commit256ae870a678999cdceb1a3740a4a4eb69b4fe27 (patch)
treed9744dbc184d83abef31d22be1a33faaab3eb95d /desktop-widgets/divelogexportdialog.cpp
parentae26875a61f38ad3be9d87d0ff8953d3f807c09a (diff)
downloadsubsurface-256ae870a678999cdceb1a3740a4a4eb69b4fe27.tar.gz
Write profile images to correct directory in TeX export
Before, we did not look at the path of the filename to export to but we should write the images there and not in pwd. Fixes #931 Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/divelogexportdialog.cpp')
-rw-r--r--desktop-widgets/divelogexportdialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp
index 96417c1bc..cb1745483 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -237,6 +237,7 @@ void DiveLogExportDialog::export_depths(const char *filename, const bool selecte
void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_only)
{
FILE *f;
+ QDir texdir = QFileInfo(filename).dir();
struct dive *dive;
struct units *units = get_units();
const char *unit;
@@ -281,13 +282,12 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o
if (selected_only && !dive->selected)
continue;
- QString filename = "profile%1.png";
ProfileWidget2 *profile = MainWindow::instance()->graphics();
profile->plotDive(dive, true);
profile->setToolTipVisibile(false);
QPixmap pix = QPixmap::grabWidget(profile);
profile->setToolTipVisibile(true);
- pix.save(filename.arg(dive->number));
+ pix.save(texdir.filePath(QString("profile%1.png").arg(dive->number)));
struct tm tm;