summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-17 04:00:20 (UTC)
committer llornkcor <llornkcor>2002-03-17 04:00:20 (UTC)
commit578725ca25862c0b06b1991a7bc8ffc2ad8ae13e (patch) (unidiff)
tree2217cff7ce86563ea688fc8138835230ea95c5c0
parent624a283591094628425c94fedfdd62941ad7c853 (diff)
downloadopie-578725ca25862c0b06b1991a7bc8ffc2ad8ae13e.zip
opie-578725ca25862c0b06b1991a7bc8ffc2ad8ae13e.tar.gz
opie-578725ca25862c0b06b1991a7bc8ffc2ad8ae13e.tar.bz2
added icons, and fixed remote dir list sorting
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp57
1 files changed, 48 insertions, 9 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 118275b..a3b29a1 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -47,2 +47,3 @@
47 47
48
48QProgressBar *ProgressBar; 49QProgressBar *ProgressBar;
@@ -96,3 +97,4 @@ OpieFtp::OpieFtp( )
96 localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 97 localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
97 98 localMenu->setCheckable(TRUE);
99
98 remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); 100 remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() ));
@@ -203,4 +205,4 @@ OpieFtp::OpieFtp( )
203 remotePath->setText( currentRemoteDir = "/"); 205 remotePath->setText( currentRemoteDir = "/");
204 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 );
205// remotePath->setText( currentRemoteDir = "/home/llornkcor/"); 206// remotePath->setText( currentRemoteDir = "/home/llornkcor/");
207 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 );
206 208
@@ -238,2 +240,3 @@ OpieFtp::OpieFtp( )
238 filterStr="*"; 240 filterStr="*";
241 b=FALSE;
239 populateLocalView(); 242 populateLocalView();
@@ -331,3 +334,6 @@ void OpieFtp::remoteDownload()
331 QString strItem = Remote_View->currentItem()->text(0); 334 QString strItem = Remote_View->currentItem()->text(0);
332 QString localFile = currentDir.canonicalPath()+"/"+strItem; 335// strItem=strItem.right(strItem.length()-1);
336
337 QString localFile = currentDir.canonicalPath()+strItem;
338// QString localFile = currentDir.canonicalPath()+"/"+strItem;
333 QString remoteFile= currentRemoteDir+strItem; 339 QString remoteFile= currentRemoteDir+strItem;
@@ -458,2 +464,3 @@ void OpieFtp::populateLocalView()
458 QString fileL, fileS, fileDate; 464 QString fileL, fileS, fileDate;
465 bool isDir=FALSE;
459 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 466 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
@@ -476,2 +483,3 @@ void OpieFtp::populateLocalView()
476 fileL+="/"; 483 fileL+="/";
484 isDir=TRUE;
477// qDebug( fileL); 485// qDebug( fileL);
@@ -479,3 +487,10 @@ void OpieFtp::populateLocalView()
479 } 487 }
480 item= new QListViewItem( Local_View,fileL,fileS, fileDate); 488 if(fileL !="./") {
489 item = new QListViewItem( Local_View,fileL,fileS, fileDate);
490 if(isDir)
491 item->setPixmap( 0, Resource::loadPixmap( "folder" ));
492 else
493 item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
494 }
495 isDir=FALSE;
481 ++it; 496 ++it;
@@ -497,4 +512,4 @@ bool OpieFtp::populateRemoteView( )
497 QString s, File_Name; 512 QString s, File_Name;
513 QListViewItem *itemDir=NULL, *itemFile=NULL;
498 QString fileL, fileS, fileDate; 514 QString fileL, fileS, fileDate;
499 new QListViewItem( Remote_View, "../");
500 if ( file.open(IO_ReadOnly)) { 515 if ( file.open(IO_ReadOnly)) {
@@ -505,4 +520,5 @@ bool OpieFtp::populateRemoteView( )
505 fileL = fileL.stripWhiteSpace(); 520 fileL = fileL.stripWhiteSpace();
506 if(s.left(1) == "d") 521 if(s.left(1) == "d")
507 fileL = fileL+"/"; 522 fileL = fileL+"/";
523// fileL = "/"+fileL+"/";
508 fileS = s.mid( 30, 42-30); 524 fileS = s.mid( 30, 42-30);
@@ -511,5 +527,19 @@ bool OpieFtp::populateRemoteView( )
511 fileDate = fileDate.stripWhiteSpace(); 527 fileDate = fileDate.stripWhiteSpace();
512 if(fileL.find("total",0,TRUE) == -1) 528 if(fileL.find("total",0,TRUE) == -1) {
513 new QListViewItem( Remote_View, fileL, fileS, fileDate); 529 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate);
530 if(s.left(1) == "d") {
531 item->setPixmap( 0, Resource::loadPixmap( "folder" ));
532 if(itemDir)
533 item->moveItem(itemDir);
534 itemDir=item;
535 } else {
536 item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
537 if(itemFile)
538 item->moveItem(itemFile);
539 itemFile=item;
540 }
541 }
514 } 542 }
543 QListViewItem * item1 = new QListViewItem( Remote_View, "../");
544 item1->setPixmap( 0, Resource::loadPixmap( "folder" ));
515 file.close(); 545 file.close();
@@ -519,2 +549,3 @@ bool OpieFtp::populateRemoteView( )
519 qDebug("temp file not opened successfullly "+sfile); 549 qDebug("temp file not opened successfullly "+sfile);
550 Remote_View->setSorting( 4,TRUE);
520 551
@@ -628,2 +659,3 @@ void OpieFtp::showHidden()
628 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 659 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
660 localMenu->setItemChecked(localMenu->idAt(0),TRUE);
629// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 661// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -633,2 +665,3 @@ void OpieFtp::showHidden()
633 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 665 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
666 localMenu->setItemChecked(localMenu->idAt(0),FALSE);
634// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 667// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -688,2 +721,8 @@ void OpieFtp::showLocalMenu(QListViewItem * item)
688 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 721 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
722 m.setCheckable(TRUE);
723 if (b)
724 m.setItemChecked(m.idAt(0),TRUE);
725 else
726 m.setItemChecked(m.idAt(0),FALSE);
727
689 m.exec( QCursor::pos() ); 728 m.exec( QCursor::pos() );
@@ -839,3 +878,3 @@ void OpieFtp::currentPathEditChanged()
839 QString oldRemoteCurrentDir = currentRemoteDir; 878 QString oldRemoteCurrentDir = currentRemoteDir;
840 qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir); 879// qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir);
841 if (TabWidget->currentPageIndex() == 0) { 880 if (TabWidget->currentPageIndex() == 0) {