summarylogtreecommitdiffstats
path: root/0002-Use-usr-share-for-resource-files-bin-folder-is-for-b.patch
blob: 4e9894e7d54beaf40d3d172fc5e5d441ceafc0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From 691a7be3dbf7b0685d410a88efd57bfc6ca41ec1 Mon Sep 17 00:00:00 2001
From: Anatol Pomozov <anatol.pomozov@gmail.com>
Date: Fri, 15 May 2015 16:28:42 -0700
Subject: [PATCH 2/4] Use /usr/share for resource files bin folder is for
 binaries.

---
 DSView/CMakeLists.txt       | 30 +++++++++++++++---------------
 DSView/pv/devicemanager.cpp |  5 +++++
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/DSView/CMakeLists.txt b/DSView/CMakeLists.txt
index 652cb58..9c146b8 100644
--- a/DSView/CMakeLists.txt
+++ b/DSView/CMakeLists.txt
@@ -350,21 +350,21 @@ set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "/usr/local/lib")
 
 # Install the executable.
 install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
-install(FILES res/DSLogic.fw DESTINATION bin/res/)
-install(FILES res/DSLogic33.bin DESTINATION bin/res/)
-install(FILES res/DSLogic50.bin DESTINATION bin/res/)
-install(FILES res/DSLogicPro.fw DESTINATION bin/res/)
-install(FILES res/DSLogicPro.bin DESTINATION bin/res/)
-install(FILES res/DSCope.fw DESTINATION bin/res/)
-install(FILES res/DSCope.bin DESTINATION bin/res/)
-install(FILES res/DSLogic0.dsc DESTINATION bin/res/)
-install(FILES res/DSLogic0.def.dsc DESTINATION bin/res/)
-install(FILES res/DSLogic1.dsc DESTINATION bin/res/)
-install(FILES res/DSLogic1.def.dsc DESTINATION bin/res/)
-install(FILES res/DSLogic2.dsc DESTINATION bin/res/)
-install(FILES res/DSLogic2.def.dsc DESTINATION bin/res/)
-install(FILES res/DSCope1.dsc DESTINATION bin/res/)
-install(FILES res/DSCope1.def.dsc DESTINATION bin/res/)
+install(FILES res/DSLogic.fw DESTINATION share/dsview/)
+install(FILES res/DSLogic33.bin DESTINATION share/dsview/)
+install(FILES res/DSLogic50.bin DESTINATION share/dsview/)
+install(FILES res/DSLogicPro.fw DESTINATION share/dsview/)
+install(FILES res/DSLogicPro.bin DESTINATION share/dsview/)
+install(FILES res/DSCope.fw DESTINATION share/dsview/)
+install(FILES res/DSCope.bin DESTINATION share/dsview/)
+install(FILES res/DSLogic0.dsc DESTINATION share/dsview/)
+install(FILES res/DSLogic0.def.dsc DESTINATION share/dsview/)
+install(FILES res/DSLogic1.dsc DESTINATION share/dsview/)
+install(FILES res/DSLogic1.def.dsc DESTINATION share/dsview/)
+install(FILES res/DSLogic2.dsc DESTINATION share/dsview/)
+install(FILES res/DSLogic2.def.dsc DESTINATION share/dsview/)
+install(FILES res/DSCope1.dsc DESTINATION share/dsview/)
+install(FILES res/DSCope1.def.dsc DESTINATION share/dsview/)
 
 #===============================================================================
 #= Packaging (handled by CPack)
diff --git a/DSView/pv/devicemanager.cpp b/DSView/pv/devicemanager.cpp
index a3d6d21..99b49ec 100644
--- a/DSView/pv/devicemanager.cpp
+++ b/DSView/pv/devicemanager.cpp
@@ -103,12 +103,17 @@ std::list<boost::shared_ptr<device::DevInst> > DeviceManager::driver_scan(
 
     // Check If DSL hardware driver
     if (strcmp(driver->name, "demo") != 0) {
+        /*
         QDir dir(QCoreApplication::applicationDirPath());
         if (!dir.cd("res"))
             return driver_devices;
         QString str = dir.absolutePath() + "/";
         QString str_utf8 = QString::fromLocal8Bit(str.toLocal8Bit());
         strcpy(config_path, str_utf8.toUtf8().data());
+        */
+        // dirty
+        // maybe use  QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
+        strcpy(config_path, "/usr/share/dsview/");
     }
 
 	// Do the scan
-- 
2.4.4