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

libkcddb

  • sources
  • kde-4.14
  • kdemultimedia
  • libkcddb
  • libkcddb
smtpsubmit.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Richard Lärkäng <nouseforaname@home.se>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library 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 GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "smtpsubmit.h"
21 
22 #include <kdebug.h>
23 #include <kio/job.h>
24 
25 namespace KCDDB
26 {
27  SMTPSubmit::SMTPSubmit(const QString& hostname, uint port, const QString& username,
28  const QString& from, const QString& to)
29  : Submit(), from_(from), to_(to)
30  {
31  url_.setProtocol(QLatin1String( "smtp" ));
32  url_.setHost(hostname);
33  url_.setPort(port);
34  if (!username.isEmpty())
35  url_.setUser(username);
36  url_.setPath(QLatin1String( "/send" ));
37  }
38 
39  SMTPSubmit::~SMTPSubmit()
40  {
41 
42  }
43 
44  KIO::Job* SMTPSubmit::createJob(const CDInfo& cdInfo)
45  {
46  url_.setQuery(QString::fromLatin1("to=%1&subject=cddb %2 %3&from=%4")
47  .arg(to_, cdInfo.get(Category).toString(),
48  cdInfo.get(QLatin1String( "discid" )).toString(), from_));
49  kDebug(60010) << "Url is: " << url_.prettyUrl();
50 
51  return KIO::storedPut(diskData_.toUtf8().data(), url_, -1, KIO::HideProgressInfo);
52  }
53 
54  void SMTPSubmit::makeDiskData( const CDInfo& cdInfo, const TrackOffsetList& offsetList )
55  {
56  diskData_ = QLatin1String( "Content-Type: text/plain; charset=\"utf-8\";\n" );
57 
58  Submit::makeDiskData(cdInfo, offsetList);
59  }
60 }
61 
KCDDB::SMTPSubmit::url_
KUrl url_
Definition: smtpsubmit.h:38
KCDDB::Category
The freedb category of the entry.
Definition: cdinfo.h:46
KCDDB::SMTPSubmit::from_
QString from_
Definition: smtpsubmit.h:39
KCDDB::SMTPSubmit::SMTPSubmit
SMTPSubmit(const QString &hostname, uint port, const QString &username, const QString &from, const QString &to)
Definition: smtpsubmit.cpp:27
KCDDB::CDInfo::get
QVariant get(const QString &type) const
Get data for type that has been assigned to this disc.
Definition: cdinfo.cpp:518
KCDDB::SMTPSubmit::~SMTPSubmit
virtual ~SMTPSubmit()
Definition: smtpsubmit.cpp:39
KCDDB::SMTPSubmit::createJob
virtual KIO::Job * createJob(const CDInfo &cdInfo)
Definition: smtpsubmit.cpp:44
KCDDB::Submit
Definition: submit.h:37
KCDDB::CDInfo
Information about a CD.
Definition: cdinfo.h:117
QString::isEmpty
bool isEmpty() const
QString
QList< uint >
KCDDB::SMTPSubmit::makeDiskData
virtual void makeDiskData(const CDInfo &, const TrackOffsetList &)
Definition: smtpsubmit.cpp:54
KCDDB::Submit::diskData_
QString diskData_
Definition: submit.h:60
QLatin1String
KCDDB::SMTPSubmit::to_
QString to_
Definition: smtpsubmit.h:39
QByteArray::data
char * data()
smtpsubmit.h
KCDDB::Submit::makeDiskData
virtual void makeDiskData(const CDInfo &, const TrackOffsetList &)
Definition: submit.cpp:69
QString::fromLatin1
QString fromLatin1(const char *str, int size)
QVariant::toString
QString toString() const
QString::toUtf8
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkcddb

Skip menu "libkcddb"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdemultimedia API Reference

Skip menu "kdemultimedia API Reference"
  • libkcddb
  • libkcompactdisc

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