File indexing completed on 2024-04-21 04:54:17

0001 /*
0002     SPDX-FileCopyrightText: 2003 Richard Lärkäng <nouseforaname@home.se>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "asynchttpsubmit.h"
0008 
0009 #include <KIO/Job>
0010 #include <QDebug>
0011 
0012 namespace KCDDB
0013 {
0014   AsyncHTTPSubmit::AsyncHTTPSubmit(const QString& from, const QString& hostname, uint port)
0015     : HTTPSubmit(from, hostname, port)
0016   {
0017 
0018   }
0019 
0020   AsyncHTTPSubmit::~AsyncHTTPSubmit()
0021   {
0022 
0023   }
0024 
0025   Result AsyncHTTPSubmit::runJob(KIO::Job* job)
0026   {
0027     connect(job, &KJob::result, this, &AsyncHTTPSubmit::slotFinished);
0028 
0029     return Success;
0030   }
0031 
0032   void AsyncHTTPSubmit::slotFinished(KJob* job)
0033   {
0034     qDebug() << "Finished";
0035 
0036     if ( job->error()==0 )
0037       Q_EMIT finished( Success );
0038     else
0039       Q_EMIT finished( UnknownError );
0040   }
0041 }
0042 
0043 #include "moc_asynchttpsubmit.cpp"