Commit 1e305793 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use pimcommon api

parent a0ada1fe
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(PIM_VERSION "5.3.46")
set(PIM_VERSION "5.3.47")
set(LIBKSIEVE_LIB_VERSION ${PIM_VERSION})
set(QT_REQUIRED_VERSION "5.6.0")
set(KMIME_LIB_VERSION "5.3.40")
......@@ -26,7 +26,7 @@ set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.42")
set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.3.40")
set(LIBKDEPIM_LIB_VERSION "5.3.40")
set(PIMCOMMON_LIB_VERSION "5.3.40")
set(PIMCOMMON_LIB_VERSION "5.3.61")
set(AKONADI_VERSION "5.3.40")
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
......
......@@ -183,7 +183,6 @@ set(ksieveui_managescriptjob_LIB_SRCS
set(ksieveui_LIB_SRCS
managesievescriptsdialog.cpp
sievenetworkmanager.cpp
widgets/custommanagesievewidget.cpp
widgets/sievetreewidgetitem.cpp
widgets/managesievetreeview.cpp
......@@ -245,7 +244,6 @@ target_include_directories(KF5KSieveUi PUBLIC "$<BUILD_INTERFACE:${libksieve_SOU
ecm_generate_headers(ksieveui_CamelCase_HEADERS
HEADER_NAMES
ManageSieveScriptsDialog
SieveNetworkManager
REQUIRED_HEADERS ksieveui_HEADERS
PREFIX KSieveUi
)
......
/*
Copyright (c) 2016 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 "sievenetworkmanager.h"
#include <QNetworkConfigurationManager>
using namespace KSieveUi;
Q_GLOBAL_STATIC(SieveNetworkManager, s_pSieveNetworkManagerSelf)
SieveNetworkManager::SieveNetworkManager(QObject *parent)
: QObject(parent)
{
mNetworkConfigureManager = new QNetworkConfigurationManager();
}
SieveNetworkManager::~SieveNetworkManager()
{
delete mNetworkConfigureManager;
}
SieveNetworkManager *SieveNetworkManager::self()
{
return s_pSieveNetworkManagerSelf();
}
QNetworkConfigurationManager *SieveNetworkManager::networkConfigureManager() const
{
return mNetworkConfigureManager;
}
/*
Copyright (c) 2016 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 SIEVENETWORKMANAGER_H
#define SIEVENETWORKMANAGER_H
#include <QObject>
#include "ksieveui_export.h"
class QNetworkConfigurationManager;
namespace KSieveUi
{
class KSIEVEUI_EXPORT SieveNetworkManager : public QObject
{
Q_OBJECT
public:
explicit SieveNetworkManager(QObject *parent = Q_NULLPTR);
~SieveNetworkManager();
static SieveNetworkManager *self();
QNetworkConfigurationManager *networkConfigureManager() const;
private:
QNetworkConfigurationManager *mNetworkConfigureManager;
};
}
#endif // SIEVENETWORKMANAGER_H
......@@ -20,11 +20,11 @@
#include "widgets/sievetreewidgetitem.h"
#include "managescriptsjob/renamescriptjob.h"
#include "libksieve_debug.h"
#include "sievenetworkmanager.h"
#include <kmanagesieve/sievejob.h>
#include <managescriptsjob/parseuserscriptjob.h>
#include <managescriptsjob/generateglobalscriptjob.h>
#include <PimCommon/NetworkManager>
#include <util/util.h>
#include <QInputDialog>
......@@ -78,7 +78,7 @@ ManageSieveWidget::ManageSieveWidget(QWidget *parent)
connect(d->mTreeView, &ManageSieveTreeView::itemSelectionChanged, this, &ManageSieveWidget::slotUpdateButtons);
connect(d->mTreeView, &ManageSieveTreeView::itemChanged, this, &ManageSieveWidget::slotItemChanged);
connect(KSieveUi::SieveNetworkManager::self()->networkConfigureManager(), &QNetworkConfigurationManager::onlineStateChanged, this, &ManageSieveWidget::slotSystemNetworkOnlineStateChanged);
connect(PimCommon::NetworkManager::self()->networkConfigureManager(), &QNetworkConfigurationManager::onlineStateChanged, this, &ManageSieveWidget::slotSystemNetworkOnlineStateChanged);
lay->addWidget(d->mTreeView);
setLayout(lay);
......@@ -93,7 +93,7 @@ ManageSieveWidget::~ManageSieveWidget()
void ManageSieveWidget::slotCheckNetworkStatus()
{
slotSystemNetworkOnlineStateChanged(KSieveUi::SieveNetworkManager::self()->networkConfigureManager()->isOnline());
slotSystemNetworkOnlineStateChanged(PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline());
}
void ManageSieveWidget::slotSystemNetworkOnlineStateChanged(bool state)
......
Supports Markdown
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