Commit 07b67df4 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Renamed importer classes.

ImportSourceClient -> ImportClient
ImportSource -> ServerImporter
ImportSourceConfig -> ServerImporterConfig
ImportSourceDialog -> ServerImportDialog
AmazonClient -> AmazonImporter
DiscogsClient -> DiscogsImporter
FreedbClient -> FreedbImporter
MusicBrainzReleaseClient -> MusicBrainzReleaseImporter
TrackTypeClient -> TrackTypeImporter
parent fcc5d8e1
......@@ -10,20 +10,20 @@ set(kid3_SRCS filelist.cpp fileproxymodel.cpp frame.cpp framelist.cpp
mp3file.cpp configdialog.cpp exportdialog.cpp formatconfig.cpp formatbox.cpp
importdialog.cpp importselector.cpp importparser.cpp generalconfig.cpp
importconfig.cpp miscconfig.cpp freedbconfig.cpp
freedbclient.cpp rendirdialog.cpp dirlist.cpp dirproxymodel.cpp taggedfile.cpp
freedbimporter.cpp rendirdialog.cpp dirlist.cpp dirproxymodel.cpp taggedfile.cpp
musicbrainzdialog.cpp musicbrainzconfig.cpp musicbrainzclient.cpp
numbertracksdialog.cpp oggfile.cpp vcedit.c flacfile.cpp
commandstablemodel.cpp taglibfile.cpp importsourceconfig.cpp
importsourcedialog.cpp importsourceclient.cpp importsource.cpp
discogsclient.cpp discogsconfig.cpp
musicbrainzreleaseclient.cpp externalprocess.cpp trackdata.cpp trackdatamodel.cpp
stringlistedit.cpp tracktypeclient.cpp filterconfig.cpp
commandstablemodel.cpp taglibfile.cpp serverimporterconfig.cpp
serverimportdialog.cpp importclient.cpp serverimporter.cpp
discogsimporter.cpp discogsconfig.cpp
musicbrainzreleaseimporter.cpp externalprocess.cpp trackdata.cpp trackdatamodel.cpp
stringlistedit.cpp tracktypeimporter.cpp filterconfig.cpp
filterdialog.cpp filefilter.cpp expressionparser.cpp pictureframe.cpp
formatreplacer.cpp httpclient.cpp downloaddialog.cpp picturelabel.cpp
browsecoverartdialog.cpp configtable.cpp configtablemodel.cpp
attributedata.cpp browserdialog.cpp imageviewer.cpp editframedialog.cpp
editframefieldsdialog.cpp playlistdialog.cpp playlistconfig.cpp
playlistcreator.cpp amazonclient.cpp amazonconfig.cpp
playlistcreator.cpp amazonimporter.cpp amazonconfig.cpp
recentfilesmenu.cpp playtoolbar.cpp)
if (HAVE_QTDBUS)
......@@ -113,7 +113,7 @@ endif (UNIX AND NOT APPLE)
set(kid3_MOC_HDRS filelist.h frametable.h frametablemodel.h id3form.h kid3.h configdialog.h
exportdialog.h formatbox.h importdialog.h importselector.h rendirdialog.h
musicbrainzdialog.h musicbrainzclient.h numbertracksdialog.h
importsourcedialog.h importsourceclient.h importsource.h externalprocess.h stringlistedit.h
serverimportdialog.h importclient.h serverimporter.h externalprocess.h stringlistedit.h
filterdialog.h filefilter.h httpclient.h downloaddialog.h
browsecoverartdialog.h configtable.h browserdialog.h imageviewer.h
editframedialog.h editframefieldsdialog.h playlistdialog.h recentfilesmenu.h
......
......@@ -34,7 +34,7 @@
* @param grp configuration group
*/
AmazonConfig::AmazonConfig(const QString& grp) :
ImportSourceConfig(grp, false, true)
ServerImporterConfig(grp, false, true)
{
m_server = "www.amazon.com:80";
}
......
......@@ -27,12 +27,12 @@
#ifndef AMAZONCONFIG_H
#define AMAZONCONFIG_H
#include "importsourceconfig.h"
#include "serverimporterconfig.h"
/**
* Amazon configuration.
*/
class AmazonConfig : public ImportSourceConfig {
class AmazonConfig : public ServerImporterConfig {
public:
/**
* Constructor.
......
/**
* \file amazonclient.cpp
* Amazon database import source.
* \file amazonimporter.cpp
* Amazon database importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,7 +24,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "amazonclient.h"
#include "amazonimporter.h"
#include <QRegExp>
#include <QDomDocument>
#include "kid3.h"
......@@ -36,18 +36,18 @@
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
AmazonClient::AmazonClient(
AmazonImporter::AmazonImporter(
QObject* parent,
ImportTrackDataVector& trackDataVector)
: ImportSource(parent, trackDataVector)
: ServerImporter(parent, trackDataVector)
{
setObjectName("AmazonClient");
setObjectName("AmazonImporter");
}
/**
* Destructor.
*/
AmazonClient::~AmazonClient()
AmazonImporter::~AmazonImporter()
{
}
......@@ -55,10 +55,10 @@ AmazonClient::~AmazonClient()
* Name of import source.
* @return name.
*/
QString AmazonClient::name() const { return "Amazon"; }
QString AmazonImporter::name() const { return "Amazon"; }
/** NULL-terminated array of server strings, 0 if not used */
const char** AmazonClient::serverList() const
const char** AmazonImporter::serverList() const
{
static const char* servers[] = {
// Parsing only works with English text
......@@ -70,23 +70,23 @@ const char** AmazonClient::serverList() const
}
/** default server, 0 to disable */
const char* AmazonClient::defaultServer() const { return "www.amazon.com:80"; }
const char* AmazonImporter::defaultServer() const { return "www.amazon.com:80"; }
/** anchor to online help, 0 to disable */
const char* AmazonClient::helpAnchor() const { return "import-amazon"; }
const char* AmazonImporter::helpAnchor() const { return "import-amazon"; }
/** configuration, 0 if not used */
ImportSourceConfig* AmazonClient::cfg() const { return &Kid3App::s_amazonCfg; }
ServerImporterConfig* AmazonImporter::config() const { return &Kid3App::s_amazonCfg; }
/** additional tags option, false if not used */
bool AmazonClient::additionalTags() const { return true; }
bool AmazonImporter::additionalTags() const { return true; }
/**
* Process finished findCddbAlbum request.
*
* @param searchStr search data received
*/
void AmazonClient::parseFindResults(const QByteArray& searchStr)
void AmazonImporter::parseFindResults(const QByteArray& searchStr)
{
/* products have the following format (depending on browser):
<td class="dataColumn"><table cellpadding="0" cellspacing="0" border="0"><tr><td>
......@@ -120,7 +120,7 @@ void AmazonClient::parseFindResults(const QByteArray& searchStr)
*
* @param albumStr album data received
*/
void AmazonClient::parseAlbumResults(const QByteArray& albumStr)
void AmazonImporter::parseAlbumResults(const QByteArray& albumStr)
{
/*
title (empty lines removed):
......@@ -419,8 +419,8 @@ void AmazonClient::parseAlbumResults(const QByteArray& albumStr)
* @param artist artist to search
* @param album album to search
*/
void AmazonClient::sendFindQuery(
const ImportSourceConfig* cfg,
void AmazonImporter::sendFindQuery(
const ServerImporterConfig* cfg,
const QString& artist, const QString& album)
{
/*
......@@ -441,8 +441,8 @@ void AmazonClient::sendFindQuery(
* @param cat category
* @param id ID
*/
void AmazonClient::sendTrackListQuery(
const ImportSourceConfig* cfg, const QString& cat, const QString& id)
void AmazonImporter::sendTrackListQuery(
const ServerImporterConfig* cfg, const QString& cat, const QString& id)
{
/*
* Query looks like this:
......
/**
* \file amazonclient.h
* Amazon database import source.
* \file amazonimporter.h
* Amazon database importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,15 +24,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AMAZONCLIENT_H
#define AMAZONCLIENT_H
#ifndef AMAZONIMPORTER_H
#define AMAZONIMPORTER_H
#include "importsource.h"
#include "serverimporter.h"
/**
* Amazon import source.
* Amazon importer.
*/
class AmazonClient : public ImportSource
class AmazonImporter : public ServerImporter
{
public:
/**
......@@ -41,13 +41,13 @@ public:
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
AmazonClient(QObject* parent,
ImportTrackDataVector& trackDataVector);
AmazonImporter(QObject* parent,
ImportTrackDataVector& trackDataVector);
/**
* Destructor.
*/
virtual ~AmazonClient();
virtual ~AmazonImporter();
/**
* Name of import source.
......@@ -65,7 +65,7 @@ public:
virtual const char* helpAnchor() const;
/** configuration, 0 if not used */
virtual ImportSourceConfig* cfg() const;
virtual ServerImporterConfig* config() const;
/** additional tags option, false if not used */
virtual bool additionalTags() const;
......@@ -92,7 +92,7 @@ public:
* @param album album to search
*/
virtual void sendFindQuery(
const ImportSourceConfig* cfg,
const ServerImporterConfig* cfg,
const QString& artist, const QString& album);
/**
......@@ -104,7 +104,7 @@ public:
* @param id ID
*/
virtual void sendTrackListQuery(
const ImportSourceConfig* cfg, const QString& cat, const QString& id);
const ServerImporterConfig* cfg, const QString& cat, const QString& id);
};
#endif
......@@ -33,7 +33,7 @@
*
* @param grp configuration group
*/
DiscogsConfig::DiscogsConfig(const QString& grp) : ImportSourceConfig(grp, false, true)
DiscogsConfig::DiscogsConfig(const QString& grp) : ServerImporterConfig(grp, false, true)
{
m_server = "www.discogs.com:80";
}
......
......@@ -27,12 +27,12 @@
#ifndef DISCOGSCONFIG_H
#define DISCOGSCONFIG_H
#include "importsourceconfig.h"
#include "serverimporterconfig.h"
/**
* Discogs configuration.
*/
class DiscogsConfig : public ImportSourceConfig {
class DiscogsConfig : public ServerImporterConfig {
public:
/**
* Constructor.
......
/**
* \file discogsclient.cpp
* Discogs client.
* \file discogsimporter.cpp
* Discogs importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,8 +24,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "discogsclient.h"
#include "importsourceconfig.h"
#include "discogsimporter.h"
#include "serverimporterconfig.h"
#include "kid3.h"
#include "genres.h"
......@@ -37,17 +37,17 @@ static const char discogsServer[] = "www.discogs.com:80";
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
DiscogsClient::DiscogsClient(QObject* parent,
ImportTrackDataVector& trackDataVector) :
ImportSource(parent, trackDataVector)
DiscogsImporter::DiscogsImporter(QObject* parent,
ImportTrackDataVector& trackDataVector) :
ServerImporter(parent, trackDataVector)
{
setObjectName("DiscogsClient");
setObjectName("DiscogsImporter");
}
/**
* Destructor.
*/
DiscogsClient::~DiscogsClient()
DiscogsImporter::~DiscogsImporter()
{
}
......@@ -55,23 +55,23 @@ DiscogsClient::~DiscogsClient()
* Name of import source.
* @return name.
*/
QString DiscogsClient::name() const { return "Discogs"; }
QString DiscogsImporter::name() const { return "Discogs"; }
/** anchor to online help, 0 to disable */
const char* DiscogsClient::helpAnchor() const { return "import-discogs"; }
const char* DiscogsImporter::helpAnchor() const { return "import-discogs"; }
/** configuration, 0 if not used */
ImportSourceConfig* DiscogsClient::cfg() const { return &Kid3App::s_discogsCfg; }
ServerImporterConfig* DiscogsImporter::config() const { return &Kid3App::s_discogsCfg; }
/** additional tags option, false if not used */
bool DiscogsClient::additionalTags() const { return true; }
bool DiscogsImporter::additionalTags() const { return true; }
/**
* Process finished findCddbAlbum request.
*
* @param searchStr search data received
*/
void DiscogsClient::parseFindResults(const QByteArray& searchStr)
void DiscogsImporter::parseFindResults(const QByteArray& searchStr)
{
// releases have the format:
// <div><a href="/Amon-Amarth-The-Avenger/release/398878"><em>Amon</em> <em>Amarth</em> - <em>The</em> <em>Avenger</em></a></div>
......@@ -111,7 +111,7 @@ static QString fixUpArtist(QString str)
"[*\\s]*\\((?:\\d+|tracks:[^)]+)\\)(\\s*/\\s*,|\\s*&amp;|\\s*And|\\s*and)"),
"\\1");
str.remove(QRegExp("[*\\s]*\\((?:\\d+|tracks:[^)]+)\\)$"));
return ImportSource::removeHtml(str);
return ServerImporter::removeHtml(str);
}
......@@ -251,7 +251,7 @@ static bool parseCredits(const QString& str, FrameCollection& frames)
*
* @param albumStr album data received
*/
void DiscogsClient::parseAlbumResults(const QByteArray& albumStr)
void DiscogsImporter::parseAlbumResults(const QByteArray& albumStr)
{
QRegExp nlSpaceRe("[\r\n]+\\s*");
QRegExp atDiscogsRe("\\s*\\([^)]+\\) at Discogs$");
......@@ -542,8 +542,8 @@ void DiscogsClient::parseAlbumResults(const QByteArray& albumStr)
* @param artist artist to search
* @param album album to search
*/
void DiscogsClient::sendFindQuery(
const ImportSourceConfig*,
void DiscogsImporter::sendFindQuery(
const ServerImporterConfig*,
const QString& artist, const QString& album)
{
/*
......@@ -563,8 +563,8 @@ void DiscogsClient::sendFindQuery(
* @param cat category
* @param id ID
*/
void DiscogsClient::sendTrackListQuery(
const ImportSourceConfig*, const QString& cat, const QString& id)
void DiscogsImporter::sendTrackListQuery(
const ServerImporterConfig*, const QString& cat, const QString& id)
{
/*
* Query looks like this:
......
/**
* \file discogsclient.h
* Discogs client.
* \file discogsimporter.h
* Discogs importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,15 +24,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DISCOGSCLIENT_H
#define DISCOGSCLIENT_H
#ifndef DISCOGSIMPORTER_H
#define DISCOGSIMPORTER_H
#include "importsource.h"
#include "serverimporter.h"
/**
* Discogs client.
* Discogs importer.
*/
class DiscogsClient : public ImportSource
class DiscogsImporter : public ServerImporter
{
public:
/**
......@@ -41,13 +41,13 @@ public:
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
DiscogsClient(QObject* parent,
ImportTrackDataVector& trackDataVector);
DiscogsImporter(QObject* parent,
ImportTrackDataVector& trackDataVector);
/**
* Destructor.
*/
virtual ~DiscogsClient();
virtual ~DiscogsImporter();
/**
* Name of import source.
......@@ -59,7 +59,7 @@ public:
virtual const char* helpAnchor() const;
/** configuration, 0 if not used */
virtual ImportSourceConfig* cfg() const;
virtual ServerImporterConfig* config() const;
/** additional tags option, false if not used */
virtual bool additionalTags() const;
......@@ -86,7 +86,7 @@ public:
* @param album album to search
*/
virtual void sendFindQuery(
const ImportSourceConfig* cfg,
const ServerImporterConfig* cfg,
const QString& artist, const QString& album);
/**
......@@ -98,7 +98,7 @@ public:
* @param id ID
*/
virtual void sendTrackListQuery(
const ImportSourceConfig* cfg, const QString& cat, const QString& id);
const ServerImporterConfig* cfg, const QString& cat, const QString& id);
};
#endif
......@@ -34,7 +34,7 @@ class QString;
*
* @param grp configuration group
*/
FreedbConfig::FreedbConfig(const QString& grp) : ImportSourceConfig(grp)
FreedbConfig::FreedbConfig(const QString& grp) : ServerImporterConfig(grp)
{
m_server = "gnudb.gnudb.org:80";
m_cgiPath = "/~cddb/cddb.cgi";
......
......@@ -27,12 +27,12 @@
#ifndef FREEDBCONFIG_H
#define FREEDBCONFIG_H
#include "importsourceconfig.h"
#include "serverimporterconfig.h"
/**
* Freedb configuration.
*/
class FreedbConfig : public ImportSourceConfig {
class FreedbConfig : public ServerImporterConfig {
public:
/**
* Constructor.
......
/**
* \file freedbclient.cpp
* freedb.org client.
* \file freedbimporter.cpp
* freedb.org importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,8 +24,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "freedbclient.h"
#include "importsourceconfig.h"
#include "freedbimporter.h"
#include "serverimporterconfig.h"
#include "kid3.h"
#include "genres.h"
......@@ -37,17 +37,17 @@ static const char gnudbServer[] = "www.gnudb.org:80";
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
FreedbClient::FreedbClient(QObject* parent,
ImportTrackDataVector& trackDataVector) :
ImportSource(parent, trackDataVector)
FreedbImporter::FreedbImporter(QObject* parent,
ImportTrackDataVector& trackDataVector) :
ServerImporter(parent, trackDataVector)
{
setObjectName("FreedbClient");
setObjectName("FreedbImporter");
}
/**
* Destructor.
*/
FreedbClient::~FreedbClient()
FreedbImporter::~FreedbImporter()
{
}
......@@ -55,10 +55,10 @@ FreedbClient::~FreedbClient()
* Name of import source.
* @return name.
*/
QString FreedbClient::name() const { return "gnudb.org"; }
QString FreedbImporter::name() const { return "gnudb.org"; }
/** NULL-terminated array of server strings, 0 if not used */
const char** FreedbClient::serverList() const
const char** FreedbImporter::serverList() const
{
static const char* servers[] = {
"www.gnudb.org:80",
......@@ -80,23 +80,23 @@ const char** FreedbClient::serverList() const
}
/** default server, 0 to disable */
const char* FreedbClient::defaultServer() const { return "www.gnudb.org:80"; }
const char* FreedbImporter::defaultServer() const { return "www.gnudb.org:80"; }
/** default CGI path, 0 to disable */
const char* FreedbClient::defaultCgiPath() const { return "/~cddb/cddb.cgi"; }
const char* FreedbImporter::defaultCgiPath() const { return "/~cddb/cddb.cgi"; }
/** anchor to online help, 0 to disable */
const char* FreedbClient::helpAnchor() const { return "import-freedb"; }
const char* FreedbImporter::helpAnchor() const { return "import-freedb"; }
/** configuration, 0 if not used */
ImportSourceConfig* FreedbClient::cfg() const { return &Kid3App::s_freedbCfg; }
ServerImporterConfig* FreedbImporter::config() const { return &Kid3App::s_freedbCfg; }
/**
* Process finished findCddbAlbum request.
*
* @param searchStr search data received
*/
void FreedbClient::parseFindResults(const QByteArray& searchStr)
void FreedbImporter::parseFindResults(const QByteArray& searchStr)
{
/*
<h2>Search Results, 1 albums found:</h2>
......@@ -223,7 +223,7 @@ static void parseFreedbAlbumData(const QString& text,
*
* @param albumStr album data received
*/
void FreedbClient::parseAlbumResults(const QByteArray& albumStr)
void FreedbImporter::parseAlbumResults(const QByteArray& albumStr)
{
QString text = QString::fromUtf8(albumStr);
FrameCollection framesHdr;
......@@ -288,8 +288,8 @@ void FreedbClient::parseAlbumResults(const QByteArray& albumStr)
* @param artist artist to search
* @param album album to search
*/
void FreedbClient::sendFindQuery(
const ImportSourceConfig*,
void FreedbImporter::sendFindQuery(
const ServerImporterConfig*,
const QString& artist, const QString& album)
{
// At the moment, only www.gnudb.org has a working search
......@@ -306,8 +306,8 @@ void FreedbClient::sendFindQuery(
* @param cat category
* @param id ID
*/
void FreedbClient::sendTrackListQuery(
const ImportSourceConfig* cfg, const QString& cat, const QString& id)
void FreedbImporter::sendTrackListQuery(
const ServerImporterConfig* cfg, const QString& cat, const QString& id)
{
sendRequest(cfg->m_server,
cfg->m_cgiPath + "?cmd=cddb+read+" + cat + "+" + id +
......
/**
* \file freedbclient.h
* freedb.org client.
* \file freedbimporter.h
* freedb.org importer.
*
* \b Project: Kid3
* \author Urs Fleisch
......@@ -24,15 +24,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FREEDBCLIENT_H
#define FREEDBCLIENT_H
#ifndef FREEDBIMPORTER_H
#define FREEDBIMPORTER_H
#include "importsource.h"
#include "serverimporter.h"
/**
* freedb.org client.
* freedb.org importer.
*/
class FreedbClient : public ImportSource
class FreedbImporter : public ServerImporter
{
public:
/**
......@@ -41,13 +41,13 @@ public:
* @param parent parent object
* @param trackDataVector track data to be filled with imported values
*/
FreedbClient(QObject* parent,
ImportTrackDataVector& trackDataVector);
FreedbImporter(QObject* parent,
ImportTrackDataVector& trackDataVector);
/**
* Destructor.
*/
virtual ~FreedbClient();
virtual ~FreedbImporter();
/**
* Name of import source.
......@@ -68,7 +68,7 @@ public:
virtual const char* helpAnchor() const;