From 2d5a8335275fa9c8863b5c6655790ab46701eebc Mon Sep 17 00:00:00 2001 From: stefan <stefan@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Mon, 5 Jul 2010 09:21:43 +0000 Subject: [PATCH] FileBrowser, default directory for Linux => examples git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2512 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/gui/src/file_browser.cc | 9 ++++++--- modules/gui/src/file_browser.hh | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/gui/src/file_browser.cc b/modules/gui/src/file_browser.cc index c922d07c8..6fe849e13 100644 --- a/modules/gui/src/file_browser.cc +++ b/modules/gui/src/file_browser.cc @@ -16,14 +16,12 @@ // along with this library; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA //------------------------------------------------------------------------------ +#include <QCoreApplication> #include <QCursor> #include <QVBoxLayout> #include <QDesktopServices> #include <QDir> -#include <QHeaderView> #include <QFileInfo> -#include <QMessageBox> -#include <QApplication> #include <QUrl> #include <ost/platform.hh> @@ -82,6 +80,11 @@ FileBrowser::FileBrowser(QWidget* parent): } } } +# else + QString example_path=path+"/share/openstructure/examples/"; + if (QDir(example_path).exists()) { + path=example_path; + } #endif this->Init(path); } diff --git a/modules/gui/src/file_browser.hh b/modules/gui/src/file_browser.hh index a4f9f263b..fadaf69a9 100644 --- a/modules/gui/src/file_browser.hh +++ b/modules/gui/src/file_browser.hh @@ -55,6 +55,7 @@ private slots: void LoadCurrentObject(); void LoadWithSystemEditor(); void LoadWithSourceViewer(); + private: void LoadObject(const QModelIndex& index); void UpdateMenu(const QString& path); -- GitLab