-rw-r--r-- | library/fileselector.cpp | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/library/fileselector.cpp b/library/fileselector.cpp index 365f383..013f43a 100644 --- a/library/fileselector.cpp +++ b/library/fileselector.cpp | |||
@@ -19,3 +19,9 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
21 | // WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT | ||
22 | // have this class. | ||
23 | #define QTOPIA_INTERNAL_FSLP | ||
24 | |||
20 | #include "fileselector.h" | 25 | #include "fileselector.h" |
26 | #include "fileselector_p.h" | ||
21 | #include "global.h" | 27 | #include "global.h" |
@@ -58,2 +64,3 @@ public: | |||
58 | CategoryMenu *cm; | 64 | CategoryMenu *cm; |
65 | bool m_noItems:1; | ||
59 | }; | 66 | }; |
@@ -65,2 +72,3 @@ FileSelectorView::FileSelectorView( const QString &f, QWidget *parent, const cha | |||
65 | d->cm = 0; | 72 | d->cm = 0; |
73 | d->m_noItems = false; | ||
66 | setAllColumnsShowFocus( TRUE ); | 74 | setAllColumnsShowFocus( TRUE ); |
@@ -82,6 +90,9 @@ void FileSelectorView::reread() | |||
82 | { | 90 | { |
83 | FileSelectorItem *item = (FileSelectorItem *)selectedItem(); | ||
84 | QString oldFile; | 91 | QString oldFile; |
85 | if ( item ) | 92 | FileSelectorItem *item; |
86 | oldFile = item->file().file(); | 93 | if( !d->m_noItems ) { // there are items |
94 | item = (FileSelectorItem *)selectedItem(); | ||
95 | if ( item ) | ||
96 | oldFile = item->file().file(); | ||
97 | } | ||
87 | clear(); | 98 | clear(); |
@@ -90,2 +101,8 @@ void FileSelectorView::reread() | |||
90 | count = files.children().count(); | 101 | count = files.children().count(); |
102 | if(count == 0 ){ // No Documents | ||
103 | d->m_noItems = true; | ||
104 | QListViewItem *it = new QListViewItem(this, tr("There are no files in this directory." ), "empty" ); | ||
105 | it->setSelectable(FALSE ); | ||
106 | return; | ||
107 | } | ||
91 | QListIterator<DocLnk> dit( files.children() ); | 108 | QListIterator<DocLnk> dit( files.children() ); |
@@ -239,2 +256,5 @@ void FileSelector::fileClicked( int button, QListViewItem *i, const QPoint &, in | |||
239 | return; | 256 | return; |
257 | if(i->text(1) == QString::fromLatin1("empty" ) ) | ||
258 | return; | ||
259 | |||
240 | if ( button == Qt::LeftButton ) { | 260 | if ( button == Qt::LeftButton ) { |
@@ -248,2 +268,5 @@ void FileSelector::filePressed( int button, QListViewItem *i, const QPoint &, in | |||
248 | return; | 268 | return; |
269 | if(i->text(1) == QString::fromLatin1("empty" ) ) | ||
270 | return; | ||
271 | |||
249 | if ( button == Qt::RightButton ) { | 272 | if ( button == Qt::RightButton ) { |
@@ -323,13 +346,2 @@ void FileSelector::setCloseVisible( bool b ) | |||
323 | /*! | 346 | /*! |
324 | Sets whether a categories menu is visible, according to \a b. | ||
325 | */ | ||
326 | void FileSelector::setCategoriesVisible( bool b ) | ||
327 | { | ||
328 | if ( b ) | ||
329 | d->mb->show(); | ||
330 | else | ||
331 | d->mb->hide(); | ||
332 | } | ||
333 | |||
334 | /*! | ||
335 | Rereads the list of files. | 347 | Rereads the list of files. |
@@ -340 +352,2 @@ void FileSelector::reread() | |||
340 | } | 352 | } |
353 | |||