• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • transfer-plugins
  • metalink
abstractmetalink.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2004 Dario Massarin <nekkar@libero.it>
4  Copyright (C) 2007 Manolo Valdes <nolis71cu@gmail.com>
5  Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net>
6  Copyright (C) 2012 Aish Raj Dahal <dahalaishraj@gmail.com>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 */
13 
14 #include "abstractmetalink.h"
15 
16 #include "core/kget.h"
17 #include "core/transfergroup.h"
18 #include "core/download.h"
19 #include "core/transferdatasource.h"
20 #include "core/filemodel.h"
21 #include "core/urlchecker.h"
22 #include "core/verifier.h"
23 #include "core/signature.h"
24 
25 #include <KIconLoader>
26 #include <KIO/DeleteJob>
27 #include <KIO/NetAccess>
28 #include <KIO/RenameDialog>
29 #include <KLocale>
30 #include <KMessageBox>
31 #include <KDebug>
32 #include <KDialog>
33 #include <KStandardDirs>
34 
35 #include <QtCore/QFile>
36 #include <QtXml/QDomElement>
37 
38 AbstractMetalink::AbstractMetalink(TransferGroup * parent, TransferFactory * factory,
39  Scheduler * scheduler, const KUrl & source, const KUrl & dest,
40  const QDomElement * e)
41  : Transfer(parent, factory, scheduler, source, dest, e),
42  m_fileModel(0),
43  m_currentFiles(0),
44  m_ready(false),
45  m_speedCount(0),
46  m_tempAverageSpeed(0),
47  m_averageSpeed(0)
48 {
49 }
50 
51 AbstractMetalink::~AbstractMetalink()
52 {
53 }
54 
55 void AbstractMetalink::slotDataSourceFactoryChange(Transfer::ChangesFlags change)
56 {
57  if ((change & Tc_Status) | (change & Tc_TotalSize)) {
58  DataSourceFactory *factory = qobject_cast<DataSourceFactory*>(sender());
59  if (change & Tc_Status) {
60  bool changeStatus;
61  updateStatus(factory, &changeStatus);
62  if (!changeStatus) {
63  change &= ~Tc_Status;
64  }
65  }
66  if (change & Tc_TotalSize) {
67  recalculateTotalSize(factory);
68  }
69  }
70  if (change & Tc_DownloadedSize) {
71  recalculateProcessedSize();
72  change |= Tc_Percent;
73  }
74  if (change & Tc_DownloadSpeed) {
75  recalculateSpeed();
76  }
77 
78  setTransferChange(change, true);
79 }
80 
81 void AbstractMetalink::recalculateTotalSize(DataSourceFactory *sender)
82 {
83  m_totalSize = 0;
84  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
85  if (factory->doDownload()) {
86  m_totalSize += factory->size();
87  }
88  }
89 
90  if (m_fileModel) {
91  if (sender) {
92  QModelIndex sizeIndex = m_fileModel->index(sender->dest(), FileItem::Size);
93  m_fileModel->setData(sizeIndex, static_cast<qlonglong>(sender->size()));
94  }
95  }
96 }
97 
98 void AbstractMetalink::recalculateProcessedSize()
99 {
100  m_downloadedSize = 0;
101  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
102  if (factory->doDownload()) {
103  m_downloadedSize += factory->downloadedSize();
104  }
105  }
106 
107  if (m_totalSize)
108  {
109  m_percent = (m_downloadedSize * 100) / m_totalSize;
110  }
111  else
112  {
113  m_percent = 0;
114  }
115 }
116 
117 void AbstractMetalink::recalculateSpeed()
118 {
119  m_downloadSpeed = 0;
120  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
121  if (factory->doDownload()) {
122  m_downloadSpeed += factory->currentSpeed();
123  }
124  }
125 
126  //calculate the average of the last three speeds
127  m_tempAverageSpeed += m_downloadSpeed;
128  ++m_speedCount;
129  if (m_speedCount == 3) {
130  m_averageSpeed = m_tempAverageSpeed / 3;
131  m_speedCount = 0;
132  m_tempAverageSpeed = 0;
133  }
134 }
135 
136 int AbstractMetalink::remainingTime() const
137 {
138  if (!m_averageSpeed) {
139  m_averageSpeed = m_downloadSpeed;
140  }
141  return KIO::calculateRemainingSeconds(m_totalSize, m_downloadedSize, m_averageSpeed);
142 }
143 
144 void AbstractMetalink::updateStatus(DataSourceFactory *sender, bool *changeStatus)
145 {
146  Job::Status status = (sender ? sender->status() : Job::Stopped);
147  *changeStatus = true;
148  switch (status)
149  {
150  case Job::Aborted:
151  case Job::Stopped: {
152  m_currentFiles = 0;
153  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
154  //one factory is still running, do not change the status
155  if (factory->doDownload() && (factory->status() == Job::Running)) {
156  *changeStatus = false;
157  ++m_currentFiles;
158  }
159  }
160 
161  if (*changeStatus) {
162  setStatus(status);
163  }
164  break;
165  }
166  case Job::Finished:
167  //one file that has been downloaded now is finished//FIXME ignore downloads that were finished in the previous download!!!!
168  if (m_currentFiles) {
169  --m_currentFiles;
170  startMetalink();
171  }
172  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
173  //one factory is not finished, do not change the status
174  if (factory->doDownload() && (factory->status() != Job::Finished)) {
175  *changeStatus = false;
176  break;
177  }
178  }
179 
180  if (*changeStatus) {
181  setStatus(Job::Finished);
182  }
183  break;
184 
185  default:
186  setStatus(status);
187  break;
188  }
189 
190  if (m_fileModel) {
191  if (sender) {
192  QModelIndex statusIndex = m_fileModel->index(sender->dest(), FileItem::Status);
193  m_fileModel->setData(statusIndex, status);
194  }
195  }
196 }
197 
198 void AbstractMetalink::slotVerified(bool isVerified)
199 {
200  Q_UNUSED(isVerified)
201 
202  if (status() == Job::Finished)
203  {
204  //see if some files are NotVerified
205  QStringList brokenFiles;
206  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
207  if (m_fileModel) {
208  QModelIndex checksumVerified = m_fileModel->index(factory->dest(), FileItem::ChecksumVerified);
209  m_fileModel->setData(checksumVerified, factory->verifier()->status());
210  }
211  if (factory->doDownload() && (factory->verifier()->status() == Verifier::NotVerified)) {
212  brokenFiles.append(factory->dest().pathOrUrl());
213  }
214  }
215 
216  if (brokenFiles.count())
217  {
218  if (KMessageBox::warningYesNoCancelList(0,
219  i18n("The download could not be verified, do you want to repair (if repairing does not work the download would be restarted) it?"),
220  brokenFiles) == KMessageBox::Yes) {
221  if (repair()) {
222  return;
223  }
224  }
225  }
226  }
227 }
228 
229 void AbstractMetalink::slotSignatureVerified()
230 {
231  if (status() == Job::Finished)
232  {
233  //see if some files are NotVerified
234  QStringList brokenFiles;
235  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
236  if (m_fileModel) {
237  QModelIndex signatureVerified = m_fileModel->index(factory->dest(), FileItem::SignatureVerified);
238  m_fileModel->setData(signatureVerified, factory->signature()->status());
239  }
240  if (factory->doDownload() && (factory->verifier()->status() == Verifier::NotVerified)) {
241  brokenFiles.append(factory->dest().pathOrUrl());
242  }
243  }
244 /*
245  if (brokenFiles.count())//TODO
246  {
247  if (KMessageBox::warningYesNoCancelList(0,
248  i18n("The download could not be verified, try to repair it?"),
249  brokenFiles) == KMessageBox::Yes)
250  {
251  if (repair())
252  {
253  return;
254  }
255  }
256  }*/
257  }
258 }
259 
260 bool AbstractMetalink::repair(const KUrl &file)
261 {
262  if (file.isValid()) {
263  if (m_dataSourceFactory.contains(file)) {
264  DataSourceFactory *broken = m_dataSourceFactory[file];
265  if (broken->verifier()->status() == Verifier::NotVerified) {
266  broken->repair();
267  return true;
268  }
269  }
270  }
271  else {
272  QList<DataSourceFactory*> broken;
273  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
274  if (factory->doDownload() && (factory->verifier()->status() == Verifier::NotVerified)) {
275  broken.append(factory);
276  }
277  }
278  if (broken.count()) {
279  foreach (DataSourceFactory *factory, broken) {
280  factory->repair();
281  }
282  return true;
283  }
284  }
285 
286  return false;
287 }
288 
289 
290 Verifier *AbstractMetalink::verifier(const KUrl &file)
291 {
292  if (!m_dataSourceFactory.contains(file)) {
293  return 0;
294  }
295 
296  return m_dataSourceFactory[file]->verifier();
297 }
298 
299 Signature *AbstractMetalink::signature(const KUrl &file)
300 {
301  if (!m_dataSourceFactory.contains(file)) {
302  return 0;
303  }
304 
305  return m_dataSourceFactory[file]->signature();
306 }
307 
308 QList<KUrl> AbstractMetalink::files() const
309 {
310  return m_dataSourceFactory.keys();
311 }
312 
313 FileModel *AbstractMetalink::fileModel()
314 {
315  if (!m_fileModel) {
316  m_fileModel = new FileModel(files(), directory(), this);
317  connect(m_fileModel, SIGNAL(rename(KUrl,KUrl)), this, SLOT(slotRename(KUrl,KUrl)));
318  connect(m_fileModel, SIGNAL(checkStateChanged()), this, SLOT(filesSelected()));
319 
320  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
321  const KUrl dest = factory->dest();
322  QModelIndex size = m_fileModel->index(dest, FileItem::Size);
323  m_fileModel->setData(size, static_cast<qlonglong>(factory->size()));
324  QModelIndex status = m_fileModel->index(dest, FileItem::Status);
325  m_fileModel->setData(status, factory->status());
326  QModelIndex checksumVerified = m_fileModel->index(dest, FileItem::ChecksumVerified);
327  m_fileModel->setData(checksumVerified, factory->verifier()->status());
328  QModelIndex signatureVerified = m_fileModel->index(dest, FileItem::SignatureVerified);
329  m_fileModel->setData(signatureVerified, factory->signature()->status());
330  if (!factory->doDownload())
331  {
332  QModelIndex index = m_fileModel->index(factory->dest(), FileItem::File);
333  m_fileModel->setData(index, Qt::Unchecked, Qt::CheckStateRole);
334  }
335  }
336  }
337 
338  return m_fileModel;
339 }
340 
341 void AbstractMetalink::slotRename(const KUrl &oldUrl, const KUrl &newUrl)
342 {
343  if (!m_dataSourceFactory.contains(oldUrl)) {
344  return;
345  }
346 
347  m_dataSourceFactory[newUrl] = m_dataSourceFactory[oldUrl];
348  m_dataSourceFactory.remove(oldUrl);
349  m_dataSourceFactory[newUrl]->setNewDestination(newUrl);
350 
351  setTransferChange(Tc_FileName);
352 }
353 
354 bool AbstractMetalink::setDirectory(const KUrl &new_directory)
355 {
356  if (new_directory == directory()) {
357  return false;
358  }
359 
360  if (m_fileModel) {
361  m_fileModel->setDirectory(new_directory);
362  }
363 
364  const QString oldDirectory = directory().pathOrUrl(KUrl::AddTrailingSlash);
365  const QString newDirectory = new_directory.pathOrUrl(KUrl::AddTrailingSlash);
366  const QString fileName = m_dest.fileName();
367  m_dest = new_directory;
368  m_dest.addPath(fileName);
369 
370  QHash<KUrl, DataSourceFactory*> newStorage;
371  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
372  const KUrl oldUrl = factory->dest();
373  const KUrl newUrl = KUrl(oldUrl.pathOrUrl().replace(oldDirectory, newDirectory));
374  factory->setNewDestination(newUrl);
375  newStorage[newUrl] = factory;
376  }
377  m_dataSourceFactory = newStorage;
378 
379  setTransferChange(Tc_FileName);
380  return true;
381 }
382 
383 QHash<KUrl, QPair<bool, int> > AbstractMetalink::availableMirrors(const KUrl &file) const
384 {
385  QHash<KUrl, QPair<bool, int> > urls;
386 
387  if (m_dataSourceFactory.contains(file)) {
388  urls = m_dataSourceFactory[file]->mirrors();
389  }
390 
391  return urls;
392 }
393 
394 
395 void AbstractMetalink::setAvailableMirrors(const KUrl &file, const QHash<KUrl, QPair<bool, int> > &mirrors)
396 {
397  if (!m_dataSourceFactory.contains(file)) {
398  return;
399  }
400 
401  m_dataSourceFactory[file]->setMirrors(mirrors);
402 }
403 
404 void AbstractMetalink::slotUpdateCapabilities()
405 {
406  Capabilities oldCap = capabilities();
407  Capabilities newCap = 0;
408  foreach (DataSourceFactory *file, m_dataSourceFactory) {
409  if (file->doDownload()) {//FIXME when a download did not start yet it should be moveable!!//FIXME why not working, when only two connections?
410  if (newCap) {
411  newCap &= file->capabilities();
412  } else {
413  newCap = file->capabilities();
414  }
415  }
416  }
417 
418  if (newCap != oldCap) {
419  setCapabilities(newCap);
420  }
421 }
422 
423 void AbstractMetalink::untickAllFiles()
424 {
425  for (int row = 0; row < fileModel()->rowCount(); ++row) {
426  QModelIndex index = fileModel()->index(row, FileItem::File);
427  if (index.isValid()) {
428  fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
429  }
430  }
431 }
432 
433 void AbstractMetalink::fileDlgFinished(int result)
434 {
435  //the dialog was not accepted untick every file, this ensures that the user does not
436  //press start by accident without first selecting the desired files
437  if (result != QDialog::Accepted) {
438  untickAllFiles();
439  }
440 
441  filesSelected();
442 
443  //no files selected to download or dialog rejected, stop the download
444  if (!m_numFilesSelected || (result != QDialog::Accepted)) {
445  setStatus(Job::Stopped);
446  setTransferChange(Tc_Status, true);
447  return;
448  }
449 
450  startMetalink();
451 }
452 
453 void AbstractMetalink::filesSelected()
454 {
455  bool overwriteAll = false;
456  bool autoSkip = false;
457  bool cancel = false;
458  QModelIndexList files = fileModel()->fileIndexes(FileItem::File);
459  m_numFilesSelected = 0;
460 
461  //sets the CheckState of the fileModel to the according DataSourceFactories
462  //and asks the user if there are existing files already
463  foreach (const QModelIndex &index, files)
464  {
465  const KUrl dest = fileModel()->getUrl(index);
466  bool doDownload = index.data(Qt::CheckStateRole).toBool();
467  if (m_dataSourceFactory.contains(dest))
468  {
469  DataSourceFactory *factory = m_dataSourceFactory[dest];
470  //ignore finished transfers
471  if ((factory->status() == Job::Finished) || (factory->status() == Job::FinishedKeepAlive)) {
472  continue;
473  }
474 
475  //check if the file at dest exists already and ask the user what to do in this case, ignore already running transfers
476  if (doDownload && (factory->status() != Job::Running) && QFile::exists(dest.toLocalFile())) {
477  //usere has chosen to skip all files that exist already before
478  if (autoSkip) {
479  fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
480  doDownload = false;
481  //ask the user, unless he has choosen overwriteAll before
482  } else if (!overwriteAll) {
483  KIO::RenameDialog dlg(0, i18n("File already exists"), index.data().toString(), dest, KIO::RenameDialog_Mode(KIO::M_MULTI | KIO::M_OVERWRITE | KIO::M_SKIP));
484  const int result = dlg.exec();
485 
486  if (result == KIO::R_RENAME) {
487  //no reason to use FileModel::rename() since the file does not exist yet, so simply skip it
488  //avoids having to deal with signals
489  const KUrl newDest = dlg.newDestUrl();
490  factory->setDoDownload(doDownload);
491  factory->setNewDestination(newDest);
492  fileModel()->setData(index, newDest.fileName(), FileItem::File);
493  ++m_numFilesSelected;
494 
495  m_dataSourceFactory.remove(dest);
496  m_dataSourceFactory[newDest] = factory;
497  continue;
498  } else if (result == KIO::R_SKIP) {
499  fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
500  doDownload = false;
501  } else if (result == KIO::R_CANCEL) {
502  cancel = true;
503  break;
504  } else if (result == KIO::R_AUTO_SKIP) {
505  autoSkip = true;
506  fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
507  doDownload = false;
508  } else if (result == KIO::R_OVERWRITE_ALL) {
509  overwriteAll = true;
510  }
511  }
512  }
513 
514  factory->setDoDownload(doDownload);
515  if (doDownload && (factory->status() != Finished) && (factory->status() != FinishedKeepAlive)) {
516  ++m_numFilesSelected;
517  }
518  }
519  }
520 
521  //the user decided to cancel, so untick all files
522  if (cancel) {
523  m_numFilesSelected = 0;
524  untickAllFiles();
525  foreach (DataSourceFactory *factory, m_dataSourceFactory) {
526  factory->setDoDownload(false);
527  }
528  }
529 
530  Transfer::ChangesFlags change = (Tc_TotalSize | Tc_DownloadSpeed);
531  //some files have been selected that are not finished yet, set them to stop if the transfer is not running (checked in slotStatus)
532  if (m_numFilesSelected) {
533  change |= Tc_Status;
534  }
535  slotDataSourceFactoryChange(change);
536 }
537 
538 void AbstractMetalink::stop()
539 {
540  kDebug(5001) << "metalink::Stop";
541  if (m_ready && ((status() != Stopped) || (status() != Finished)))
542  {
543  m_currentFiles = 0;
544  foreach (DataSourceFactory *factory, m_dataSourceFactory)
545  {
546  factory->stop();
547  }
548  }
549 }
550 
551 #include "abstractmetalink.moc"
552 
AbstractMetalink::m_ready
bool m_ready
Definition: abstractmetalink.h:104
AbstractMetalink::fileDlgFinished
void fileDlgFinished(int result)
Definition: abstractmetalink.cpp:433
FileItem::File
Definition: filemodel.h:45
AbstractMetalink::m_speedCount
int m_speedCount
Definition: abstractmetalink.h:105
Transfer::ChangesFlags
int ChangesFlags
Definition: transfer.h:100
AbstractMetalink::m_tempAverageSpeed
int m_tempAverageSpeed
Definition: abstractmetalink.h:106
AbstractMetalink::remainingTime
int remainingTime() const
Definition: abstractmetalink.cpp:136
Transfer::Tc_FileName
Definition: transfer.h:52
Transfer::m_dest
KUrl m_dest
Definition: transfer.h:357
TransferGroup
class TransferGroup:
Definition: transfergroup.h:46
Scheduler
Scheduler class: what handle all the jobs in kget.
Definition: scheduler.h:32
Job::Finished
The job is stopped, but this also indicates that it stopped because an error occurred.
Definition: job.h:47
Transfer::capabilities
Capabilities capabilities() const
Returns the capabilities this Transfer supports.
Definition: transfer.h:111
Transfer::m_downloadedSize
KIO::filesize_t m_downloadedSize
Definition: transfer.h:361
AbstractMetalink::m_currentFiles
int m_currentFiles
Definition: abstractmetalink.h:102
Job::Status
Status
The status property describes the current job status.
Definition: job.h:42
AbstractMetalink::m_fileModel
FileModel * m_fileModel
Definition: abstractmetalink.h:101
DataSourceFactory::size
KIO::filesize_t size() const
Definition: datasourcefactory.h:71
AbstractMetalink::signature
virtual Signature * signature(const KUrl &file)
Definition: abstractmetalink.cpp:299
Job::FinishedKeepAlive
The job exited from its Running state successfully.
Definition: job.h:48
AbstractMetalink::setDirectory
virtual bool setDirectory(const KUrl &newDirectory)
Move the download to the new destination.
Definition: abstractmetalink.cpp:354
DataSourceFactory
This class manages multiple DataSources and saves the received data to the file.
Definition: datasourcefactory.h:38
AbstractMetalink::m_averageSpeed
int m_averageSpeed
Definition: abstractmetalink.h:107
AbstractMetalink::files
virtual QList< KUrl > files() const
Definition: abstractmetalink.cpp:308
AbstractMetalink::slotUpdateCapabilities
void slotUpdateCapabilities()
Definition: abstractmetalink.cpp:404
download.h
urlchecker.h
AbstractMetalink::setAvailableMirrors
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: abstractmetalink.cpp:395
FileModel::fileIndexes
QModelIndexList fileIndexes(int column) const
Returns a list of pointers to all files of this model.
Definition: filemodel.cpp:475
DataSourceFactory::repair
void repair()
Tries to repair a broken download, via completely redownloading it or only the borken parts...
Definition: datasourcefactory.cpp:889
AbstractMetalink::AbstractMetalink
AbstractMetalink(TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0)
Definition: abstractmetalink.cpp:38
DataSourceFactory::capabilities
Transfer::Capabilities capabilities() const
The capabilities the DataSourceFactory supports.
Definition: datasourcefactory.h:55
Verifier::status
VerificationStatus status() const
Definition: verifier.cpp:206
AbstractMetalink::verifier
virtual Verifier * verifier(const KUrl &file)
Definition: abstractmetalink.cpp:290
Transfer::m_totalSize
KIO::filesize_t m_totalSize
Definition: transfer.h:360
Transfer::Tc_Status
Definition: transfer.h:53
AbstractMetalink::updateStatus
void updateStatus(DataSourceFactory *sender, bool *changeStatus)
Definition: abstractmetalink.cpp:144
FileModel
This model represents the files that are being downloaded.
Definition: filemodel.h:101
AbstractMetalink::slotRename
void slotRename(const KUrl &oldUrl, const KUrl &newUrl)
Definition: abstractmetalink.cpp:341
Transfer::m_downloadSpeed
int m_downloadSpeed
Definition: transfer.h:364
DataSourceFactory::downloadedSize
KIO::filesize_t downloadedSize() const
Definition: datasourcefactory.h:72
FileModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: filemodel.cpp:506
Job::Running
Definition: job.h:43
DataSourceFactory::setDoDownload
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
AbstractMetalink::repair
bool repair(const KUrl &file=KUrl())
Tries to repair file.
Definition: abstractmetalink.cpp:260
AbstractMetalink::recalculateProcessedSize
void recalculateProcessedSize()
Definition: abstractmetalink.cpp:98
DataSourceFactory::verifier
Verifier * verifier()
Definition: datasourcefactory.cpp:1222
FileModel::setDirectory
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
Transfer::factory
TransferFactory * factory() const
Definition: transfer.h:272
transfergroup.h
AbstractMetalink::m_numFilesSelected
int m_numFilesSelected
Definition: abstractmetalink.h:108
signature.h
AbstractMetalink::slotDataSourceFactoryChange
void slotDataSourceFactoryChange(Transfer::ChangesFlags change)
Definition: abstractmetalink.cpp:55
AbstractMetalink::slotSignatureVerified
virtual void slotSignatureVerified()
Definition: abstractmetalink.cpp:229
verifier.h
AbstractMetalink::availableMirrors
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: abstractmetalink.cpp:383
transferdatasource.h
Job::Aborted
The job is stopped.
Definition: job.h:45
Transfer::directory
virtual KUrl directory() const
Definition: transfer.h:159
Transfer::Tc_DownloadSpeed
Definition: transfer.h:56
Transfer::setTransferChange
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
FileItem::ChecksumVerified
Definition: filemodel.h:48
Job::Stopped
The job is being executed.
Definition: job.h:44
AbstractMetalink::m_dataSourceFactory
QHash< KUrl, DataSourceFactory * > m_dataSourceFactory
Definition: abstractmetalink.h:103
DataSourceFactory::dest
KUrl dest() const
Definition: datasourcefactory.h:76
AbstractMetalink::recalculateSpeed
void recalculateSpeed()
Definition: abstractmetalink.cpp:117
Verifier
Definition: verifier.h:68
DataSourceFactory::currentSpeed
ulong currentSpeed() const
Definition: datasourcefactory.h:73
AbstractMetalink::~AbstractMetalink
virtual ~AbstractMetalink()
Definition: abstractmetalink.cpp:51
Job::status
Status status() const
Definition: job.h:93
abstractmetalink.h
AbstractMetalink::recalculateTotalSize
void recalculateTotalSize(DataSourceFactory *sender)
Definition: abstractmetalink.cpp:81
Transfer::dest
const KUrl & dest() const
Definition: transfer.h:149
AbstractMetalink::untickAllFiles
void untickAllFiles()
Definition: abstractmetalink.cpp:423
FileModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: filemodel.cpp:390
DataSourceFactory::setNewDestination
bool setNewDestination(const KUrl &newDest)
Definition: datasourcefactory.cpp:823
AbstractMetalink::stop
virtual void stop()
Definition: abstractmetalink.cpp:538
FileItem::Status
Definition: filemodel.h:46
kget.h
Signature::status
VerificationStatus status() const
Definition: signature.cpp:124
Transfer::setStatus
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
Transfer::Tc_TotalSize
Definition: transfer.h:54
FileItem::SignatureVerified
Definition: filemodel.h:49
AbstractMetalink::slotVerified
void slotVerified(bool isVerified)
Definition: abstractmetalink.cpp:198
Signature
Class to verify signatures.
Definition: signature.h:38
AbstractMetalink::startMetalink
virtual void startMetalink()=0
Starts the type of metalink download.
Transfer::Tc_Percent
Definition: transfer.h:55
Transfer::Tc_DownloadedSize
Definition: transfer.h:63
Transfer::m_percent
int m_percent
Definition: transfer.h:363
DataSourceFactory::doDownload
bool doDownload() const
Returns whether the datasourcefactory should download the file or not, true by default.
Definition: datasourcefactory.h:141
FileItem::Size
Definition: filemodel.h:47
AbstractMetalink::filesSelected
void filesSelected()
Checks if the ticked (not started yet) files exist already on the hd and asks the user how to proceed...
Definition: abstractmetalink.cpp:453
FileModel::getUrl
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
TransferFactory
TransferFactory.
Definition: transferfactory.h:52
Transfer::setCapabilities
void setCapabilities(Capabilities capabilities)
Sets the capabilities and automatically emits capabilitiesChanged.
Definition: transfer.cpp:68
AbstractMetalink::fileModel
FileModel * fileModel()
Definition: abstractmetalink.cpp:313
DataSourceFactory::status
Job::Status status() const
Definition: datasourcefactory.h:152
Verifier::NotVerified
Definition: verifier.h:79
DataSourceFactory::stop
void stop()
Definition: datasourcefactory.cpp:327
DataSourceFactory::signature
Signature * signature()
Definition: datasourcefactory.cpp:1231
FileModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: filemodel.cpp:436
filemodel.h
Transfer
Definition: transfer.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal