File indexing completed on 2024-06-16 13:00:17

0001 #include <KService>
0002 #include <KServiceType>
0003 #include <QMimeDatabase>
0004 
0005 #include <QApplication>
0006 #include <QDebug>
0007 
0008 int main(int argc, char *argv[])
0009 {
0010     QApplication::setApplicationName(QStringLiteral("getalltest"));
0011     QApplication k(argc, argv);
0012 
0013     // for (int i = 0 ; i < 2 ; ++i ) { // test twice to see if they got deleted
0014     qDebug() << "All services";
0015     const KService::List services = KService::allServices();
0016     qDebug() << "got " << services.count() << " services";
0017     for (const KService::Ptr &s : services) {
0018         qDebug() << s->name() << " " << s->entryPath();
0019     }
0020     //}
0021 
0022     qDebug() << "All mimeTypes";
0023     QMimeDatabase db;
0024     const QList<QMimeType> mimeTypes = db.allMimeTypes();
0025     qDebug() << "got " << mimeTypes.count() << " mimeTypes";
0026     for (const QMimeType &m : mimeTypes) {
0027         qDebug() << m.name();
0028     }
0029 
0030     qDebug() << "All service types";
0031     const KServiceType::List list = KServiceType::allServiceTypes();
0032     qDebug() << "got " << list.count() << " service types";
0033     for (const KServiceType::Ptr &st : list) {
0034         qDebug() << st->name();
0035     }
0036 
0037     qDebug() << "done";
0038 
0039     return 0;
0040 }