1 /* This file is part of the KDE project
2 Copyright (C) 2004 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
25 class TestTrash
: public QObject
38 void urlTestDirectory();
39 void urlTestSubDirectory();
41 void trashFileFromHome();
42 void trashPercentFileFromHome();
43 void trashUtf8FileFromHome();
44 void trashUmlautFileFromHome();
45 void testTrashNotEmpty();
46 void trashFileFromOther();
47 void trashFileIntoOtherPartition();
48 void trashFileOwnedByRoot();
49 void trashSymlinkFromHome();
50 void trashSymlinkFromOther();
51 void trashBrokenSymlinkFromHome();
52 void trashDirectoryFromHome();
53 void trashReadOnlyDirFromHome();
54 void trashDirectoryFromOther();
55 void trashDirectoryOwnedByRoot();
57 void tryRenameInsideTrash();
60 void statFileInRoot();
61 void statDirectoryInRoot();
62 void statSymlinkInRoot();
63 void statFileInDirectory();
65 void copyFileFromTrash();
66 void copyFileInDirectoryFromTrash();
67 void copyDirectoryFromTrash();
68 void copySymlinkFromTrash();
70 void moveFileFromTrash();
71 void moveFileInDirectoryFromTrash();
72 void moveDirectoryFromTrash();
73 void moveSymlinkFromTrash();
76 void listRecursiveRootDir();
80 void delFileInDirectory();
85 void restoreFileFromSubDir();
86 void restoreFileToDeletedDirectory();
92 void slotEntries( KIO::Job
*, const KIO::UDSEntryList
& );
95 void trashFile( const QString
& origFilePath
, const QString
& fileId
);
96 void trashSymlink( const QString
& origFilePath
, const QString
& fileName
, bool broken
);
97 void trashDirectory( const QString
& origPath
, const QString
& fileName
);
98 void copyFromTrash( const QString
& fileId
, const QString
& destPath
, const QString
& relativePath
= QString() );
99 void moveFromTrash( const QString
& fileId
, const QString
& destPath
, const QString
& relativePath
= QString() );
101 QString
homeTmpDir() const;
102 QString
otherTmpDir() const;
103 QString
utf8FileName() const;
104 QString
umlautFileName() const;
105 QString
readOnlyDirPath() const;
109 QString m_otherPartitionTopDir
;
110 QString m_otherPartitionTrashDir
;
111 bool m_tmpIsWritablePartition
;
113 int m_otherPartitionId
;
116 QStringList m_listResult
;