File indexing completed on 2022-11-29 18:26:11

0001 #include <stdio.h>
0002 #include <QDir>
0003 #include <QFile>
0004 #include <kfilemetainfo.h>
0005 #include <qmimedatabase.h>
0006 
0007 int main(int argc, char **argv)
0008 {
0009 
0010     if (argc < 2) {
0011         printf("usage: %s <file>\n", argv[0]);
0012         return 1;
0013     }
0014 
0015     QMimeDatabase db;
0016     for (int i = 1; i < argc; i++) {
0017         QString file = QFile::decodeName(argv[i]);
0018         qWarning("File: %s", file.toLocal8Bit().data());
0019         QMimeType mime = db.mimeTypeForFile(file);
0020         qWarning("Mime type (mimeTypeForFile): %s", mime.name().toLatin1().constData());
0021         KFileMetaInfo meta(file, QString(), KFileMetaInfo::TechnicalInfo | KFileMetaInfo::ContentInfo);
0022     }
0023 
0024     return 0;
0025 }