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" ) tde_message_fatal( "dbus-1-tqt is required, but was not found on your system" )
endif( ) 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://specifications.freedesktop.org/notification-spec/latest/ar01s09.html
https://sylvaindurand.org/update-notifications-with-libnotify/ https://sylvaindurand.org/update-notifications-with-libnotify/
To test the implementation use following:
gdbus call \ gdbus call \
--session \ --session \
--dest org.freedesktop.Notifications \ --dest org.freedesktop.Notifications \

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

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

@ -1,23 +1,26 @@
/* /*
* PropertiesService.cpp
* *
* Created on: Feb 7, 2021 * Notification DBus Service implementation
* Author: emanoil
* *
* 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, * This file is part of kdbusnotification.
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * kdbusnotification is free software; you can redistribute it and/or modify
* GNU General Public License for more details. * 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" #include "NotificationsService.h"
@ -104,7 +107,7 @@ void NotificationsService::NotifyAsync(
notificationMap[id]->setIcon(icon); notificationMap[id]->setIcon(icon);
notificationMap[id]->setPaletteBackgroundColor(TQt::black); notificationMap[id]->setPaletteBackgroundColor(TQt::black);
notificationMap[id]->setPaletteForegroundColor(TQt::white); 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]->setText(app_name + ": " + summary + "\n" + body);
notificationMap[id]->setActions(actions); notificationMap[id]->setActions(actions);
notificationMap[id]->setHints(hints); notificationMap[id]->setHints(hints);

@ -1,24 +1,28 @@
/* /*
* PropertiesService.h
* *
* Created on: Feb 7, 2021 * Notification DBus Service implementation
* Author: emanoil
* *
* 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, * This file is part of kdbusnotification.
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * kdbusnotification is free software; you can redistribute it and/or modify
* GNU General Public License for more details. * 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_ #ifndef NOTIFICATIONSSERVICE_H_
#define NOTIFICATIONSSERVICE_H_ #define NOTIFICATIONSSERVICE_H_

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

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

@ -1,10 +1,10 @@
/* /*
* main.cpp * main.cpp
* *
* Created on: May 11, 2021 * Copyright (C) 2021 Emanoil Kotsev <deloptes@gmail.com>
* Author: emanoil
* *
* 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <iostream>
#include <tdecmdlineargs.h> #include <tdecmdlineargs.h>
#include <tdeaboutdata.h> #include <tdeaboutdata.h>
#include <tdemessagebox.h> #include <tdemessagebox.h>
@ -49,7 +47,7 @@ main(int argc, char **argv)
if (!KUniqueApplication::start()) 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; return 0;
} }
@ -60,7 +58,7 @@ main(int argc, char **argv)
{ {
KMessageBox::error(NULL,i18n("Can't connect to DBus!")); KMessageBox::error(NULL,i18n("Can't connect to DBus!"));
// debug message for testing // 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(); KUniqueApplication::kApplication()->quit();
return 0; 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * 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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* *
*/ */

@ -2,7 +2,7 @@
* *
* Notification 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 kdbusnotification. * 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"> <!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