-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 0b88a35..7ca3fff 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -561,97 +561,97 @@ bool OpieFtp::remoteDirList(const QString &dir) | |||
561 | tmp+="._temp"; | 561 | tmp+="._temp"; |
562 | // qDebug("Listing remote dir "+tmp); | 562 | // qDebug("Listing remote dir "+tmp); |
563 | // QCopEnvelope ( "QPE/System", "busy()" ); | 563 | // QCopEnvelope ( "QPE/System", "busy()" ); |
564 | if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) { | 564 | if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) { |
565 | QString msg; | 565 | QString msg; |
566 | msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) ); | 566 | msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) ); |
567 | msg.replace(QRegExp(":"),"\n"); | 567 | msg.replace(QRegExp(":"),"\n"); |
568 | QMessageBox::message(tr("Note"),msg); | 568 | QMessageBox::message(tr("Note"),msg); |
569 | return false; | 569 | return false; |
570 | } | 570 | } |
571 | populateRemoteView() ; | 571 | populateRemoteView() ; |
572 | // QCopEnvelope ( "QPE/System", "notBusy()" ); | 572 | // QCopEnvelope ( "QPE/System", "notBusy()" ); |
573 | return true; | 573 | return true; |
574 | } | 574 | } |
575 | 575 | ||
576 | bool OpieFtp::remoteChDir(const QString &dir) | 576 | bool OpieFtp::remoteChDir(const QString &dir) |
577 | { | 577 | { |
578 | // QCopEnvelope ( "QPE/System", "busy()" ); | 578 | // QCopEnvelope ( "QPE/System", "busy()" ); |
579 | if (!FtpChdir( dir.latin1(), conn )) { | 579 | if (!FtpChdir( dir.latin1(), conn )) { |
580 | QString msg; | 580 | QString msg; |
581 | msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); | 581 | msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); |
582 | msg.replace(QRegExp(":"),"\n"); | 582 | msg.replace(QRegExp(":"),"\n"); |
583 | QMessageBox::message(tr("Note"),msg); | 583 | QMessageBox::message(tr("Note"),msg); |
584 | // qDebug(msg); | 584 | // qDebug(msg); |
585 | // QCopEnvelope ( "QPE/System", "notBusy()" ); | 585 | // QCopEnvelope ( "QPE/System", "notBusy()" ); |
586 | return FALSE; | 586 | return FALSE; |
587 | } | 587 | } |
588 | // QCopEnvelope ( "QPE/System", "notBusy()" ); | 588 | // QCopEnvelope ( "QPE/System", "notBusy()" ); |
589 | return TRUE; | 589 | return TRUE; |
590 | } | 590 | } |
591 | 591 | ||
592 | void OpieFtp::populateLocalView() | 592 | void OpieFtp::populateLocalView() |
593 | { | 593 | { |
594 | Local_View->clear(); | 594 | Local_View->clear(); |
595 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 595 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
596 | currentDir.setMatchAllDirs(TRUE); | 596 | currentDir.setMatchAllDirs(TRUE); |
597 | currentDir.setNameFilter(filterStr); | 597 | currentDir.setNameFilter(filterStr); |
598 | QString fileL, fileS, fileDate; | 598 | QString fileL, fileS, fileDate; |
599 | bool isDir=FALSE; | 599 | bool isDir=FALSE; |
600 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 600 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
601 | QFileInfoListIterator it(*list); | 601 | QFileInfoListIterator it(*list); |
602 | QFileInfo *fi; | 602 | QFileInfo *fi; |
603 | while ( (fi=it.current()) ) { | 603 | while ( (fi=it.current()) ) { |
604 | if (fi->isSymLink() ){ | 604 | if (fi->isSymLink() ){ |
605 | QString symLink=fi->readLink(); | 605 | QString symLink=fi->readLink(); |
606 | // qDebug("Symlink detected "+symLink); | 606 | // qDebug("Symlink detected "+symLink); |
607 | QFileInfo sym( symLink); | 607 | QFileInfo sym( symLink); |
608 | fileS.sprintf( "%10li", sym.size() ); | 608 | fileS.sprintf( "%10li", sym.size() ); |
609 | fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); | 609 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); |
610 | fileDate = sym.lastModified().toString(); | 610 | fileDate = sym.lastModified().toString(); |
611 | } else { | 611 | } else { |
612 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); | 612 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); |
613 | fileS.sprintf( "%10li", fi->size() ); | 613 | fileS.sprintf( "%10li", fi->size() ); |
614 | fileL.sprintf( "%s",fi->fileName().data() ); | 614 | fileL.sprintf( "%s",fi->fileName().data() ); |
615 | fileDate= fi->lastModified().toString(); | 615 | fileDate= fi->lastModified().toString(); |
616 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { | 616 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { |
617 | fileL+="/"; | 617 | fileL+="/"; |
618 | isDir=TRUE; | 618 | isDir=TRUE; |
619 | // qDebug( fileL); | 619 | // qDebug( fileL); |
620 | } | 620 | } |
621 | } | 621 | } |
622 | if(fileL !="./" && fi->exists()) { | 622 | if(fileL !="./" && fi->exists()) { |
623 | item= new QListViewItem( Local_View,fileL, fileDate, fileS ); | 623 | item= new QListViewItem( Local_View,fileL, fileDate, fileS ); |
624 | QPixmap pm; | 624 | QPixmap pm; |
625 | 625 | ||
626 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 626 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
627 | if( !QDir( fi->filePath() ).isReadable()) | 627 | if( !QDir( fi->filePath() ).isReadable()) |
628 | pm = Resource::loadPixmap( "lockedfolder" ); | 628 | pm = Resource::loadPixmap( "lockedfolder" ); |
629 | else | 629 | else |
630 | pm= Resource::loadPixmap( "folder" ); | 630 | pm= Resource::loadPixmap( "folder" ); |
631 | item->setPixmap( 0,pm ); | 631 | item->setPixmap( 0,pm ); |
632 | } else { | 632 | } else { |
633 | if( !fi->isReadable() ) | 633 | if( !fi->isReadable() ) |
634 | pm = Resource::loadPixmap( "locked" ); | 634 | pm = Resource::loadPixmap( "locked" ); |
635 | else { | 635 | else { |
636 | MimeType mt(fi->filePath()); | 636 | MimeType mt(fi->filePath()); |
637 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 637 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
638 | if(pm.isNull()) | 638 | if(pm.isNull()) |
639 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 639 | pm = Resource::loadPixmap( "UnknownDocument-14" ); |
640 | item->setPixmap( 0,pm); | 640 | item->setPixmap( 0,pm); |
641 | } | 641 | } |
642 | } | 642 | } |
643 | if( fileL.find("->",0,TRUE) != -1) { | 643 | if( fileL.find("->",0,TRUE) != -1) { |
644 | // overlay link image | 644 | // overlay link image |
645 | pm= Resource::loadPixmap( "folder" ); | 645 | pm= Resource::loadPixmap( "folder" ); |
646 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 646 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
647 | QPainter painter( &pm ); | 647 | QPainter painter( &pm ); |
648 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 648 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
649 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 649 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
650 | item->setPixmap( 0, pm); | 650 | item->setPixmap( 0, pm); |
651 | } | 651 | } |
652 | } | 652 | } |
653 | isDir=FALSE; | 653 | isDir=FALSE; |
654 | ++it; | 654 | ++it; |
655 | } | 655 | } |
656 | Local_View->setSorting( 3,FALSE); | 656 | Local_View->setSorting( 3,FALSE); |
657 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); | 657 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); |