kget
metalink.cpp
Go to the documentation of this file.
85 Download *download = new Download(m_source, QString(KStandardDirs::locateLocal("appdata", "metalinks/") + m_source.fileName()));
86 connect(download, SIGNAL(finishedSuccessfully(KUrl,QByteArray)), SLOT(metalinkInit(KUrl,QByteArray)));
117 if (KMessageBox::questionYesNo(0, i18n("A newer version of this Metalink might exist, do you want to download it?"),
155 connect(dataFactory, SIGNAL(dataSourceFactoryChange(Transfer::ChangesFlags)), this, SLOT(slotDataSourceFactoryChange(Transfer::ChangesFlags)));
158 connect(dataFactory, SIGNAL(log(QString,Transfer::LogLevel)), this, SLOT(setLog(QString,Transfer::LogLevel)));
436 //one file that has been downloaded now is finished//FIXME ignore downloads that were finished in the previous download!!!!
493 i18n("The download could not be verified, do you want to repair (if repairing does not work the download would be restarted) it?"),
512 QModelIndex signatureVerified = m_fileModel->index(factory->dest(), FileItem::SignatureVerified);
602 connect(file, SIGNAL(dataSourceFactoryChange(Transfer::ChangesFlags)), this, SLOT(slotDataSourceFactoryChange(Transfer::ChangesFlags)));
606 connect(file, SIGNAL(log(QString,Transfer::LogLevel)), this, SLOT(setLog(QString,Transfer::LogLevel)));
614 //enough simultanous files already, so increase the number and set file to stop --> that will decrease the number again
712 //check if the file at dest exists already and ask the user what to do in this case, ignore already running transfers
720 KIO::RenameDialog dlg(0, i18n("File already exists"), index.data().toString(), dest, KIO::RenameDialog_Mode(KIO::M_MULTI | KIO::M_OVERWRITE | KIO::M_SKIP));
752 if (doDownload && (factory->status() != Finished) && (factory->status() != FinishedKeepAlive)) {
768 //some files have been selected that are not finished yet, set them to stop if the transfer is not running (checked in slotStatus)
834 void Metalink::setAvailableMirrors(const KUrl &file, const QHash<KUrl, QPair<bool, int> > &mirrors)
849 if (file->doDownload()) {//FIXME when a download did not start yet it should be moveable!!//FIXME why not working, when only two connections?
QDomNodeList elementsByTagName(const QString &tagname) const
Definition: filemodel.h:45
static bool load(const KUrl &destination, Metalink *metalink)
Loads destination into metalink.
Definition: metalinker.cpp:1232
Definition: urlchecker.h:61
Definition: transfer.h:52
The job is stopped, but this also indicates that it stopped because an error occurred.
Definition: job.h:47
void addPartialChecksums(const QString &type, KIO::filesize_t length, const QStringList &checksums)
Add partial checksums that can be used as repairinformation.
Definition: verifier.cpp:524
Definition: download.h:23
const Key key(const T &value) const
Capabilities capabilities() const
Returns the capabilities this Transfer supports.
Definition: transfer.h:111
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
QObject * sender() const
This class manages multiple DataSources and saves the received data to the file.
Definition: datasourcefactory.h:38
int size() const
QHash< KUrl, QPair< bool, int > > mirrors() const
Return all mirrors, where bool defines if the mirror is used, while in defines the number of paralell...
Definition: datasourcefactory.cpp:565
Definition: fileselectiondlg.h:29
bool isEmpty() const
QHash< KUrl, QPair< bool, int > > availableMirrors(const KUrl &file) const
The mirrors that are available bool if it is used, int how many paralell connections are allowed to t...
Definition: metalink.cpp:821
bool exists() const
QModelIndexList fileIndexes(int column) const
Returns a list of pointers to all files of this model.
Definition: filemodel.cpp:475
void repair()
Tries to repair a broken download, via completely redownloading it or only the borken parts...
Definition: datasourcefactory.cpp:889
Transfer::Capabilities capabilities() const
The capabilities the DataSourceFactory supports.
Definition: datasourcefactory.h:55
int size() const
Metalink(TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0)
Definition: metalink.cpp:43
Definition: transfer.h:53
bool isValid() const
int count(const T &value) const
void setMaxMirrorsUsed(int maxMirrorsUsed)
Change the maximum number off mirrors that will be used for downloading, if the download started alre...
Definition: datasourcefactory.h:87
void append(const T &value)
KIO::filesize_t downloadedSize() const
Definition: datasourcefactory.h:72
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: filemodel.cpp:506
Definition: job.h:43
void addMirror(const KUrl &url, bool used, int numParalellConnections=1)
Add a mirror that can be used for downloading.
Definition: datasourcefactory.cpp:378
virtual void load(const QDomElement *element)
Loads the transfer's info from the QDomElement.
Definition: transfer.cpp:244
const_iterator constEnd() const
void setDoDownload(bool doDownload)
Set if the datasourcefactory should download the file or not, if set to false the download will be st...
Definition: datasourcefactory.cpp:350
void setAttribute(const QString &name, const QString &value)
virtual bool setDirectory(const KUrl &newDirectory)
Move the download to the new destination.
Definition: metalink.cpp:789
virtual void save(const QDomElement &element)
Saves this transfer to the given QDomNode.
Definition: transfer.cpp:230
Definition: transfer.h:96
int remainingTime() const
Reimplemented to return a time based on the average of the last three speeds.
Definition: metalink.cpp:404
void setDirectory(const KUrl &newDirectory)
Set the url to the directory the files are stored in, the filemodel stores its entries as relative pa...
Definition: filemodel.cpp:538
int remove(const Key &key)
QList< Key > keys() const
void capabilitiesChanged()
Emitted when the capabilities of the Transfer change.
iterator end()
void load(const QDomElement *e)
Loads the transfer's info from the QDomElement.
Definition: metalink.cpp:573
static UrlError checkSource(const KUrl &source, bool showNotification=false)
Convenience method of checkUrl.
Definition: urlchecker.cpp:139
Definition: transfer.h:56
virtual void setTransferChange(ChangesFlags change, bool postEvent=false)
Makes the TransferHandler associated with this transfer know that a change in this transfer has occur...
Definition: transfer.cpp:338
Definition: filemodel.h:48
const_iterator constBegin() const
Definition: verifier.h:68
QVariant data(int role) const
bool isEmpty() const
Definition: metalinker.h:206
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: filemodel.cpp:390
bool setNewDestination(const KUrl &newDest)
Definition: datasourcefactory.cpp:823
QDomElement firstChildElement(const QString &tagName) const
Definition: filemodel.h:46
bool isValid() const
checks if the minimum requirements of a metalink are met
Definition: metalinker.cpp:687
void addChecksums(const QHash< QString, QString > &checksums)
Add multiple checksums that will later be used in the verification process.
Definition: verifier.cpp:519
void setStatus(Job::Status jobStatus, const QString &text=QString(), const QPixmap &pix=QPixmap())
Sets the Job status to jobStatus, the status text to text and the status pixmap to pix...
Definition: transfer.cpp:292
Definition: transfer.h:54
Definition: filemodel.h:49
void setAvailableMirrors(const KUrl &file, const QHash< KUrl, QPair< bool, int > > &mirrors)
Set the mirrors, int the number of paralell connections to the mirror bool if the mirror should be us...
Definition: metalink.cpp:834
bool toBool() const
Definition: transfer.h:55
bool contains(const Key &key) const
void setAsciiDetatchedSignature(const QString &signature)
Definition: signature.cpp:141
Definition: transfer.h:63
Definition: transfer.h:97
bool doDownload() const
Returns whether the datasourcefactory should download the file or not, true by default.
Definition: datasourcefactory.h:141
QDomElement createElement(const QString &tagName)
Definition: filemodel.h:47
KUrl getUrl(const QModelIndex &index)
The url on the filesystem (no check if the file exists yet!) of index, it can be a folder or file...
Definition: filemodel.cpp:544
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setCapabilities(Capabilities capabilities)
Sets the capabilities and automatically emits capabilitiesChanged.
Definition: transfer.cpp:68
QObject * parent() const
void deinit()
Deletes the created (downloadInitialized() is true) file if the download was not finished Does not de...
Definition: datasourcefactory.cpp:112
void setLog(const QString &message, Transfer::LogLevel level=Log_Info)
Set Transfer history.
Definition: transfer.cpp:201
QString toString() const
Definition: verifier.h:79
iterator begin()
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: filemodel.cpp:436
Definition: transfer.h:36
void save(const QDomElement &element)
Saves this transfer to the given QDomNode.
Definition: metalink.cpp:623
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.