summaryrefslogtreecommitdiffstats
path: root/juk/webimagefetcherdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /juk/webimagefetcherdialog.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/webimagefetcherdialog.cpp')
-rw-r--r--juk/webimagefetcherdialog.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/juk/webimagefetcherdialog.cpp b/juk/webimagefetcherdialog.cpp
index cc14ed61..5e9e0d0c 100644
--- a/juk/webimagefetcherdialog.cpp
+++ b/juk/webimagefetcherdialog.cpp
@@ -24,39 +24,39 @@
#include <kiconloader.h>
#include <kurllabel.h>
-#include <qvbox.h>
-#include <qlayout.h>
-#include <qimage.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qeventloop.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
+#include <tqimage.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqeventloop.h>
#include "webimagefetcherdialog.h"
#include "tag.h"
WebImageFetcherDialog::WebImageFetcherDialog(const WebImageList &imageList,
const FileHandle &file,
- QWidget *parent) :
- KDialogBase(parent, "internet_image_fetcher", true, QString::null,
+ TQWidget *parent) :
+ KDialogBase(parent, "internet_image_fetcher", true, TQString::null,
Ok | Cancel | User1 , NoDefault, true),
- m_pixmap(QPixmap()),
+ m_pixmap(TQPixmap()),
m_imageList(imageList),
m_file(file)
{
disableResize();
- QWidget *mainBox = new QWidget(this);
- QBoxLayout *mainLayout = new QVBoxLayout(mainBox);
+ TQWidget *mainBox = new TQWidget(this);
+ TQBoxLayout *mainLayout = new TQVBoxLayout(mainBox);
m_iconWidget = new KIconView(mainBox);
- m_iconWidget->setResizeMode(QIconView::Adjust);
+ m_iconWidget->setResizeMode(TQIconView::Adjust);
m_iconWidget->setSpacing(10);
m_iconWidget->setFixedSize(500,550);
m_iconWidget->arrangeItemsInGrid();
m_iconWidget->setItemsMovable(false);
mainLayout->addWidget(m_iconWidget);
- connect(m_iconWidget, SIGNAL(executed(QIconViewItem *)),
- this, SLOT(slotOk()));
+ connect(m_iconWidget, TQT_SIGNAL(executed(TQIconViewItem *)),
+ this, TQT_SLOT(slotOk()));
// Before changing the code below be sure to check the attribution terms
// of the Yahoo Image Search API.
@@ -66,10 +66,10 @@ WebImageFetcherDialog::WebImageFetcherDialog(const WebImageList &imageList,
logoLabel->setPixmap(UserIcon("yahoo_credit"));
logoLabel->setMargin(15); // Allow large margin per attribution terms.
logoLabel->setUseTips(true); // Show URL in tooltip.
- connect(logoLabel, SIGNAL(leftClickedURL(const QString &)),
- SLOT(showCreditURL(const QString &)));
+ connect(logoLabel, TQT_SIGNAL(leftClickedURL(const TQString &)),
+ TQT_SLOT(showCreditURL(const TQString &)));
- QBoxLayout *creditLayout = new QHBoxLayout(mainLayout);
+ TQBoxLayout *creditLayout = new TQHBoxLayout(mainLayout);
creditLayout->addStretch(); // Left spacer
creditLayout->addWidget(logoLabel);
creditLayout->addStretch(); // Right spacer
@@ -82,7 +82,7 @@ WebImageFetcherDialog::~WebImageFetcherDialog()
{
}
-void WebImageFetcherDialog::showCreditURL(const QString &url)
+void WebImageFetcherDialog::showCreditURL(const TQString &url)
{
// Don't use static member since I'm sure that someday knowing my luck
// Yahoo will change their mimetype they serve.
@@ -91,7 +91,7 @@ void WebImageFetcherDialog::showCreditURL(const QString &url)
void WebImageFetcherDialog::setLayout()
{
- setCaption(QString("%1 - %2 (%3)")
+ setCaption(TQString("%1 - %2 (%3)")
.arg(m_file.tag()->artist())
.arg(m_file.tag()->album())
.arg(m_imageList.size()));
@@ -138,7 +138,7 @@ void WebImageFetcherDialog::slotOk()
KMessageBox::sorry(this,
i18n("The cover you have selected is unavailable. Please select another."),
i18n("Cover Unavailable"));
- QPixmap blankPix;
+ TQPixmap blankPix;
blankPix.resize(80, 80);
blankPix.fill();
m_iconWidget->currentItem()->setPixmap(blankPix, true, true);
@@ -151,45 +151,45 @@ void WebImageFetcherDialog::slotOk()
void WebImageFetcherDialog::slotCancel()
{
- m_pixmap = QPixmap();
+ m_pixmap = TQPixmap();
reject();
}
void WebImageFetcherDialog::slotUser1()
{
- m_pixmap = QPixmap();
+ m_pixmap = TQPixmap();
accept();
emit newSearchRequested();
}
-QPixmap WebImageFetcherDialog::fetchedImage(uint index) const
+TQPixmap WebImageFetcherDialog::fetchedImage(uint index) const
{
- return (index > m_imageList.count()) ? QPixmap() : pixmapFromURL(m_imageList[index].imageURL());
+ return (index > m_imageList.count()) ? TQPixmap() : pixmapFromURL(m_imageList[index].imageURL());
}
-QPixmap WebImageFetcherDialog::pixmapFromURL(const KURL &url) const
+TQPixmap WebImageFetcherDialog::pixmapFromURL(const KURL &url) const
{
- QString file;
+ TQString file;
if(KIO::NetAccess::download(url, file, 0)) {
- QPixmap pixmap = QPixmap(file);
+ TQPixmap pixmap = TQPixmap(file);
KIO::NetAccess::removeTempFile(file);
return pixmap;
}
KIO::NetAccess::removeTempFile(file);
- return QPixmap();
+ return TQPixmap();
}
////////////////////////////////////////////////////////////////////////////////
// CoverIconViewItem
////////////////////////////////////////////////////////////////////////////////
-CoverIconViewItem::CoverIconViewItem(QIconView *parent, const WebImage &image) :
- QObject(parent), KIconViewItem(parent, parent->lastItem(), image.size()), m_job(0)
+CoverIconViewItem::CoverIconViewItem(TQIconView *parent, const WebImage &image) :
+ TQObject(parent), KIconViewItem(parent, parent->lastItem(), image.size()), m_job(0)
{
// Set up the iconViewItem
- QPixmap mainMap;
+ TQPixmap mainMap;
mainMap.resize(80, 80);
mainMap.fill();
setPixmap(mainMap, true, true);
@@ -197,9 +197,9 @@ CoverIconViewItem::CoverIconViewItem(QIconView *parent, const WebImage &image) :
// Start downloading the image.
m_job = KIO::get(image.thumbURL(), false, false);
- connect(m_job, SIGNAL(result(KIO::Job *)), this, SLOT(imageResult(KIO::Job *)));
- connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)),
- this, SLOT(imageData(KIO::Job *, const QByteArray &)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(imageResult(KIO::Job *)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
+ this, TQT_SLOT(imageData(KIO::Job *, const TQByteArray &)));
}
CoverIconViewItem::~CoverIconViewItem()
@@ -209,16 +209,16 @@ CoverIconViewItem::~CoverIconViewItem()
// Drain results issued by KIO before being deleted,
// and before deleting the job.
- kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
+ kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput);
delete m_job;
}
}
-void CoverIconViewItem::imageData(KIO::Job *, const QByteArray &data)
+void CoverIconViewItem::imageData(KIO::Job *, const TQByteArray &data)
{
int currentSize = m_buffer.size();
- m_buffer.resize(currentSize + data.size(), QGArray::SpeedOptim);
+ m_buffer.resize(currentSize + data.size(), TQGArray::SpeedOptim);
memcpy(&(m_buffer.data()[currentSize]), data.data(), data.size());
}
@@ -227,8 +227,8 @@ void CoverIconViewItem::imageResult(KIO::Job *job)
if(job->error())
return;
- QPixmap iconImage(m_buffer);
- iconImage = QImage(iconImage.convertToImage()).smoothScale(80, 80, QImage::ScaleMin);
+ TQPixmap iconImage(m_buffer);
+ iconImage = TQImage(iconImage.convertToImage()).smoothScale(80, 80, TQImage::ScaleMin);
setPixmap(iconImage, true, true);
}