Code adjustments after revew

align copyright statements in header and cpp files

explain why gdbus as example used in README

remove iostream dependency in favour of tqDebug in main.cpp

add again xml header in notificationdaemon.xml

remove dbug-glib check from ConfigureChecks.cmake

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
feat/with_dbus-1-tqt
Emanoil Kotsev 4 years ago
parent 2da6bb1dc4
commit 202ee25cb1

@ -31,10 +31,4 @@ if( NOT DBUS_TQT_FOUND )
tde_message_fatal( "dbus-1-tqt is required, but was not found on your system" )
endif( )
##### check for dbus-glib-1
pkg_search_module( DBUS-GLIB dbus-glib-1 )
if( NOT DBUS-GLIB_FOUND )
tde_message_fatal( "The dbus-glib library is required, but was not found on your system" )
endif( NOT DBUS-GLIB_FOUND )

@ -25,6 +25,8 @@ If you wish to contribute to Kdbusnotification (TDE), you might do so:
https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html
https://sylvaindurand.org/update-notifications-with-libnotify/
To test the implementation use following:
gdbus call \
--session \
--dest org.freedesktop.Notifications \

@ -1,10 +1,10 @@
/*
* NotificationDaemon.cpp
*
* Created on: May 11, 2021
* Author: emanoil
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* kdbusnotification Copyright (C) 2009 kdbusnotification development team
*
* This file is part of kdbusnotification.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@ -19,6 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <tqtimer.h>
#include <tqdbusmessage.h>
#include <tqdbuserror.h>
@ -52,7 +53,6 @@ NotificationDaemon::~NotificationDaemon()
delete freedesktopService;
delete orgService;
delete rootService;
// delete receiver;
}
bool NotificationDaemon::isConnectedToDBUS(){

@ -1,10 +1,10 @@
/*
* NotificationDaemon.h
*
* Created on: May 11, 2021
* Author: emanoil
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* kdbusnotification Copyright (C) 2009 kdbusnotification development team
*
* This file is part of kdbusnotification.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@ -19,6 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SRC_DAEMON_NOTIFICATIONDAEMON_H_
#define SRC_DAEMON_NOTIFICATIONDAEMON_H_
@ -78,7 +79,6 @@ private:
OrgNodeService *orgService;
FreeDesktopNodeService *freedesktopService;
NotificationsNodeService *notificationService;
// DBusReceiver *receiver;
TQT_DBusConnection mConnection;
int retryCount;

@ -1,23 +1,26 @@
/*
* PropertiesService.cpp
*
* Created on: Feb 7, 2021
* Author: emanoil
* Notification DBus Service implementation
*
* hardwarecontrol Copyright (C) 2009 hardwarecontrol development team
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
* This file is part of kdbusnotification.
*
* kdbusnotification 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.
*
* kdbusnotification 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 kdbusnotification; 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "NotificationsService.h"
@ -104,7 +107,7 @@ void NotificationsService::NotifyAsync(
notificationMap[id]->setIcon(icon);
notificationMap[id]->setPaletteBackgroundColor(TQt::black);
notificationMap[id]->setPaletteForegroundColor(TQt::white);
// FXIME: handle hypertext in the body
// TODO: handle hypertext in the body
notificationMap[id]->setText(app_name + ": " + summary + "\n" + body);
notificationMap[id]->setActions(actions);
notificationMap[id]->setHints(hints);

@ -1,24 +1,28 @@
/*
* PropertiesService.h
*
* Created on: Feb 7, 2021
* Author: emanoil
* Notification DBus Service implementation
*
* hardwarecontrol Copyright (C) 2009 hardwarecontrol development team
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
* This file is part of kdbusnotification.
*
* kdbusnotification 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.
*
* kdbusnotification 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 kdbusnotification; 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef NOTIFICATIONSSERVICE_H_
#define NOTIFICATIONSSERVICE_H_

@ -1,10 +1,10 @@
/*
* NotifyWidget.cpp
*
* Created on: May 14, 2021
* Author: emanoil
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* kdbusnotification Copyright (C) 2009 kdbusnotification development team
*
* This file is part of kdbusnotification.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2

@ -1,10 +1,10 @@
/*
* NotifyWidget.h
*
* Created on: May 14, 2021
* Author: emanoil
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* kdbusnotification Copyright (C) 2009 kdbusnotification development team
*
* This file is part of kdbusnotification.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@ -19,6 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SRC_DAEMON_NOTIFYWIDGET_H_
#define SRC_DAEMON_NOTIFYWIDGET_H_

@ -1,10 +1,10 @@
/*
* main.cpp
*
* Created on: May 11, 2021
* Author: emanoil
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
* kdbusnotification Copyright (C) 2009 kdbusnotification development team
*
* This file is part of kdbusnotification.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@ -20,8 +20,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <iostream>
#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
#include <tdemessagebox.h>
@ -49,7 +47,7 @@ main(int argc, char **argv)
if (!KUniqueApplication::start())
{
std::cerr << i18n("notification-daemon-tde is already running.\n").local8Bit();
tqDebug(i18n("notification-daemon-tde is already running.\n").local8Bit());
return 0;
}
@ -60,7 +58,7 @@ main(int argc, char **argv)
{
KMessageBox::error(NULL,i18n("Can't connect to DBus!"));
// debug message for testing
std::cerr << i18n("Can't connect to DBus!\n").local8Bit();
tqDebug(i18n("Can't connect to DBus!\n").local8Bit());
KUniqueApplication::kApplication()->quit();
return 0;
}

@ -1,24 +1,24 @@
/*
*
* HardwareControl DBus Service implementation
* Notification DBus Service implementation
*
* Copyright (C) 2020 Emanoil Kotsev <deloptes@gmail.com>
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
*
* This file is part of tdecore/tdehw.
* This file is part of kdbusnotification.
*
* hardwarecontrol is free software; you can redistribute it and/or modify
* kdbusnotification 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.
*
* hardwarecontrol is distributed in the hope that it will be useful,
* kdbusnotification 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 tdelibs; if not, write to the Free Software
* along with kdbusnotification; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/

@ -2,7 +2,7 @@
*
* Notification DBus Service implementation
*
* Copyright (C) 2020 Emanoil Kotsev <deloptes@gmail.com>
* Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
*
*
* This file is part of kdbusnotification.

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!--

Loading…
Cancel
Save