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;
......
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>FileRenamerBase</class>
<widget class="QWidget">
<property name="name">
<cstring>FileRenamerBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>489</width>
<height>579</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="caption">
<string>File Renamer Configuration</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout4</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KComboBox" row="1" column="1">
<item>
<property name="text">
<string> - </string>
</property>
</item>
<item>
<property name="text">
<string>_</string>
</property>
</item>
<item>
<property name="text">
<string>-</string>
</property>
</item>
<property name="name">
<cstring>m_separator</cstring>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1_6</cstring>
</property>
<property name="text">
<string>Music folder:</string>
</property>
</widget>
<widget class="QLayoutWidget" row="2" column="1">
<property name="name">
<cstring>layout3</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QComboBox">
<item>
<property name="text">
<string>Album Tag</string>
</property>
</item>
<item>
<property name="text">
<string>Artist Tag</string>
</property>
</item>
<item>
<property name="text">
<string>Genre Tag</string>
</property>
</item>
<item>
<property name="text">
<string>Title Tag</string>
</property>
</item>
<item>
<property name="text">
<string>Track Tag</string>
</property>
</item>
<item>
<property name="text">
<string>Year Tag</string>
</property>
</item>
<property name="name">
<cstring>m_category</cstring>
</property>
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>m_insertCategory</cstring>
</property>
<property name="text">
<string>Insert Category</string>
</property>
</widget>
</hbox>
</widget>
<widget class="KUrlRequester" row="0" column="1">
<property name="name">
<cstring>m_musicFolder</cstring>
</property>
<property name="url" stdset="0">
<string>/home/kde-cvs/music</string>
</property>
<property name="showLocalProtocol">
<bool>true</bool>
</property>
<property name="mode">
<number>26</number>
</property>
</widget>
<widget class="QLabel" row="2" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Add category:</string>
</property>
<property name="buddy" stdset="0">
<cstring>m_category</cstring>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
<property name="name">
<cstring>textLabel1_7</cstring>
</property>
<property name="text">
<string>Separator:</string>
</property>
</widget>
</grid>
</widget>
<widget class="Line">
<property name="name">
<cstring>line1_2</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QScrollView">
<property name="name">
<cstring>m_mainView</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="Line">
<property name="name">
<cstring>line1</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Example</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout2</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="KPushButton">
<property name="name">
<cstring>m_showExample</cstring>
</property>
<property name="text">
<string>Show Renamer Test Dialog</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>m_exampleText</cstring>
</property>
<property name="focusPolicy">
<enum>NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</vbox>
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>FileRenamerBase</class>
<widget class="QWidget" name="FileRenamerBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>489</width>
<height>579</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string>File Renamer Configuration</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="KComboBox" name="m_separator" >
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="textLabel1_6" >
<property name="text" >
<string>Music folder:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QComboBox" name="m_category" >
<item>
<property name="text" >
<string>Album Tag</string>
</property>
</item>
<item>
<property name="text" >
<string>Artist Tag</string>
</property>
</item>
<item>
<property name="text" >
<string>Genre Tag</string>
</property>
</item>
<item>
<property name="text" >
<string>Title Tag</string>
</property>
</item>
<item>
<property name="text" >
<string>Track Tag</string>
</property>
</item>
<item>
<property name="text" >
<string>Year Tag</string>
</property>
</item>
</widget>
<spacer>
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>QScrollView</class>
<header location="global">qscrollview.h</header>
<sizehint>
<width>100</width>
<height>30</height>
</sizehint>
<container>1</container>
<sizepolicy>
<hordata>5</hordata>
<verdata>5</verdata>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<pixmap>image0</pixmap>
</customwidget>
</customwidgets>
<images>
<image name="image0">
<data format="PNG" length="1002">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082</data>
</image>
</images>
<connections>
<connection>
<sender>m_separator</sender>
<signal>textChanged(const QString&amp;)</signal>
<receiver>FileRenamerBase</receiver>
<slot>exampleTextChanged()</slot>
</connection>
<connection>
<sender>m_musicFolder</sender>
<signal>textChanged(const QString&amp;)</signal>
<receiver>FileRenamerBase</receiver>
<slot>exampleTextChanged()</slot>
</connection>
<connection>
<sender>m_showExample</sender>
<signal>clicked()</signal>
<receiver>FileRenamerBase</receiver>
<slot>toggleExampleDialog()</slot>
</connection>
<connection>
<sender>m_insertCategory</sender>
<signal>clicked()</signal>
<receiver>FileRenamerBase</receiver>
<slot>insertCategory()</slot>
</connection>
</connections>
<tabstops>
<tabstop>m_musicFolder</tabstop>
<tabstop>m_separator</tabstop>
<tabstop>m_category</tabstop>
<tabstop>m_insertCategory</tabstop>
<tabstop>m_showExample</tabstop>
</tabstops>
<slots>
<slot access="protected">exampleTextChanged()</slot>
<slot access="protected">toggleExampleDialog()</slot>
<slot access="protected">insertCategory()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kcombobox.h</includehint>
<includehint>klineedit.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kurlrequester.h</includehint>
<includehint>klineedit.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>qscrollview.h</includehint>
<includehint>kpushbutton.h</includehint>
</includehints>
</UI>
</item>
<item>
<widget class="KPushButton" name="m_insertCategory" />
</item>
</layout>
</item>
<item row="0" column="1" >
<widget class="KUrlRequester" name="m_musicFolder" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Add category:</string>
</property>
<property name="buddy" >
<cstring>m_category</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="textLabel1_7" >
<property name="text" >
<string>Separator:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line1_2" >
<property name="frameShape" >
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Q3ScrollView" name="m_mainView" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line1" >
<property name="frameShape" >
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Q3GroupBox" name="groupBox1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Example</string>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_showExample" >
<property name="text" >
<string>Show Renamer Test Dialog</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="m_exampleText" >
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops" >
<bool>false</bool>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends></extends>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>Q3ScrollView</class>
<extends>QWidget</extends>
<header>q3scrollview.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KPushButton</class>