author | llornkcor <llornkcor> | 2002-04-28 13:40:18 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-28 13:40:18 (UTC) |
commit | caae6c7deade10081709daa8a0de8ad548b6e30d (patch) (unidiff) | |
tree | 7bbc4d3b832101dd17a07ae1940ecca44a555eef | |
parent | 495103fd36f52dad3a564b924326519c9f52ccaf (diff) | |
download | opie-caae6c7deade10081709daa8a0de8ad548b6e30d.zip opie-caae6c7deade10081709daa8a0de8ad548b6e30d.tar.gz opie-caae6c7deade10081709daa8a0de8ad548b6e30d.tar.bz2 |
changed remove dir function to be recursive and more dangerous
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index ab31c91..faa03dc 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -798,12 +798,17 @@ void AdvancedFm::localDelete() | |||
798 | if( myFile.find(" -> ",0,TRUE) != -1) | 798 | if( myFile.find(" -> ",0,TRUE) != -1) |
799 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); | 799 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); |
800 | 800 | ||
801 | QString f = currentDir.canonicalPath()+"/"+myFile; | 801 | QString f = currentDir.canonicalPath(); |
802 | if(f.right(1).find("/",0,TRUE) == -1) | ||
803 | f+="/"; | ||
804 | f+=myFile; | ||
802 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { | 805 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
803 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+" ?" | 806 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ |
807 | "\nand all it's contents ?" | ||
804 | ,tr("Yes"),tr("No"),0,0,1) ) { | 808 | ,tr("Yes"),tr("No"),0,0,1) ) { |
805 | case 0: { | 809 | case 0: { |
806 | QString cmd="rmdir -rf "+f; | 810 | f=f.left(f.length()-1); |
811 | QString cmd="rm -rf "+f; | ||
807 | system( cmd.latin1()); | 812 | system( cmd.latin1()); |
808 | populateLocalView(); | 813 | populateLocalView(); |
809 | } | 814 | } |
@@ -842,12 +847,17 @@ void AdvancedFm::remoteDelete() | |||
842 | myFile = (*it); | 847 | myFile = (*it); |
843 | if(myFile.find(" -> ",0,TRUE) != -1) | 848 | if(myFile.find(" -> ",0,TRUE) != -1) |
844 | myFile = myFile.left(myFile.find(" -> ",0,TRUE)); | 849 | myFile = myFile.left(myFile.find(" -> ",0,TRUE)); |
845 | QString f = currentRemoteDir.canonicalPath()+"/"+myFile; | 850 | QString f = currentDir.canonicalPath(); |
851 | if(f.right(1).find("/",0,TRUE) == -1) | ||
852 | f+="/"; | ||
853 | f+=myFile; | ||
846 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { | 854 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
847 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+" ?", | 855 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ |
856 | "\nand all it's contents ?", | ||
848 | tr("Yes"),tr("No"),0,0,1) ) { | 857 | tr("Yes"),tr("No"),0,0,1) ) { |
849 | case 0: { | 858 | case 0: { |
850 | QString cmd="rmdir -rf "+f; | 859 | f=f.left(f.length()-1); |
860 | QString cmd="rm -rf "+f; | ||
851 | system( cmd.latin1()); | 861 | system( cmd.latin1()); |
852 | populateRemoteView(); | 862 | populateRemoteView(); |
853 | } | 863 | } |