On Sun, Aug 3, 2014 at 3:35 AM, Richard DePas <richard.de...@gmail.com>
wrote:
>
>
> Tried an export to divelogs.de. I do have a login for this although I do
> not believe I have ever exported form Subsurface. When trying the operation
> I received an error at the bottom stating "cannot create temporary file.
> Access is denied." Does this mean access to divelogs.de?
>

I guess this error occurs on your Windows machine before the attempt to
upload the log. If my assumption is correct, it is due to QFile::encodeName
not converting / to \ on Windows (thus attempting to write to root or
\windows directory with no access rights). If so, the attached patch should
fix this.

miika
From 142f04b97b05cd05017a6aa5a8c8df7052fed555 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.tur...@gmail.com>
Date: Sun, 3 Aug 2014 10:11:20 +0300
Subject: [PATCH] Try to fix divelogs upload on Windows

We use zip_open with parameter QFile::encodeName(tempfile). I am just
guessing that this does not handle the / as directory separator properly
and use the native QDir::separator() instead. This will hopefully fix
the divelogs.de upload on Windows.

Signed-off-by: Miika Turkia <miika.tur...@gmail.com>
---
 qt-ui/subsurfacewebservices.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 565dc3f..5f30308 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -607,7 +607,7 @@ void DivelogsDeWebServices::downloadDives()
 void DivelogsDeWebServices::prepareDivesForUpload(bool selected)
 {
 	/* generate a random filename and create/open that file with zip_open */
-	QString filename = QDir::tempPath() + "/import-" + QString::number(qrand() % 99999999) + ".dld";
+	QString filename = QDir::tempPath() + QDir::separator() + "import-" + QString::number(qrand() % 99999999) + ".dld";
 	if (prepare_dives_for_divelogs(filename, selected)) {
 		QFile f(filename);
 		if (f.open(QIODevice::ReadOnly)) {
-- 
1.9.1

_______________________________________________
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to