author | llornkcor <llornkcor> | 2003-07-17 13:14:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-17 13:14:32 (UTC) |
commit | c72b7e02defdbcc1f2b6b4ff38f256486cfaeec7 (patch) (unidiff) | |
tree | 086f295d49a8d88308c536a8038aa0ba6c179a3d /noncore/apps/advancedfm/advancedfmMenu.cpp | |
parent | 6ca1d7605597f4b8a7559167e5cf3d6e093805cd (diff) | |
download | opie-c72b7e02defdbcc1f2b6b4ff38f256486cfaeec7.zip opie-c72b7e02defdbcc1f2b6b4ff38f256486cfaeec7.tar.gz opie-c72b7e02defdbcc1f2b6b4ff38f256486cfaeec7.tar.bz2 |
some crazy characters fixing
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 267 |
1 files changed, 122 insertions, 145 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 9f21245..00d0e07 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -29,31 +29,33 @@ | |||
29 | #include <qstring.h> | 29 | #include <qstring.h> |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qpixmap.h> | 32 | #include <qpixmap.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qtabwidget.h> | 35 | #include <qtabwidget.h> |
36 | #include <qtoolbutton.h> | 36 | #include <qtoolbutton.h> |
37 | #include <qtabwidget.h> | 37 | #include <qtabwidget.h> |
38 | #include <qlineedit.h> | 38 | #include <qlineedit.h> |
39 | #include <qlistview.h> | 39 | #include <qlistview.h> |
40 | 40 | ||
41 | #include <errno.h> | ||
41 | #include <stdlib.h> | 42 | #include <stdlib.h> |
42 | #include <unistd.h> | 43 | #include <unistd.h> |
43 | #include <sys/stat.h> | 44 | #include <sys/stat.h> |
44 | #include <dirent.h> | 45 | #include <dirent.h> |
45 | #include <sys/sendfile.h> | 46 | #include <sys/sendfile.h> |
46 | #include <fcntl.h> | 47 | #include <fcntl.h> |
47 | 48 | ||
49 | |||
48 | void AdvancedFm::doDirChange() | 50 | void AdvancedFm::doDirChange() |
49 | { | 51 | { |
50 | ListClicked( CurrentView()->currentItem()); | 52 | ListClicked( CurrentView()->currentItem()); |
51 | } | 53 | } |
52 | 54 | ||
53 | void AdvancedFm::showMenuHidden() | 55 | void AdvancedFm::showMenuHidden() |
54 | { | 56 | { |
55 | if (b) | 57 | if (b) |
56 | { | 58 | { |
57 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 59 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
58 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 60 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
59 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 61 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
@@ -161,107 +163,103 @@ void AdvancedFm::makeDir() | |||
161 | fileDlg->exec(); | 163 | fileDlg->exec(); |
162 | if( fileDlg->result() == 1 ) | 164 | if( fileDlg->result() == 1 ) |
163 | { | 165 | { |
164 | QDir *thisDir = CurrentDir(); | 166 | QDir *thisDir = CurrentDir(); |
165 | QString filename = fileDlg->LineEdit1->text(); | 167 | QString filename = fileDlg->LineEdit1->text(); |
166 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); | 168 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); |
167 | } | 169 | } |
168 | populateView(); | 170 | populateView(); |
169 | } | 171 | } |
170 | 172 | ||
171 | void AdvancedFm::doDelete() | 173 | void AdvancedFm::doDelete() |
172 | { | 174 | { |
173 | 175 | QStringList curFileList = getPath(); | |
174 | QStringList curFileList = getPath(); | 176 | bool doMsg=true; |
175 | bool doMsg=true; | 177 | int count = curFileList.count(); |
176 | int count = curFileList.count(); | 178 | if( count > 0) { |
177 | if( count > 0) | 179 | if(count > 1 ) { |
178 | { | 180 | QString msg; |
179 | if(count > 1 ) | 181 | msg=tr("Really delete\n%1 files?").arg(count); |
180 | { | 182 | switch ( QMessageBox::warning(this,tr("Delete"),msg |
181 | QString msg; | 183 | ,tr("Yes"),tr("No"),0,0,1) ) |
182 | msg=tr("Really delete\n%1 files?").arg(count); | 184 | { |
183 | switch ( QMessageBox::warning(this,tr("Delete"),msg | 185 | case 0: |
184 | ,tr("Yes"),tr("No"),0,0,1) ) | 186 | doMsg=false; |
185 | { | 187 | break; |
186 | case 0: | 188 | case 1: |
187 | doMsg=false; | 189 | return; |
188 | break; | 190 | break; |
189 | case 1: | 191 | }; |
190 | return; | ||
191 | break; | ||
192 | }; | ||
193 | } | 192 | } |
194 | 193 | ||
195 | QString myFile; | 194 | QString myFile; |
196 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | ||
197 | { | ||
198 | myFile = (*it); | ||
199 | if( myFile.find(" -> ",0,TRUE) != -1) | ||
200 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); | ||
201 | |||
202 | QString f = CurrentDir()->canonicalPath(); | ||
203 | if(f.right(1).find("/",0,TRUE) == -1) | ||
204 | f += "/"; | ||
205 | f += myFile; | ||
206 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory | ||
207 | { | ||
208 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), | ||
209 | tr("Really delete %1\nand all it's contents ?" ).arg( f ) , | ||
210 | tr("Yes"), | ||
211 | tr("No"), | ||
212 | 0, | ||
213 | 0, | ||
214 | 1) ) | ||
215 | { | ||
216 | case 0: | ||
217 | { | ||
218 | f=f.left(f.length()-1); | ||
219 | QString cmd="rm -rf "+f; | ||
220 | startProcess( (const QString)cmd.latin1() ); | ||
221 | populateView(); | ||
222 | } | ||
223 | break; | ||
224 | case 1: | ||
225 | // exit | ||
226 | break; | ||
227 | }; | ||
228 | 195 | ||
229 | } else { | 196 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
230 | if(doMsg) { | 197 | myFile = (*it); |
231 | switch ( QMessageBox::warning(this,tr("Delete"), | 198 | if( myFile.find(" -> ",0,TRUE) != -1) |
232 | tr("Really delete\n%1?").arg( f ), | 199 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); |
233 | tr("Yes"), | 200 | |
234 | tr("No"), | 201 | QString f = CurrentDir()->canonicalPath(); |
235 | 0, | 202 | if(f.right(1).find("/",0,TRUE) == -1) |
236 | 0, | 203 | f += "/"; |
237 | 1) ) { | 204 | f += myFile; |
238 | case 1: | 205 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
239 | return; | 206 | //if file is a directory |
240 | break; | 207 | |
241 | }; | 208 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), |
242 | } | 209 | tr("Really delete %1\nand all it's contents ?" ).arg( f ) , |
243 | QString cmd="rm "+f; | 210 | tr("Yes"), tr("No"), 0, 0, 1) ) { |
244 | QFile file(f); | 211 | case 0: |
245 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) { | 212 | { |
246 | qDebug("remove link files "+f); | 213 | f=f.left(f.length()-1); |
247 | // AppLnk lnk(f); | 214 | QString cmd="rm -rf "+f; |
248 | // qDebug(lnk.linkFile()); | 215 | startProcess( (const QString)cmd.latin1() ); |
249 | // lnk.removeLinkFile(); | 216 | populateView(); |
250 | file.remove(); | 217 | } |
251 | } | 218 | break; |
219 | case 1: | ||
220 | // exit | ||
221 | break; | ||
222 | }; | ||
223 | |||
224 | } else { | ||
225 | if(doMsg) { | ||
226 | switch ( QMessageBox::warning(this,tr("Delete"), | ||
227 | tr("Really delete\n%1?").arg( myFile ), | ||
228 | tr("Yes"), tr("No"), 0, 0, 1) ) { | ||
229 | case 1: | ||
230 | return; | ||
231 | break; | ||
232 | }; | ||
233 | } | ||
234 | |||
235 | QString cmd="rm "+f; | ||
236 | QFile file(f); | ||
237 | QFileInfo fi(myFile); | ||
238 | if( fi.fileName().find("../",0,TRUE)==-1) { | ||
239 | qDebug("remove link files "+myFile); | ||
240 | |||
241 | // DocLnk lnk(f); | ||
242 | DocLnk *lnk; | ||
243 | lnk = new DocLnk(f); | ||
244 | qDebug("Deleting doclnk " + lnk->linkFile()); | ||
245 | if(lnk->isValid()) | ||
246 | lnk->removeLinkFile(); | ||
247 | // delete lnk; | ||
248 | file.remove(); | ||
249 | } | ||
250 | } | ||
252 | } | 251 | } |
253 | } | 252 | } |
254 | } | 253 | populateView(); |
255 | populateView(); | ||
256 | } | 254 | } |
257 | 255 | ||
258 | void AdvancedFm::filePerms() | 256 | void AdvancedFm::filePerms() |
259 | { | 257 | { |
260 | QStringList curFileList = getPath(); | 258 | QStringList curFileList = getPath(); |
261 | QString filePath; | 259 | QString filePath; |
262 | 260 | ||
263 | filePath = CurrentDir()->canonicalPath()+"/"; | 261 | filePath = CurrentDir()->canonicalPath()+"/"; |
264 | 262 | ||
265 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 263 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
266 | { | 264 | { |
267 | filePermissions *filePerm; | 265 | filePermissions *filePerm; |
@@ -358,26 +356,25 @@ void AdvancedFm::copy() | |||
358 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 356 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
359 | tr("%1 exists. Ok to overwrite?").arg( item ), | 357 | tr("%1 exists. Ok to overwrite?").arg( item ), |
360 | tr("Yes"),tr("No"),0,0,1) ) | 358 | tr("Yes"),tr("No"),0,0,1) ) |
361 | { | 359 | { |
362 | case 1: | 360 | case 1: |
363 | return; | 361 | return; |
364 | break; | 362 | break; |
365 | }; | 363 | }; |
366 | } | 364 | } |
367 | f.remove(); | 365 | f.remove(); |
368 | } | 366 | } |
369 | 367 | ||
370 | if( !copyFile( curFile, destFile) ) | 368 | if( !copyFile( curFile, destFile) ) { |
371 | { | ||
372 | QMessageBox::message("AdvancedFm", | 369 | QMessageBox::message("AdvancedFm", |
373 | tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); | 370 | tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); |
374 | return; | 371 | return; |
375 | } | 372 | } |
376 | } | 373 | } |
377 | setOtherTabCurrent(); | 374 | setOtherTabCurrent(); |
378 | populateView(); | 375 | populateView(); |
379 | } | 376 | } |
380 | } | 377 | } |
381 | 378 | ||
382 | void AdvancedFm::copyAs() | 379 | void AdvancedFm::copyAs() |
383 | { | 380 | { |
@@ -411,26 +408,25 @@ void AdvancedFm::copyAs() | |||
411 | switch (QMessageBox::warning(this,tr("File Exists!"), | 408 | switch (QMessageBox::warning(this,tr("File Exists!"), |
412 | item+tr("\nexists. Ok to overwrite?"), | 409 | item+tr("\nexists. Ok to overwrite?"), |
413 | tr("Yes"),tr("No"),0,0,1) ) | 410 | tr("Yes"),tr("No"),0,0,1) ) |
414 | { | 411 | { |
415 | case 0: | 412 | case 0: |
416 | f.remove(); | 413 | f.remove(); |
417 | break; | 414 | break; |
418 | case 1: | 415 | case 1: |
419 | return; | 416 | return; |
420 | break; | 417 | break; |
421 | }; | 418 | }; |
422 | } | 419 | } |
423 | if( !copyFile( curFile, destFile) ) | 420 | if( !copyFile( curFile, destFile) ) { |
424 | { | ||
425 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 421 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
426 | +curFile +tr("to\n")+destFile); | 422 | +curFile +tr("to\n")+destFile); |
427 | return; | 423 | return; |
428 | } | 424 | } |
429 | } | 425 | } |
430 | delete fileDlg; | 426 | delete fileDlg; |
431 | 427 | ||
432 | } | 428 | } |
433 | setOtherTabCurrent(); | 429 | setOtherTabCurrent(); |
434 | populateView(); | 430 | populateView(); |
435 | } | 431 | } |
436 | 432 | ||
@@ -464,26 +460,25 @@ void AdvancedFm::copySameDir() | |||
464 | switch (QMessageBox::warning(this,tr("Delete"), | 460 | switch (QMessageBox::warning(this,tr("Delete"), |
465 | destFile+tr(" already exists.\nDo you really want to delete it?"), | 461 | destFile+tr(" already exists.\nDo you really want to delete it?"), |
466 | tr("Yes"),tr("No"),0,0,1) ) { | 462 | tr("Yes"),tr("No"),0,0,1) ) { |
467 | case 0: | 463 | case 0: |
468 | 464 | ||
469 | f.remove(); | 465 | f.remove(); |
470 | break; | 466 | break; |
471 | case 1: | 467 | case 1: |
472 | return; | 468 | return; |
473 | break; | 469 | break; |
474 | }; | 470 | }; |
475 | } | 471 | } |
476 | if(!copyFile( curFile,destFile) ) | 472 | if(!copyFile( curFile,destFile) ) { |
477 | { | ||
478 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 473 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
479 | +curFile +tr("to\n")+destFile); | 474 | +curFile +tr("to\n")+destFile); |
480 | return; | 475 | return; |
481 | } | 476 | } |
482 | 477 | ||
483 | qDebug("copy "+curFile+" as "+destFile); | 478 | qDebug("copy "+curFile+" as "+destFile); |
484 | } | 479 | } |
485 | delete fileDlg; | 480 | delete fileDlg; |
486 | } | 481 | } |
487 | populateView(); | 482 | populateView(); |
488 | } | 483 | } |
489 | 484 | ||
@@ -507,95 +502,84 @@ void AdvancedFm::move() | |||
507 | destFile+="/"; | 502 | destFile+="/"; |
508 | destFile += item; | 503 | destFile += item; |
509 | qDebug("Destination file is "+destFile); | 504 | qDebug("Destination file is "+destFile); |
510 | 505 | ||
511 | curFile = thisDir->canonicalPath(); | 506 | curFile = thisDir->canonicalPath(); |
512 | if(curFile.right(1).find("/",0,TRUE) == -1) | 507 | if(curFile.right(1).find("/",0,TRUE) == -1) |
513 | curFile +="/"; | 508 | curFile +="/"; |
514 | curFile+= item; | 509 | curFile+= item; |
515 | qDebug("CurrentFile file is " + curFile); | 510 | qDebug("CurrentFile file is " + curFile); |
516 | 511 | ||
517 | QFile f( curFile); | 512 | QFile f( curFile); |
518 | if( f.exists()) { | 513 | if( f.exists()) { |
519 | if( !copyFile( curFile, destFile) ) | 514 | if( !copyFile( curFile, destFile) ) { |
520 | { | ||
521 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); | 515 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); |
522 | return; | 516 | return; |
523 | } else | 517 | } else |
524 | QFile::remove(curFile); | 518 | QFile::remove(curFile); |
525 | } | 519 | } |
526 | } | 520 | } |
527 | 521 | ||
528 | } | 522 | } |
529 | setOtherTabCurrent(); | 523 | setOtherTabCurrent(); |
530 | populateView(); | 524 | populateView(); |
531 | // populateLocalView(); | 525 | // populateLocalView(); |
532 | } | 526 | } |
533 | 527 | ||
534 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | 528 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) |
535 | { | 529 | { |
536 | // char bf[ 50000 ]; | ||
537 | // int bytesRead; | ||
538 | bool success = true; | 530 | bool success = true; |
539 | struct stat status; | 531 | struct stat status; |
540 | 532 | QFile srcFile(src); | |
541 | // QFile s( src ); | 533 | QFile destFile(dest); |
542 | // QFile d( dest ); | 534 | int err=0; |
543 | |||
544 | int read_fd=0; | 535 | int read_fd=0; |
545 | int write_fd=0; | 536 | int write_fd=0; |
546 | struct stat stat_buf; | 537 | struct stat stat_buf; |
547 | off_t offset = 0; | 538 | off_t offset = 0; |
548 | read_fd = ::open(src.latin1(), O_RDONLY); | 539 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { |
540 | qWarning("open failed"); | ||
541 | return success = false; | ||
542 | } | ||
543 | read_fd = srcFile.handle(); | ||
549 | if(read_fd != -1) { | 544 | if(read_fd != -1) { |
550 | fstat (read_fd, &stat_buf); | 545 | fstat (read_fd, &stat_buf); |
551 | write_fd = ::open(dest.latin1(), O_WRONLY | O_CREAT, stat_buf.st_mode); | 546 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { |
547 | qWarning("destfile open failed"); | ||
548 | return success = false; | ||
549 | } | ||
550 | write_fd = destFile.handle(); | ||
552 | if(write_fd != -1) { | 551 | if(write_fd != -1) { |
553 | if(sendfile(write_fd, read_fd, &offset, stat_buf.st_size) == -1) { | 552 | err =sendfile(write_fd, read_fd, &offset, stat_buf.st_size); |
554 | success = false; | 553 | if( err == -1) { |
554 | QString msg; | ||
555 | switch(err) { | ||
556 | case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; | ||
557 | case EINVAL: msg = "Descriptor is not valid or locked. "; | ||
558 | case ENOMEM: msg = "Insufficient memory to read from in_fd."; | ||
559 | case EIO: msg = "Unspecified error while reading from in_fd."; | ||
560 | }; | ||
561 | success = false; | ||
562 | qWarning(msg); | ||
555 | } | 563 | } |
556 | } else { | 564 | } else { |
557 | success = false; | 565 | success = false; |
558 | } | 566 | } |
559 | } else { | 567 | } else { |
560 | success = false; | 568 | success = false; |
561 | } | 569 | } |
562 | 570 | srcFile.close(); | |
563 | ::close (read_fd); | 571 | destFile.close(); |
564 | ::close (write_fd); | ||
565 | |||
566 | |||
567 | // if( s.open( IO_ReadOnly | IO_Raw ) && d.open( IO_WriteOnly | IO_Raw ) ) | ||
568 | // { | ||
569 | // while( (bytesRead = s.readBlock( bf, sizeof( bf ) )) == sizeof( bf ) ) | ||
570 | // { | ||
571 | // if( d.writeBlock( bf, sizeof( bf ) ) != sizeof( bf ) ){ | ||
572 | // success = FALSE; | ||
573 | // break; | ||
574 | // } | ||
575 | // } | ||
576 | // if( success && (bytesRead > 0) ) | ||
577 | // { | ||
578 | // d.writeBlock( bf, bytesRead ); | ||
579 | // } | ||
580 | |||
581 | // } | ||
582 | // else | ||
583 | // { | ||
584 | // success = FALSE; | ||
585 | // } | ||
586 | |||
587 | // Set file permissions | 572 | // Set file permissions |
588 | if( stat( (const char *) src, &status ) == 0 ) | 573 | if( stat( (const char *) src, &status ) == 0 ) { |
589 | { | ||
590 | chmod( (const char *) dest, status.st_mode ); | 574 | chmod( (const char *) dest, status.st_mode ); |
591 | } | 575 | } |
592 | 576 | ||
593 | return success; | 577 | return success; |
594 | } | 578 | } |
595 | 579 | ||
596 | void AdvancedFm::runCommand() | 580 | void AdvancedFm::runCommand() |
597 | { | 581 | { |
598 | QDir *thisDir = CurrentDir(); | 582 | QDir *thisDir = CurrentDir(); |
599 | 583 | ||
600 | QString curFile; | 584 | QString curFile; |
601 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); | 585 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); |
@@ -703,48 +687,41 @@ void AdvancedFm::mkSym() | |||
703 | 687 | ||
704 | cmd = "ln -s "+curFile+" "+destName; | 688 | cmd = "ln -s "+curFile+" "+destName; |
705 | qDebug(cmd); | 689 | qDebug(cmd); |
706 | startProcess( (const QString)cmd ); | 690 | startProcess( (const QString)cmd ); |
707 | } | 691 | } |
708 | setOtherTabCurrent(); | 692 | setOtherTabCurrent(); |
709 | populateView(); | 693 | populateView(); |
710 | } | 694 | } |
711 | } | 695 | } |
712 | 696 | ||
713 | void AdvancedFm::doBeam() | 697 | void AdvancedFm::doBeam() |
714 | { | 698 | { |
715 | Ir ir; | 699 | Ir ir; |
716 | if(!ir.supported()) | 700 | if(!ir.supported()) { |
717 | { | 701 | } else { |
718 | } | ||
719 | else | ||
720 | { | ||
721 | QStringList curFileList = getPath(); | 702 | QStringList curFileList = getPath(); |
722 | if( curFileList.count() > 0) | 703 | if( curFileList.count() > 0) { |
723 | { | 704 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
724 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 705 | QString curFile = (*it); |
725 | { | 706 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; |
726 | 707 | if( curFilePath.right(1) == "/") { | |
727 | QString curFile = CurrentDir()->canonicalPath()+"/"+(*it); | 708 | curFilePath = curFilePath.left( curFilePath.length() -1); |
728 | if( curFile.right(1) == "/") | ||
729 | { | ||
730 | curFile = curFile.left( curFile.length() -1); | ||
731 | } | ||
732 | Ir *file = new Ir(this, "IR"); | ||
733 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); | ||
734 | file->send( curFile, curFile ); | ||
735 | } | 709 | } |
736 | } | 710 | Ir *file = new Ir(this, "IR"); |
737 | } | 711 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); |
738 | 712 | file->send( curFilePath, curFile ); | |
713 | } | ||
714 | } | ||
715 | } | ||
739 | } | 716 | } |
740 | 717 | ||
741 | void AdvancedFm::fileBeamFinished( Ir *) | 718 | void AdvancedFm::fileBeamFinished( Ir *) |
742 | { | 719 | { |
743 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 720 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
744 | } | 721 | } |
745 | 722 | ||
746 | void AdvancedFm::selectAll() | 723 | void AdvancedFm::selectAll() |
747 | { | 724 | { |
748 | // if (TabWidget->currentTab() == 0) { | 725 | // if (TabWidget->currentTab() == 0) { |
749 | QListView *thisView = CurrentView(); | 726 | QListView *thisView = CurrentView(); |
750 | thisView->selectAll(true); | 727 | thisView->selectAll(true); |