update to 0.9.3b OBS-URL: https://build.opensuse.org/request/show/454646 OBS-URL: https://build.opensuse.org/package/show/Education/fritzing?expand=0&rev=49
37 lines
1.6 KiB
Diff
37 lines
1.6 KiB
Diff
From a31df40b54435500a9806f8f1aa90a98131cb788 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Zimmermann <bugs@vdm-design.de>
|
|
Date: Sat, 4 Feb 2017 10:05:05 +0100
|
|
Subject: [PATCH] folderutils.cpp: Fix getAppPartsSubFolder2 returns current
|
|
working directory if fritzing-parts folder is not found
|
|
|
|
getApplicationSubFolder returns QDir() if the directory can not be found,
|
|
but QDir() returns the current working directory, which nearly always exists and probably is the wrong path.
|
|
As getAppPartsSubFolder2 only checks for existence of that directory we end up with the wrong directory if parts folder is used instead for fritzing-parts.
|
|
Therefore check if when we ask for fritzing-parts folder we really get a folder with that name.
|
|
---
|
|
src/utils/folderutils.cpp | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/utils/folderutils.cpp b/src/utils/folderutils.cpp
|
|
index 96f10c7..3dfd966 100644
|
|
--- a/src/utils/folderutils.cpp
|
|
+++ b/src/utils/folderutils.cpp
|
|
@@ -121,12 +121,12 @@ QDir FolderUtils::getAppPartsSubFolder(QString search) {
|
|
QDir FolderUtils::getAppPartsSubFolder2(QString search) {
|
|
if (m_partsPath.isEmpty()) {
|
|
QDir dir = getApplicationSubFolder("fritzing-parts");
|
|
- if (dir.exists()) {
|
|
+ if (dir.exists() && dir.dirName().endsWith("fritzing-parts")) {
|
|
m_partsPath = dir.absolutePath();
|
|
}
|
|
else {
|
|
QDir dir = getApplicationSubFolder("parts");
|
|
- if (dir.exists()) {
|
|
+ if (dir.exists() && dir.dirName().endsWith("parts")) {
|
|
m_partsPath = dir.absolutePath();
|
|
}
|
|
}
|
|
--
|
|
2.10.2
|
|
|