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.

jobtest.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* This file is part of the KDE project
  2. Copyright (C) 2004 David Faure <faure@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef JOBTEST_H
  17. #define JOBTEST_H
  18. #include <tqstring.h>
  19. #include <tqobject.h>
  20. #include <tdeio/job.h>
  21. class JobTest : public TQObject
  22. {
  23. Q_OBJECT
  24. public:
  25. JobTest() {}
  26. void setup();
  27. void runAll();
  28. void cleanup();
  29. // Local tests (tdeio_file only)
  30. void get();
  31. void copyFileToSamePartition();
  32. void copyDirectoryToSamePartition();
  33. void copyDirectoryToExistingDirectory();
  34. void copyFileToOtherPartition();
  35. void copyDirectoryToOtherPartition();
  36. void listRecursive();
  37. void moveFileToSamePartition();
  38. void moveDirectoryToSamePartition();
  39. void moveFileToOtherPartition();
  40. void moveSymlinkToOtherPartition();
  41. void moveDirectoryToOtherPartition();
  42. void moveFileNoPermissions();
  43. void moveDirectoryNoPermissions();
  44. // Remote tests
  45. void copyFileToSystem();
  46. private slots:
  47. void slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& lst );
  48. void slotGetResult( TDEIO::Job* );
  49. void slotMimetype(TDEIO::Job*,const TQString&);
  50. private:
  51. TQString homeTmpDir() const;
  52. TQString otherTmpDir() const;
  53. TQString realSystemPath() const;
  54. KURL systemTmpDir() const;
  55. enum { AlreadyExists = 1 };
  56. void copyLocalFile( const TQString& src, const TQString& dest );
  57. void copyLocalDirectory( const TQString& src, const TQString& dest, int flags = 0 );
  58. void moveLocalFile( const TQString& src, const TQString& dest );
  59. void moveLocalDirectory( const TQString& src, const TQString& dest );
  60. void copyFileToSystem( bool resolve_local_urls );
  61. int m_result;
  62. TQByteArray m_data;
  63. TQStringList m_names;
  64. TQString m_mimetype;
  65. };
  66. #endif