summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-04 22:38:02 (UTC)
committer llornkcor <llornkcor>2002-05-04 22:38:02 (UTC)
commita59ee560e5a170d124838c4e2ce7e6af0102aa2e (patch) (unidiff)
tree144caabfb34b165a3d3208e47a8a81ce70fcd8af
parentd510e5a69762c8452b9d7b3d8122bc9fa85ed8b3 (diff)
downloadopie-a59ee560e5a170d124838c4e2ce7e6af0102aa2e.zip
opie-a59ee560e5a170d124838c4e2ce7e6af0102aa2e.tar.gz
opie-a59ee560e5a170d124838c4e2ce7e6af0102aa2e.tar.bz2
buf gix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp2
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
@@ -545,129 +545,129 @@ void OpieFtp::remoteDownload()
545 } 545 }
546 for ( ; it.current(); ++it ) { 546 for ( ; it.current(); ++it ) {
547 Remote_View->clearSelection(); 547 Remote_View->clearSelection();
548 } 548 }
549 Remote_View->setFocus(); 549 Remote_View->setFocus();
550 TabWidget->setCurrentPage(0); 550 TabWidget->setCurrentPage(0);
551 populateLocalView(); 551 populateLocalView();
552// QCopEnvelope ( "QPE/System", "notBusy()" ); 552// QCopEnvelope ( "QPE/System", "notBusy()" );
553} 553}
554 554
555bool OpieFtp::remoteDirList(const QString &dir) 555bool OpieFtp::remoteDirList(const QString &dir)
556{ 556{
557 QString tmp = QDir::homeDirPath(); 557 QString tmp = QDir::homeDirPath();
558 if(tmp.right(1) != "/") 558 if(tmp.right(1) != "/")
559 tmp+="/._temp"; 559 tmp+="/._temp";
560 else 560 else
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
576bool OpieFtp::remoteChDir(const QString &dir) 576bool 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
592void OpieFtp::populateLocalView() 592void 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() );
658 fillCombo( (const QString &)currentDir); 658 fillCombo( (const QString &)currentDir);
659} 659}
660 660
661bool OpieFtp::populateRemoteView( ) 661bool OpieFtp::populateRemoteView( )
662{ 662{
663// qDebug("populate remoteview"); 663// qDebug("populate remoteview");
664 QString sfile=QDir::homeDirPath(); 664 QString sfile=QDir::homeDirPath();
665 if(sfile.right(1) != "/") 665 if(sfile.right(1) != "/")
666 sfile+="/._temp"; 666 sfile+="/._temp";
667 else 667 else
668 sfile+="._temp"; 668 sfile+="._temp";
669 QFile file( sfile); 669 QFile file( sfile);
670 Remote_View->clear(); 670 Remote_View->clear();
671 QString s, File_Name; 671 QString s, File_Name;
672 QListViewItem *itemDir=NULL, *itemFile=NULL; 672 QListViewItem *itemDir=NULL, *itemFile=NULL;
673 QString fileL, fileS, fileDate; 673 QString fileL, fileS, fileDate;