File labtool_firmware_path.patch of Package labtool

From c3ee5abb2118f1259cc423adbe4a50a1dbbe6033 Mon Sep 17 00:00:00 2001
From: Scott Tsai <scottt.tw@gmail.com>
Date: Sun, 14 Sep 2014 06:01:17 +0800
Subject: [PATCH 2/3] LabToolDeviceCommThread: allow launching LabTool from
 ./app/LabTool

This makes the path handling in LabToolDeviceCommThread::prepareDfuImage() more consistant with ::runDFU() and allow launching LabTool from "./app/LabTool", i.e. one directory level up.
---
 app/device/labtool/labtooldevicecommthread.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/device/labtool/labtooldevicecommthread.cpp b/app/device/labtool/labtooldevicecommthread.cpp
index ee2b019..0f0eca8 100644
--- a/app/device/labtool/labtooldevicecommthread.cpp
+++ b/app/device/labtool/labtooldevicecommthread.cpp
@@ -139,14 +139,17 @@ void LabToolDeviceCommThread::reconnectToTarget()
 void LabToolDeviceCommThread::prepareDfuImage()
 {
 #ifndef Q_OS_MACX
-    QString fName = "../fw/firmware.bin";
+    QString fName = "fw/firmware.bin";
 #else
     QString appPath = QCoreApplication::applicationDirPath();
     QString fName = appPath + "/../Resources/firmware.bin";
 #endif
 
     if (!QFile::exists(fName)) {
-        fName = "firmware.bin";
+        fName = "../" + fName;
+        if (!QFile::exists(fName)) {
+            fName = "firmware.bin";
+        }
     }
 
     QFile fIn(fName);
-- 
2.1.4

openSUSE Build Service is sponsored by