From 04303f0eb2c3b4242b10ea8ac604c2557b9bb433 Mon Sep 17 00:00:00 2001
From: andreas <andreas@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Tue, 29 Jun 2010 18:08:06 +0000
Subject: [PATCH] bugfix for file_browser in the mac specific section

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2476 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/gui/src/file_browser.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/src/file_browser.cc b/modules/gui/src/file_browser.cc
index b1bce39a2..c922d07c8 100644
--- a/modules/gui/src/file_browser.cc
+++ b/modules/gui/src/file_browser.cc
@@ -60,8 +60,8 @@ FileBrowser::FileBrowser(QWidget* parent):
  Widget(NULL, parent)
 {
   QString path=QDir::currentPath();
+  QDir dir(QCoreApplication::applicationDirPath());
 # if defined(_MSC_VER)
-    QDir dir(QCoreApplication::applicationDirPath());
     dir.cdUp();
     dir.cdUp();
     path=dir.path();
@@ -72,11 +72,15 @@ FileBrowser::FileBrowser(QWidget* parent):
 # elif defined(__APPLE__)
   if (path.contains("DNG.app") || path=="/") {
     QString example_path="/Applications/OpenStructure/Examples/";
-    dir.cdUp();
-    QString example_path=dir.path()+"/examples";
     if (QDir(example_path).exists()) {
       path=example_path;
-    }    
+    }    else{
+      dir.cdUp();
+      example_path=dir.path()+"/examples";
+      if (QDir(example_path).exists()) {
+        path=example_path;
+      }
+    }
   }
 #endif
   this->Init(path);
-- 
GitLab