summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-12-16 04:14:46 (UTC)
committer llornkcor <llornkcor>2002-12-16 04:14:46 (UTC)
commitcc6c77e7014a3056debd6963946265671d41517d (patch) (unidiff)
tree1b8f929dd83a8d64915b91ecb3052c19ff5ac0b5
parentb1880703eea8601e06cf3d3e8593b649cd1a485e (diff)
downloadopie-cc6c77e7014a3056debd6963946265671d41517d.zip
opie-cc6c77e7014a3056debd6963946265671d41517d.tar.gz
opie-cc6c77e7014a3056debd6963946265671d41517d.tar.bz2
send as text the real filename is symlink
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp8
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp32
3 files changed, 29 insertions, 12 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 92804b2..c653b90 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -316,5 +316,6 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) {
316 strSize=strSize.stripWhiteSpace(); 316 strSize=strSize.stripWhiteSpace();
317 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 317 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
318 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 318 QString strItem2 = dealWithSymName((const QString&)strItem);
319// QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
319 if(QDir(strItem2).exists() ) { 320 if(QDir(strItem2).exists() ) {
320 currentDir.cd(strItem2, TRUE); 321 currentDir.cd(strItem2, TRUE);
@@ -362,5 +363,6 @@ void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) {
362 strSize=strSize.stripWhiteSpace(); 363 strSize=strSize.stripWhiteSpace();
363 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 364 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
364 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 365 QString strItem2 = dealWithSymName((const QString&)strItem);
366// QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
365 currentRemoteDir.cd(strItem2, TRUE); 367 currentRemoteDir.cd(strItem2, TRUE);
366 populateRemoteView(); 368 populateRemoteView();
@@ -462,5 +464,5 @@ void AdvancedFm::currentPathComboChanged() {
462 464
463void AdvancedFm::fillCombo(const QString &currentPath) { 465void AdvancedFm::fillCombo(const QString &currentPath) {
464 466 qDebug("%d",TabWidget->getCurrentTab());
465 if (TabWidget->getCurrentTab() == 0) { 467 if (TabWidget->getCurrentTab() == 0) {
466// if (TabWidget->currentPageIndex() == 0) { 468// if (TabWidget->currentPageIndex() == 0) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 9948255..7ced056 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -125,4 +125,5 @@ protected:
125 void parsetab(const QString &fileName); 125 void parsetab(const QString &fileName);
126 QString checkDiskSpace(const QString &); 126 QString checkDiskSpace(const QString &);
127 QString dealWithSymName(const QString &);
127 128
128protected slots: 129protected slots:
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 0a9f921..f77554a 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -104,8 +104,16 @@ void AdvancedFm::showRemoteHidden() {
104} 104}
105 105
106QString AdvancedFm::dealWithSymName(const QString &fileName) {
107 QString strItem = fileName;
108 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
109}
110
106void AdvancedFm::runThis() { 111void AdvancedFm::runThis() {
107 QString fs; 112 QString fs;
108 if (TabWidget->getCurrentTab() == 0) { 113 if (TabWidget->getCurrentTab() == 0) {
109 QString curFile = Local_View->currentItem()->text(0); 114 QString curFile = Local_View->currentItem()->text(0);
115 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
116 curFile = dealWithSymName((const QString&)curFile);
117
110 if(curFile != "../") { 118 if(curFile != "../") {
111 119
@@ -133,4 +141,6 @@ void AdvancedFm::runThis() {
133 QString curFile = Remote_View->currentItem()->text(0); 141 QString curFile = Remote_View->currentItem()->text(0);
134 if(curFile != "../") { 142 if(curFile != "../") {
143 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
144 curFile = dealWithSymName((const QString&)curFile);
135 145
136 fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); 146 fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
@@ -161,4 +171,6 @@ void AdvancedFm::runText() {
161 QString curFile = Local_View->currentItem()->text(0); 171 QString curFile = Local_View->currentItem()->text(0);
162 if(curFile != "../") { 172 if(curFile != "../") {
173 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
174 curFile = dealWithSymName((const QString&)curFile);
163 curFile = currentDir.canonicalPath()+"/"+curFile; 175 curFile = currentDir.canonicalPath()+"/"+curFile;
164 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); 176 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
@@ -169,4 +181,6 @@ void AdvancedFm::runText() {
169 if(curFile != "../") { 181 if(curFile != "../") {
170 curFile = currentRemoteDir.canonicalPath()+"/"+curFile; 182 curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
183 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
184 curFile = dealWithSymName((const QString&)curFile);
171 DocLnk nf(curFile); 185 DocLnk nf(curFile);
172 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); 186 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
@@ -483,5 +497,5 @@ void AdvancedFm::copy() {
483 f.remove(); 497 f.remove();
484 } 498 }
485 if(!copyFile(destFile, curFile) ) { 499 if(!copyFile( curFile, destFile) ) {
486 QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile); 500 QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
487 return; 501 return;
@@ -514,5 +528,5 @@ void AdvancedFm::copy() {
514 f.remove(); 528 f.remove();
515 } 529 }
516 if(!copyFile(destFile, curFile) ) { 530 if(!copyFile( curFile, destFile) ) {
517 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 531 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
518 +curFile +tr("to\n")+destFile); 532 +curFile +tr("to\n")+destFile);
@@ -562,5 +576,5 @@ void AdvancedFm::copyAs() {
562 }; 576 };
563 } 577 }
564 if(!copyFile(destFile, curFile) ) { 578 if(!copyFile( curFile,destFile) ) {
565 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 579 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
566 +curFile +tr("to\n")+destFile); 580 +curFile +tr("to\n")+destFile);
@@ -602,5 +616,5 @@ void AdvancedFm::copyAs() {
602 }; 616 };
603 } 617 }
604 if(!copyFile(destFile, curFile) ) { 618 if(!copyFile( curFile,destFile) ) {
605 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 619 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
606 +curFile +tr("to\n")+destFile); 620 +curFile +tr("to\n")+destFile);
@@ -652,5 +666,5 @@ void AdvancedFm::copySameDir() {
652 }; 666 };
653 } 667 }
654 if(!copyFile(destFile, curFile) ) { 668 if(!copyFile( curFile,destFile) ) {
655 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 669 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
656 +curFile +tr("to\n")+destFile); 670 +curFile +tr("to\n")+destFile);
@@ -690,5 +704,5 @@ void AdvancedFm::copySameDir() {
690 }; 704 };
691 } 705 }
692 if(!copyFile(destFile, curFile) ) { 706 if(!copyFile( curFile,destFile) ) {
693 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 707 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
694 +curFile +tr("to\n")+destFile); 708 +curFile +tr("to\n")+destFile);
@@ -731,5 +745,5 @@ void AdvancedFm::move() {
731 QFile f( curFile); 745 QFile f( curFile);
732 if( f.exists()) { 746 if( f.exists()) {
733 if(!copyFile( destFile, curFile) ) { 747 if(!copyFile( curFile,destFile) ) {
734 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); 748 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
735 return; 749 return;
@@ -763,5 +777,5 @@ void AdvancedFm::move() {
763 QFile f( curFile); 777 QFile f( curFile);
764 if( f.exists()) { 778 if( f.exists()) {
765 if(!copyFile( destFile, curFile) ) { 779 if(!copyFile( curFile, destFile) ) {
766 QMessageBox::message(tr("Note"),tr("Could not move\n") + curFile); 780 QMessageBox::message(tr("Note"),tr("Could not move\n") + curFile);
767 return; 781 return;
@@ -777,5 +791,5 @@ void AdvancedFm::move() {
777} 791}
778 792
779bool AdvancedFm::copyFile( const QString & dest, const QString & src ) { 793bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
780 char bf[ 50000 ]; 794 char bf[ 50000 ];
781 int bytesRead; 795 int bytesRead;