File indexing completed on 2024-12-22 04:56:51

0001 /*
0002  * SPDX-FileCopyrightText: 2013 Christian Mollekopf <mollekopf@kolabsys.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  *
0006  */
0007 
0008 #include "dummymigrator.h"
0009 #include <QDebug>
0010 #include <QTimer>
0011 #include <chrono>
0012 
0013 using namespace std::chrono_literals;
0014 
0015 DummyMigrator::DummyMigrator(const QString &identifier)
0016     : MigratorBase(QLatin1StringView("dummymigrator") + identifier, QString(), QString())
0017 {
0018 }
0019 
0020 QString DummyMigrator::displayName() const
0021 {
0022     return QStringLiteral("dummymigrator");
0023 }
0024 
0025 void DummyMigrator::startWork()
0026 {
0027     qDebug();
0028     QTimer::singleShot(10s, this, &DummyMigrator::onTimerElapsed);
0029 }
0030 
0031 void DummyMigrator::onTimerElapsed()
0032 {
0033     qDebug();
0034     setMigrationState(Complete);
0035 }
0036 
0037 bool DummyMigrator::shouldAutostart() const
0038 {
0039     return true;
0040 }
0041 
0042 bool DummyMigrator::canStart()
0043 {
0044     return true;
0045 }
0046 
0047 void DummyMigrator::pause()
0048 {
0049     qDebug();
0050     MigratorBase::pause();
0051 }
0052 
0053 void DummyMigrator::abort()
0054 {
0055     qDebug();
0056     MigratorBase::abort();
0057 }
0058 
0059 #include "moc_dummymigrator.cpp"