From 11787ea278bc6ff6d5bc797b597df3f26e2ec9b4 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 19:55:13 +0200 Subject: Introduce DBusAPI and RWAHost classes --- src/RWAHost.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/RWAHost.h (limited to 'src/RWAHost.h') diff --git a/src/RWAHost.h b/src/RWAHost.h new file mode 100644 index 0000000..c78ef5f --- /dev/null +++ b/src/RWAHost.h @@ -0,0 +1,56 @@ +/* + * This file is part of Remote Support Desktop + * https://gitlab.das-netzwerkteam.de/RemoteWebApp/rwa.support.desktopapp + * Copyright 2021 Daniel Teichmann + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RWAHOST_H +#define RWAHOST_H + +#include +#include + +class RWAHost : public QObject +{ + Q_OBJECT +public: + explicit RWAHost(QString uuid = "", QString alias = "", QString url = ""); + + QString uuid() const; + QString alias() const; + QString url() const; + + void setUuid(const QString &uuid); + void setAlias(const QString &alias); + void setUrl(const QString &url); + +private: + QString _uuid; + QString _alias; + QString _url; + +signals: + +public slots: +}; + +#endif // RWAHOST_H -- cgit v1.2.3 From 9d3405f5e94e21e4401c30808dc3c93f6fbd3283 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 7 Jul 2021 15:40:58 +0200 Subject: RWAHost is now an QObject available to QML. --- src/RWAHost.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/RWAHost.h') diff --git a/src/RWAHost.h b/src/RWAHost.h index c78ef5f..58b6d45 100644 --- a/src/RWAHost.h +++ b/src/RWAHost.h @@ -29,19 +29,14 @@ #include #include -class RWAHost : public QObject -{ +class RWAHost : public QObject { Q_OBJECT -public: - explicit RWAHost(QString uuid = "", QString alias = "", QString url = ""); - - QString uuid() const; - QString alias() const; - QString url() const; + Q_PROPERTY(QString uuid READ uuid WRITE setUuid NOTIFY uuidChanged) + Q_PROPERTY(QString alias READ alias WRITE setAlias NOTIFY aliasChanged) + Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged) - void setUuid(const QString &uuid); - void setAlias(const QString &alias); - void setUrl(const QString &url); +public: + RWAHost(QString uuid = "", QString alias = "", QString url = ""); private: QString _uuid; @@ -49,8 +44,19 @@ private: QString _url; signals: + void uuidChanged(QString uuid); + void aliasChanged(QString alias); + void urlChanged(QString url); public slots: + QString uuid() const; + QString alias() const; + QString url() const; + + void setUuid(const QString &uuid); + void setAlias(const QString &alias); + void setUrl(const QString &url); + }; #endif // RWAHOST_H -- cgit v1.2.3 From afafc8ff96e486e9f903c643945832bee11659a1 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Mon, 12 Jul 2021 12:51:27 +0200 Subject: Make RWAHost object creation silent again. --- src/RWAHost.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/RWAHost.h') diff --git a/src/RWAHost.h b/src/RWAHost.h index 58b6d45..cd3b1ce 100644 --- a/src/RWAHost.h +++ b/src/RWAHost.h @@ -37,6 +37,7 @@ class RWAHost : public QObject { public: RWAHost(QString uuid = "", QString alias = "", QString url = ""); + RWAHost(const RWAHost&); private: QString _uuid; -- cgit v1.2.3