summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index efcaf84..36de842 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -128,26 +128,26 @@ OpieFtp::OpieFtp( )
128 Local_View->addColumn( tr("File"),150); 128 Local_View->addColumn( tr("File"),150);
129 Local_View->addColumn( tr("Size"),-1); 129 Local_View->addColumn( tr("Size"),-1);
130 Local_View->setColumnAlignment(1,QListView::AlignRight); 130 Local_View->setColumnAlignment(1,QListView::AlignRight);
131 Local_View->addColumn( tr("Date"),-1); 131 Local_View->addColumn( tr("Date"),-1);
132 Local_View->setColumnAlignment(2,QListView::AlignRight); 132 Local_View->setColumnAlignment(2,QListView::AlignRight);
133 Local_View->setAllColumnsShowFocus(TRUE); 133 Local_View->setAllColumnsShowFocus(TRUE);
134 Local_View->setMultiSelection( TRUE ); 134 Local_View->setMultiSelection( TRUE );
135 135
136 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 136 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
137 137
138 tabLayout->addWidget( Local_View, 0, 0 ); 138 tabLayout->addWidget( Local_View, 0, 0 );
139 139
140 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 140 connect( Local_View, SIGNAL( clicked( QListViewItem*)),
141 this,SLOT( localListClicked(QListViewItem *)) ); 141 this,SLOT( localListClicked(QListViewItem *)) );
142// connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), 142// connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)),
143// this,SLOT( localListClicked(QListViewItem *)) ); 143// this,SLOT( localListClicked(QListViewItem *)) );
144 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 144// connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
145 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 145// this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) );
146 146
147 TabWidget->insertTab( tab, tr( "Local" ) ); 147 TabWidget->insertTab( tab, tr( "Local" ) );
148 148
149 tab_2 = new QWidget( TabWidget, "tab_2" ); 149 tab_2 = new QWidget( TabWidget, "tab_2" );
150 tabLayout_2 = new QGridLayout( tab_2 ); 150 tabLayout_2 = new QGridLayout( tab_2 );
151 tabLayout_2->setSpacing( 2); 151 tabLayout_2->setSpacing( 2);
152 tabLayout_2->setMargin( 2); 152 tabLayout_2->setMargin( 2);
153 153
@@ -256,28 +256,16 @@ OpieFtp::OpieFtp( )
256 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 256 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
257 this,SLOT(currentPathComboChanged())); 257 this,SLOT(currentPathComboChanged()));
258 258
259 ProgressBar = new QProgressBar( this, "ProgressBar" ); 259 ProgressBar = new QProgressBar( this, "ProgressBar" );
260 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 3 ); 260 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 3 );
261 261
262// fillCombos(); 262// fillCombos();
263 263
264#ifdef DEVELOPERS_VERSION
265 ServerComboBox->lineEdit()->setText( tr( "192.168.129.201" ) );
266 UsernameComboBox->lineEdit()->setText("root");
267 PortSpinBox->setValue( 4242);
268 remotePath->setText( currentRemoteDir = "/");
269// ServerComboBox->lineEdit()->setText( tr( "llornkcor.com" ) );
270// UsernameComboBox->lineEdit()->setText("llornkcor");
271// PortSpinBox->setValue( 21);
272// remotePath->setText( currentRemoteDir = "/home/llornkcor");
273 PasswordEdit->setText( tr( "" ) );
274#endif
275
276 filterStr="*"; 264 filterStr="*";
277 b=FALSE; 265 b=FALSE;
278 populateLocalView(); 266 populateLocalView();
279 readConfig(); 267 readConfig();
280 ServerComboBox->setCurrentItem(currentServerConfig); 268 ServerComboBox->setCurrentItem(currentServerConfig);
281 TabWidget->setCurrentPage(2); 269 TabWidget->setCurrentPage(2);
282} 270}
283 271
@@ -718,18 +706,20 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
718 currentPathCombo->lineEdit()->setText( currentRemoteDir ); 706 currentPathCombo->lineEdit()->setText( currentRemoteDir );
719 fillRemoteCombo( (const QString &)currentDir); 707 fillRemoteCombo( (const QString &)currentDir);
720 QCopEnvelope ( "QPE/System", "notBusy()" ); 708 QCopEnvelope ( "QPE/System", "notBusy()" );
721 } 709 }
722} 710}
723 711
724void OpieFtp::localListClicked(QListViewItem *selectedItem) 712void OpieFtp::localListClicked(QListViewItem *selectedItem)
725{ 713{
726 if(item) { 714// qDebug(selectedItem->text(0));
727 QString strItem=selectedItem->text(0); 715 if(item!= NULL) {
716
717 QString strItem=selectedItem->text(0);
728 QString strSize=selectedItem->text(1); 718 QString strSize=selectedItem->text(1);
729 strSize=strSize.stripWhiteSpace(); 719 strSize=strSize.stripWhiteSpace();
730 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 720 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
731 // is symlink 721 // is symlink
732 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 722 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
733 if(QDir(strItem2).exists() ) { 723 if(QDir(strItem2).exists() ) {
734 currentDir.cd(strItem2, TRUE); 724 currentDir.cd(strItem2, TRUE);
735 populateLocalView(); 725 populateLocalView();
@@ -784,23 +774,20 @@ void OpieFtp::showHidden()
784// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 774// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
785 b=FALSE; 775 b=FALSE;
786 } 776 }
787 populateLocalView(); 777 populateLocalView();
788} 778}
789 779
790void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 780void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
791{ 781{
792 switch (mouse) { 782// if(item)
793 case 1: 783if (mouse == 2) {
794 break;
795 case 2:
796 showLocalMenu(item); 784 showLocalMenu(item);
797 break; 785 }
798 };
799} 786}
800 787
801void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 788void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
802{ 789{
803 switch (mouse) { 790 switch (mouse) {
804 case 1: 791 case 1:
805 break; 792 break;
806 case 2: 793 case 2:
@@ -820,17 +807,18 @@ void OpieFtp::showRemoteMenu(QListViewItem * item)
820 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 807 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
821 m.insertSeparator(); 808 m.insertSeparator();
822 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 809 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
823 m.exec( QCursor::pos() ); 810 m.exec( QCursor::pos() );
824} 811}
825 812
826void OpieFtp::showLocalMenu(QListViewItem * item) 813void OpieFtp::showLocalMenu(QListViewItem * item)
827{ 814{
828 QPopupMenu m; 815
816 QPopupMenu m;
829 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 817 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
830 m.insertSeparator(); 818 m.insertSeparator();
831 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) 819 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1)
832 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); 820 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
833 else 821 else
834 m.insertItem( tr( "Upload" ), this, SLOT( localUpload() )); 822 m.insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
835 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 823 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
836 m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); 824 m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));