Changeset View
Changeset View
Standalone View
Standalone View
test/metadatawidgetapp.cpp
Show All 20 Lines | |||||
21 | #include <QApplication> | 21 | #include <QApplication> | ||
22 | #include <QCommandLineParser> | 22 | #include <QCommandLineParser> | ||
23 | #include <QFileInfo> | 23 | #include <QFileInfo> | ||
24 | #include <kfileitem.h> | 24 | #include <kfileitem.h> | ||
25 | 25 | | |||
26 | int main(int argc, char** argv) | 26 | int main(int argc, char** argv) | ||
27 | { | 27 | { | ||
28 | QApplication app(argc, argv); | 28 | QApplication app(argc, argv); | ||
29 | app.setApplicationName("FileMetadataWidgetApp"); | 29 | app.setApplicationName(QStringLiteral("FileMetadataWidgetApp")); | ||
30 | 30 | | |||
31 | QCommandLineParser parser; | 31 | QCommandLineParser parser; | ||
32 | parser.addPositionalArgument("filename", "files"); | 32 | parser.addPositionalArgument(QStringLiteral("filename"), QStringLiteral("files")); | ||
33 | parser.process(app); | 33 | parser.process(app); | ||
34 | 34 | | |||
35 | Baloo::FileMetaDataWidget* widget = new Baloo::FileMetaDataWidget(); | 35 | Baloo::FileMetaDataWidget* widget = new Baloo::FileMetaDataWidget(); | ||
36 | 36 | | |||
37 | KFileItemList list; | 37 | KFileItemList list; | ||
38 | for (const QString& path : parser.positionalArguments()) { | 38 | for (const QString& path : parser.positionalArguments()) { | ||
39 | QFileInfo fi(path); | 39 | QFileInfo fi(path); | ||
40 | list << KFileItem(QUrl::fromLocalFile(fi.absoluteFilePath()), QString(), mode_t()); | 40 | list << KFileItem(QUrl::fromLocalFile(fi.absoluteFilePath()), QString(), mode_t()); | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | widget->show(); | 43 | widget->show(); | ||
44 | widget->setItems(list); | 44 | widget->setItems(list); | ||
45 | 45 | | |||
46 | return app.exec(); | 46 | return app.exec(); | ||
47 | } | 47 | } |