summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 4ced52d..c07a1e5 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -201,7 +201,6 @@ void PIconView::slotDirUp() {
201 QDir dir( m_path ); 201 QDir dir( m_path );
202 dir.cdUp(); 202 dir.cdUp();
203 slotChangeDir( dir.absPath() ); 203 slotChangeDir( dir.absPath() );
204
205} 204}
206 205
207/* 206/*
@@ -215,11 +214,18 @@ void PIconView::slotChangeDir(const QString& path) {
215 if (!lister ) 214 if (!lister )
216 return; 215 return;
217 216
217 /*
218 * Say what we want and take what we get
219 */
218 lister->setStartPath( path ); 220 lister->setStartPath( path );
219 m_path = lister->currentPath(); 221 m_path = lister->currentPath();
220 222
221 m_view->viewport()->setUpdatesEnabled( false ); 223 m_view->viewport()->setUpdatesEnabled( false );
222 m_view->clear(); 224 m_view->clear();
225
226 /*
227 * add files and folders
228 */
223 addFolders( lister->folders() ); 229 addFolders( lister->folders() );
224 addFiles( lister->files() ); 230 addFiles( lister->files() );
225 m_view->viewport()->setUpdatesEnabled( true ); 231 m_view->viewport()->setUpdatesEnabled( true );
@@ -232,6 +238,10 @@ void PIconView::slotChangeDir(const QString& path) {
232 static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); 238 static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) );
233} 239}
234 240
241/**
242 * get the current file name
243 * @param isDir see if this is a dir or real file
244 */
235QString PIconView::currentFileName(bool &isDir)const { 245QString PIconView::currentFileName(bool &isDir)const {
236 isDir = false; 246 isDir = false;
237 QIconViewItem* _it = m_view->currentItem(); 247 QIconViewItem* _it = m_view->currentItem();
@@ -258,6 +268,10 @@ void PIconView::slotTrash() {
258 currentView()->dirLister()->deleteImage( pa ); 268 currentView()->dirLister()->deleteImage( pa );
259 delete m_view->currentItem(); 269 delete m_view->currentItem();
260} 270}
271
272/*
273 * see what views are available
274 */
261void PIconView::loadViews() { 275void PIconView::loadViews() {
262 ViewMap::Iterator it; 276 ViewMap::Iterator it;
263 ViewMap* map = viewMap(); 277 ViewMap* map = viewMap();
@@ -269,6 +283,9 @@ void PIconView::resetView() {
269 slotViewChanged(m_views->currentItem()); 283 slotViewChanged(m_views->currentItem());
270} 284}
271 285
286/*
287 *swicth view reloadDir and connect signals
288 */
272void PIconView::slotViewChanged( int i) { 289void PIconView::slotViewChanged( int i) {
273 if (!m_views->count() ) { 290 if (!m_views->count() ) {
274 setCurrentView( 0l); 291 setCurrentView( 0l);
@@ -303,6 +320,9 @@ void PIconView::slotReloadDir() {
303} 320}
304 321
305 322
323/*
324 * add files and folders
325 */
306void PIconView::addFolders( const QStringList& lst) { 326void PIconView::addFolders( const QStringList& lst) {
307 QStringList::ConstIterator it; 327 QStringList::ConstIterator it;
308 328
@@ -319,6 +339,9 @@ void PIconView::addFiles( const QStringList& lst) {
319 339
320} 340}
321 341
342/*
343 * user clicked on the item. Change dir or view
344 */
322void PIconView::slotClicked(QIconViewItem* _it) { 345void PIconView::slotClicked(QIconViewItem* _it) {
323 if(!_it ) 346 if(!_it )
324 return; 347 return;
@@ -330,6 +353,10 @@ void PIconView::slotClicked(QIconViewItem* _it) {
330 slotShowImage(); 353 slotShowImage();
331} 354}
332 355
356/*
357 * got thumb info add to the cache if items is visible
358 * we later need update after processing of slave is done
359 */
333void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { 360void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
334 IconViewItem* item = g_stringInf[_path]; 361 IconViewItem* item = g_stringInf[_path];
335 if (!item ) 362 if (!item )
@@ -342,6 +369,10 @@ void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
342 item->setText( str ); 369 item->setText( str );
343 g_stringInf.remove( _path ); 370 g_stringInf.remove( _path );
344} 371}
372
373/*
374 * got thumbnail and see if it is visible so we need to update later
375 */
345void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) { 376void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
346 IconViewItem* item = g_stringPix[_path]; 377 IconViewItem* item = g_stringPix[_path];
347 if (!item ) 378 if (!item )
@@ -359,10 +390,17 @@ void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
359} 390}
360 391
361 392
393/*
394 * FIXME rename
395 */
362void PIconView::slotRename() { 396void PIconView::slotRename() {
363 397
364} 398}
365 399
400
401/*
402 * BEAM the current file
403 */
366void PIconView::slotBeam() { 404void PIconView::slotBeam() {
367 bool isDir; 405 bool isDir;
368 QString pa = currentFileName( isDir ); 406 QString pa = currentFileName( isDir );
@@ -376,6 +414,9 @@ void PIconView::slotBeam() {
376 414
377} 415}
378 416
417/*
418 * BEAM done clean up
419 */
379void PIconView::slotBeamDone( Ir* ir) { 420void PIconView::slotBeamDone( Ir* ir) {
380 delete ir; 421 delete ir;
381} 422}
@@ -393,7 +434,6 @@ void PIconView::slotEnd() {
393 434
394void PIconView::slotShowImage() 435void PIconView::slotShowImage()
395{ 436{
396 qWarning( "SLotShowImage" );
397 bool isDir = false; 437 bool isDir = false;
398 QString name = currentFileName(isDir); 438 QString name = currentFileName(isDir);
399 if (isDir) return; 439 if (isDir) return;
@@ -404,7 +444,6 @@ void PIconView::slotShowImage( const QString& name) {
404 emit sig_display( name ); 444 emit sig_display( name );
405} 445}
406void PIconView::slotImageInfo() { 446void PIconView::slotImageInfo() {
407 qWarning( "SlotImageInfo" );
408 bool isDir = false; 447 bool isDir = false;
409 QString name = currentFileName(isDir); 448 QString name = currentFileName(isDir);
410 if (isDir) return; 449 if (isDir) return;