Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:wolfi323:branches:home:wolfi323:branches:KDE:Frameworks5
kget5
port-kurl-to-qurl.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File port-kurl-to-qurl.patch of Package kget5
diff --git a/transfer-plugins/bittorrent/advanceddetails/fileview.cpp b/transfer-plugins/bittorrent/advanceddetails/fileview.cpp index 41d9a742..4690e943 100644 --- a/transfer-plugins/bittorrent/advanceddetails/fileview.cpp +++ b/transfer-plugins/bittorrent/advanceddetails/fileview.cpp @@ -219,7 +219,7 @@ namespace kt void FileView::open() { - new KRun(KUrl(preview_path), 0, 0, true, true); + new KRun(QUrl(preview_path), 0, 0, true, true); //Wolfi: nicht eher QUrl::fromLocalFile(...)?? } void FileView::changePriority(bt::Priority newpriority) @@ -277,7 +277,7 @@ namespace kt QModelIndexList sel = selectionModel()->selectedRows(); QMap<bt::TorrentFileInterface*,QString> moves; - QString dir = KFileDialog::getExistingDirectory(KUrl("kfiledialog:///saveTorrentData"), + QString dir = KFileDialog::getExistingDirectory(QUrl("kfiledialog:///saveTorrentData"), this,i18n("Select a directory to move the data to.")); if (dir.isNull()) return; @@ -298,7 +298,7 @@ namespace kt } else { - QString dir = KFileDialog::getExistingDirectory(KUrl("kfiledialog:///saveTorrentData"), + QString dir = KFileDialog::getExistingDirectory(QUrl("kfiledialog:///saveTorrentData"), this,i18n("Select a directory to move the data to.")); if (dir.isNull()) return; @@ -352,17 +352,17 @@ namespace kt if (!file) { // directory - new KRun(KUrl(curr_tc->getDataDir() + model->dirPath(proxy_model->mapToSource(index))), 0, 0, true, true); + new KRun(QUrl(curr_tc->getDataDir() + model->dirPath(proxy_model->mapToSource(index))), 0, 0, true, true); //Wolfi: nicht eher QUrl::fromLocalFile(...)?? } else { // file - new KRun(KUrl(file->getPathOnDisk()), 0, 0, true, true); + new KRun(QUrl(file->getPathOnDisk()), 0, 0, true, true); //Wolfi: nicht eher QUrl::fromLocalFile(...)?? } } else { - new KRun(KUrl(curr_tc->getStats().output_path), 0, 0, true, true); + new KRun(QUrl(curr_tc->getStats().output_path), 0, 0, true, true); //Wolfi: nicht eher QUrl::fromLocalFile(...)?? } } diff --git a/transfer-plugins/bittorrent/advanceddetails/trackermodel.cpp b/transfer-plugins/bittorrent/advanceddetails/trackermodel.cpp index 752665c2..0ba19376 100644 --- a/transfer-plugins/bittorrent/advanceddetails/trackermodel.cpp +++ b/transfer-plugins/bittorrent/advanceddetails/trackermodel.cpp @@ -128,7 +128,7 @@ namespace kt if (role == Qt::CheckStateRole) { - KUrl url = trackers.at(index.row())->trk->trackerURL(); + QUrl url = trackers.at(index.row())->trk->trackerURL(); tc->getTrackersList()->setTrackerEnabled(url,(Qt::CheckState)value.toUInt() == Qt::Checked); return true; } @@ -188,7 +188,7 @@ namespace kt for (int i = 0;i < count;i++) { Item* item = trackers.takeAt(row); - KUrl url = item->trk->trackerURL(); + QUrl url = item->trk->trackerURL(); tc->getTrackersList()->removeTracker(url); delete item; } @@ -214,10 +214,10 @@ namespace kt } - KUrl TrackerModel::trackerUrl(const QModelIndex & index) + QUrl TrackerModel::trackerUrl(const QModelIndex & index) { if (!tc || !index.isValid() || index.row() < 0 || index.row() >= trackers.count()) - return KUrl(); + return QUrl(); return ((Item*)index.internalPointer())->trk->trackerURL(); } @@ -280,7 +280,7 @@ namespace kt { switch (column) { - case 0: return trk->trackerURL().prettyUrl(); + case 0: return trk->trackerURL().toDisplayString(); case 1: return trk->trackerStatusString(); case 2: return seeders >= 0 ? seeders : QVariant(); case 3: return leechers >= 0 ? leechers : QVariant(); @@ -301,7 +301,7 @@ namespace kt { switch (column) { - case 0: return trk->trackerURL().prettyUrl(); + case 0: return trk->trackerURL().toDisplayString(); case 1: return status; case 2: return seeders; case 3: return leechers; diff --git a/transfer-plugins/bittorrent/advanceddetails/trackermodel.h b/transfer-plugins/bittorrent/advanceddetails/trackermodel.h index bfe0ae81..74ae99e2 100644 --- a/transfer-plugins/bittorrent/advanceddetails/trackermodel.h +++ b/transfer-plugins/bittorrent/advanceddetails/trackermodel.h @@ -22,7 +22,7 @@ #define KTTRACKERMODEL_H #include <QList> -#include <KUrl> +#include <QUrl> #include <QAbstractTableModel> #include <interfaces/trackerinterface.h> @@ -58,7 +58,7 @@ namespace kt virtual QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const; /// Get a tracker url given a model index - KUrl trackerUrl(const QModelIndex & idx); + QUrl trackerUrl(const QModelIndex & idx); /// Get a tracker given a model index bt::TrackerInterface* tracker(const QModelIndex & idx); diff --git a/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.cpp b/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.cpp index 71850aea..e8020450 100644 --- a/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.cpp +++ b/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.cpp @@ -142,7 +142,7 @@ namespace kt const bt::WebSeedInterface* ws = curr_tc->getWebSeed(index.row()); switch (index.column()) { - case 0: return ws->getUrl().prettyUrl(); + case 0: return ws->getUrl().toDisplayString(); case 1: return bt::BytesPerSecToString(ws->getDownloadRate()); case 2: return bt::BytesToString(ws->getTotalDownloaded()); case 3: return ws->getStatus(); diff --git a/transfer-plugins/bittorrent/advanceddetails/webseedstab.cpp b/transfer-plugins/bittorrent/advanceddetails/webseedstab.cpp index d87e07f7..897884f8 100644 --- a/transfer-plugins/bittorrent/advanceddetails/webseedstab.cpp +++ b/transfer-plugins/bittorrent/advanceddetails/webseedstab.cpp @@ -79,8 +79,8 @@ namespace kt if (!curr_tc) return; - KUrl url(m_webseed->text()); - if (curr_tc != 0 && url.isValid() && url.protocol() == "http") + QUrl url(m_webseed->text()); + if (curr_tc != 0 && url.isValid() && url.scheme() == "http") { if (curr_tc->addWebSeed(url)) { @@ -89,7 +89,7 @@ namespace kt } else { - KMessageBox::error(this,i18n("Cannot add the webseed %1, it is already part of the list of webseeds.", url.prettyUrl())); + KMessageBox::error(this,i18n("Cannot add the webseed %1, it is already part of the list of webseeds.", url.toDisplayString())); } } } @@ -106,7 +106,7 @@ namespace kt if (ws && ws->isUserCreated()) { if (!curr_tc->removeWebSeed(ws->getUrl())) - KMessageBox::error(this,i18n("Cannot remove webseed %1, it is part of the torrent.", ws->getUrl().prettyUrl())); + KMessageBox::error(this,i18n("Cannot remove webseed %1, it is part of the torrent.", ws->getUrl().toDisplayString())); } } @@ -139,8 +139,8 @@ namespace kt void WebSeedsTab::onWebSeedTextChanged(const QString & ws) { - KUrl url(ws); - m_add->setEnabled(curr_tc != 0 && url.isValid() && url.protocol() == "http"); + QUrl url(ws); + m_add->setEnabled(curr_tc != 0 && url.isValid() && url.scheme() == "http"); } void WebSeedsTab::update() diff --git a/transfer-plugins/bittorrent/btdatasource.cpp b/transfer-plugins/bittorrent/btdatasource.cpp index 6262c8d5..88bcaa67 100644 --- a/transfer-plugins/bittorrent/btdatasource.cpp +++ b/transfer-plugins/bittorrent/btdatasource.cpp @@ -29,11 +29,11 @@ using namespace bt; -BTDataSource::BTDataSource(const KUrl &srcUrl, QObject *parent) +BTDataSource::BTDataSource(const QUrl &srcUrl, QObject *parent) : TransferDataSource(srcUrl, parent), m_offset(0), m_bytes(0), - m_torrentSource(KUrl()) + m_torrentSource(QUrl()) { bt::InitLog(KStandardDirs::locateLocal("appdata", "torrentlog.log"));//initialize the torrent-log @@ -81,7 +81,7 @@ void BTDataSource::start() if (m_torrentSource.isEmpty()) { Download *download = new Download(m_source, KStandardDirs::locateLocal("appdata", "tmp/") + m_source.fileName()); - connect(download, SIGNAL(finishedSuccessfully(KUrl,QByteArray)), SLOT(init(KUrl,QByteArray))); + connect(download, SIGNAL(finishedSuccessfully(QUrl,QByteArray)), SLOT(init(QUrl,QByteArray))); } else { @@ -121,7 +121,7 @@ void BTDataSource::update() tc->update(); } -void BTDataSource::init(const KUrl &torrentSource, const QByteArray &data) +void BTDataSource::init(const QUrl &torrentSource, const QByteArray &data) { Q_UNUSED(data) m_torrentSource = torrentSource; diff --git a/transfer-plugins/bittorrent/btdatasource.h b/transfer-plugins/bittorrent/btdatasource.h index bbc02d21..2af239d2 100644 --- a/transfer-plugins/bittorrent/btdatasource.h +++ b/transfer-plugins/bittorrent/btdatasource.h @@ -14,7 +14,7 @@ #include "core/transferdatasource.h" #include <kio/job.h> -#include <KUrl> +#include <QUrl> #include <QTimer> namespace bt @@ -31,7 +31,7 @@ class BTDataSource : public TransferDataSource { Q_OBJECT public: - BTDataSource(const KUrl &srcUrl, QObject *parent); + BTDataSource(const QUrl &srcUrl, QObject *parent); ~BTDataSource(); void start(); @@ -40,7 +40,7 @@ class BTDataSource : public TransferDataSource void getData(const KIO::fileoffset_t &off, const QByteArray &dataArray); private slots: - void init(const KUrl &torrentSource, const QByteArray &data); + void init(const QUrl &torrentSource, const QByteArray &data); void cacheAdded(BTCache *cache); void selectorAdded(BTChunkSelector *selector); void update(); @@ -53,7 +53,7 @@ class BTDataSource : public TransferDataSource KIO::fileoffset_t m_offset; KIO::fileoffset_t m_bytes; - KUrl m_torrentSource; + QUrl m_torrentSource; QTimer timer; }; diff --git a/transfer-plugins/bittorrent/btdetailswidget.cpp b/transfer-plugins/bittorrent/btdetailswidget.cpp index 52280a9e..a9d8da12 100644 --- a/transfer-plugins/bittorrent/btdetailswidget.cpp +++ b/transfer-plugins/bittorrent/btdetailswidget.cpp @@ -22,8 +22,8 @@ BTDetailsWidget::BTDetailsWidget(BTTransferHandler * transfer) setupUi(this); // Update the view with the correct values - srcEdit->setText(transfer->source().pathOrUrl()); - destEdit->setText(transfer->dest().pathOrUrl()); + srcEdit->setText(transfer->source().toDisplayString(QUrl::PreferLocalFile)); //Wolfi: ist hier evtl. toString(...) besser, also z.B: Passwörter von Url nicht entfernen? + destEdit->setText(transfer->dest().toDisplayString(QUrl::PreferLocalFile)); //Wolfi: ditto seederLabel->setText(i18nc("not available", "n/a")); leecherLabel->setText(i18nc("not available", "n/a")); @@ -80,7 +80,7 @@ void BTDetailsWidget::slotTransferChanged(TransferHandler * transfer, TransferHa progressBar->setValue(m_transfer->percent()); if(flags & Transfer::Tc_FileName) - destEdit->setText(m_transfer->dest().pathOrUrl()); + destEdit->setText(m_transfer->dest().toDisplayString(QUrl::PreferLocalFile)); //Wolfi: ditto } void BTDetailsWidget::showEvent(QShowEvent * event) diff --git a/transfer-plugins/bittorrent/bttransfer.cpp b/transfer-plugins/bittorrent/bttransfer.cpp index 5bab4fd3..834581a9 100644 --- a/transfer-plugins/bittorrent/bttransfer.cpp +++ b/transfer-plugins/bittorrent/bttransfer.cpp @@ -36,7 +36,7 @@ #include <KIconLoader> #include <KIO/CopyJob> #include <KStandardDirs> -#include <KUrl> +#include <QUrl> #include <KMessageBox> #include <QFile> @@ -49,7 +49,7 @@ #endif BTTransfer::BTTransfer(TransferGroup* parent, TransferFactory* factory, - Scheduler* scheduler, const KUrl& src, const KUrl& dest, + Scheduler* scheduler, const QUrl &src, const QUrl& dest, const QDomElement * e) : Transfer(parent, factory, scheduler, src, dest, e), torrent(0), @@ -60,7 +60,7 @@ BTTransfer::BTTransfer(TransferGroup* parent, TransferFactory* factory, m_fileModel(0), m_updateCounter(0) { - m_directory = m_dest.upUrl();//FIXME test + m_directory = KIO::upUrl(m_dest);//FIXME test setCapabilities(Transfer::Cap_Moving | Transfer::Cap_Renaming | Transfer::Cap_Resuming | Transfer::Cap_SpeedLimit); } @@ -133,7 +133,7 @@ void BTTransfer::start() setTransferChange(Tc_Status, true); //m_source = KStandardDirs::locateLocal("appdata", "tmp/") + m_source.fileName(); - connect(download, SIGNAL(finishedSuccessfully(KUrl,QByteArray)), SLOT(btTransferInit(KUrl,QByteArray))); + connect(download, SIGNAL(finishedSuccessfully(QUrl,QByteArray)), SLOT(btTransferInit(QUrl,QByteArray))); } else btTransferInit(); @@ -142,20 +142,22 @@ void BTTransfer::start() startTorrent(); } -bool BTTransfer::setDirectory(const KUrl &newDirectory) +bool BTTransfer::setDirectory(const QUrl &newDirectory) { //check if the newDestination is the same as the old - KUrl temp = newDirectory; - temp.addPath(torrent->getStats().torrent_name); + QUrl temp = newDirectory; + temp = temp.adjusted(QUrl::StripTrailingSlash); + temp.setPath(temp.path() + '/' + (torrent->getStats().torrent_name)); if (newDirectory.isValid() && (newDirectory != dest()) && (temp != dest())) { - if (torrent->changeOutputDir(newDirectory.pathOrUrl(), bt::TorrentInterface::MOVE_FILES)) + if (torrent->changeOutputDir(newDirectory.url(QUrl::PreferLocalFile), bt::TorrentInterface::MOVE_FILES)) { connect(torrent, SIGNAL(aboutToBeStarted(bt::TorrentInterface*,bool&)), this, SLOT(newDestResult())); m_movingFile = true; m_directory = newDirectory; m_dest = m_directory; - m_dest.addPath(torrent->getStats().torrent_name); + m_dest = m_dest.adjusted(QUrl::StripTrailingSlash); + m_dest.setPath(m_dest.path() + '/' + (torrent->getStats().torrent_name)); setStatus(Job::Stopped, i18nc("changing the destination of the file", "Changing destination"), SmallIcon("media-playback-pause")); setTransferChange(Tc_Status, true); @@ -252,7 +254,7 @@ void BTTransfer::addTracker(const QString &url) return; } - if(!KUrl(url).isValid()) { + if(!QUrl(url).isValid()) { KMessageBox::error(0, i18n("Malformed URL.")); return; } @@ -353,8 +355,8 @@ void BTTransfer::updateFilesStatus() const bt::TorrentStats *stats = &torrent->getStats(); if (stats->multi_file_torrent) { - QHash<KUrl, bt::TorrentFileInterface*>::const_iterator it; - QHash<KUrl, bt::TorrentFileInterface*>::const_iterator itEnd = m_files.constEnd(); + QHash<QUrl, bt::TorrentFileInterface*>::const_iterator it; + QHash<QUrl, bt::TorrentFileInterface*>::const_iterator itEnd = m_files.constEnd(); for (it = m_files.constBegin(); it != itEnd; ++it) { QModelIndex status = m_fileModel->index(it.key(), FileItem::Status); @@ -399,7 +401,7 @@ void BTTransfer::updateFilesStatus() } } -void BTTransfer::btTransferInit(const KUrl &src, const QByteArray &data) +void BTTransfer::btTransferInit(const QUrl &src, const QByteArray &data) { Q_UNUSED(data) qCDebug(KGET_DEBUG); @@ -452,12 +454,14 @@ void BTTransfer::btTransferInit(const KUrl &src, const QByteArray &data) m_ready = true; kDebug() << "Source:" << m_source.path() << "Destination:" << m_dest.path(); - torrent->init(0, file.readAll(), m_tmp + m_source.fileName().remove(".torrent"), KUrl(m_dest.directory()).toLocalFile()); + m_dest = m_dest.adjusted(QUrl::StripTrailingSlash); + torrent->init(0, file.readAll(), m_tmp + m_source.fileName().remove(".torrent"), QUrl::fromLocalFile(m_dest.adjusted(QUrl::RemoveFilename).path()).toLocalFile()); m_dest = torrent->getStats().output_path; if (!torrent->getStats().multi_file_torrent && (m_dest.fileName() != torrent->getStats().torrent_name))//TODO check if this is needed, so if that case is true at some point { - m_dest.addPath(torrent->getStats().torrent_name); + m_dest = m_dest.adjusted(QUrl::StripTrailingSlash); + m_dest.setPath(m_dest.path() + '/' + (torrent->getStats().torrent_name)); } torrent->createFiles(); @@ -500,12 +504,12 @@ void BTTransfer::slotDownloadFinished(bt::TorrentInterface* ti) } /**Property-Functions**/ -KUrl::List BTTransfer::trackersList() const +QList<QUrl> BTTransfer::trackersList() const { if (!torrent) - return KUrl::List(); + return QList<QUrl>(); - KUrl::List trackers; + QList<QUrl> trackers; foreach (bt::TrackerInterface * tracker, torrent->getTrackersList()->getTrackers()) trackers << tracker->trackerURL(); return trackers; @@ -661,9 +665,9 @@ void BTTransfer::destroyed() static_cast<BTTransferHandler*>(handler())->torrentMonitor()->destroyed(); } -QList<KUrl> BTTransfer::files() const +QList<QUrl> BTTransfer::files() const { - QList<KUrl> urls; + QList<QUrl> urls; if (!torrent) { @@ -676,16 +680,17 @@ QList<KUrl> BTTransfer::files() const for (uint i = 0; i < torrent->getNumFiles(); ++i) { const QString path = torrent->getTorrentFile(i).getPathOnDisk(); - urls.append(KUrl(path)); + urls.append(QUrl(path)); //Wolfi: nicht eher QUrl::fromLocalFile(path)?? } } //one single file else { - KUrl temp = m_dest; + QUrl temp = m_dest; if (m_dest.fileName() != torrent->getStats().torrent_name)//TODO check if the body is ever entered! { - temp.addPath(torrent->getStats().torrent_name); + temp = temp.adjusted(QUrl::StripTrailingSlash); + temp.setPath(temp.path() + '/' + (torrent->getStats().torrent_name)); } urls.append(temp); } @@ -718,7 +723,7 @@ void BTTransfer::filesSelected() { foreach (const QModelIndex &index, indexes) { - const KUrl dest = fileModel()->getUrl(index); + const QUrl dest = fileModel()->getUrl(index); const bool doDownload = index.data(Qt::CheckStateRole).toBool(); bt::TorrentFileInterface *file = m_files[dest]; file->setDoNotDownload(!doDownload); @@ -743,15 +748,15 @@ FileModel *BTTransfer::fileModel()//TODO correct file model for one-file-torrent for (bt::Uint32 i = 0; i < torrent->getNumFiles(); ++i) { bt::TorrentFileInterface *file = &torrent->getTorrentFile(i); - m_files[KUrl(file->getPathOnDisk())] = file; + m_files[QUrl(file->getPathOnDisk())] = file; //Wolfi: nicht eher QUrl::fromLocalFile(file->...)?? } m_fileModel = new FileModel(m_files.keys(), directory(), this); - // connect(m_fileModel, SIGNAL(rename(KUrl,KUrl)), this, SLOT(slotRename(KUrl,KUrl))); + // connect(m_fileModel, SIGNAL(rename(QUrl,QUrl)), this, SLOT(slotRename(QUrl,QUrl))); connect(m_fileModel, SIGNAL(checkStateChanged()), this, SLOT(filesSelected())); //set the checkstate, the status and the size of the model items - QHash<KUrl, bt::TorrentFileInterface*>::const_iterator it; - QHash<KUrl, bt::TorrentFileInterface*>::const_iterator itEnd = m_files.constEnd(); + QHash<QUrl, bt::TorrentFileInterface*>::const_iterator it; + QHash<QUrl, bt::TorrentFileInterface*>::const_iterator itEnd = m_files.constEnd(); const Job::Status curentStatus = this->status(); for (it = m_files.constBegin(); it != itEnd; ++it) { @@ -781,17 +786,18 @@ FileModel *BTTransfer::fileModel()//TODO correct file model for one-file-torrent //one single file else { - QList<KUrl> urls; - KUrl temp = m_dest; + QList<QUrl> urls; + QUrl temp = m_dest; if (m_dest.fileName() != torrent->getStats().torrent_name)//TODO check if the body is ever entered! { - temp.addPath(torrent->getStats().torrent_name); + temp = temp.adjusted(QUrl::StripTrailingSlash); + temp.setPath(temp.path() + '/' + (torrent->getStats().torrent_name)); } - const KUrl url = temp; + const QUrl url = temp; urls.append(url); m_fileModel = new FileModel(urls, directory(), this); - // connect(m_fileModel, SIGNAL(rename(KUrl,KUrl)), this, SLOT(slotRename(KUrl,KUrl))); + // connect(m_fileModel, SIGNAL(rename(QUrl,QUrl)), this, SLOT(slotRename(QUrl,QUrl))); connect(m_fileModel, SIGNAL(checkStateChanged()), this, SLOT(filesSelected())); QModelIndex size = m_fileModel->index(url, FileItem::Size); diff --git a/transfer-plugins/bittorrent/bttransfer.h b/transfer-plugins/bittorrent/bttransfer.h index 69a1e823..c2bc2d66 100644 --- a/transfer-plugins/bittorrent/bttransfer.h +++ b/transfer-plugins/bittorrent/bttransfer.h @@ -51,7 +51,7 @@ class BTTransfer : public Transfer, public bt::MonitorInterface }; BTTransfer(TransferGroup* parent, TransferFactory* factory, - Scheduler* scheduler, const KUrl& src, const KUrl& dest, + Scheduler* scheduler, const QUrl &src, const QUrl& dest, const QDomElement * e = 0); ~BTTransfer(); @@ -68,16 +68,16 @@ class BTTransfer : public Transfer, public bt::MonitorInterface /** * @returns the directory the Transfer will be stored to */ - virtual KUrl directory() const {return m_directory;} + virtual QUrl directory() const {return m_directory;} /** * Move the download to the new destination * @param newDirectory is a directory where the download should be stored * @returns true if newDestination can be used */ - virtual bool setDirectory(const KUrl &newDirectory); + virtual bool setDirectory(const QUrl &newDirectory); - virtual QList<KUrl> files() const; + virtual QList<QUrl> files() const; FileModel *fileModel(); @@ -92,7 +92,7 @@ class BTTransfer : public Transfer, public bt::MonitorInterface int leechesDisconnected() const; int sessionBytesDownloaded() const; int sessionBytesUploaded() const; - KUrl::List trackersList() const; + QList<QUrl> trackersList() const; bt::TorrentControl * torrentControl(); //More Bittorrent-Functions @@ -107,7 +107,7 @@ class BTTransfer : public Transfer, public bt::MonitorInterface void setSpeedLimits(int ulLimit, int dlLimit); private slots: - void btTransferInit(const KUrl &src = KUrl(), const QByteArray &data = QByteArray()); + void btTransferInit(const QUrl &src = QUrl(), const QByteArray &data = QByteArray()); void update(); void slotStoppedByError(const bt::TorrentInterface* &error, const QString &errormsg); void slotDownloadFinished(bt::TorrentInterface* ti); @@ -131,7 +131,7 @@ class BTTransfer : public Transfer, public bt::MonitorInterface virtual void filePreviewChanged(bt::TorrentFileInterface*, bool) {} bt::TorrentControl *torrent; - KUrl m_directory; + QUrl m_directory; QString m_tmp; QString m_tmpTorrentFile; float m_ratio; @@ -140,7 +140,7 @@ class BTTransfer : public Transfer, public bt::MonitorInterface bool m_downloadFinished; bool m_movingFile; FileModel *m_fileModel; - QHash<KUrl, bt::TorrentFileInterface*> m_files; + QHash<QUrl, bt::TorrentFileInterface*> m_files; int m_updateCounter; }; diff --git a/transfer-plugins/bittorrent/bttransferfactory.cpp b/transfer-plugins/bittorrent/bttransferfactory.cpp index ec9eb43e..7ae75cb1 100644 --- a/transfer-plugins/bittorrent/bttransferfactory.cpp +++ b/transfer-plugins/bittorrent/bttransferfactory.cpp @@ -38,7 +38,7 @@ BTTransferFactory::~BTTransferFactory() { } -Transfer * BTTransferFactory::createTransfer(const KUrl &srcUrl, const KUrl &destUrl, +Transfer * BTTransferFactory::createTransfer(const QUrl &srcUrl, const QUrl &destUrl, TransferGroup * parent, Scheduler * scheduler, const QDomElement * e ) @@ -98,7 +98,7 @@ const QList<QAction *> BTTransferFactory::actions(TransferHandler *handler) return QList<QAction *>(); } -TransferDataSource * BTTransferFactory::createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent) +TransferDataSource * BTTransferFactory::createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent) { Q_UNUSED(srcUrl) Q_UNUSED(type) @@ -108,7 +108,7 @@ TransferDataSource * BTTransferFactory::createTransferDataSource(const KUrl &src return 0; } -bool BTTransferFactory::isSupported(const KUrl &url) const +bool BTTransferFactory::isSupported(const QUrl &url) const { return url.url().endsWith(QLatin1String(".torrent")); } diff --git a/transfer-plugins/bittorrent/bttransferfactory.h b/transfer-plugins/bittorrent/bttransferfactory.h index 32b0fab6..050a292b 100644 --- a/transfer-plugins/bittorrent/bttransferfactory.h +++ b/transfer-plugins/bittorrent/bttransferfactory.h @@ -19,7 +19,7 @@ class BTTransferFactory : public TransferFactory BTTransferFactory(QObject *parent, const QVariantList &args); ~BTTransferFactory(); - Transfer * createTransfer(const KUrl &srcUrl, const KUrl &destUrl, TransferGroup * parent, Scheduler * scheduler, const QDomElement * e = 0); + Transfer * createTransfer(const QUrl &srcUrl, const QUrl &destUrl, TransferGroup * parent, Scheduler * scheduler, const QDomElement * e = 0); TransferHandler * createTransferHandler(Transfer * transfer, Scheduler * scheduler); @@ -27,9 +27,9 @@ class BTTransferFactory : public TransferFactory const QList<QAction *> actions(TransferHandler * handler = 0); - TransferDataSource * createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent); + TransferDataSource * createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent); - bool isSupported(const KUrl &url) const; + bool isSupported(const QUrl &url) const; }; #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor