From dce885739546f45b12ec137f52420f8262902a99 Mon Sep 17 00:00:00 2001 From: andreas <andreas@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Thu, 22 Jul 2010 18:26:58 +0000 Subject: [PATCH] fixed initialization of FileBrowser member variables git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2586 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/gui/src/file_browser.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/gui/src/file_browser.cc b/modules/gui/src/file_browser.cc index 6fe849e13..3510e95e5 100644 --- a/modules/gui/src/file_browser.cc +++ b/modules/gui/src/file_browser.cc @@ -55,7 +55,11 @@ namespace ost { namespace gui { FileBrowser::FileBrowser(QWidget* parent): - Widget(NULL, parent) + Widget(NULL, parent), + menu_(new QComboBox(this)), + model_(new QDirModel), + view_(new QListView(this)), + action_list_() { QString path=QDir::currentPath(); QDir dir(QCoreApplication::applicationDirPath()); @@ -90,23 +94,24 @@ FileBrowser::FileBrowser(QWidget* parent): } FileBrowser::FileBrowser(const QString& path, QWidget* parent): - Widget(NULL, parent) + Widget(NULL, parent), + menu_(new QComboBox(this)), + model_(new QDirModel), + view_(new QListView(this)), + action_list_() { this->Init(path); } void FileBrowser::Init(const QString& path) { - model_=new QDirModel; model_->setSorting(QDir::Name|QDir::DirsFirst|QDir::IgnoreCase); - view_=new QListView(this); view_->setModel(model_); view_->setRootIndex(model_->index(path)); view_->setAttribute(Qt::WA_MacShowFocusRect, false); view_->setContextMenuPolicy(Qt::CustomContextMenu); connect(view_,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ShowContextMenu(const QPoint&))); - menu_= new QComboBox(this); UpdateMenu(path); QVBoxLayout* l=new QVBoxLayout(this); -- GitLab