File: kpropertiesdialogtest.cpp

package info (click to toggle)
kf6-kio 6.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,788 kB
  • sloc: cpp: 101,822; xml: 519; ansic: 215; python: 199; ruby: 60; sh: 21; makefile: 17
file content (28 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <QApplication>
#include <QDebug>
#include <QDir>
#include <kpropertiesdialog.h>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    if (argc <= 1) {
        qWarning() << "Expected argument: [url], the path or url to the file/dir for which to show properties";
        return 1;
    }
    const QUrl u = QUrl::fromUserInput(QString::fromLatin1(argv[1]), QDir::currentPath());

    {
        KPropertiesDialog dlg(u);
        QObject::connect(&dlg, &KPropertiesDialog::applied, []() {
            qDebug() << "applied";
        });
        QObject::connect(&dlg, &KPropertiesDialog::canceled, []() {
            qDebug() << "canceled";
        });
        dlg.exec();
    }

    return 0;
}