Diffstat (limited to 'libopie2/opieui/fileselector') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 30 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.h | 3 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector_p.h | 2 |
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 | |||
156 | return selector()->m_startDir; | 156 | return selector()->m_startDir; |
157 | } | 157 | } |
158 | 158 | ||
159 | bool OFileViewInterface::allItem( const QString& item )const | ||
160 | { | ||
161 | return selector()->m_allList.contains( item ); | ||
162 | } | ||
163 | |||
164 | |||
159 | ODocumentFileView::ODocumentFileView( OFileSelector* selector ) | 165 | ODocumentFileView::ODocumentFileView( OFileSelector* selector ) |
160 | :OFileViewInterface( selector ) | 166 | :OFileViewInterface( selector ) |
161 | { | 167 | { |
@@ -530,14 +536,6 @@ bool OFileViewFileListView::eventFilter (QObject *, QEvent *e) | |||
530 | return false; | 536 | return false; |
531 | } | 537 | } |
532 | 538 | ||
533 | /** | ||
534 | * @return true if the item show all files or directories | ||
535 | */ | ||
536 | bool OFileViewFileListView::allItem( const QString& item )const | ||
537 | { | ||
538 | return m_sel->allItem( item ); | ||
539 | } | ||
540 | |||
541 | void OFileViewFileListView::connectSlots() | 539 | void OFileViewFileListView::connectSlots() |
542 | { | 540 | { |
543 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), | 541 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), |
@@ -825,7 +823,7 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent ) | |||
825 | 823 | ||
826 | void OFileViewFileSystem::activate( const QString& str ) | 824 | void OFileViewFileSystem::activate( const QString& str ) |
827 | { | 825 | { |
828 | m_all = m_view->allItem( str ); | 826 | m_all = allItem( str ); |
829 | } | 827 | } |
830 | 828 | ||
831 | 829 | ||
@@ -875,7 +873,7 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel, | |||
875 | m_mode = mode; | 873 | m_mode = mode; |
876 | m_selector = sel; | 874 | m_selector = sel; |
877 | 875 | ||
878 | m_allList = new QStringList(); | 876 | m_allList = QStringList(); |
879 | 877 | ||
880 | initUI(); | 878 | initUI(); |
881 | m_lneEdit->setText( fileName ); | 879 | m_lneEdit->setText( fileName ); |
@@ -1033,12 +1031,12 @@ void OFileSelector::initViews() | |||
1033 | { | 1031 | { |
1034 | m_views.insert( QObject::tr("Directories"), in ); | 1032 | m_views.insert( QObject::tr("Directories"), in ); |
1035 | m_views.insert( QObject::tr("All Directories"), in ); | 1033 | m_views.insert( QObject::tr("All Directories"), in ); |
1036 | m_allList->append( QObject::tr("All Directories") ); | 1034 | m_allList.append( QObject::tr("All Directories") ); |
1037 | } else { | 1035 | } else { |
1038 | m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) ); | 1036 | m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) ); |
1039 | m_views.insert( QObject::tr("Files"), in ); | 1037 | m_views.insert( QObject::tr("Files"), in ); |
1040 | m_views.insert( QObject::tr("All Files"), in ); | 1038 | m_views.insert( QObject::tr("All Files"), in ); |
1041 | m_allList->append( QObject::tr("All Files") ); | 1039 | m_allList.append( QObject::tr("All Files") ); |
1042 | } | 1040 | } |
1043 | } | 1041 | } |
1044 | 1042 | ||
@@ -1158,14 +1156,6 @@ int OFileSelector::selector()const | |||
1158 | return m_selector; | 1156 | return m_selector; |
1159 | } | 1157 | } |
1160 | 1158 | ||
1161 | /** | ||
1162 | * @return true if the item show all files or directories | ||
1163 | */ | ||
1164 | bool OFileSelector::allItem( const QString& item )const | ||
1165 | { | ||
1166 | return ( m_allList->findIndex( item ) != -1 ); | ||
1167 | } | ||
1168 | |||
1169 | QStringList OFileSelector::currentMimeType()const | 1159 | QStringList OFileSelector::currentMimeType()const |
1170 | { | 1160 | { |
1171 | return m_mimeType[m_cmbMime->currentText()]; | 1161 | 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: | |||
121 | 121 | ||
122 | int mode()const; | 122 | int mode()const; |
123 | int selector()const; | 123 | int selector()const; |
124 | bool allItem( const QString& )const; | ||
125 | 124 | ||
126 | /** | 125 | /** |
127 | * Set the Icon visible | 126 | * Set the Icon visible |
@@ -213,7 +212,7 @@ private: | |||
213 | int m_mode; | 212 | int m_mode; |
214 | int m_selector; | 213 | int m_selector; |
215 | 214 | ||
216 | QStringList* m_allList; | 215 | QStringList m_allList; |
217 | 216 | ||
218 | struct Data; // used for future versions | 217 | struct Data; // used for future versions |
219 | Data *d; | 218 | 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: | |||
75 | virtual QWidget* widget( QWidget* parent) = 0; | 75 | virtual QWidget* widget( QWidget* parent) = 0; |
76 | virtual void activate( const QString& ); | 76 | virtual void activate( const QString& ); |
77 | QString name()const; | 77 | QString name()const; |
78 | bool allItem( const QString& )const; | ||
78 | protected: | 79 | protected: |
79 | OFileSelector* selector()const; | 80 | OFileSelector* selector()const; |
80 | void setName( const QString& ); | 81 | void setName( const QString& ); |
@@ -152,7 +153,6 @@ public: | |||
152 | void reread( bool all = false ); | 153 | void reread( bool all = false ); |
153 | int fileCount()const; | 154 | int fileCount()const; |
154 | QString currentDir()const; | 155 | QString currentDir()const; |
155 | bool allItem( const QString& )const; | ||
156 | protected: | 156 | protected: |
157 | bool eventFilter (QObject *o, QEvent *e); | 157 | bool eventFilter (QObject *o, QEvent *e); |
158 | private slots: | 158 | private slots: |