-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 8b98898..e770304 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -187,36 +187,38 @@ void AdvancedFm::doDelete() { | |||
187 | startProcess( (const QString)cmd.latin1() ); | 187 | startProcess( (const QString)cmd.latin1() ); |
188 | populateView(); | 188 | populateView(); |
189 | } | 189 | } |
190 | break; | 190 | break; |
191 | case 1: | 191 | case 1: |
192 | // exit | 192 | // exit |
193 | break; | 193 | break; |
194 | default: | 194 | default: |
195 | break; | 195 | break; |
196 | }; | 196 | }; |
197 | 197 | ||
198 | } else { | 198 | } else { |
199 | if(doMsg) { | 199 | if(doMsg) { |
200 | switch ( QMessageBox::warning(this,tr("Delete"), | 200 | switch ( QMessageBox::warning(this,tr("Delete"), |
201 | tr("<p>Really delete %1?</p>").arg( myFile ), | 201 | tr("<p>Really delete %1?</p>").arg( myFile ), |
202 | tr("Yes"), tr("No"), 0, 0, 1) ) { | 202 | tr("Yes"), tr("No"), 0, 0, 1) ) { |
203 | case 1: | 203 | case 0; |
204 | return; | 204 | break; |
205 | break; | 205 | case 1: |
206 | default: | 206 | return; |
207 | return; | 207 | break; |
208 | break; | 208 | default: |
209 | }; | 209 | return; |
210 | } | 210 | break; |
211 | }; | ||
212 | } | ||
211 | 213 | ||
212 | QString cmd="rm "+f; | 214 | QString cmd="rm "+f; |
213 | QFile file(f); | 215 | QFile file(f); |
214 | QFileInfo fi(myFile); | 216 | QFileInfo fi(myFile); |
215 | if( fi.fileName().find("../",0,TRUE)==-1) { | 217 | if( fi.fileName().find("../",0,TRUE)==-1) { |
216 | // odebug << "remove link files "+myFile << oendl; | 218 | // odebug << "remove link files "+myFile << oendl; |
217 | 219 | ||
218 | // DocLnk lnk(f); | 220 | // DocLnk lnk(f); |
219 | DocLnk *lnk; | 221 | DocLnk *lnk; |
220 | lnk = new DocLnk(f); | 222 | lnk = new DocLnk(f); |
221 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; | 223 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; |
222 | if(lnk->isValid()) | 224 | if(lnk->isValid()) |
@@ -313,24 +315,26 @@ void AdvancedFm::copy() { | |||
313 | curFile = thisDir->canonicalPath()+"/"+ item; | 315 | curFile = thisDir->canonicalPath()+"/"+ item; |
314 | destFile = thatDir->canonicalPath()+"/"+ item; | 316 | destFile = thatDir->canonicalPath()+"/"+ item; |
315 | 317 | ||
316 | // odebug << "Destination file is "+destFile << oendl; | 318 | // odebug << "Destination file is "+destFile << oendl; |
317 | // odebug << "CurrentFile file is " + curFile << oendl; | 319 | // odebug << "CurrentFile file is " + curFile << oendl; |
318 | 320 | ||
319 | QFile f(destFile); | 321 | QFile f(destFile); |
320 | if( f.exists()) { | 322 | if( f.exists()) { |
321 | if(doMsg) { | 323 | if(doMsg) { |
322 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 324 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
323 | tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), | 325 | tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), |
324 | tr("Yes"),tr("No"),0,0,1)) { | 326 | tr("Yes"),tr("No"),0,0,1)) { |
327 | case 0; | ||
328 | break; | ||
325 | case 1: | 329 | case 1: |
326 | return; | 330 | return; |
327 | break; | 331 | break; |
328 | default: | 332 | default: |
329 | return; | 333 | return; |
330 | break; | 334 | break; |
331 | }; | 335 | }; |
332 | } | 336 | } |
333 | f.remove(); | 337 | f.remove(); |
334 | } | 338 | } |
335 | 339 | ||
336 | if( !copyFile( curFile, destFile) ) { | 340 | if( !copyFile( curFile, destFile) ) { |
@@ -421,25 +425,24 @@ void AdvancedFm::copySameDir() { | |||
421 | 425 | ||
422 | if( fileDlg->result() == 1 ) { | 426 | if( fileDlg->result() == 1 ) { |
423 | 427 | ||
424 | QString filename = fileDlg->LineEdit1->text(); | 428 | QString filename = fileDlg->LineEdit1->text(); |
425 | destFile = thisDir->canonicalPath()+"/"+filename; | 429 | destFile = thisDir->canonicalPath()+"/"+filename; |
426 | 430 | ||
427 | QFile f(destFile); | 431 | QFile f(destFile); |
428 | if( f.exists()) { | 432 | if( f.exists()) { |
429 | switch (QMessageBox::warning(this,tr("Delete"), | 433 | switch (QMessageBox::warning(this,tr("Delete"), |
430 | tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), | 434 | tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), |
431 | tr("Yes"),tr("No"),0,0,1) ) { | 435 | tr("Yes"),tr("No"),0,0,1) ) { |
432 | case 0: | 436 | case 0: |
433 | |||
434 | f.remove(); | 437 | f.remove(); |
435 | break; | 438 | break; |
436 | case 1: | 439 | case 1: |
437 | return; | 440 | return; |
438 | break; | 441 | break; |
439 | default: | 442 | default: |
440 | return; | 443 | return; |
441 | break; | 444 | break; |
442 | }; | 445 | }; |
443 | } | 446 | } |
444 | if(!copyFile( curFile,destFile) ) { | 447 | if(!copyFile( curFile,destFile) ) { |
445 | QMessageBox::message("AdvancedFm",tr("<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); | 448 | QMessageBox::message("AdvancedFm",tr("<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); |