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