summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp30
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h3
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h2
3 files changed, 12 insertions, 23 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index e8d502f..01a51a2 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -157,4 +157,10 @@ QString OFileViewInterface::startDirectory()const
}
+bool OFileViewInterface::allItem( const QString& item )const
+{
+ return selector()->m_allList.contains( item );
+}
+
+
ODocumentFileView::ODocumentFileView( OFileSelector* selector )
:OFileViewInterface( selector )
@@ -531,12 +537,4 @@ bool OFileViewFileListView::eventFilter (QObject *, QEvent *e)
}
-/**
- * @return true if the item show all files or directories
- */
-bool OFileViewFileListView::allItem( const QString& item )const
-{
- return m_sel->allItem( item );
-}
-
void OFileViewFileListView::connectSlots()
{
@@ -826,5 +824,5 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent )
void OFileViewFileSystem::activate( const QString& str )
{
- m_all = m_view->allItem( str );
+ m_all = allItem( str );
}
@@ -876,5 +874,5 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel,
m_selector = sel;
- m_allList = new QStringList();
+ m_allList = QStringList();
initUI();
@@ -1034,10 +1032,10 @@ void OFileSelector::initViews()
m_views.insert( QObject::tr("Directories"), in );
m_views.insert( QObject::tr("All Directories"), in );
- m_allList->append( QObject::tr("All Directories") );
+ m_allList.append( QObject::tr("All Directories") );
} else {
m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) );
m_views.insert( QObject::tr("Files"), in );
m_views.insert( QObject::tr("All Files"), in );
- m_allList->append( QObject::tr("All Files") );
+ m_allList.append( QObject::tr("All Files") );
}
}
@@ -1159,12 +1157,4 @@ int OFileSelector::selector()const
}
-/**
- * @return true if the item show all files or directories
- */
-bool OFileSelector::allItem( const QString& item )const
-{
- return ( m_allList->findIndex( item ) != -1 );
-}
-
QStringList OFileSelector::currentMimeType()const
{
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h
index d96712a..d166afd 100644
--- a/libopie2/opieui/fileselector/ofileselector.h
+++ b/libopie2/opieui/fileselector/ofileselector.h
@@ -122,5 +122,4 @@ public:
int mode()const;
int selector()const;
- bool allItem( const QString& )const;
/**
@@ -214,5 +213,5 @@ private:
int m_selector;
- QStringList* m_allList;
+ QStringList m_allList;
struct Data; // used for future versions
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h
index 252a7f5..790d2bd 100644
--- a/libopie2/opieui/fileselector/ofileselector_p.h
+++ b/libopie2/opieui/fileselector/ofileselector_p.h
@@ -76,4 +76,5 @@ public:
virtual void activate( const QString& );
QString name()const;
+ bool allItem( const QString& )const;
protected:
OFileSelector* selector()const;
@@ -153,5 +154,4 @@ public:
int fileCount()const;
QString currentDir()const;
- bool allItem( const QString& )const;
protected:
bool eventFilter (QObject *o, QEvent *e);