summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
index e43baed..f5c711a 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
@@ -42,49 +42,48 @@ Doc_DirLister::Doc_DirLister()
42} 42}
43 43
44QString Doc_DirLister::defaultPath()const { 44QString Doc_DirLister::defaultPath()const {
45 return QString::null; 45 return QString::null;
46} 46}
47 47
48bool Doc_DirLister::matchCat(const AppLnk* app) 48bool Doc_DirLister::matchCat(const AppLnk* app)
49{ 49{
50 if (!app) return false; 50 if (!app) return false;
51 if (m_catFilter==0 || app->categories().contains(m_catFilter) || m_catFilter == -1 && app->categories().count() == 0 ) { 51 if (m_catFilter==0 || app->categories().contains(m_catFilter) || m_catFilter == -1 && app->categories().count() == 0 ) {
52 return true; 52 return true;
53 } 53 }
54 return false; 54 return false;
55} 55}
56 56
57QString Doc_DirLister::setStartPath(const QString&) { 57QString Doc_DirLister::setStartPath(const QString&) {
58 static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png"); 58 static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png");
59 if (m_namemap.isEmpty()) { 59 if (m_namemap.isEmpty()) {
60 if (!m_docreads) { 60 if (!m_docreads) {
61 Global::findDocuments(&m_ds,Mtype_str); 61 Global::findDocuments(&m_ds,Mtype_str);
62 m_docreads = true; 62 m_docreads = true;
63 } 63 }
64 QListIterator<DocLnk> dit(m_ds.children()); 64 QListIterator<DocLnk> dit(m_ds.children());
65 for( ; dit.current(); ++dit) { 65 for( ; dit.current(); ++dit) {
66// if (! (*dit)->isValid()) continue;
67 if (!matchCat((*dit))) continue; 66 if (!matchCat((*dit))) continue;
68 m_namemap[(*dit)->name()]=(*dit)->file(); 67 m_namemap[(*dit)->name()]=(*dit)->file();
69 m_filemap[(*dit)->file()]=(*dit)->name(); 68 m_filemap[(*dit)->file()]=(*dit)->name();
70 } 69 }
71 } 70 }
72 return QString::null; 71 return QString::null;
73} 72}
74 73
75QString Doc_DirLister::currentPath()const { 74QString Doc_DirLister::currentPath()const {
76 return QString::null; 75 return QString::null;
77} 76}
78 77
79 78
80QStringList Doc_DirLister::folders()const { 79QStringList Doc_DirLister::folders()const {
81 return QStringList(); 80 return QStringList();
82} 81}
83 82
84QStringList Doc_DirLister::files()const { 83QStringList Doc_DirLister::files()const {
85 QStringList out; 84 QStringList out;
86 QMap<QString,QString>::ConstIterator it; 85 QMap<QString,QString>::ConstIterator it;
87 for (it = m_namemap.begin();it != m_namemap.end();++it) { 86 for (it = m_namemap.begin();it != m_namemap.end();++it) {
88 out.append(it.key()); 87 out.append(it.key());
89 } 88 }
90 return out; 89 return out;
@@ -161,31 +160,29 @@ QString Doc_DirLister::nameToFname(const QString&name)const
161 return m_namemap[name]; 160 return m_namemap[name];
162} 161}
163 162
164QString Doc_DirLister::dirUp( const QString& p ) const{ 163QString Doc_DirLister::dirUp( const QString& p ) const{
165 return p; 164 return p;
166} 165}
167 166
168QWidget* Doc_DirLister::widget(QWidget*parent) 167QWidget* Doc_DirLister::widget(QWidget*parent)
169{ 168{
170 CategorySelect * catmb = new CategorySelect(parent); 169 CategorySelect * catmb = new CategorySelect(parent);
171 Categories cats( 0 ); 170 Categories cats( 0 );
172 cats.load( categoryFileName() ); 171 cats.load( categoryFileName() );
173 QArray<int> vl( 0 ); 172 QArray<int> vl( 0 );
174 catmb->setCategories( vl, "Document View", // No tr 173 catmb->setCategories( vl, "Document View", // No tr
175 "Document View" ); 174 "Document View" );
176 catmb->setRemoveCategoryEdit( TRUE ); 175 catmb->setRemoveCategoryEdit( TRUE );
177 catmb->setAllCategories( TRUE ); 176 catmb->setAllCategories( TRUE );
178 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); 177 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int)));
179 catmb->setCurrentCategory(-2); 178 catmb->setCurrentCategory(-2);
180 return catmb; 179 return catmb;
181} 180}
182 181
183void Doc_DirLister::showCategory(int which) 182void Doc_DirLister::showCategory(int which)
184{ 183{
185 Categories cat;
186 cat.load( categoryFileName() );
187 m_catFilter = which==-2?0:which; 184 m_catFilter = which==-2?0:which;
188 m_namemap.clear(); 185 m_namemap.clear();
189 setStartPath(""); 186 setStartPath("");
190 emit sig_reloadDir(); 187 emit sig_reloadDir();
191} 188}