File indexing completed on 2024-06-16 06:57:01

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