File indexing completed on 2024-12-08 06:40:38

0001 #include <QApplication>
0002 #include <QDebug>
0003 #include <QDir>
0004 #include <kpropertiesdialog.h>
0005 
0006 int main(int argc, char **argv)
0007 {
0008     QApplication app(argc, argv);
0009 
0010     if (argc <= 1) {
0011         qWarning() << "Expected argument: [url], the path or url to the file/dir for which to show properties";
0012         return 1;
0013     }
0014     const QUrl u = QUrl::fromUserInput(QString::fromLatin1(argv[1]), QDir::currentPath());
0015 
0016     {
0017         KPropertiesDialog dlg(u);
0018         QObject::connect(&dlg, &KPropertiesDialog::applied, []() {
0019             qDebug() << "applied";
0020         });
0021         QObject::connect(&dlg, &KPropertiesDialog::canceled, []() {
0022             qDebug() << "canceled";
0023         });
0024         dlg.exec();
0025     }
0026 
0027     return 0;
0028 }