-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/impl/doc/doc_lister.cpp | 40 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/impl/doc/doc_lister.h | 1 |
4 files changed, 28 insertions, 20 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 087db30..77597d2 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -236,13 +236,15 @@ void PIconView::initKeys() { | |||
236 | } | 236 | } |
237 | 237 | ||
238 | 238 | ||
239 | /* | 239 | /* |
240 | * change one dir up | 240 | * change one dir up |
241 | */ | 241 | */ |
242 | void PIconView::slotDirUp() { | 242 | void PIconView::slotDirUp() |
243 | { | ||
244 | if (m_path.isEmpty()) return; | ||
243 | QDir dir( m_path ); | 245 | QDir dir( m_path ); |
244 | dir.cdUp(); | 246 | dir.cdUp(); |
245 | slotChangeDir( dir.absPath() ); | 247 | slotChangeDir( dir.absPath() ); |
246 | } | 248 | } |
247 | 249 | ||
248 | /* | 250 | /* |
@@ -577,12 +579,14 @@ void PIconView::slotImageInfo( const QString& name) { | |||
577 | 579 | ||
578 | void PIconView::slotChangeMode( int mode ) { | 580 | void PIconView::slotChangeMode( int mode ) { |
579 | if ( mode >= 1 && mode <= 3 ) | 581 | if ( mode >= 1 && mode <= 3 ) |
580 | m_mode = mode; | 582 | m_mode = mode; |
581 | 583 | ||
582 | m_cfg->writeEntry("ListViewMode", m_mode); | 584 | m_cfg->writeEntry("ListViewMode", m_mode); |
585 | /* performance! */ | ||
586 | m_view->clear(); | ||
583 | calculateGrid(); | 587 | calculateGrid(); |
584 | slotReloadDir(); | 588 | slotReloadDir(); |
585 | } | 589 | } |
586 | 590 | ||
587 | 591 | ||
588 | void PIconView::resizeEvent( QResizeEvent* re ) { | 592 | void PIconView::resizeEvent( QResizeEvent* re ) { |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 058fca0..ec6b051 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -221,12 +221,13 @@ void PMainWindow::slotConfig() { | |||
221 | QMap<PDirView*, QWidget*> lst; | 221 | QMap<PDirView*, QWidget*> lst; |
222 | 222 | ||
223 | for( ; _it != vM->end(); ++_it ) { | 223 | for( ; _it != vM->end(); ++_it ) { |
224 | PDirView *view = (_it.data())(*m_cfg); | 224 | PDirView *view = (_it.data())(*m_cfg); |
225 | PInterfaceInfo *inf = view->interfaceInfo(); | 225 | PInterfaceInfo *inf = view->interfaceInfo(); |
226 | QWidget *_wid = inf->configWidget( *m_cfg ); | 226 | QWidget *_wid = inf->configWidget( *m_cfg ); |
227 | if (!_wid) continue; | ||
227 | _wid->reparent(wid, QPoint() ); | 228 | _wid->reparent(wid, QPoint() ); |
228 | lst.insert( view, _wid ); | 229 | lst.insert( view, _wid ); |
229 | wid->addTab( _wid, "fileopen", inf->name() ); | 230 | wid->addTab( _wid, "fileopen", inf->name() ); |
230 | } | 231 | } |
231 | 232 | ||
232 | /* | 233 | /* |
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp index f695a76..73b2863 100644 --- a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp +++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp | |||
@@ -28,50 +28,55 @@ Doc_DirLister::Doc_DirLister() | |||
28 | this, SLOT(slotThumbInfo(const QString&, const QString&)) ); | 28 | this, SLOT(slotThumbInfo(const QString&, const QString&)) ); |
29 | connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)), | 29 | connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)), |
30 | this, SLOT(slotFullInfo(const QString&, const QString&)) ); | 30 | this, SLOT(slotFullInfo(const QString&, const QString&)) ); |
31 | connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)), | 31 | connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)), |
32 | this, SLOT(slotThumbNail(const QString&, const QPixmap&)) ); | 32 | this, SLOT(slotThumbNail(const QString&, const QPixmap&)) ); |
33 | 33 | ||
34 | m_namemap.clear(); | ||
35 | m_filemap.clear(); | ||
34 | } | 36 | } |
35 | 37 | ||
36 | QString Doc_DirLister::defaultPath()const { | 38 | QString Doc_DirLister::defaultPath()const { |
37 | return ""; QPEApplication::documentDir(); | 39 | return ""; QPEApplication::documentDir(); |
38 | } | 40 | } |
39 | 41 | ||
40 | QString Doc_DirLister::setStartPath( const QString& path ) { | 42 | QString Doc_DirLister::setStartPath(const QString&) { |
41 | m_namemap.clear(); | ||
42 | m_out.clear(); | ||
43 | static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png"); | 43 | static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png"); |
44 | owarn << "Set start path" << oendl; | 44 | if (m_namemap.isEmpty()) { |
45 | DocLnkSet ds; | 45 | DocLnkSet ds; |
46 | Global::findDocuments(&ds,Mtype_str); | 46 | Global::findDocuments(&ds,Mtype_str); |
47 | QListIterator<DocLnk> dit(ds.children()); | 47 | QListIterator<DocLnk> dit(ds.children()); |
48 | for( ; dit.current(); ++dit) { | 48 | for( ; dit.current(); ++dit) { |
49 | owarn << (*dit)->file() << oendl; | 49 | owarn << (*dit)->file() << oendl; |
50 | m_namemap[(*dit)->name()]=(*dit)->file(); | 50 | m_namemap[(*dit)->name()]=(*dit)->file(); |
51 | m_filemap[(*dit)->file()]=(*dit)->name(); | 51 | m_filemap[(*dit)->file()]=(*dit)->name(); |
52 | m_out.append((*dit)->name()); | 52 | } |
53 | } | 53 | } |
54 | owarn << "Set start path end" << oendl; | 54 | return QString::null; |
55 | return ""; | ||
56 | } | 55 | } |
57 | 56 | ||
58 | QString Doc_DirLister::currentPath()const { | 57 | QString Doc_DirLister::currentPath()const { |
59 | return ""; | 58 | return QString::null; |
60 | } | 59 | } |
61 | 60 | ||
62 | 61 | ||
63 | QStringList Doc_DirLister::folders()const { | 62 | QStringList Doc_DirLister::folders()const { |
64 | return QStringList(); | 63 | return QStringList(); |
65 | } | 64 | } |
66 | 65 | ||
67 | QStringList Doc_DirLister::files()const { | 66 | QStringList Doc_DirLister::files()const { |
68 | return m_out; | 67 | QStringList out; |
68 | QMap<QString,QString>::ConstIterator it; | ||
69 | for (it = m_namemap.begin();it != m_namemap.end();++it) { | ||
70 | out.append(it.key()); | ||
71 | } | ||
72 | return out; | ||
69 | } | 73 | } |
70 | 74 | ||
71 | void Doc_DirLister::deleteImage( const QString& ) { | 75 | void Doc_DirLister::deleteImage( const QString& ) |
76 | { | ||
72 | } | 77 | } |
73 | 78 | ||
74 | void Doc_DirLister::thumbNail( const QString& str, int w, int h) { | 79 | void Doc_DirLister::thumbNail( const QString& str, int w, int h) { |
75 | if (m_namemap.find(str)==m_namemap.end()) { | 80 | if (m_namemap.find(str)==m_namemap.end()) { |
76 | owarn << "Item " << str << " not found" << oendl; | 81 | owarn << "Item " << str << " not found" << oendl; |
77 | return; | 82 | return; |
@@ -92,13 +97,12 @@ QImage Doc_DirLister::image( const QString& str, Factor f, int m) { | |||
92 | void Doc_DirLister::imageInfo( const QString& str) { | 97 | void Doc_DirLister::imageInfo( const QString& str) { |
93 | if (m_namemap.find(str)==m_namemap.end()) { | 98 | if (m_namemap.find(str)==m_namemap.end()) { |
94 | owarn << "Item " << str << " not found" << oendl; | 99 | owarn << "Item " << str << " not found" << oendl; |
95 | return; | 100 | return; |
96 | } | 101 | } |
97 | QString fname = m_namemap[str]; | 102 | QString fname = m_namemap[str]; |
98 | owarn << "Image info: " << fname << oendl; | ||
99 | SlaveMaster::self()->thumbInfo( fname ); | 103 | SlaveMaster::self()->thumbInfo( fname ); |
100 | } | 104 | } |
101 | 105 | ||
102 | void Doc_DirLister::fullImageInfo( const QString& str) { | 106 | void Doc_DirLister::fullImageInfo( const QString& str) { |
103 | if (m_namemap.find(str)==m_namemap.end()) { | 107 | if (m_namemap.find(str)==m_namemap.end()) { |
104 | owarn << "Item " << str << " not found" << oendl; | 108 | owarn << "Item " << str << " not found" << oendl; |
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.h b/noncore/graphics/opie-eye/impl/doc/doc_lister.h index d89b579..a65b616 100644 --- a/noncore/graphics/opie-eye/impl/doc/doc_lister.h +++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.h | |||
@@ -29,13 +29,12 @@ public: | |||
29 | void imageInfo( const QString& ); | 29 | void imageInfo( const QString& ); |
30 | void fullImageInfo( const QString& ); | 30 | void fullImageInfo( const QString& ); |
31 | virtual QString nameToFname(const QString&name)const; | 31 | virtual QString nameToFname(const QString&name)const; |
32 | 32 | ||
33 | private: | 33 | private: |
34 | QMap<QString,QString> m_namemap,m_filemap; | 34 | QMap<QString,QString> m_namemap,m_filemap; |
35 | QStringList m_out; | ||
36 | protected slots: | 35 | protected slots: |
37 | virtual void slotFullInfo(const QString&, const QString&); | 36 | virtual void slotFullInfo(const QString&, const QString&); |
38 | virtual void slotThumbInfo(const QString&, const QString&); | 37 | virtual void slotThumbInfo(const QString&, const QString&); |
39 | virtual void slotThumbNail(const QString&, const QPixmap&); | 38 | virtual void slotThumbNail(const QString&, const QPixmap&); |
40 | }; | 39 | }; |
41 | 40 | ||