diff options
| author | Pekka Vuorela <pvuorela@iki.fi> | 2025-12-05 09:25:35 +0200 |
|---|---|---|
| committer | Pekka Vuorela <pvuorela@iki.fi> | 2025-12-05 10:30:56 +0200 |
| commit | 1b3da9780f86287dec2cb8b07cfb922afad853f1 (patch) | |
| tree | 41be5c67d20ca295d5d06fd66f04fe94c9b76da1 | |
| parent | 2328252358fd2eaed810a02c4f791919ebe7be21 (diff) | |
Remove heartbeat classes
Apparently unused since 2011(!) - commit 4a659f06eac
Change-Id: Iaa80ce9a1c68bb7431922350c45e9ce0db8807b9
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Damien Caliste <dcaliste@free.fr>
Reviewed-by: <matti.viljanen@kapsi.fi>
5 files changed, 4 insertions, 378 deletions
diff --git a/src/libraries/qmfmessageserver/CMakeLists.txt b/src/libraries/qmfmessageserver/CMakeLists.txt index 8900a65a..3ddf4fce 100644 --- a/src/libraries/qmfmessageserver/CMakeLists.txt +++ b/src/libraries/qmfmessageserver/CMakeLists.txt @@ -8,8 +8,7 @@ set(SRC qmailmessageservice.cpp qmailserviceconfiguration.cpp qmailstoreaccountfilter.cpp - qmailtransport.cpp - qmailheartbeattimer_qtimer.cpp) # NB: There are multiple implementations + qmailtransport.cpp) set(HEADERS longstream_p.h @@ -21,8 +20,7 @@ set(HEADERS qmailmessageservice.h qmailserviceconfiguration.h qmailstoreaccountfilter.h - qmailtransport.h - qmailheartbeattimer.h) + qmailtransport.h) add_library(QmfMessageServer SHARED ${SRC} ${HEADERS}) diff --git a/src/libraries/qmfmessageserver/qmailheartbeattimer.h b/src/libraries/qmfmessageserver/qmailheartbeattimer.h deleted file mode 100644 index 098f03c6..00000000 --- a/src/libraries/qmfmessageserver/qmailheartbeattimer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Messaging Framework. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMAILHEARTBEATTIMER_H -#define QMAILHEARTBEATTIMER_H - -#include <QObject> -#include <QTimer> -#include <QPair> -#include <qmailglobal.h> - -class MESSAGESERVER_EXPORT QMailHeartbeatTimer : public QObject -{ - Q_OBJECT -public: - explicit QMailHeartbeatTimer(QObject *parent = Q_NULLPTR); - ~QMailHeartbeatTimer(); - - bool isActive() const; - - void setInterval(int interval); - void setInterval(int minimum, int maximum); - QPair<int, int> interval() const; - - void setSingleShot(bool singleShot); - bool isSingleShot() const; - void wokeUp(); - - static void singleShot(int interval, QObject *receiver, const char *member); - static void singleShot(int minimum, int maximum, QObject *receiver, const char *member); - -public Q_SLOTS: - void start(int interval); - void start(int minimum, int maximum); - - void start(); - void stop(); - -Q_SIGNALS: - void timeout(); - -private: - Q_DISABLE_COPY(QMailHeartbeatTimer) - - class QMailHeartbeatTimerPrivate* const d_ptr; - Q_DECLARE_PRIVATE(QMailHeartbeatTimer) -}; - -#endif diff --git a/src/libraries/qmfmessageserver/qmailheartbeattimer_iphb.cpp b/src/libraries/qmfmessageserver/qmailheartbeattimer_iphb.cpp deleted file mode 100644 index 56251db0..00000000 --- a/src/libraries/qmfmessageserver/qmailheartbeattimer_iphb.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Messaging Framework. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmailheartbeattimer.h" -#include <QPair> -#include <QSystemAlignedTimer> - -QTM_USE_NAMESPACE - -struct QMailHeartbeatTimerPrivate -{ - QMailHeartbeatTimerPrivate() - : timer(new QSystemAlignedTimer) - {} - - ~QMailHeartbeatTimerPrivate() - { - delete timer; - } - - QSystemAlignedTimer* timer; -}; - -namespace { - int toSeconds(int milliseconds) { return milliseconds / 1000; } - int toMilliseconds(int seconds) { return seconds * 1000; } -} - -QMailHeartbeatTimer::QMailHeartbeatTimer(QObject *parent) - : QObject(parent), d_ptr(new QMailHeartbeatTimerPrivate) -{ - Q_D(QMailHeartbeatTimer); - connect(d->timer, SIGNAL(timeout()), this, SIGNAL(timeout())); -} - -QMailHeartbeatTimer::~QMailHeartbeatTimer() -{ - delete d_ptr; -} - -bool QMailHeartbeatTimer::isActive() const -{ - const Q_D(QMailHeartbeatTimer); - return d->timer->isActive(); -} - -void QMailHeartbeatTimer::setInterval(int interval) -{ - setInterval(interval, interval); -} - -void QMailHeartbeatTimer::setInterval(int minimum, int maximum) -{ - Q_ASSERT(minimum <= maximum); - Q_D(QMailHeartbeatTimer); - d->timer->setMinimumInterval(toSeconds(minimum)); - d->timer->setMaximumInterval(toSeconds(maximum)); -} - -QPair<int, int> QMailHeartbeatTimer::interval() const -{ - const Q_D(QMailHeartbeatTimer); - return qMakePair(toMilliseconds(d->timer->minimumInterval()), toMilliseconds(d->timer->maximumInterval())); -} - -void QMailHeartbeatTimer::setSingleShot(bool singleShot) -{ - Q_D(QMailHeartbeatTimer); - d->timer->setSingleShot(singleShot); -} - -bool QMailHeartbeatTimer::isSingleShot() const -{ - const Q_D(QMailHeartbeatTimer); - return d->timer->isSingleShot(); -} - -void QMailHeartbeatTimer::singleShot(int minimum, int maximum, QObject *receiver, const char *member) -{ - Q_ASSERT(minimum <= maximum); - QSystemAlignedTimer::singleShot(toSeconds(minimum), toSeconds(maximum), receiver, member); -} - -void QMailHeartbeatTimer::singleShot(int interval, QObject *receiver, const char *member) -{ - QSystemAlignedTimer::singleShot(toSeconds(interval), toSeconds(interval), receiver, member); -} - -void QMailHeartbeatTimer::start(int interval) -{ - start(interval, interval); -} - -void QMailHeartbeatTimer::start(int minimum, int maximum) -{ - Q_ASSERT(minimum <= maximum); - Q_D(QMailHeartbeatTimer); - d->timer->start(toSeconds(minimum), toSeconds(maximum)); -} - -void QMailHeartbeatTimer::start() -{ - Q_D(QMailHeartbeatTimer); - d->timer->start(); -} - -void QMailHeartbeatTimer::stop() -{ - Q_D(QMailHeartbeatTimer); - d->timer->stop(); -} - -void QMailHeartbeatTimer::wokeUp() -{ - Q_D(QMailHeartbeatTimer); - d->timer->wokeUp(); -} diff --git a/src/libraries/qmfmessageserver/qmailheartbeattimer_qtimer.cpp b/src/libraries/qmfmessageserver/qmailheartbeattimer_qtimer.cpp deleted file mode 100644 index 1befd382..00000000 --- a/src/libraries/qmfmessageserver/qmailheartbeattimer_qtimer.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Messaging Framework. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmailheartbeattimer.h" -#include <QPair> - -class QMailHeartbeatTimerPrivate -{ -public: - QMailHeartbeatTimerPrivate() - : timer(new QTimer), interval(0, 0) - {} - - ~QMailHeartbeatTimerPrivate() - { - delete timer; - } - - QTimer* timer; - QPair<int, int> interval; -}; - -QMailHeartbeatTimer::QMailHeartbeatTimer(QObject *parent) - : QObject(parent), d_ptr(new QMailHeartbeatTimerPrivate) -{ - Q_D(QMailHeartbeatTimer); - connect(d->timer, SIGNAL(timeout()), this, SIGNAL(timeout())); -} - -QMailHeartbeatTimer::~QMailHeartbeatTimer() -{ - delete d_ptr; -} - -bool QMailHeartbeatTimer::isActive() const -{ - const Q_D(QMailHeartbeatTimer); - return d->timer->isActive(); -} - -void QMailHeartbeatTimer::setInterval(int interval) -{ - setInterval(interval, interval); -} - -void QMailHeartbeatTimer::setInterval(int minimum, int maximum) -{ - Q_ASSERT(minimum <= maximum); - Q_D(QMailHeartbeatTimer); - d->timer->setInterval((minimum + maximum) / 2); - d->interval = qMakePair(minimum, maximum); -} - -QPair<int, int> QMailHeartbeatTimer::interval() const -{ - const Q_D(QMailHeartbeatTimer); - return d->interval; -} - -void QMailHeartbeatTimer::setSingleShot(bool singleShot) -{ - Q_D(QMailHeartbeatTimer); - d->timer->setSingleShot(singleShot); -} - -bool QMailHeartbeatTimer::isSingleShot() const -{ - const Q_D(QMailHeartbeatTimer); - return d->timer->isSingleShot(); -} - -void QMailHeartbeatTimer::singleShot(int minimum, int maximum, QObject *receiver, const char *member) -{ - Q_ASSERT(minimum <= maximum); - QTimer::singleShot((minimum + maximum) / 2, receiver, member); -} - -void QMailHeartbeatTimer::singleShot(int interval, QObject *receiver, const char *member) -{ - QTimer::singleShot(interval, receiver, member); -} - -void QMailHeartbeatTimer::start(int interval) -{ - start(interval, interval); -} - -void QMailHeartbeatTimer::start(int minimum, int maximum) -{ - Q_ASSERT(minimum <= maximum); - Q_D(QMailHeartbeatTimer); - d->timer->start((minimum + maximum) / 2); -} - -void QMailHeartbeatTimer::start() -{ - Q_D(QMailHeartbeatTimer); - d->timer->start(); -} - -void QMailHeartbeatTimer::stop() -{ - Q_D(QMailHeartbeatTimer); - d->timer->stop(); -} - -void QMailHeartbeatTimer::wokeUp() -{ - if (isSingleShot()) { - stop(); - } else { - start(); - } -} diff --git a/src/libraries/qmfmessageserver/qmfmessageserver.pro b/src/libraries/qmfmessageserver/qmfmessageserver.pro index eeb084fc..9e7879c2 100644 --- a/src/libraries/qmfmessageserver/qmfmessageserver.pro +++ b/src/libraries/qmfmessageserver/qmfmessageserver.pro @@ -22,8 +22,7 @@ HEADERS += \ qmailmessageservice.h \ qmailserviceconfiguration.h \ qmailstoreaccountfilter.h \ - qmailtransport.h \ - qmailheartbeattimer.h + qmailtransport.h SOURCES += \ longstream.cpp \ @@ -35,6 +34,5 @@ SOURCES += \ qmailmessageservice.cpp \ qmailserviceconfiguration.cpp \ qmailstoreaccountfilter.cpp \ - qmailtransport.cpp \ - qmailheartbeattimer_qtimer.cpp # NB: There are multiple implementations + qmailtransport.cpp |
