author | mickeyl <mickeyl> | 2004-07-18 15:07:08 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-07-18 15:07:08 (UTC) |
commit | 63c1d7b2cb5abfcfa518363caf9e9c24dbb906dc (patch) (unidiff) | |
tree | ed9c37e249a132229f5f90500478189c0fa69d1e | |
parent | 35625ac739a9e070ceff4714328a91bb00b1f8a9 (diff) | |
download | opie-63c1d7b2cb5abfcfa518363caf9e9c24dbb906dc.zip opie-63c1d7b2cb5abfcfa518363caf9e9c24dbb906dc.tar.gz opie-63c1d7b2cb5abfcfa518363caf9e9c24dbb906dc.tar.bz2 |
no need to warn here. debug seems enough
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 1f6ca05..5528aed 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -502,125 +502,125 @@ int OFileViewFileListView::fileCount()const | |||
502 | } | 502 | } |
503 | 503 | ||
504 | QString OFileViewFileListView::currentDir()const | 504 | QString OFileViewFileListView::currentDir()const |
505 | { | 505 | { |
506 | return m_currentDir; | 506 | return m_currentDir; |
507 | } | 507 | } |
508 | 508 | ||
509 | OFileSelector* OFileViewFileListView::selector() | 509 | OFileSelector* OFileViewFileListView::selector() |
510 | { | 510 | { |
511 | return m_sel; | 511 | return m_sel; |
512 | } | 512 | } |
513 | 513 | ||
514 | bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) | 514 | bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) |
515 | { | 515 | { |
516 | if ( e->type() == QEvent::KeyPress ) | 516 | if ( e->type() == QEvent::KeyPress ) |
517 | { | 517 | { |
518 | QKeyEvent *k = (QKeyEvent *)e; | 518 | QKeyEvent *k = (QKeyEvent *)e; |
519 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) | 519 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) |
520 | { | 520 | { |
521 | slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); | 521 | slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); |
522 | return true; | 522 | return true; |
523 | } | 523 | } |
524 | } | 524 | } |
525 | return false; | 525 | return false; |
526 | } | 526 | } |
527 | 527 | ||
528 | void OFileViewFileListView::connectSlots() | 528 | void OFileViewFileListView::connectSlots() |
529 | { | 529 | { |
530 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), | 530 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), |
531 | this, SLOT(slotCurrentChanged(QListViewItem*) ) ); | 531 | this, SLOT(slotCurrentChanged(QListViewItem*) ) ); |
532 | connect(m_view, SIGNAL(mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ), | 532 | connect(m_view, SIGNAL(mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ), |
533 | this, SLOT(slotClicked(int,QListViewItem*,const QPoint&,int) ) ); | 533 | this, SLOT(slotClicked(int,QListViewItem*,const QPoint&,int) ) ); |
534 | } | 534 | } |
535 | 535 | ||
536 | void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) | 536 | void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) |
537 | { | 537 | { |
538 | if (!item) | 538 | if (!item) |
539 | return; | 539 | return; |
540 | #if 0 | 540 | #if 0 |
541 | 541 | ||
542 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); | 542 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); |
543 | 543 | ||
544 | if (!sel->isDir() ) | 544 | if (!sel->isDir() ) |
545 | { | 545 | { |
546 | selector()->m_lneEdit->setText( sel->text(1) ); | 546 | selector()->m_lneEdit->setText( sel->text(1) ); |
547 | // if in fileselector mode we will emit selected | 547 | // if in fileselector mode we will emit selected |
548 | if ( selector()->mode() == OFileSelector::FileSelector ) | 548 | if ( selector()->mode() == OFileSelector::FileSelector ) |
549 | { | 549 | { |
550 | owarn << "slot Current Changed" << oendl; | 550 | odebug << "slot Current Changed" << oendl; |
551 | QStringList str = QStringList::split("->", sel->text(1) ); | 551 | QStringList str = QStringList::split("->", sel->text(1) ); |
552 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); | 552 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); |
553 | emit selector()->fileSelected( path ); | 553 | emit selector()->fileSelected( path ); |
554 | DocLnk lnk( path ); | 554 | DocLnk lnk( path ); |
555 | emit selector()->fileSelected( lnk ); | 555 | emit selector()->fileSelected( lnk ); |
556 | } | 556 | } |
557 | } | 557 | } |
558 | #endif | 558 | #endif |
559 | } | 559 | } |
560 | 560 | ||
561 | void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) | 561 | void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) |
562 | { | 562 | { |
563 | if (!item || ( button != Qt::LeftButton) ) | 563 | if (!item || ( button != Qt::LeftButton) ) |
564 | return; | 564 | return; |
565 | 565 | ||
566 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); | 566 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); |
567 | if (!sel->isLocked() ) | 567 | if (!sel->isLocked() ) |
568 | { | 568 | { |
569 | QStringList str = QStringList::split("->", sel->text(1) ); | 569 | QStringList str = QStringList::split("->", sel->text(1) ); |
570 | if (sel->isDir() ) | 570 | if (sel->isDir() ) |
571 | { | 571 | { |
572 | m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); | 572 | m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); |
573 | emit selector()->dirSelected( m_currentDir ); | 573 | emit selector()->dirSelected( m_currentDir ); |
574 | reread( m_all ); | 574 | reread( m_all ); |
575 | } | 575 | } |
576 | else | 576 | else |
577 | { // file | 577 | { // file |
578 | owarn << "slot Clicked" << oendl; | 578 | odebug << "slot Clicked" << oendl; |
579 | selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); | 579 | selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); |
580 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); | 580 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); |
581 | emit selector()->fileSelected( path ); | 581 | emit selector()->fileSelected( path ); |
582 | DocLnk lnk( path ); | 582 | DocLnk lnk( path ); |
583 | emit selector()->fileSelected( lnk ); | 583 | emit selector()->fileSelected( lnk ); |
584 | } | 584 | } |
585 | } // not locked | 585 | } // not locked |
586 | } | 586 | } |
587 | 587 | ||
588 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) | 588 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) |
589 | { | 589 | { |
590 | MimeType type( info->absFilePath() ); | 590 | MimeType type( info->absFilePath() ); |
591 | if (!compliesMime( type.id() ) ) | 591 | if (!compliesMime( type.id() ) ) |
592 | return; | 592 | return; |
593 | 593 | ||
594 | QPixmap pix = type.pixmap(); | 594 | QPixmap pix = type.pixmap(); |
595 | QString dir, name; bool locked; | 595 | QString dir, name; bool locked; |
596 | if ( pix.isNull() ) | 596 | if ( pix.isNull() ) |
597 | { | 597 | { |
598 | QWMatrix matrix; | 598 | QWMatrix matrix; |
599 | QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); | 599 | QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); |
600 | matrix.scale( .4, .4 ); | 600 | matrix.scale( .4, .4 ); |
601 | pix = pixer.xForm( matrix ); | 601 | pix = pixer.xForm( matrix ); |
602 | } | 602 | } |
603 | dir = info->dirPath( true ); | 603 | dir = info->dirPath( true ); |
604 | locked = false; | 604 | locked = false; |
605 | if ( symlink ) | 605 | if ( symlink ) |
606 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); | 606 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); |
607 | else | 607 | else |
608 | { | 608 | { |
609 | name = info->fileName(); | 609 | name = info->fileName(); |
610 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || | 610 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || |
611 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) | 611 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) |
612 | { | 612 | { |
613 | locked = true; pix = Resource::loadPixmap("locked"); | 613 | locked = true; pix = Resource::loadPixmap("locked"); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | (void)new OFileSelectorItem( m_view, pix, name, | 616 | (void)new OFileSelectorItem( m_view, pix, name, |
617 | info->lastModified().toString(), QString::number( info->size() ), | 617 | info->lastModified().toString(), QString::number( info->size() ), |
618 | dir, locked ); | 618 | dir, locked ); |
619 | } | 619 | } |
620 | 620 | ||
621 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) | 621 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) |
622 | { | 622 | { |
623 | bool locked = false; QString name; QPixmap pix; | 623 | bool locked = false; QString name; QPixmap pix; |
624 | 624 | ||
625 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || | 625 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || |
626 | ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) | 626 | ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) |