File indexing completed on 2024-06-16 13:00:19

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2020 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include <QApplication>
0009 #include <QDebug>
0010 #include <QList>
0011 #include <QUrl>
0012 
0013 #include <KIO/OpenFileManagerWindowJob>
0014 
0015 int main(int argc, char **argv)
0016 {
0017     QApplication::setApplicationName(QStringLiteral("openfilemanagerwindowtest"));
0018     QApplication app(argc, argv);
0019 
0020     const QList<QUrl> urls{QUrl(QStringLiteral("file:///etc/fstab")), QUrl(QStringLiteral("file:///etc/passwd"))};
0021 
0022     auto *job = new KIO::OpenFileManagerWindowJob();
0023     job->setHighlightUrls(urls);
0024     job->start();
0025 
0026     QObject::connect(job, &KJob::result, job, [&](KJob *job) {
0027         app.exit(job->error());
0028     });
0029 
0030     return app.exec();
0031 }