PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/managefile/fileUtilthread.cpp

http://filesearch.googlecode.com/
C++ | 39 lines | 27 code | 6 blank | 6 comment | 0 complexity | 8ff6e6001f079304288ce5af3da0aa14 MD5 | raw file
  1. #include "filethread.h"
  2. #include <iostream>
  3. FileThread::FileThread(QString fileName)
  4. {
  5. this->fileName = fileName;
  6. }
  7. FileThread::FileThread()
  8. {
  9. }
  10. void FileThread::setFileName(QString fileName)
  11. {
  12. this->fileName = fileName;
  13. }
  14. void FileThread::run()
  15. {
  16. QTextCodec *code;
  17. code = QTextCodec::codecForName("gb18030");
  18. code->fromUnicode(fileName).data();
  19. qDebug() << "FileThread::run before open" ;
  20. QDesktopServices::openUrl ( QUrl::fromLocalFile(fileName) );
  21. // QDesktopServices::openUrl(QUrl(fileName, QUrl::StrictMode));
  22. qDebug() << "FileThread::run after open" ;
  23. //emit finished();
  24. emit terminate();
  25. }
  26. //void FileThread::finished()
  27. //{
  28. // qDebug() << "finish cccc" ;
  29. //}
  30. FileThread::~FileThread()
  31. {
  32. qDebug() << "aaaa" ;
  33. }