File indexing completed on 2024-04-14 04:35:09

0001 /*
0002     SPDX-FileCopyrightText: 2012-2015 Vishesh Handa <vhanda@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #include "filemetadatawidget.h"
0008 
0009 #include <KFileItem>
0010 #include <QApplication>
0011 #include <QCommandLineParser>
0012 #include <QFileInfo>
0013 
0014 int main(int argc, char **argv)
0015 {
0016     QApplication app(argc, argv);
0017     app.setApplicationName(QStringLiteral("FileMetadataWidgetApp"));
0018 
0019     QCommandLineParser parser;
0020     parser.addPositionalArgument(QStringLiteral("filename"), QStringLiteral("files"));
0021     parser.process(app);
0022 
0023     auto widget = new Baloo::FileMetaDataWidget();
0024 
0025     KFileItemList list;
0026     const auto args = parser.positionalArguments();
0027     for (const QString &path : args) {
0028         QFileInfo fi(path);
0029         list << KFileItem(QUrl::fromLocalFile(fi.absoluteFilePath()), QString(), mode_t());
0030     }
0031 
0032     widget->show();
0033     widget->setItems(list);
0034 
0035     return app.exec();
0036 }