• 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
  • checksumsearch
checksumsearch.h
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #ifndef CHECKSUMSEARCH_H
21 #define CHECKSUMSEARCH_H
22 
23 #include <QtCore/QObject>
24 
25 #include <KIO/Job>
26 #include <KUrl>
27 
28 class ChecksumSearch : public QObject
29 {
30  Q_OBJECT
31 
32  public:
33  ChecksumSearch(const QList<KUrl> &srcs, const QString &fileName, const QStringList &types, QObject *parent = 0);
34  ~ChecksumSearch();
35 
40  enum UrlChangeMode
41  {
42  kg_Append,
43  kg_ReplaceFile,
44  kg_ReplaceEnding
45  };
46 
50  static QStringList urlChangeModes() {return URLCHANGEMODES;}
51 
58  static KUrl createUrl(const KUrl &src, const QString &change, UrlChangeMode mode);
59 
60  Q_SIGNALS:
61  void data(QString type, QString checksum);
62 
63  private slots:
64  void slotResult(KJob *job);
65  void slotData(KIO::Job *job, const QByteArray &data);
66 
67  private:
71  void createDownload();
72 
76  void parseDownload();
77 
81  void parseDownloadEmpty();
82 
83  private:
84  KIO::TransferJob *m_copyJob;
85  KUrl m_src;
86  QList<KUrl> m_srcs;
87  QString m_fileName;
88  QString m_type;
89  QStringList m_types;
90  QByteArray m_dataBA;
91  QString m_data;
92  bool m_isEmpty;
93  static const QStringList URLCHANGEMODES;
94 };
95 
96 #endif
ChecksumSearch::createUrl
static KUrl createUrl(const KUrl &src, const QString &change, UrlChangeMode mode)
Returns a modified url according to the parameters.
Definition: checksumsearch.cpp:166
ChecksumSearch::kg_ReplaceEnding
Replaces the file of the Url with QString –> "http://test.com/aFile.zip"; "MD5SUMS" "http://test...
Definition: checksumsearch.h:44
ChecksumSearch::urlChangeModes
static QStringList urlChangeModes()
Returns the available mode-names.
Definition: checksumsearch.h:50
ChecksumSearch::UrlChangeMode
UrlChangeMode
Used to define in whiche way the url should be changed to try and find Checksums. ...
Definition: checksumsearch.h:40
QObject
ChecksumSearch::kg_Append
Definition: checksumsearch.h:42
ChecksumSearch::data
void data(QString type, QString checksum)
ChecksumSearch::~ChecksumSearch
~ChecksumSearch()
Definition: checksumsearch.cpp:42
ChecksumSearch
Definition: checksumsearch.h:28
ChecksumSearch::ChecksumSearch
ChecksumSearch(const QList< KUrl > &srcs, const QString &fileName, const QStringList &types, QObject *parent=0)
Definition: checksumsearch.cpp:32
KJob
ChecksumSearch::kg_ReplaceFile
Appends the QString to the Url –> "http://test.com/aFile.zip"; ".md5" "http://test.com/aFile.zip.md5".
Definition: checksumsearch.h:43
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