Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhaikuapplication.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig <tobias.koenig@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QCoreApplication>
7#include <QFileOpenEvent>
8
9#include <qpa/qwindowsysteminterface.h>
10
11#include <Entry.h>
12#include <Path.h>
13
14QHaikuApplication::QHaikuApplication(const char *signature)
16{
17}
18
20{
21 QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
22 return true;
23}
24
25void QHaikuApplication::RefsReceived(BMessage* message)
26{
27 uint32 type;
28 int32 count;
29
30 const status_t status = message->GetInfo("refs", &type, &count);
31 if (status == B_OK && type == B_REF_TYPE) {
32 entry_ref ref;
33 for (int32 i = 0; i < count; ++i) {
34 if (message->FindRef("refs", i, &ref) == B_OK) {
35 const BPath path(&ref);
36 QCoreApplication::postEvent(QCoreApplication::instance(), new QFileOpenEvent(QFile::decodeName(path.Path())));
37 }
38 }
39 }
40
41 BApplication::RefsReceived(message);
42}
void RefsReceived(BMessage *message) override
bool QuitRequested() override
QHaikuApplication(const char *signature)