Commit 560fcdf8 authored by Laurent Montel's avatar Laurent Montel 😁

Add util class

parent 5fa85fea
......@@ -8,8 +8,14 @@ include_directories(
set(followupreminderlib_SRCS
followupreminderinfo.cpp
followupreminderutil.cpp
)
kde4_add_kcfg_files(followupreminderlib_SRCS
followupreminderagentsettings.kcfgc
)
kde4_add_library( followupreminder ${LIBRARY_TYPE} ${followupreminderlib_SRCS} )
target_link_libraries( followupreminder ${KDE4_KDEUI_LIBS} )
......@@ -34,10 +40,6 @@ set(followupreminderagent_SRCS
qt4_add_dbus_adaptor(followupreminderagent_SRCS org.freedesktop.Akonadi.FollowUpReminder.xml followupreminderagent.h FollowUpReminderAgent)
kde4_add_kcfg_files(followupreminderagent_SRCS
followupreminderagentsettings.kcfgc
)
kde4_add_executable(akonadi_followupreminder_agent ${followupreminderagent_SRCS})
target_link_libraries(akonadi_followupreminder_agent
......
......@@ -3,3 +3,6 @@ File=followupreminderagentsettings.kcfg
ClassName=FollowUpReminderAgentSettings
Singleton=true
Mutators=true
Visibility=FOLLOWUPREMINDER_EXPORT
IncludeFiles=followupreminder_export.h
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
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.
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "followupreminderutil.h"
#include <QDBusInterface>
#include "followupreminderagentsettings.h"
bool FollowUpReminder::FollowUpReminderUtil::sentLaterAgentWasRegistered()
{
QDBusInterface interface( QLatin1String("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent"), QLatin1String("/FollowUpReminder") );
return interface.isValid();
}
bool FollowUpReminder::FollowUpReminderUtil::sentLaterAgentEnabled()
{
return FollowUpReminderAgentSettings::self()->enabled();
}
void FollowUpReminder::FollowUpReminderUtil::reload()
{
QDBusInterface interface( QLatin1String("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent"), QLatin1String("/FollowUpReminder") );
if (interface.isValid()) {
interface.call(QLatin1String("reload"));
}
}
void FollowUpReminder::FollowUpReminderUtil::forceReparseConfiguration()
{
FollowUpReminderAgentSettings::self()->writeConfig();
FollowUpReminderAgentSettings::self()->config()->reparseConfiguration();
}
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
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.
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FOLLOWUPREMINDERUTIL_H
#define FOLLOWUPREMINDERUTIL_H
#include "followupreminder_export.h"
namespace FollowUpReminder {
namespace FollowUpReminderUtil {
FOLLOWUPREMINDER_EXPORT bool sentLaterAgentWasRegistered();
FOLLOWUPREMINDER_EXPORT bool sentLaterAgentEnabled();
FOLLOWUPREMINDER_EXPORT void reload();
FOLLOWUPREMINDER_EXPORT void forceReparseConfiguration();
}
}
#endif // FOLLOWUPREMINDERUTIL_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment