/*
 * SPDX-FileCopyrightText: 2026 ChromiumOS-Guy <chromiumos-guy-opensource@proton.me>
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "request.h"
#include "request_adaptor.h"

#include <QDBusConnection>
#include <QDBusObjectPath>
#include <QDebug>

Request::Request(const QDBusObjectPath &handle, QObject *parent)
    : QObject(parent)
{
    new RequestAdaptor(this);
    if (!QDBusConnection::sessionBus().registerObject(handle.path(), this)) {
        qWarning() << "Failed to register request object for" << handle.path()
                   << QDBusConnection::sessionBus().lastError().message();
        deleteLater();
    }
}

void Request::Close()
{
    deleteLater();
}