summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-05-17 18:17:11 (UTC)
committer cniehaus <cniehaus>2003-05-17 18:17:11 (UTC)
commit982d7a64a7526379fc0f3b0ae64fdcce430775ff (patch) (unidiff)
treefedd5d50bb4cdfd923a9deb09e8cd6c19f8b2e31
parent325096fb28d129429b17a781c4c1e8d6ca9aa585 (diff)
downloadopie-982d7a64a7526379fc0f3b0ae64fdcce430775ff.zip
opie-982d7a64a7526379fc0f3b0ae64fdcce430775ff.tar.gz
opie-982d7a64a7526379fc0f3b0ae64fdcce430775ff.tar.bz2
ported to HEAD
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 2201960..9f21245 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -192,53 +192,62 @@ void AdvancedFm::doDelete()
192 }; 192 };
193 } 193 }
194 194
195 QString myFile; 195 QString myFile;
196 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) 196 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it )
197 { 197 {
198 myFile = (*it); 198 myFile = (*it);
199 if( myFile.find(" -> ",0,TRUE) != -1) 199 if( myFile.find(" -> ",0,TRUE) != -1)
200 myFile = myFile.left( myFile.find(" -> ",0,TRUE)); 200 myFile = myFile.left( myFile.find(" -> ",0,TRUE));
201 201
202 QString f = CurrentDir()->canonicalPath(); 202 QString f = CurrentDir()->canonicalPath();
203 if(f.right(1).find("/",0,TRUE) == -1) 203 if(f.right(1).find("/",0,TRUE) == -1)
204 f += "/"; 204 f += "/";
205 f += myFile; 205 f += myFile;
206 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory 206 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory
207 { 207 {
208 switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + 208 switch ( QMessageBox::warning( this, tr("Delete Directory?"),
209 "\nand all it's contents ?" 209 tr("Really delete %1\nand all it's contents ?" ).arg( f ) ,
210 ,tr("Yes"),tr("No"),0,0,1) ) 210 tr("Yes"),
211 tr("No"),
212 0,
213 0,
214 1) )
211 { 215 {
212 case 0: 216 case 0:
213 { 217 {
214 f=f.left(f.length()-1); 218 f=f.left(f.length()-1);
215 QString cmd="rm -rf "+f; 219 QString cmd="rm -rf "+f;
216 startProcess( (const QString)cmd.latin1() ); 220 startProcess( (const QString)cmd.latin1() );
217 populateView(); 221 populateView();
218 } 222 }
219 break; 223 break;
220 case 1: 224 case 1:
221 // exit 225 // exit
222 break; 226 break;
223 }; 227 };
224 228
225 } else { 229 } else {
226 if(doMsg) { 230 if(doMsg) {
227 switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f 231 switch ( QMessageBox::warning(this,tr("Delete"),
228 +" ?",tr("Yes"),tr("No"),0,0,1) ) { 232 tr("Really delete\n%1?").arg( f ),
233 tr("Yes"),
234 tr("No"),
235 0,
236 0,
237 1) ) {
229 case 1: 238 case 1:
230 return; 239 return;
231 break; 240 break;
232 }; 241 };
233 } 242 }
234 QString cmd="rm "+f; 243 QString cmd="rm "+f;
235 QFile file(f); 244 QFile file(f);
236 if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) { 245 if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) {
237 qDebug("remove link files "+f); 246 qDebug("remove link files "+f);
238// AppLnk lnk(f); 247// AppLnk lnk(f);
239// qDebug(lnk.linkFile()); 248// qDebug(lnk.linkFile());
240// lnk.removeLinkFile(); 249// lnk.removeLinkFile();
241 file.remove(); 250 file.remove();
242 } 251 }
243 } 252 }
244 } 253 }