From 691a7be3dbf7b0685d410a88efd57bfc6ca41ec1 Mon Sep 17 00:00:00 2001 From: Anatol Pomozov 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 > 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