summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index 5528aed..b06defd 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -59,15 +59,17 @@
using namespace Opie::Ui::Internal;
namespace Opie {
namespace Ui {
namespace Internal {
-OFileViewInterface::OFileViewInterface( OFileSelector* selector )
- : m_selector( selector )
-{}
+OFileViewInterface::OFileViewInterface( OFileSelector* _selector )
+ : m_selector( _selector )
+{
+ selector()->registerView( this );
+}
OFileViewInterface::~OFileViewInterface()
{}
QString OFileViewInterface::name()const
{
@@ -508,13 +510,13 @@ QString OFileViewFileListView::currentDir()const
OFileSelector* OFileViewFileListView::selector()
{
return m_sel;
}
-bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e)
+bool OFileViewFileListView::eventFilter (QObject *, QEvent *e)
{
if ( e->type() == QEvent::KeyPress )
{
QKeyEvent *k = (QKeyEvent *)e;
if ( (k->key()==Key_Enter) || (k->key()==Key_Return))
{
@@ -944,13 +946,13 @@ void OFileSelector::initUI()
}
/*
* This will make sure that the return key in the name edit causes dialogs to close
*/
-bool OFileSelector::eventFilter (QObject *o, QEvent *e)
+bool OFileSelector::eventFilter (QObject *, QEvent *e)
{
if ( e->type() == QEvent::KeyPress )
{
QKeyEvent *k = (QKeyEvent *)e;
if ( (k->key()==Key_Enter) || (k->key()==Key_Return))
{
@@ -995,17 +997,24 @@ void OFileSelector::initViews()
/* see above why add both */
OFileViewInterface* in = new OFileViewFileSystem( this );
m_views.insert( QObject::tr("Files"), in );
m_views.insert( QObject::tr("All Files"), in );
}
+void OFileSelector::registerView( const Internal::OFileViewInterface* iface ) {
+ m_viewsPtr.append( iface );
+}
+
+
/**
* d'tor
*/
OFileSelector::~OFileSelector()
{
+ m_viewsPtr.setAutoDelete( true );
+ m_viewsPtr.clear();
}
/**
* Convience function for the fileselector