00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TESTTRASH_H
00021 #define TESTTRASH_H
00022
00023 #include <tqobject.h>
00024
00025 class TestTrash : public QObject
00026 {
00027 Q_OBJECT
00028
00029 public:
00030 TestTrash() {}
00031 void setup();
00032 void cleanTrash();
00033 void runAll();
00034
00035
00036
00037 void urlTestFile();
00038 void urlTestDirectory();
00039 void urlTestSubDirectory();
00040
00041 void trashFileFromHome();
00042 void trashPercentFileFromHome();
00043 void trashUtf8FileFromHome();
00044 void trashUmlautFileFromHome();
00045 void testTrashNotEmpty();
00046 void trashFileFromOther();
00047 void trashFileIntoOtherPartition();
00048 void trashFileOwnedByRoot();
00049 void trashSymlinkFromHome();
00050 void trashSymlinkFromOther();
00051 void trashBrokenSymlinkFromHome();
00052 void trashDirectoryFromHome();
00053 void trashReadOnlyDirFromHome();
00054 void trashDirectoryFromOther();
00055 void trashDirectoryOwnedByRoot();
00056
00057 void tryRenameInsideTrash();
00058
00059 void statRoot();
00060 void statFileInRoot();
00061 void statDirectoryInRoot();
00062 void statSymlinkInRoot();
00063 void statFileInDirectory();
00064
00065 void copyFileFromTrash();
00066 void copyFileInDirectoryFromTrash();
00067 void copyDirectoryFromTrash();
00068 void copySymlinkFromTrash();
00069
00070 void moveFileFromTrash();
00071 void moveFileInDirectoryFromTrash();
00072 void moveDirectoryFromTrash();
00073 void moveSymlinkFromTrash();
00074
00075 void listRootDir();
00076 void listRecursiveRootDir();
00077 void listSubDir();
00078
00079 void delRootFile();
00080 void delFileInDirectory();
00081 void delDirectory();
00082
00083 void getFile();
00084 void restoreFile();
00085 void restoreFileFromSubDir();
00086 void restoreFileToDeletedDirectory();
00087
00088 void emptyTrash();
00089
00090 private slots:
00091 void slotEntries( KIO::Job*, const KIO::UDSEntryList& );
00092
00093 private:
00094 void trashFile( const TQString& origFilePath, const TQString& fileId );
00095 void trashSymlink( const TQString& origFilePath, const TQString& fileName, bool broken );
00096 void trashDirectory( const TQString& origPath, const TQString& fileName );
00097 void copyFromTrash( const TQString& fileId, const TQString& destPath, const TQString& relativePath = TQString::null );
00098 void moveFromTrash( const TQString& fileId, const TQString& destPath, const TQString& relativePath = TQString::null );
00099
00100 TQString homeTmpDir() const;
00101 TQString otherTmpDir() const;
00102 TQString utf8FileName() const;
00103 TQString umlautFileName() const;
00104 TQString readOnlyDirPath() const;
00105
00106 TQString m_trashDir;
00107
00108 TQString m_otherPartitionTopDir;
00109 TQString m_otherPartitionTrashDir;
00110 bool m_tmpIsWritablePartition;
00111 int m_tmpTrashId;
00112 int m_otherPartitionId;
00113
00114 int m_entryCount;
00115 TQStringList m_listResult;
00116 };
00117
00118 #endif