Commit dc88eea2 authored by Michael Pyne's avatar Michael Pyne

Rename references to the old Google image fetcher code to something more generic since

we no longer use Google.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=679485
parent bc9ca5f3
......@@ -38,8 +38,8 @@ set(juk_SRCS ${tunepimp_SRCS}
filerenamer.cpp
filerenameroptions.cpp
filerenamerconfigdlg.cpp
googlefetcher.cpp
googlefetcherdialog.cpp
webimagefetcher.cpp
webimagefetcherdialog.cpp
historyplaylist.cpp
juk.cpp
k3bexporter.cpp
......
......@@ -20,9 +20,9 @@
#include "covermanager.h"
// The Google Fetcher dialog also has a class named CoverIconViewItem and I
// The WebImageFetcher dialog also has a class named CoverIconViewItem and I
// don't like the idea of naming it "CoverIVI" or something, so just namespace
// it out. I would merge them except for googlefetcher's dependence on KIO
// it out. I would merge them except for webimagefetcher's dependence on KIO
// and such.
namespace CoverUtility
......
......@@ -72,7 +72,7 @@
#include "k3bexporter.h"
#include "upcomingplaylist.h"
#include "deletedialog.h"
#include "googlefetcher.h"
#include "webimagefetcher.h"
#include "coverinfo.h"
#include "coverdialog.h"
#include "tagtransactionmanager.h"
......@@ -321,7 +321,7 @@ Playlist::Playlist(PlaylistCollection *collection, const QString &name,
const QString &iconName) :
K3ListView(collection->playlistStack()),
m_collection(collection),
m_fetcher(new GoogleFetcher(this)),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_applySharedSettings(true),
......@@ -344,7 +344,7 @@ Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items
const QString &name, const QString &iconName) :
K3ListView(collection->playlistStack()),
m_collection(collection),
m_fetcher(new GoogleFetcher(this)),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_applySharedSettings(true),
......@@ -368,7 +368,7 @@ Playlist::Playlist(PlaylistCollection *collection, const QFileInfo &playlistFile
const QString &iconName) :
K3ListView(collection->playlistStack()),
m_collection(collection),
m_fetcher(new GoogleFetcher(this)),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_applySharedSettings(true),
......@@ -391,7 +391,7 @@ Playlist::Playlist(PlaylistCollection *collection, const QFileInfo &playlistFile
Playlist::Playlist(PlaylistCollection *collection, bool delaySetup) :
K3ListView(collection->playlistStack()),
m_collection(collection),
m_fetcher(new GoogleFetcher(this)),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_applySharedSettings(true),
......
......@@ -39,7 +39,7 @@ class QFileInfo;
class QMimeData;
class QDrag;
class GoogleFetcher;
class WebImageFetcher;
class PlaylistItem;
class PlaylistCollection;
class PlaylistToolTip;
......@@ -641,7 +641,7 @@ private:
StringHash m_members;
GoogleFetcher *m_fetcher;
WebImageFetcher *m_fetcher;
int m_currentColumn;
int m_processed;
......
......@@ -906,7 +906,7 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
menu->addAction(createAction(i18n("Get Cover From &File..."),
SLOT(slotAddLocalCover()), "addCover", "file-import", KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F)));
menu->addAction(createAction(i18n("Get Cover From &Internet..."),
SLOT(slotAddInternetCover()), "googleCover", "connection-established", KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_G)));
SLOT(slotAddInternetCover()), "webImageCover", "connection-established", KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_G)));
menu->addAction(createAction(i18n("&Delete Cover"),
SLOT(slotRemoveCovers()), "removeCover", "edit-delete"));
menu->addAction(createAction(i18n("Show Cover &Manager"),
......
......@@ -12,7 +12,7 @@
* *
***************************************************************************/
#include "googlefetcher.h"
#include "webimagefetcher.h"
#include <kapplication.h>
#include <kstatusbar.h>
......@@ -24,7 +24,7 @@
#include <kio/job.h>
#include "covermanager.h"
#include "googlefetcherdialog.h"
#include "webimagefetcherdialog.h"
#include "filehandle.h"
#include "tag.h"
#include "juk.h"
......@@ -35,11 +35,11 @@
#include <QPointer>
#include <QList>
GoogleImage::GoogleImage()
WebImage::WebImage()
{
}
GoogleImage::GoogleImage(const QString &imageURL, const QString &thumbURL,
WebImage::WebImage(const QString &imageURL, const QString &thumbURL,
int width, int height) :
m_imageURL(imageURL),
m_thumbURL(thumbURL),
......@@ -47,9 +47,9 @@ GoogleImage::GoogleImage(const QString &imageURL, const QString &thumbURL,
{
}
class GoogleFetcher::Private
class WebImageFetcher::Private
{
friend class GoogleFetcher;
friend class WebImageFetcher;
Private() : selectedIndex(0), connection(0), dialog(0)
{
......@@ -58,24 +58,24 @@ class GoogleFetcher::Private
FileHandle file;
QString searchString;
QString loadedQuery;
GoogleImageList imageList;
WebImageList imageList;
uint selectedIndex;
QPointer<KIO::StoredTransferJob> connection;
GoogleFetcherDialog *dialog;
WebImageFetcherDialog *dialog;
};
GoogleFetcher::GoogleFetcher(QObject *parent)
WebImageFetcher::WebImageFetcher(QObject *parent)
: QObject(parent), d(new Private)
{
}
GoogleFetcher::~GoogleFetcher()
WebImageFetcher::~WebImageFetcher()
{
delete d->connection;
delete d;
}
void GoogleFetcher::setFile(const FileHandle &file)
void WebImageFetcher::setFile(const FileHandle &file)
{
d->file = file;
d->searchString = QString(file.tag()->artist() + ' ' + file.tag()->album());
......@@ -84,18 +84,18 @@ void GoogleFetcher::setFile(const FileHandle &file)
d->dialog->setFile(file);
}
void GoogleFetcher::abortSearch()
void WebImageFetcher::abortSearch()
{
if(d->connection)
d->connection->kill();
}
void GoogleFetcher::chooseCover()
void WebImageFetcher::chooseCover()
{
slotLoadImageURLs();
}
void GoogleFetcher::slotLoadImageURLs()
void WebImageFetcher::slotLoadImageURLs()
{
d->imageList.clear();
......@@ -112,7 +112,7 @@ void GoogleFetcher::slotLoadImageURLs()
// Wait for the results...
}
void GoogleFetcher::slotWebRequestFinished(KJob *job)
void WebImageFetcher::slotWebRequestFinished(KJob *job)
{
kDebug(65432) << k_funcinfo << endl;
......@@ -189,7 +189,7 @@ void GoogleFetcher::slotWebRequestFinished(KJob *job)
}
d->imageList.append(
GoogleImage(
WebImage(
resultUrl.toElement().text(),
thumbnail.namedItem("Url").toElement().text(),
width.toElement().text().toInt(),
......@@ -201,7 +201,7 @@ void GoogleFetcher::slotWebRequestFinished(KJob *job)
// Have results, show them and pick one.
if(!d->dialog) {
d->dialog = new GoogleFetcherDialog(d->imageList, d->file, 0);
d->dialog = new WebImageFetcherDialog(d->imageList, d->file, 0);
d->dialog->setModal(true);
connect(d->dialog, SIGNAL(coverSelected()), SLOT(slotCoverChosen()));
......@@ -212,7 +212,7 @@ void GoogleFetcher::slotWebRequestFinished(KJob *job)
d->dialog->show();
}
void GoogleFetcher::slotCoverChosen()
void WebImageFetcher::slotCoverChosen()
{
QPixmap pixmap = d->dialog->result();
if(pixmap.isNull()) {
......@@ -225,12 +225,12 @@ void GoogleFetcher::slotCoverChosen()
emit signalCoverChanged(newId);
}
void GoogleFetcher::slotNewSearch()
void WebImageFetcher::slotNewSearch()
{
requestNewSearchTerms();
}
void GoogleFetcher::displayWaitMessage()
void WebImageFetcher::displayWaitMessage()
{
KStatusBar *statusBar = JuK::JuKInstance()->statusBar();
statusBar->showMessage(i18n("Searching for Images. Please Wait..."));
......@@ -238,7 +238,7 @@ void GoogleFetcher::displayWaitMessage()
statusBar->clearMessage();
}
void GoogleFetcher::requestNewSearchTerms(bool noResults)
void WebImageFetcher::requestNewSearchTerms(bool noResults)
{
bool ok;
QString search = KInputDialog::getText(i18n("Cover Downloader"),
......@@ -252,6 +252,6 @@ void GoogleFetcher::requestNewSearchTerms(bool noResults)
}
}
#include "googlefetcher.moc"
#include "webimagefetcher.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -14,8 +14,8 @@
* *
***************************************************************************/
#ifndef GOOGLEFETCHER_H
#define GOOGLEFETCHER_H
#ifndef WEBIMAGEFETCHER_H
#define WEBIMAGEFETCHER_H
#include <QObject>
#include <QString>
......@@ -30,16 +30,16 @@ class QList;
class KJob;
class FileHandle;
class GoogleFetcherDialog;
class WebImageFetcherDialog;
class GoogleImage
class WebImage
{
public:
GoogleImage();
WebImage();
GoogleImage(const QString &imageURL,
WebImage(const QString &imageURL,
const QString &thumbURL,
int width, int height);
int width, int height);
QString imageURL() const { return m_imageURL; }
QString thumbURL() const { return m_thumbURL; }
......@@ -51,15 +51,15 @@ private:
QString m_size;
};
typedef QList<GoogleImage> GoogleImageList;
typedef QList<WebImage> WebImageList;
class GoogleFetcher : public QObject
class WebImageFetcher : public QObject
{
Q_OBJECT
public:
GoogleFetcher(QObject *parent);
~GoogleFetcher();
WebImageFetcher(QObject *parent);
~WebImageFetcher();
void setFile(const FileHandle &file);
void chooseCover();
......@@ -68,7 +68,7 @@ public slots:
void abortSearch();
signals:
void signalNewSearch(GoogleImageList &images);
void signalNewSearch(WebImageList &images);
void signalCoverChanged(int coverId);
private:
......
......@@ -14,7 +14,7 @@
* *
***************************************************************************/
#include "googlefetcherdialog.h"
#include "webimagefetcherdialog.h"
#include "tag.h"
#include <kapplication.h>
......@@ -35,7 +35,7 @@
#include <QListView>
#include <QPixmap>
GoogleFetcherDialog::GoogleFetcherDialog(const GoogleImageList &imageList,
WebImageFetcherDialog::WebImageFetcherDialog(const WebImageList &imageList,
const FileHandle &file,
QWidget *parent) :
KDialog(parent),
......@@ -96,18 +96,18 @@ GoogleFetcherDialog::GoogleFetcherDialog(const GoogleImageList &imageList,
setInitialSize(QSize(500, 480));
}
GoogleFetcherDialog::~GoogleFetcherDialog()
WebImageFetcherDialog::~WebImageFetcherDialog()
{
}
void GoogleFetcherDialog::showCreditURL(const QString &url)
void WebImageFetcherDialog::showCreditURL(const QString &url)
{
// Don't use static member since I'm sure that someday knowing my luck
// Yahoo will change their mimetype they serve.
(void) new KRun(KUrl(url), topLevelWidget());
}
void GoogleFetcherDialog::setLayout()
void WebImageFetcherDialog::setLayout()
{
setCaption(QString("%1 - %2 (%3)")
.arg(m_file.tag()->artist())
......@@ -117,7 +117,7 @@ void GoogleFetcherDialog::setLayout()
QStandardItemModel *model = new QStandardItemModel(m_iconWidget);
QAbstractItemModel *oldModel = m_iconWidget->model();
foreach(GoogleImage image, m_imageList) {
foreach(WebImage image, m_imageList) {
CoverIconViewItem *item = new CoverIconViewItem(m_iconWidget, image);
model->appendRow(item);
}
......@@ -128,12 +128,12 @@ void GoogleFetcherDialog::setLayout()
adjustSize();
}
void GoogleFetcherDialog::setImageList(const GoogleImageList &imageList)
void WebImageFetcherDialog::setImageList(const WebImageList &imageList)
{
m_imageList = imageList;
}
void GoogleFetcherDialog::setFile(const FileHandle &file)
void WebImageFetcherDialog::setFile(const FileHandle &file)
{
m_file = file;
}
......@@ -142,24 +142,24 @@ void GoogleFetcherDialog::setFile(const FileHandle &file)
// public slots
////////////////////////////////////////////////////////////////////////////////
void GoogleFetcherDialog::refreshScreen(GoogleImageList &imageList)
void WebImageFetcherDialog::refreshScreen(WebImageList &imageList)
{
setImageList(imageList);
setLayout();
}
int GoogleFetcherDialog::exec()
int WebImageFetcherDialog::exec()
{
setLayout();
return KDialog::exec();
}
void GoogleFetcherDialog::slotOk()
void WebImageFetcherDialog::slotOk()
{
slotActivated(m_iconWidget->currentIndex());
}
void GoogleFetcherDialog::slotActivated(const QModelIndex &index)
void WebImageFetcherDialog::slotActivated(const QModelIndex &index)
{
m_pixmap = pixmapFromURL(m_imageList[index.row()].imageURL());
......@@ -176,7 +176,7 @@ void GoogleFetcherDialog::slotActivated(const QModelIndex &index)
emit coverSelected();
}
void GoogleFetcherDialog::selectedItemIsBad()
void WebImageFetcherDialog::selectedItemIsBad()
{
QModelIndex index = m_iconWidget->currentIndex();
......@@ -188,18 +188,18 @@ void GoogleFetcherDialog::selectedItemIsBad()
item->setIcon(DesktopIcon("dialog-error"));
}
void GoogleFetcherDialog::slotCancel()
void WebImageFetcherDialog::slotCancel()
{
m_pixmap = QPixmap();
reject();
}
QPixmap GoogleFetcherDialog::fetchedImage(int index) const
QPixmap WebImageFetcherDialog::fetchedImage(int index) const
{
return (index > m_imageList.count()) ? QPixmap() : pixmapFromURL(m_imageList[index].imageURL());
}
QPixmap GoogleFetcherDialog::pixmapFromURL(const KUrl &url) const
QPixmap WebImageFetcherDialog::pixmapFromURL(const KUrl &url) const
{
QString file;
......@@ -217,7 +217,7 @@ QPixmap GoogleFetcherDialog::pixmapFromURL(const KUrl &url) const
// CoverIconViewItem
////////////////////////////////////////////////////////////////////////////////
CoverIconViewItem::CoverIconViewItem(QWidget *parent, const GoogleImage &image) :
CoverIconViewItem::CoverIconViewItem(QWidget *parent, const WebImage &image) :
QObject(parent), QStandardItem(image.size()), m_job(0)
{
// Set up the iconViewItem
......@@ -293,6 +293,6 @@ void CoverIconViewItem::imageResult(KJob *job)
setIcon(realImage);
}
#include "googlefetcherdialog.moc"
#include "webimagefetcherdialog.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -14,12 +14,12 @@
* *
***************************************************************************/
#ifndef GOOGLEFETCHERDIALOG_H
#define GOOGLEFETCHERDIALOG_H
#ifndef WEBIMAGEFETCHERDIALOG_H
#define WEBIMAGEFETCHERDIALOG_H
#include <kdialog.h>
#include "googlefetcher.h"
#include "webimagefetcher.h"
#include "filehandle.h"
#include <QPixmap>
......@@ -31,21 +31,21 @@ class KUrl;
class QListView;
class GoogleFetcherDialog : public KDialog
class WebImageFetcherDialog : public KDialog
{
Q_OBJECT
public:
GoogleFetcherDialog(const GoogleImageList &urlList,
WebImageFetcherDialog(const WebImageList &urlList,
const FileHandle &file,
QWidget *parent = 0);
virtual ~GoogleFetcherDialog();
virtual ~WebImageFetcherDialog();
QPixmap result() const { return m_pixmap; }
void setLayout();
void setImageList(const GoogleImageList &urlList);
void setImageList(const WebImageList &urlList);
void setFile(const FileHandle &file);
signals:
......@@ -54,7 +54,7 @@ signals:
public slots:
int exec();
void refreshScreen(GoogleImageList &list);
void refreshScreen(WebImageList &list);
protected slots:
void slotActivated(const QModelIndex &);
......@@ -68,7 +68,7 @@ private:
QPixmap pixmapFromURL(const KUrl &url) const;
QPixmap m_pixmap;
GoogleImageList m_imageList;
WebImageList m_imageList;
QListView *m_iconWidget;
bool m_takeIt;
bool m_newSearch;
......@@ -88,7 +88,7 @@ class CoverIconViewItem : public QObject, public QStandardItem
Q_OBJECT
public:
CoverIconViewItem(QWidget *parent, const GoogleImage &image);
CoverIconViewItem(QWidget *parent, const WebImage &image);
~CoverIconViewItem();
private slots:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment