File indexing completed on 2024-04-28 04:57:33

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2008 Manolo Valdes <nolis71cu@gmail.com>
0004 
0005    This program is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 */
0010 
0011 #include "mirrorsearchtransferdatasource.h"
0012 #include "mirrors.h"
0013 
0014 #include "kget_debug.h"
0015 #include <QDebug>
0016 
0017 MirrorSearchTransferDataSource::MirrorSearchTransferDataSource(const QUrl &srcUrl, QObject *parent)
0018     : TransferDataSource(srcUrl, parent)
0019 {
0020     m_filename = m_sourceUrl.fileName();
0021     qCDebug(KGET_DEBUG) << m_filename;
0022 }
0023 
0024 void MirrorSearchTransferDataSource::start()
0025 {
0026     qCDebug(KGET_DEBUG);
0027     if (!m_filename.isEmpty())
0028         MirrorSearch(m_filename, this, SLOT(slotSearchUrls(QList<QUrl> &)));
0029 }
0030 
0031 void MirrorSearchTransferDataSource::stop()
0032 {
0033     qCDebug(KGET_DEBUG);
0034 }
0035 
0036 void MirrorSearchTransferDataSource::addSegments(const QPair<KIO::fileoffset_t, KIO::fileoffset_t> &segmentSize, const QPair<int, int> &segmentRange)
0037 {
0038     Q_UNUSED(segmentSize)
0039     Q_UNUSED(segmentRange)
0040     qCDebug(KGET_DEBUG);
0041 }
0042 
0043 void MirrorSearchTransferDataSource::slotSearchUrls(QList<QUrl> &Urls)
0044 {
0045     Q_EMIT data(Urls);
0046 }
0047 
0048 #include "moc_mirrorsearchtransferdatasource.cpp"