-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 29 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/gif_slave.cpp | 3 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/jpeg_slave.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/png_slave.cpp | 3 |
5 files changed, 20 insertions, 22 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index b3f0006..ed9fc9c 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -1,145 +1,144 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "iconview.h" | 6 | #include "iconview.h" |
7 | 7 | ||
8 | #include <lib/imagecache.h> | 8 | #include <lib/imagecache.h> |
9 | 9 | ||
10 | #include <iface/dirview.h> | 10 | #include <iface/dirview.h> |
11 | #include <iface/dirlister.h> | 11 | #include <iface/dirlister.h> |
12 | 12 | ||
13 | #include <opie2/oconfig.h> | 13 | #include <opie2/oconfig.h> |
14 | #include <opie2/okeyconfigwidget.h> | 14 | #include <opie2/okeyconfigwidget.h> |
15 | #include <opie2/odebug.h> | ||
15 | 16 | ||
16 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
17 | #include <qpe/qpemessagebox.h> | 18 | #include <qpe/qpemessagebox.h> |
18 | #include <qpe/ir.h> | 19 | #include <qpe/ir.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 20 | #include <qpe/qcopenvelope_qws.h> |
20 | 21 | ||
21 | 22 | ||
22 | #include <qiconview.h> | 23 | #include <qiconview.h> |
23 | #include <qlabel.h> | 24 | #include <qlabel.h> |
24 | #include <qhbox.h> | 25 | #include <qhbox.h> |
25 | #include <qcombobox.h> | 26 | #include <qcombobox.h> |
26 | #include <qdir.h> | 27 | #include <qdir.h> |
27 | #include <qapplication.h> | 28 | #include <qapplication.h> |
28 | #include <qmainwindow.h> | 29 | #include <qmainwindow.h> |
29 | #include <qtimer.h> | 30 | #include <qtimer.h> |
30 | #include <qstyle.h> | 31 | #include <qstyle.h> |
31 | 32 | ||
32 | 33 | ||
33 | using Opie::Ui::OKeyConfigItem; | 34 | using Opie::Ui::OKeyConfigItem; |
34 | 35 | ||
35 | namespace { | 36 | namespace { |
36 | QPixmap* _dirPix = 0; | 37 | QPixmap* _dirPix = 0; |
37 | QPixmap* _unkPix = 0; | 38 | QPixmap* _unkPix = 0; |
38 | class IconViewItem : public QIconViewItem { | 39 | class IconViewItem : public QIconViewItem { |
39 | public: | 40 | public: |
40 | IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false); | 41 | IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false); |
41 | QPixmap* pixmap()const; | 42 | QPixmap* pixmap()const; |
42 | QString path()const { return m_path; } | 43 | QString path()const { return m_path; } |
43 | bool isDir()const { return m_isDir; } | 44 | bool isDir()const { return m_isDir; } |
44 | void setText( const QString& ); | 45 | void setText( const QString& ); |
45 | void reCalc(); | 46 | |
47 | |||
46 | private: | 48 | private: |
47 | mutable QPixmap* m_pix; | 49 | mutable QPixmap* m_pix; |
48 | QString m_path; | 50 | QString m_path; |
49 | bool m_isDir : 1; | 51 | bool m_isDir : 1; |
50 | bool m_noInfo :1; | 52 | bool m_noInfo :1; |
51 | }; | 53 | }; |
52 | 54 | ||
53 | 55 | ||
54 | /* | 56 | /* |
55 | * If we request an Image or String | 57 | * If we request an Image or String |
56 | * we add it to the map | 58 | * we add it to the map |
57 | */ | 59 | */ |
58 | QMap<QString, IconViewItem*> g_stringInf; | 60 | QMap<QString, IconViewItem*> g_stringInf; |
59 | QMap<QString, IconViewItem*> g_stringPix; | 61 | QMap<QString, IconViewItem*> g_stringPix; |
60 | 62 | ||
61 | IconViewItem::IconViewItem( QIconView* view,const QString& path, | 63 | IconViewItem::IconViewItem( QIconView* view,const QString& path, |
62 | const QString& name, bool isDir ) | 64 | const QString& name, bool isDir ) |
63 | : QIconViewItem( view ), m_path( path ), m_isDir( isDir ), | 65 | : QIconViewItem( view ), m_path( path ), m_isDir( isDir ), |
64 | m_noInfo( false ) | 66 | m_noInfo( false ) |
65 | { | 67 | { |
66 | QIconViewItem::setText( name ); | 68 | QIconViewItem::setText( name ); |
67 | if ( isDir && !_dirPix ) | 69 | if ( isDir && !_dirPix ) |
68 | _dirPix = new QPixmap( Resource::loadPixmap("advancedfm/FileBrowser")); | 70 | _dirPix = new QPixmap( Resource::loadPixmap("advancedfm/FileBrowser")); |
69 | else if ( !isDir && !_unkPix ) | 71 | else if ( !isDir && !_unkPix ) |
70 | _unkPix = new QPixmap( Resource::loadPixmap( "UnknownDocument" ) ); | 72 | _unkPix = new QPixmap( Resource::loadPixmap( "UnknownDocument" ) ); |
71 | } | 73 | } |
72 | inline QPixmap* IconViewItem::pixmap()const { | 74 | inline QPixmap* IconViewItem::pixmap()const { |
75 | qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d", | ||
76 | rect().x(),rect().y(),rect().width(),rect().height(), | ||
77 | iconView()->contentsX(), iconView()->contentsY()); | ||
78 | |||
73 | if ( m_isDir ) | 79 | if ( m_isDir ) |
74 | return _dirPix; | 80 | return _dirPix; |
75 | else{ | 81 | else{ |
76 | if (!m_noInfo && !g_stringInf.contains( m_path ) ) { | 82 | if (!m_noInfo && !g_stringInf.contains( m_path ) ) { |
77 | currentView()->dirLister()->imageInfo( m_path ); | 83 | currentView()->dirLister()->imageInfo( m_path ); |
78 | g_stringInf.insert( m_path, const_cast<IconViewItem*>(this)); | 84 | g_stringInf.insert( m_path, const_cast<IconViewItem*>(this)); |
79 | } | 85 | } |
80 | 86 | ||
81 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); | 87 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); |
82 | if ( !m_pix && !g_stringPix.contains( m_path )) { | 88 | if ( !m_pix && !g_stringPix.contains( m_path )) { |
83 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); | 89 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); |
84 | g_stringPix.insert( m_path, const_cast<IconViewItem*>(this)); | 90 | g_stringPix.insert( m_path, const_cast<IconViewItem*>(this)); |
85 | } | 91 | } |
86 | return m_pix ? m_pix : _unkPix; | 92 | return m_pix ? m_pix : _unkPix; |
87 | } | 93 | } |
88 | } | 94 | } |
89 | inline void IconViewItem::setText( const QString& str ) { | 95 | inline void IconViewItem::setText( const QString& str ) { |
90 | QString text = QIconViewItem::text()+"\n"+str; | 96 | QString text = QIconViewItem::text()+"\n"+str; |
91 | m_noInfo = true; | 97 | m_noInfo = true; |
92 | QIconViewItem::setText( text ); | 98 | QIconViewItem::setText( text ); |
93 | reCalc(); | ||
94 | } | ||
95 | |||
96 | inline void IconViewItem::reCalc() | ||
97 | { | ||
98 | calcRect(); | ||
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | 102 | ||
103 | PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | 103 | PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) |
104 | : QVBox( wid ), m_cfg( cfg ) | 104 | : QVBox( wid ), m_cfg( cfg ) |
105 | { | 105 | { |
106 | { | 106 | { |
107 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 107 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
108 | } | 108 | } |
109 | m_path = QDir::homeDirPath(); | 109 | m_path = QDir::homeDirPath(); |
110 | 110 | ||
111 | QHBox *hbox = new QHBox( this ); | 111 | QHBox *hbox = new QHBox( this ); |
112 | QLabel* lbl = new QLabel( hbox ); | 112 | QLabel* lbl = new QLabel( hbox ); |
113 | lbl->setText( tr("View as" ) ); | 113 | lbl->setText( tr("View as" ) ); |
114 | 114 | ||
115 | m_views = new QComboBox( hbox, "View As" ); | 115 | m_views = new QComboBox( hbox, "View As" ); |
116 | connect( m_views, SIGNAL(activated(int)), | 116 | connect( m_views, SIGNAL(activated(int)), |
117 | this, SLOT(slotViewChanged(int)) ); | 117 | this, SLOT(slotViewChanged(int)) ); |
118 | 118 | ||
119 | m_view= new QIconView( this ); | 119 | m_view= new QIconView( this ); |
120 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), | 120 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), |
121 | this, SLOT(slotClicked(QIconViewItem*)) ); | 121 | this, SLOT(slotClicked(QIconViewItem*)) ); |
122 | 122 | ||
123 | m_view->setArrangement( QIconView::LeftToRight ); | 123 | m_view->setArrangement( QIconView::LeftToRight ); |
124 | m_view->setItemTextPos( QIconView::Right ); | 124 | m_view->setItemTextPos( QIconView::Right ); |
125 | m_view->setResizeMode(QIconView::Adjust); | ||
126 | 125 | ||
127 | int dw = QApplication::desktop()->width(); | 126 | int dw = QApplication::desktop()->width(); |
128 | int viewerWidth = dw-style().scrollBarExtent().width(); | 127 | int viewerWidth = dw-style().scrollBarExtent().width(); |
129 | m_view->setGridX( viewerWidth-2*m_view->spacing() ); | 128 | m_view->setGridX( viewerWidth-3*m_view->spacing()); |
130 | m_view->setGridY( fontMetrics().height()*2+40 ); | 129 | m_view->setGridY( fontMetrics().height()*2+40 ); |
131 | 130 | ||
132 | 131 | ||
133 | initKeys(); | 132 | initKeys(); |
134 | 133 | ||
135 | loadViews(); | 134 | loadViews(); |
136 | slotViewChanged( m_views->currentItem() ); | 135 | slotViewChanged( m_views->currentItem() ); |
137 | } | 136 | } |
138 | 137 | ||
139 | PIconView::~PIconView() { | 138 | PIconView::~PIconView() { |
140 | { | 139 | { |
141 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 140 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
142 | } | 141 | } |
143 | m_viewManager->save(); | 142 | m_viewManager->save(); |
144 | delete m_viewManager; | 143 | delete m_viewManager; |
145 | } | 144 | } |
@@ -183,37 +182,37 @@ void PIconView::slotDirUp() { | |||
183 | dir.cdUp(); | 182 | dir.cdUp(); |
184 | slotChangeDir( dir.absPath() ); | 183 | slotChangeDir( dir.absPath() ); |
185 | 184 | ||
186 | } | 185 | } |
187 | 186 | ||
188 | void PIconView::slotChangeDir(const QString& path) { | 187 | void PIconView::slotChangeDir(const QString& path) { |
189 | if ( !currentView() ) | 188 | if ( !currentView() ) |
190 | return; | 189 | return; |
191 | 190 | ||
192 | PDirLister *lister = currentView()->dirLister(); | 191 | PDirLister *lister = currentView()->dirLister(); |
193 | if (!lister ) | 192 | if (!lister ) |
194 | return; | 193 | return; |
195 | 194 | ||
196 | lister->setStartPath( path ); | 195 | lister->setStartPath( path ); |
197 | m_path = lister->currentPath(); | 196 | m_path = lister->currentPath(); |
198 | 197 | ||
199 | m_view->setUpdatesEnabled( false ); | 198 | m_view->viewport()->setUpdatesEnabled( false ); |
200 | m_view->clear(); | 199 | m_view->clear(); |
201 | addFolders( lister->folders() ); | 200 | addFolders( lister->folders() ); |
202 | addFiles( lister->files() ); | 201 | addFiles( lister->files() ); |
203 | m_view->setUpdatesEnabled( true ); | 202 | m_view->viewport()->setUpdatesEnabled( true ); |
204 | 203 | ||
205 | // Also invalidate the cache. We can't cancel the operations anyway | 204 | // Also invalidate the cache. We can't cancel the operations anyway |
206 | g_stringPix.clear(); | 205 | g_stringPix.clear(); |
207 | g_stringInf.clear(); | 206 | g_stringInf.clear(); |
208 | 207 | ||
209 | // looks ugly | 208 | // looks ugly |
210 | static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); | 209 | static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); |
211 | } | 210 | } |
212 | 211 | ||
213 | QString PIconView::currentFileName(bool &isDir)const { | 212 | QString PIconView::currentFileName(bool &isDir)const { |
214 | isDir = false; | 213 | isDir = false; |
215 | QIconViewItem* _it = m_view->currentItem(); | 214 | QIconViewItem* _it = m_view->currentItem(); |
216 | if ( !_it ) | 215 | if ( !_it ) |
217 | return QString::null; | 216 | return QString::null; |
218 | 217 | ||
219 | IconViewItem* it = static_cast<IconViewItem*>( _it ); | 218 | IconViewItem* it = static_cast<IconViewItem*>( _it ); |
@@ -301,78 +300,76 @@ void PIconView::slotClicked(QIconViewItem* _it) { | |||
301 | if(!_it ) | 300 | if(!_it ) |
302 | return; | 301 | return; |
303 | 302 | ||
304 | IconViewItem* it = static_cast<IconViewItem*>(_it); | 303 | IconViewItem* it = static_cast<IconViewItem*>(_it); |
305 | if( it->isDir() ) | 304 | if( it->isDir() ) |
306 | slotChangeDir( it->path() ); | 305 | slotChangeDir( it->path() ); |
307 | else // view image | 306 | else // view image |
308 | ; | 307 | ; |
309 | } | 308 | } |
310 | 309 | ||
311 | void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { | 310 | void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { |
312 | if ( g_stringInf.contains( _path ) ) { | 311 | if ( g_stringInf.contains( _path ) ) { |
313 | IconViewItem* item = g_stringInf[_path]; | 312 | IconViewItem* item = g_stringInf[_path]; |
314 | /* if set the view shows nonsens! | 313 | /* if set the view shows nonsens! |
315 | I dont know how to fix the format of displayed text :(*/ | 314 | I dont know how to fix the format of displayed text :(*/ |
316 | item->setText( str ); | 315 | item->setText( str ); |
317 | item->repaint(); | ||
318 | g_stringInf.remove( _path ); | 316 | g_stringInf.remove( _path ); |
319 | } | 317 | } |
320 | } | 318 | } |
321 | void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) { | 319 | void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) { |
322 | if ( g_stringPix.contains( _path ) ) { | 320 | if ( g_stringPix.contains( _path ) ) { |
323 | IconViewItem* item = g_stringPix[_path]; | 321 | IconViewItem* item = g_stringPix[_path]; |
324 | 322 | ||
325 | if (pix.width()>0) { | 323 | if (pix.width()>0) { |
326 | PPixmapCache::self()->insertImage( _path, pix, 64, 64 ); | 324 | PPixmapCache::self()->insertImage( _path, pix, 64, 64 ); |
327 | /* required for a recalculated rectangle. otherwise the view show nonsense! */ | 325 | /* required for a recalculated rectangle. otherwise the view show nonsense! */ |
328 | item->reCalc(); | ||
329 | } else { | 326 | } else { |
330 | PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 ); | 327 | PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 ); |
331 | } | 328 | } |
332 | item->repaint(); | ||
333 | g_stringPix.remove( _path ); | 329 | g_stringPix.remove( _path ); |
334 | } | 330 | } |
335 | } | 331 | } |
336 | 332 | ||
337 | 333 | ||
338 | void PIconView::slotRename() { | 334 | void PIconView::slotRename() { |
339 | 335 | ||
340 | } | 336 | } |
341 | 337 | ||
342 | void PIconView::slotBeam() { | 338 | void PIconView::slotBeam() { |
343 | bool isDir; | 339 | bool isDir; |
344 | QString pa = currentFileName( isDir ); | 340 | QString pa = currentFileName( isDir ); |
345 | if ( isDir && pa.isEmpty() ) | 341 | if ( isDir && pa.isEmpty() ) |
346 | return; | 342 | return; |
347 | 343 | ||
348 | Ir* ir = new Ir( this ); | 344 | Ir* ir = new Ir( this ); |
349 | connect( ir, SIGNAL(done(Ir*)), | 345 | connect( ir, SIGNAL(done(Ir*)), |
350 | this, SLOT(slotBeamDone(Ir*))); | 346 | this, SLOT(slotBeamDone(Ir*))); |
351 | ir->send(pa, tr( "Image" ) ); | 347 | ir->send(pa, tr( "Image" ) ); |
352 | 348 | ||
353 | } | 349 | } |
354 | 350 | ||
355 | void PIconView::slotBeamDone( Ir* ir) { | 351 | void PIconView::slotBeamDone( Ir* ir) { |
356 | delete ir; | 352 | delete ir; |
357 | } | 353 | } |
358 | 354 | ||
359 | void PIconView::slotStart() { | 355 | void PIconView::slotStart() { |
360 | m_view->setUpdatesEnabled( false ); | 356 | m_view->viewport()->setUpdatesEnabled( false ); |
361 | } | 357 | } |
362 | 358 | ||
363 | void PIconView::slotEnd() { | 359 | void PIconView::slotEnd() { |
364 | m_view->setUpdatesEnabled( true ); | 360 | m_view->arrangeItemsInGrid( ); |
361 | m_view->viewport()->setUpdatesEnabled( true ); | ||
365 | } | 362 | } |
366 | 363 | ||
367 | void PIconView::slotShowImage() { | 364 | void PIconView::slotShowImage() { |
368 | 365 | ||
369 | } | 366 | } |
370 | void PIconView::slotShowImage( const QString& ) { | 367 | void PIconView::slotShowImage( const QString& ) { |
371 | 368 | ||
372 | } | 369 | } |
373 | void PIconView::slotImageInfo() { | 370 | void PIconView::slotImageInfo() { |
374 | 371 | ||
375 | } | 372 | } |
376 | void PIconView::slotImageInfo( const QString& ) { | 373 | void PIconView::slotImageInfo( const QString& ) { |
377 | 374 | ||
378 | } | 375 | } |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 0314659..83ff4f1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -96,33 +96,33 @@ void PMainWindow::slotConfig() { | |||
96 | QDialog dlg(this, 0, true); | 96 | QDialog dlg(this, 0, true); |
97 | dlg.setCaption( tr("Phunk View - Config" ) ); | 97 | dlg.setCaption( tr("Phunk View - Config" ) ); |
98 | 98 | ||
99 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 99 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
100 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); | 100 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
101 | lay->addWidget( wid ); | 101 | lay->addWidget( wid ); |
102 | ViewMap *vM = viewMap(); | 102 | ViewMap *vM = viewMap(); |
103 | ViewMap::Iterator _it = vM->begin(); | 103 | ViewMap::Iterator _it = vM->begin(); |
104 | QMap<PDirView*, QWidget*> lst; | 104 | QMap<PDirView*, QWidget*> lst; |
105 | 105 | ||
106 | for( ; _it != vM->end(); ++_it ) { | 106 | for( ; _it != vM->end(); ++_it ) { |
107 | PDirView *view = (_it.data())(*m_cfg); | 107 | PDirView *view = (_it.data())(*m_cfg); |
108 | PInterfaceInfo *inf = view->interfaceInfo(); | 108 | PInterfaceInfo *inf = view->interfaceInfo(); |
109 | QWidget *_wid = inf->configWidget( *m_cfg ); | 109 | QWidget *_wid = inf->configWidget( *m_cfg ); |
110 | _wid->reparent(wid, QPoint() ); | 110 | _wid->reparent(wid, QPoint() ); |
111 | lst.insert( view, _wid ); | 111 | lst.insert( view, _wid ); |
112 | wid->addTab( _wid, QString::null, inf->name() ); | 112 | wid->addTab( _wid, "fileopen", inf->name() ); |
113 | } | 113 | } |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Add the KeyConfigWidget | 116 | * Add the KeyConfigWidget |
117 | */ | 117 | */ |
118 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 118 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
119 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 119 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
120 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 120 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
121 | keyWid->load(); | 121 | keyWid->load(); |
122 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 122 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
123 | 123 | ||
124 | 124 | ||
125 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 125 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
126 | 126 | ||
127 | QMap<PDirView*, QWidget*>::Iterator it; | 127 | QMap<PDirView*, QWidget*>::Iterator it; |
128 | for ( it = lst.begin(); it != lst.end(); ++it ) { | 128 | for ( it = lst.begin(); it != lst.end(); ++it ) { |
diff --git a/noncore/graphics/opie-eye/slave/gif_slave.cpp b/noncore/graphics/opie-eye/slave/gif_slave.cpp index feb69b6..f0dc86e 100644 --- a/noncore/graphics/opie-eye/slave/gif_slave.cpp +++ b/noncore/graphics/opie-eye/slave/gif_slave.cpp | |||
@@ -273,33 +273,34 @@ FILE * infile; | |||
273 | 273 | ||
274 | GifSlave::GifSlave() | 274 | GifSlave::GifSlave() |
275 | : SlaveInterface(QStringList("gif")) | 275 | : SlaveInterface(QStringList("gif")) |
276 | {} | 276 | {} |
277 | 277 | ||
278 | GifSlave::~GifSlave() { | 278 | GifSlave::~GifSlave() { |
279 | 279 | ||
280 | } | 280 | } |
281 | 281 | ||
282 | QString GifSlave::iconViewName(const QString& str) { | 282 | QString GifSlave::iconViewName(const QString& str) { |
283 | QString st; | 283 | QString st; |
284 | get_gif_info(QFile::encodeName( str ).data(), st ); | 284 | get_gif_info(QFile::encodeName( str ).data(), st ); |
285 | return st; | 285 | return st; |
286 | } | 286 | } |
287 | 287 | ||
288 | QString GifSlave::fullImageInfo( const QString& str) { | 288 | QString GifSlave::fullImageInfo( const QString& str) { |
289 | QString st; | 289 | QString st = "<qt>"; |
290 | get_gif_info(QFile::encodeName( str ).data(), st, true ); | 290 | get_gif_info(QFile::encodeName( str ).data(), st, true ); |
291 | st.append( "</qt>" ); | ||
291 | return st; | 292 | return st; |
292 | } | 293 | } |
293 | 294 | ||
294 | QPixmap GifSlave::pixmap(const QString& path, int width, int height ) { | 295 | QPixmap GifSlave::pixmap(const QString& path, int width, int height ) { |
295 | static QImage img; | 296 | static QImage img; |
296 | img.load( path ); | 297 | img.load( path ); |
297 | if ( img.isNull() ) { | 298 | if ( img.isNull() ) { |
298 | QPixmap pix; | 299 | QPixmap pix; |
299 | return pix; | 300 | return pix; |
300 | } | 301 | } |
301 | 302 | ||
302 | return ThumbNailTool::scaleImage( img, width,height ); | 303 | return ThumbNailTool::scaleImage( img, width,height ); |
303 | } | 304 | } |
304 | 305 | ||
305 | 306 | ||
diff --git a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp index 95055fd..086b47f 100644 --- a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp +++ b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp | |||
@@ -1287,60 +1287,59 @@ static QString exposure_program( int i ) { | |||
1287 | 1287 | ||
1288 | return QObject::tr( "Exposure Program: %1\n" ).arg( exp ); | 1288 | return QObject::tr( "Exposure Program: %1\n" ).arg( exp ); |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | JpegSlave::JpegSlave() | 1291 | JpegSlave::JpegSlave() |
1292 | : SlaveInterface( QStringList::split( " ", "jpeg jpg" ) ) | 1292 | : SlaveInterface( QStringList::split( " ", "jpeg jpg" ) ) |
1293 | {} | 1293 | {} |
1294 | 1294 | ||
1295 | JpegSlave::~JpegSlave() {} | 1295 | JpegSlave::~JpegSlave() {} |
1296 | 1296 | ||
1297 | QString JpegSlave::iconViewName( const QString& path) { | 1297 | QString JpegSlave::iconViewName( const QString& path) { |
1298 | ExifData ImageInfo; | 1298 | ExifData ImageInfo; |
1299 | if ( !ImageInfo.scan( path ) ) | 1299 | if ( !ImageInfo.scan( path ) ) |
1300 | return QString::null; | 1300 | return QString::null; |
1301 | 1301 | ||
1302 | QString tag; | 1302 | QString tag; |
1303 | tag = QObject::tr( "<qt>Comment: %1\n" ).arg( ImageInfo.getComment() ); | 1303 | tag = QObject::tr( "Comment: %1\n" ).arg( ImageInfo.getComment() ); |
1304 | { | 1304 | { |
1305 | // ODP fixme | 1305 | // ODP fixme |
1306 | QString timestring = TimeString::dateString( parseDateTime( ImageInfo.getDateTime() ), FALSE ); | 1306 | QString timestring = TimeString::dateString( parseDateTime( ImageInfo.getDateTime() ), FALSE ); |
1307 | tag += QObject::tr( "Date/Time: %1\n" ).arg( timestring ); | 1307 | tag += QObject::tr( "Date/Time: %1\n" ).arg( timestring ); |
1308 | } | 1308 | } |
1309 | tag += QObject::tr( "Dimensions: %1x%2\n" ).arg(ImageInfo.getWidth()) | 1309 | tag += QObject::tr( "Dimensions: %1x%2\n" ).arg(ImageInfo.getWidth()) |
1310 | .arg(ImageInfo.getHeight() ); | 1310 | .arg(ImageInfo.getHeight() ); |
1311 | 1311 | ||
1312 | tag += color_mode_to_string( ImageInfo.getIsColor() ); | 1312 | tag += color_mode_to_string( ImageInfo.getIsColor() ); |
1313 | 1313 | ||
1314 | tag += compression_to_string( ImageInfo.getCompressionLevel() ); | 1314 | tag += compression_to_string( ImageInfo.getCompressionLevel() ); |
1315 | tag += QObject::tr( "</qt>" ); | ||
1316 | 1315 | ||
1317 | return tag; | 1316 | return tag; |
1318 | } | 1317 | } |
1319 | 1318 | ||
1320 | 1319 | ||
1321 | /* | 1320 | /* |
1322 | * messy messy string creation | 1321 | * messy messy string creation |
1323 | */ | 1322 | */ |
1324 | QString JpegSlave::fullImageInfo( const QString& path) { | 1323 | QString JpegSlave::fullImageInfo( const QString& path) { |
1325 | ExifData ImageInfo; | 1324 | ExifData ImageInfo; |
1326 | if ( !ImageInfo.scan( path ) ) | 1325 | if ( !ImageInfo.scan( path ) ) |
1327 | return QString::null; | 1326 | return QString::null; |
1328 | 1327 | ||
1329 | QString tag, tmp; | 1328 | QString tag, tmp; |
1330 | tag = QObject::tr( "Comment: %1\n" ).arg( ImageInfo.getComment() ); | 1329 | tag = QObject::tr( "<qt>Comment: %1\n" ).arg( ImageInfo.getComment() ); |
1331 | 1330 | ||
1332 | tmp = ImageInfo.getCameraMake(); | 1331 | tmp = ImageInfo.getCameraMake(); |
1333 | if ( tmp.length() ) | 1332 | if ( tmp.length() ) |
1334 | tag += QObject::tr( "Manufacturer: %1\n" ).arg( tmp ); | 1333 | tag += QObject::tr( "Manufacturer: %1\n" ).arg( tmp ); |
1335 | tmp = ImageInfo.getCameraModel(); | 1334 | tmp = ImageInfo.getCameraModel(); |
1336 | if ( tmp.length() ) | 1335 | if ( tmp.length() ) |
1337 | tag += QObject::tr( "Model: %1\n" ).arg( tmp ); | 1336 | tag += QObject::tr( "Model: %1\n" ).arg( tmp ); |
1338 | { | 1337 | { |
1339 | // ODP fixme | 1338 | // ODP fixme |
1340 | tmp = TimeString::dateString( parseDateTime( ImageInfo.getDateTime() ), FALSE ); | 1339 | tmp = TimeString::dateString( parseDateTime( ImageInfo.getDateTime() ), FALSE ); |
1341 | tag += QObject::tr( "Date/Time: %1\n" ).arg( tmp ); | 1340 | tag += QObject::tr( "Date/Time: %1\n" ).arg( tmp ); |
1342 | } | 1341 | } |
1343 | tag += QObject::tr( "Dimensions: %1x%2\n" ).arg(ImageInfo.getWidth()) | 1342 | tag += QObject::tr( "Dimensions: %1x%2\n" ).arg(ImageInfo.getWidth()) |
1344 | .arg(ImageInfo.getHeight() ); | 1343 | .arg(ImageInfo.getHeight() ); |
1345 | 1344 | ||
1346 | tag += color_mode_to_string( ImageInfo.getIsColor() ); | 1345 | tag += color_mode_to_string( ImageInfo.getIsColor() ); |
diff --git a/noncore/graphics/opie-eye/slave/png_slave.cpp b/noncore/graphics/opie-eye/slave/png_slave.cpp index 72b93cc..86e1cdc 100644 --- a/noncore/graphics/opie-eye/slave/png_slave.cpp +++ b/noncore/graphics/opie-eye/slave/png_slave.cpp | |||
@@ -182,29 +182,30 @@ end: | |||
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | PNGSlave::PNGSlave() | 185 | PNGSlave::PNGSlave() |
186 | : SlaveInterface("png") | 186 | : SlaveInterface("png") |
187 | { | 187 | { |
188 | } | 188 | } |
189 | PNGSlave::~PNGSlave() { | 189 | PNGSlave::~PNGSlave() { |
190 | } | 190 | } |
191 | QString PNGSlave::iconViewName( const QString& path) { | 191 | QString PNGSlave::iconViewName( const QString& path) { |
192 | QString str; | 192 | QString str; |
193 | read_comment( path, false, str ); | 193 | read_comment( path, false, str ); |
194 | return str; | 194 | return str; |
195 | } | 195 | } |
196 | 196 | ||
197 | QString PNGSlave::fullImageInfo( const QString& path) { | 197 | QString PNGSlave::fullImageInfo( const QString& path) { |
198 | QString str; | 198 | QString str = "<qt>"; |
199 | read_comment( path, true, str ); | 199 | read_comment( path, true, str ); |
200 | str += "</qt>"; | ||
200 | return str; | 201 | return str; |
201 | } | 202 | } |
202 | 203 | ||
203 | 204 | ||
204 | QPixmap PNGSlave::pixmap( const QString& path, int width, int height) { | 205 | QPixmap PNGSlave::pixmap( const QString& path, int width, int height) { |
205 | QImage img; img.load( path ); | 206 | QImage img; img.load( path ); |
206 | if ( img.isNull() ) | 207 | if ( img.isNull() ) |
207 | return QPixmap(); | 208 | return QPixmap(); |
208 | else | 209 | else |
209 | return ThumbNailTool::scaleImage( img, width,height ); | 210 | return ThumbNailTool::scaleImage( img, width,height ); |
210 | } | 211 | } |