summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -156,6 +156,12 @@ QString OFileViewInterface::startDirectory()const
return selector()->m_startDir;
}
+bool OFileViewInterface::allItem( const QString& item )const
+{
+ return selector()->m_allList.contains( item );
+}
+
+
ODocumentFileView::ODocumentFileView( OFileSelector* selector )
:OFileViewInterface( selector )
{
@@ -530,14 +536,6 @@ bool OFileViewFileListView::eventFilter (QObject *, QEvent *e)
return false;
}
-/**
- * @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()
{
connect(m_view, SIGNAL(clicked(QListViewItem*) ),
@@ -825,7 +823,7 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent )
void OFileViewFileSystem::activate( const QString& str )
{
- m_all = m_view->allItem( str );
+ m_all = allItem( str );
}
@@ -875,7 +873,7 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel,
m_mode = mode;
m_selector = sel;
- m_allList = new QStringList();
+ m_allList = QStringList();
initUI();
m_lneEdit->setText( fileName );
@@ -1033,12 +1031,12 @@ 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") );
}
}
@@ -1158,14 +1156,6 @@ int OFileSelector::selector()const
return m_selector;
}
-/**
- * @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
{
return m_mimeType[m_cmbMime->currentText()];
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
@@ -121,7 +121,6 @@ public:
int mode()const;
int selector()const;
- bool allItem( const QString& )const;
/**
* Set the Icon visible
@@ -213,7 +212,7 @@ private:
int m_mode;
int m_selector;
- QStringList* m_allList;
+ QStringList m_allList;
struct Data; // used for future versions
Data *d;
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
@@ -75,6 +75,7 @@ public:
virtual QWidget* widget( QWidget* parent) = 0;
virtual void activate( const QString& );
QString name()const;
+ bool allItem( const QString& )const;
protected:
OFileSelector* selector()const;
void setName( const QString& );
@@ -152,7 +153,6 @@ public:
void reread( bool all = false );
int fileCount()const;
QString currentDir()const;
- bool allItem( const QString& )const;
protected:
bool eventFilter (QObject *o, QEvent *e);
private slots: