##// END OF EJS Templates
Really basic implementation of Downloader which might replace current...
Really basic implementation of Downloader which might replace current NetworkController It is currently really basic, it only does synchronous DLs with or without authentication. It is written to isolate as much as possible Qt Network classes. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r878:e439cb403ff9
r1342:91cbf8a85daf
Show More
TimeController.cpp
51 lines | 1.1 KiB | text/x-c | CppLexer
/ core / src / Time / TimeController.cpp
#include "Time/TimeController.h"
#include <QDataStream>
Q_LOGGING_CATEGORY(LOG_TimeController, "TimeController")
struct TimeController::TimeControllerPrivate {
SqpRange m_DateTime;
};
TimeController::TimeController(QObject *parent)
: QObject{parent}, impl{spimpl::make_unique_impl<TimeControllerPrivate>()}
{
qCDebug(LOG_TimeController()) << tr("TimeController construction");
}
SqpRange TimeController::dateTime() const noexcept
{
return impl->m_DateTime;
}
QByteArray TimeController::mimeDataForTimeRange(const SqpRange &timeRange)
{
QByteArray encodedData;
QDataStream stream{&encodedData, QIODevice::WriteOnly};
stream << timeRange.m_TStart << timeRange.m_TEnd;
return encodedData;
}
SqpRange TimeController::timeRangeForMimeData(const QByteArray &mimeData)
{
QDataStream stream{mimeData};
SqpRange timeRange;
stream >> timeRange.m_TStart >> timeRange.m_TEnd;
return timeRange;
}
void TimeController::onTimeToUpdate(SqpRange dateTime)
{
impl->m_DateTime = dateTime;
}
void TimeController::onTimeNotify()
{
emit timeUpdated(impl->m_DateTime);
}