summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Małek <michalm@jabster.pl>2014-08-06 08:19:52 (GMT)
committerMichał Małek <michalm@jabster.pl>2014-08-06 08:19:52 (GMT)
commitc7feb4e99a9f75c5e9f9a9201fcb12bd6a9e7f94 (patch)
treecf99b432aa2b3bacb2c52b733a59a4b50d69d8a3
parentec37677e234994a92d31b9de745881bddd34bbe3 (diff)
Ported KUrl to QUrl
-rw-r--r--libkcddb/httplookup.cpp20
-rw-r--r--libkcddb/httplookup.h5
-rw-r--r--libkcddb/httpsubmit.cpp4
-rw-r--r--libkcddb/httpsubmit.h4
-rw-r--r--libkcddb/sites.cpp25
-rw-r--r--libkcddb/sites.h2
-rw-r--r--libkcddb/smtpsubmit.cpp8
-rw-r--r--libkcddb/smtpsubmit.h4
8 files changed, 36 insertions, 36 deletions
diff --git a/libkcddb/httplookup.cpp b/libkcddb/httplookup.cpp
index 5e360c8..0b3c9f3 100644
--- a/libkcddb/httplookup.cpp
+++ b/libkcddb/httplookup.cpp
@@ -21,7 +21,8 @@
#include "httplookup.h"
-#include <kio/job.h>
+#include <KIO/Job>
+#include <QtCore/QUrlQuery>
#include <QtCore/QDebug>
namespace KCDDB
@@ -66,7 +67,7 @@ namespace KCDDB
void
HTTPLookup::initURL( const QString & hostName, uint port )
{
- cgiURL_.setProtocol( QLatin1String( "http" ) );
+ cgiURL_.setScheme( QLatin1String( "http" ) );
cgiURL_.setHost( hostName );
cgiURL_.setPort( port );
cgiURL_.setPath( QLatin1String( "/~cddb/cddb.cgi" ) );
@@ -77,17 +78,16 @@ namespace KCDDB
void
HTTPLookup::makeURL( const QString & cmd )
{
- // The whole query has to constructed each time as the
- // CDDB CGI script expects the parameters in strict order
-
- cgiURL_.setQuery( QString::null ); //krazy:exclude=nullstrassign for old broken gcc
-
QString hello = QString::fromLatin1("%1 %2 %3 %4")
.arg(user_, localHostName_, clientName(), clientVersion());
- cgiURL_.addQueryItem( QLatin1String( "cmd" ), cmd );
- cgiURL_.addQueryItem( QLatin1String( "hello" ), hello );
- cgiURL_.addQueryItem( QLatin1String( "proto" ), QLatin1String( "6" ) );
+ // The whole query has to constructed each time as the
+ // CDDB CGI script expects the parameters in strict order
+ QUrlQuery query;
+ query.addQueryItem( QLatin1String( "cmd" ), cmd );
+ query.addQueryItem( QLatin1String( "hello" ), hello );
+ query.addQueryItem( QLatin1String( "proto" ), QLatin1String( "6" ) );
+ cgiURL_.setQuery( query );
}
void
diff --git a/libkcddb/httplookup.h b/libkcddb/httplookup.h
index c4861ac..83bcb17 100644
--- a/libkcddb/httplookup.h
+++ b/libkcddb/httplookup.h
@@ -22,9 +22,8 @@
#ifndef KCDDB_HTTP_LOOKUP_H
#define KCDDB_HTTP_LOOKUP_H
-#include <kurl.h>
-
#include "lookup.h"
+#include <QtCore/QUrl>
namespace KIO
{
@@ -69,7 +68,7 @@ namespace KCDDB
protected:
bool block_;
- KUrl cgiURL_;
+ QUrl cgiURL_;
QByteArray data_;
State state_;
Result result_;
diff --git a/libkcddb/httpsubmit.cpp b/libkcddb/httpsubmit.cpp
index 284467c..96386b9 100644
--- a/libkcddb/httpsubmit.cpp
+++ b/libkcddb/httpsubmit.cpp
@@ -20,15 +20,15 @@
#include "httpsubmit.h"
+#include <KIO/Job>
#include <QtCore/QDebug>
-#include <kio/job.h>
namespace KCDDB
{
HTTPSubmit::HTTPSubmit(const QString& from, const QString& hostname, uint port)
: Submit(), from_(from)
{
- url_.setProtocol( QLatin1String( "http" ));
+ url_.setScheme( QLatin1String( "http" ));
url_.setHost(hostname);
url_.setPort(port);
url_.setPath(QLatin1String( "/~cddb/submit.cgi" ));
diff --git a/libkcddb/httpsubmit.h b/libkcddb/httpsubmit.h
index a37f773..93f06ba 100644
--- a/libkcddb/httpsubmit.h
+++ b/libkcddb/httpsubmit.h
@@ -20,7 +20,7 @@
*/
#include "submit.h"
-#include <kurl.h>
+#include <QtCore/QUrl>
namespace KCDDB
{
@@ -33,7 +33,7 @@ namespace KCDDB
protected:
virtual KIO::Job* createJob(const CDInfo& cdInfo);
- KUrl url_;
+ QUrl url_;
QString from_;
} ;
}
diff --git a/libkcddb/sites.cpp b/libkcddb/sites.cpp
index a3f69ae..c84e482 100644
--- a/libkcddb/sites.cpp
+++ b/libkcddb/sites.cpp
@@ -19,12 +19,13 @@
#include "sites.h"
-#include <kurl.h>
-#include <kio/netaccess.h>
-#include <kio/job.h>
-#include <QTextStream>
+#include <KIO/Job>
+#include <KIO/NetAccess>
#include <QtCore/QDebug>
-#include <QRegExp>
+#include <QtCore/QRegExp>
+#include <QtCore/QTextStream>
+#include <QtCore/QUrl>
+#include <QtCore/QUrlQuery>
namespace KCDDB
{
@@ -36,20 +37,20 @@ namespace KCDDB
QList<Mirror>
Sites::siteList()
{
- KUrl url;
- url.setProtocol( QLatin1String( "http" ) );
+ QUrl url;
+ url.setScheme( QLatin1String( "http" ) );
url.setHost( QLatin1String( "freedb.freedb.org" ) );
url.setPort( 80 );
url.setPath( QLatin1String( "/~cddb/cddb.cgi" ) );
- url.setQuery( QString::null ); //krazy:exclude=nullstrassign for old broken gcc
-
QString hello = QString::fromLatin1("%1 %2 %3 %4")
.arg(QLatin1String( "libkcddb-user" ), QLatin1String( "localHost" ), CDDB::clientName(), CDDB::clientVersion());
- url.addQueryItem( QLatin1String( "cmd" ), QLatin1String( "sites" ) );
- url.addQueryItem( QLatin1String( "hello" ), hello );
- url.addQueryItem( QLatin1String( "proto" ), QLatin1String( "5" ) );
+ QUrlQuery query;
+ query.addQueryItem( QLatin1String( "cmd" ), QLatin1String( "sites" ) );
+ query.addQueryItem( QLatin1String( "hello" ), hello );
+ query.addQueryItem( QLatin1String( "proto" ), QLatin1String( "5" ) );
+ url.setQuery( query );
QList<Mirror> result;
diff --git a/libkcddb/sites.h b/libkcddb/sites.h
index 3a4121b..97a157f 100644
--- a/libkcddb/sites.h
+++ b/libkcddb/sites.h
@@ -20,10 +20,10 @@
#ifndef KCDDB_SITES_H
#define KCDDB_SITES_H
-#include <QtCore/QList>
#include <libkcddb/cddb.h>
#include <libkcddb/lookup.h>
#include <libkcddb/kcddb_export.h>
+#include <QtCore/QList>
namespace KCDDB
{
diff --git a/libkcddb/smtpsubmit.cpp b/libkcddb/smtpsubmit.cpp
index bf2c268..2608e50 100644
--- a/libkcddb/smtpsubmit.cpp
+++ b/libkcddb/smtpsubmit.cpp
@@ -20,7 +20,7 @@
#include "smtpsubmit.h"
#include "logging.h"
-#include <kio/job.h>
+#include <KIO/Job>
namespace KCDDB
{
@@ -28,11 +28,11 @@ namespace KCDDB
const QString& from, const QString& to)
: Submit(), from_(from), to_(to)
{
- url_.setProtocol(QLatin1String( "smtp" ));
+ url_.setScheme(QLatin1String( "smtp" ));
url_.setHost(hostname);
url_.setPort(port);
if (!username.isEmpty())
- url_.setUser(username);
+ url_.setUserName(username);
url_.setPath(QLatin1String( "/send" ));
}
@@ -46,7 +46,7 @@ namespace KCDDB
url_.setQuery(QString::fromLatin1("to=%1&subject=cddb %2 %3&from=%4")
.arg(to_, cdInfo.get(Category).toString(),
cdInfo.get(QLatin1String( "discid" )).toString(), from_));
- qCDebug(LIBKCDDB) << "Url is: " << url_.prettyUrl();
+ qCDebug(LIBKCDDB) << "Url is: " << url_.toDisplayString();
return KIO::storedPut(diskData_.toUtf8().data(), url_, -1, KIO::HideProgressInfo);
}
diff --git a/libkcddb/smtpsubmit.h b/libkcddb/smtpsubmit.h
index 6a082b0..01da5b3 100644
--- a/libkcddb/smtpsubmit.h
+++ b/libkcddb/smtpsubmit.h
@@ -20,7 +20,7 @@
*/
#include "submit.h"
-#include <kurl.h>
+#include <QtCore/QUrl>
namespace KCDDB
{
@@ -35,7 +35,7 @@ namespace KCDDB
virtual KIO::Job* createJob(const CDInfo& cdInfo);
- KUrl url_;
+ QUrl url_;
QString from_, to_;
} ;
}