blob: 114a2cad55f5972c880923fd819bd67811112a21 [file] [log] [blame]
From ebbc071ed53eef7778f5b526763c128ab7b34c6b Mon Sep 17 00:00:00 2001
From: Jeremy Drake <github@jdrake.com>
Date: Wed, 2 Dec 2020 23:07:02 -0800
Subject: [PATCH 3/3] Look in ../share/fritzing from bin dir on mingw.
This seems to be the best option for finding the prefix.
---
src/utils/folderutils.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/utils/folderutils.cpp b/src/utils/folderutils.cpp
index 5914924b..a6d97603 100644
--- a/src/utils/folderutils.cpp
+++ b/src/utils/folderutils.cpp
@@ -212,7 +212,7 @@ const QString FolderUtils::libraryPath()
const QString FolderUtils::applicationDirPath() {
if (m_appPath.isEmpty()) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(__MINGW32__)
m_appPath = QCoreApplication::applicationDirPath();
#else
// look in standard Fritzing location (applicationDirPath and parent folders) then in standard linux locations
@@ -224,6 +224,9 @@ const QString FolderUtils::applicationDirPath() {
#ifdef Q_OS_MAC
candidates.append(dir.absolutePath() + "/Resources");
+#endif
+#ifdef __MINGW32__
+ candidates.append(QDir::cleanPath(dir.absolutePath() + "/share/fritzing"));
#endif
candidates.append(dir.absolutePath());
if (dir.cdUp()) {
--
2.31.1.windows.1