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
39 void urlTestDirectory();
40 void urlTestSubDirectory();
42 void trashFileFromHome();
43 void trashPercentFileFromHome();
44 void trashUtf8FileFromHome();
45 void trashUmlautFileFromHome();
46 void testTrashNotEmpty();
47 void trashFileFromOther();
48 void trashFileIntoOtherPartition();
49 void trashFileOwnedByRoot();
50 void trashSymlinkFromHome();
51 void trashSymlinkFromOther();
52 void trashBrokenSymlinkFromHome();
53 void trashDirectoryFromHome();
54 void trashReadOnlyDirFromHome();
55 void trashDirectoryFromOther();
56 void trashDirectoryOwnedByRoot();
58 void tryRenameInsideTrash();
61 void statFileInRoot();
62 void statDirectoryInRoot();
63 void statSymlinkInRoot();
64 void statFileInDirectory();
66 void copyFileFromTrash();
67 void copyFileInDirectoryFromTrash();
68 void copyDirectoryFromTrash();
69 void copySymlinkFromTrash();
71 void moveFileFromTrash();
72 void moveFileInDirectoryFromTrash();
73 void moveDirectoryFromTrash();
74 void moveSymlinkFromTrash();
77 void listRecursiveRootDir();
81 void delFileInDirectory();
86 void restoreFileFromSubDir();
87 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
;