delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kioslave / trash / tests / testtrash.h
blob870e168eba1f46b4507da70de765867bdbbb8902
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.
20 #ifndef TESTTRASH_H
21 #define TESTTRASH_H
23 #include <QObject>
25 class TestTrash : public QObject
27 Q_OBJECT
29 public:
30 TestTrash() {}
32 private Q_SLOTS:
33 void initTestCase();
35 void testIcons();
37 void urlTestFile();
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();
59 void statRoot();
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();
75 void listRootDir();
76 void listRecursiveRootDir();
77 void listSubDir();
79 void delRootFile();
80 void delFileInDirectory();
81 void delDirectory();
83 void getFile();
84 void restoreFile();
85 void restoreFileFromSubDir();
86 void restoreFileToDeletedDirectory();
88 void emptyTrash();
89 void testTrashSize();
91 protected Q_SLOTS:
92 void slotEntries( KIO::Job*, const KIO::UDSEntryList& );
94 private:
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;
107 QString m_trashDir;
109 QString m_otherPartitionTopDir;
110 QString m_otherPartitionTrashDir;
111 bool m_tmpIsWritablePartition;
112 int m_tmpTrashId;
113 int m_otherPartitionId;
115 int m_entryCount;
116 QStringList m_listResult;
119 #endif