Commit 69f4f521 authored by Scott Wheeler's avatar Scott Wheeler

More stuff that's sort of working.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=513911
parent 93eb09ff
......@@ -22,12 +22,13 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qcursor.h>
//Added by qt3to4:
#include <QPixmap>
#include <QMouseEvent>
#include <Q3Frame>
#include <QHBoxLayout>
#include <QEvent>
#include <QDesktopWidget>
#include "collectionlist.h"
#include "playlistsearch.h"
......@@ -199,7 +200,7 @@ void CoverInfo::popup() const
{
QPixmap image = pixmap(FullSize);
QPoint mouse = QCursor::pos();
QRect desktop = QApplication::desktop()->screenGeometry(mouse);
QRect desktop = KApplication::desktop()->screenGeometry(mouse);
int x = mouse.x();
int y = mouse.y();
......
......@@ -274,7 +274,7 @@ QByteArray CoverDrag::encodedData(const char *mimetype) const
{
if(qstrcmp(CoverDrag::mimetype, mimetype) == 0) {
QByteArray data;
QDataStream ds(data, QIODevice::WriteOnly);
QDataStream ds(&data, QIODevice::WriteOnly);
ds << Q_UINT32(m_id);
return data;
......@@ -283,7 +283,7 @@ QByteArray CoverDrag::encodedData(const char *mimetype) const
QPixmap large = CoverManager::coverFromId(m_id, CoverManager::FullSize);
QImage img = large.convertToImage();
QByteArray data;
QBuffer buffer(data);
QBuffer buffer(&data);
buffer.open(IO_WriteOnly);
img.save(&buffer, "PNG"); // Write in PNG format.
......@@ -305,7 +305,7 @@ bool CoverDrag::decode(const QMimeSource *e, coverKey &id)
return false;
QByteArray data = e->encodedData(mimetype);
QDataStream ds(data, QIODevice::ReadOnly);
QDataStream ds(&data, QIODevice::ReadOnly);
Q_UINT32 i;
ds >> i;
......@@ -358,24 +358,25 @@ QPixmap CoverManager::coverFromData(const CoverData &coverData, Size size)
path.prepend('t');
// Check in cache for the pixmap.
QPixmap *pix = data()->pixmapCache[path];
if(pix) {
kDebug(65432) << "Found pixmap in cover cache.\n";
return *pix;
}
// Not in cache, load it and add it.
pix = new QPixmap(coverData.path);
if(pix->isNull())
return QPixmap();
if(size == Thumbnail) {
// Convert to image for smoothScale()
QImage image = pix->convertToImage();
pix->convertFromImage(image.smoothScale(80, 80, QImage::ScaleMin));
}
if(size == Thumbnail)
pix->scaled(80, 80, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap returnValue = *pix; // Save it early.
if(!data()->pixmapCache.insert(path, pix, pix->height() * pix->width()))
delete pix;
......
......@@ -16,6 +16,7 @@
#ifndef DIRECTORYLIST_H
#define DIRECTORYLIST_H
#include <kdialogbase.h>
class DirectoryListBase;
......
This diff is collapsed.
......@@ -27,18 +27,26 @@
FileRenamerTagOptions::FileRenamerTagOptions(QWidget *parent,
const TagRenamerOptions &options) :
FileRenamerTagOptionsBase(parent), m_options(options)
QWidget(parent),
Ui::FileRenamerTagOptionsBase(),
m_options(options)
{
setupUi(this);
layout()->setSpacing(KDialog::spacingHint());
layout()->setMargin(0);
m_emptyTagGroup->layout()->setSpacing(KDialog::spacingHint());
m_trackGroup->layout()->setSpacing(KDialog::spacingHint());
#warning Just commenting these out for now.
/*
m_emptyValueLayout->setSpacing(KDialog::spacingHint());
m_exampleLayout->setSpacing(KDialog::spacingHint());
m_spinLayout->setSpacing(KDialog::spacingHint());
m_widthLayout->setSpacing(KDialog::spacingHint());
m_tagLayout->setSpacing(KDialog::spacingHint());
*/
m_tagFormatGroup->layout()->setSpacing(KDialog::spacingHint());
if(m_options.category() != Track)
......@@ -78,7 +86,7 @@ void FileRenamerTagOptions::slotBracketsChanged()
void FileRenamerTagOptions::slotTrackWidthChanged()
{
unsigned width = m_trackWidth->value();
int width = m_trackWidth->value();
m_options.setTrackWidth(width);
......
......@@ -25,17 +25,16 @@
*
* @author Michael Pyne <michael.pyne@kdemail.net>
*/
class FileRenamerTagOptions : public Ui_FileRenamerTagOptionsBase
class FileRenamerTagOptions : public QWidget, public Ui::FileRenamerTagOptionsBase
{
Q_OBJECT
public:
FileRenamerTagOptions(QWidget *parent, const TagRenamerOptions &options);
virtual ~FileRenamerTagOptions() {}
const TagRenamerOptions &options() const { return m_options; }
protected slots:
protected slots:
virtual void slotBracketsChanged();
virtual void slotTrackWidthChanged();
virtual void slotEmptyActionChanged();
......
......@@ -52,7 +52,7 @@ void FolderPlaylist::setFolder(const QString &s)
void FolderPlaylist::slotReload()
{
if(!m_folder.isNull())
addFiles(m_folder);
addFiles(QStringList(m_folder));
}
////////////////////////////////////////////////////////////////////////////////
......
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