Warning, file /frameworks/kio/tests/kdirlistertest_gui.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of the KDE desktop environment 0003 SPDX-FileCopyrightText: 2001, 2002 Michael Brade <brade@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef _KDIRLISTERTEST_GUI_H_ 0009 #define _KDIRLISTERTEST_GUI_H_ 0010 0011 #include <QString> 0012 #include <QUrl> 0013 #include <QWidget> 0014 0015 #include <kdirlister.h> 0016 #include <kfileitem.h> 0017 0018 #include <iostream> 0019 0020 using namespace std; 0021 0022 class PrintSignals : public QObject 0023 { 0024 Q_OBJECT 0025 public: 0026 PrintSignals() 0027 : QObject() 0028 { 0029 } 0030 0031 public Q_SLOTS: 0032 void started(const QUrl &url) 0033 { 0034 cout << "*** started( " << url.url().toLocal8Bit().data() << " )" << endl; 0035 } 0036 void canceled() 0037 { 0038 cout << "canceled()" << endl; 0039 } 0040 void listingDirCanceled(const QUrl &url) 0041 { 0042 cout << "*** canceled( " << url.toDisplayString().toLocal8Bit().data() << " )" << endl; 0043 } 0044 void completed() 0045 { 0046 cout << "*** completed()" << endl; 0047 } 0048 void listingDirCompleted(const QUrl &url) 0049 { 0050 cout << "*** completed( " << url.toDisplayString().toLocal8Bit().data() << " )" << endl; 0051 } 0052 void redirection(const QUrl &src, const QUrl &dest) 0053 { 0054 cout << "*** redirection( " << src.toDisplayString().toLocal8Bit().data() << ", " << dest.toDisplayString().toLocal8Bit().data() << " )" << endl; 0055 } 0056 void clear() 0057 { 0058 cout << "*** clear()" << endl; 0059 } 0060 void newItems(const KFileItemList &items) 0061 { 0062 cout << "*** newItems: " << endl; 0063 for (auto it = items.cbegin(), itEnd = items.constEnd(); it != itEnd; ++it) { 0064 cout << (*it).name().toLocal8Bit().data() << endl; 0065 } 0066 } 0067 void itemsDeleted(const KFileItemList &) 0068 { 0069 cout << "*** itemsDeleted: " << endl; 0070 // TODO 0071 } 0072 #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 100) 0073 void itemsFilteredByMime(const KFileItemList &) 0074 { 0075 cout << "*** itemsFilteredByMime: " << endl; 0076 // TODO 0077 } 0078 #endif 0079 void refreshItems(const QList<QPair<KFileItem, KFileItem>> &) 0080 { 0081 cout << "*** refreshItems: " << endl; 0082 // TODO 0083 } 0084 void infoMessage(const QString &msg) 0085 { 0086 cout << "*** infoMessage: " << msg.toLocal8Bit().data() << endl; 0087 } 0088 0089 void percent(int percent) 0090 { 0091 cout << "*** percent: " << percent << endl; 0092 } 0093 0094 void totalSize(KIO::filesize_t size) 0095 { 0096 cout << "*** totalSize: " << (long)size << endl; 0097 } 0098 0099 void processedSize(KIO::filesize_t size) 0100 { 0101 cout << "*** processedSize: " << (long)size << endl; 0102 } 0103 0104 void speed(int bytes_per_second) 0105 { 0106 cout << "*** speed: " << bytes_per_second << endl; 0107 } 0108 }; 0109 0110 class KDirListerTest : public QWidget 0111 { 0112 Q_OBJECT 0113 public: 0114 KDirListerTest(QWidget *parent = nullptr, const QUrl &url = {}); 0115 ~KDirListerTest() override; 0116 0117 public Q_SLOTS: 0118 void startRoot(); 0119 void startHome(); 0120 void startTar(); 0121 void test(); 0122 void completed(); 0123 0124 private: 0125 KDirLister *lister; 0126 PrintSignals *debug; 0127 }; 0128 0129 #endif