TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0KB

  1. #include <tdeapplication.h>
  2. #include <tdeio/defaultprogress.h>
  3. #include <kurl.h>
  4. #include <kdebug.h>
  5. using namespace TDEIO;
  6. int main(int argc, char **argv)
  7. {
  8. TDEApplication app(argc, argv, "kdefaultprogresstest",true,true);
  9. DefaultProgress* dlg = new DefaultProgress();
  10. KURL src("http://this.host.doesn't.exist/this/dir/neither/andthisfileneither");
  11. KURL dest("file:/tmp/dest");
  12. dlg->slotCopying( 0L, src, dest );
  13. dlg->slotTotalSize( 0L, 12000 );
  14. dlg->slotTotalFiles( 0L, 12 );
  15. dlg->slotTotalDirs( 0L, 1 );
  16. dlg->slotSpeed( 0L, 55 );
  17. dlg->slotInfoMessage( 0L, TQString::fromLatin1( "Starting..." ) );
  18. int files = 0;
  19. for ( int size = 0 ; size < 12000 ; size += 1 )
  20. {
  21. dlg->slotProcessedSize( 0L, size );
  22. dlg->slotPercent( 0L, 100 * size / 12000 );
  23. if ( size % 1000 == 0 )
  24. {
  25. dlg->slotProcessedFiles( 0L, ++files );
  26. }
  27. kapp->processEvents();
  28. }
  29. dlg->slotInfoMessage( 0L, TQString::fromLatin1( "Done." ) );
  30. delete dlg;
  31. return 0;
  32. }