Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Planella
juk
Commits
cf046a30
Commit
cf046a30
authored
Sep 01, 2005
by
Laurent Montel
Browse files
qt3to4 + my script
svn path=/trunk/KDE/kdemultimedia/juk/; revision=455930
parent
32d1f3ee
Changes
85
Hide whitespace changes
Inline
Side-by-side
advancedsearchdialog.cpp
View file @
cf046a30
...
...
@@ -19,12 +19,14 @@
#include
<klocale.h>
#include
<qradiobutton.h>
#include
<qvgroupbox.h>
#include
<qlabel.h>
#include
<qhbox.h>
#include
<qvbox.h>
#include
<q
3
hbox.h>
#include
<q
3
vbox.h>
#include
<qlayout.h>
#include
<qhbuttongroup.h>
//Added by qt3to4:
#include
<QHBoxLayout>
#include
<QBoxLayout>
#include
"collectionlist.h"
#include
"advancedsearchdialog.h"
...
...
@@ -42,20 +44,20 @@ AdvancedSearchDialog::AdvancedSearchDialog(const QString &defaultName,
{
makeVBoxMainWidget
();
QHBox
*
box
=
new
QHBox
(
mainWidget
());
Q
3
HBox
*
box
=
new
Q
3
HBox
(
mainWidget
());
box
->
setSpacing
(
5
);
new
QLabel
(
i18n
(
"Playlist name:"
),
box
);
m_playlistNameLineEdit
=
new
KLineEdit
(
defaultName
,
box
);
QVGroupBox
*
criteriaGroupBox
=
new
QVGroupBox
(
i18n
(
"Search Criteria"
),
mainWidget
());
static_cast
<
QHBox
*>
(
mainWidget
())
->
setStretchFactor
(
criteriaGroupBox
,
1
);
static_cast
<
Q
3
HBox
*>
(
mainWidget
())
->
setStretchFactor
(
criteriaGroupBox
,
1
);
QHButtonGroup
*
group
=
new
QHButtonGroup
(
criteriaGroupBox
);
Q
3
HButtonGroup
*
group
=
new
Q
3
HButtonGroup
(
criteriaGroupBox
);
m_matchAnyButton
=
new
QRadioButton
(
i18n
(
"Match any of the following"
),
group
);
m_matchAllButton
=
new
QRadioButton
(
i18n
(
"Match all of the following"
),
group
);
m_criteria
=
new
QVBox
(
criteriaGroupBox
);
m_criteria
=
new
Q
3
VBox
(
criteriaGroupBox
);
if
(
defaultSearch
.
isNull
())
{
m_searchLines
.
append
(
new
SearchLine
(
m_criteria
));
...
...
@@ -127,7 +129,7 @@ void AdvancedSearchDialog::accept()
m_search
.
addPlaylist
(
CollectionList
::
instance
());
QValueListConstIterator
<
SearchLine
*>
it
=
m_searchLines
.
begin
();
Q
3
ValueListConstIterator
<
SearchLine
*>
it
=
m_searchLines
.
begin
();
for
(;
it
!=
m_searchLines
.
end
();
++
it
)
m_search
.
addComponent
((
*
it
)
->
searchComponent
());
...
...
@@ -141,7 +143,7 @@ void AdvancedSearchDialog::accept()
void
AdvancedSearchDialog
::
clear
()
{
QValueListConstIterator
<
SearchLine
*>
it
=
m_searchLines
.
begin
();
Q
3
ValueListConstIterator
<
SearchLine
*>
it
=
m_searchLines
.
begin
();
for
(;
it
!=
m_searchLines
.
end
();
++
it
)
(
*
it
)
->
clear
();
}
...
...
advancedsearchdialog.h
View file @
cf046a30
...
...
@@ -17,10 +17,12 @@
#define ADVANCEDSEARCHDIALOG_H
#include
<kdialogbase.h>
//Added by qt3to4:
#include
<Q3ValueList>
class
KLineEdit
;
class
KPushButton
;
class
QGroupBox
;
class
Q
3
GroupBox
;
class
QRadioButton
;
class
SearchLine
;
...
...
@@ -58,7 +60,7 @@ private:
QWidget
*
m_criteria
;
PlaylistSearch
m_search
;
QString
m_playlistName
;
QValueList
<
SearchLine
*>
m_searchLines
;
Q
3
ValueList
<
SearchLine
*>
m_searchLines
;
KLineEdit
*
m_playlistNameLineEdit
;
QRadioButton
*
m_matchAnyButton
;
QRadioButton
*
m_matchAllButton
;
...
...
cache.cpp
View file @
cf046a30
...
...
@@ -66,11 +66,11 @@ void Cache::save()
QFile
f
(
cacheFileName
);
if
(
!
f
.
open
(
IO
_
WriteOnly
))
if
(
!
f
.
open
(
Q
IO
Device
::
WriteOnly
))
return
;
QByteArray
data
;
QDataStream
s
(
data
,
IO
_
WriteOnly
);
QDataStream
s
(
data
,
Q
IO
Device
::
WriteOnly
);
for
(
Iterator
it
=
begin
();
it
!=
end
();
++
it
)
{
s
<<
(
*
it
).
absFilePath
();
...
...
@@ -96,7 +96,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
QFile
f
(
playlistsFile
);
if
(
!
f
.
open
(
IO
_
ReadOnly
))
if
(
!
f
.
open
(
Q
IO
Device
::
ReadOnly
))
return
;
QDataStream
fs
(
&
f
);
...
...
@@ -120,7 +120,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
// Create a new stream just based on the data.
QDataStream
s
(
data
,
IO
_
ReadOnly
);
QDataStream
s
(
data
,
Q
IO
Device
::
ReadOnly
);
while
(
!
s
.
atEnd
())
{
...
...
@@ -203,11 +203,11 @@ void Cache::savePlaylists(const PlaylistList &playlists)
QString
playlistsFile
=
dirName
+
"playlists.new"
;
QFile
f
(
playlistsFile
);
if
(
!
f
.
open
(
IO
_
WriteOnly
))
if
(
!
f
.
open
(
Q
IO
Device
::
WriteOnly
))
return
;
QByteArray
data
;
QDataStream
s
(
data
,
IO
_
WriteOnly
);
QDataStream
s
(
data
,
Q
IO
Device
::
WriteOnly
);
for
(
PlaylistList
::
ConstIterator
it
=
playlists
.
begin
();
it
!=
playlists
.
end
();
++
it
)
{
if
(
*
it
)
{
...
...
@@ -267,7 +267,7 @@ void Cache::load()
QFile
f
(
cacheFileName
);
if
(
!
f
.
open
(
IO
_
ReadOnly
))
if
(
!
f
.
open
(
Q
IO
Device
::
ReadOnly
))
return
;
CacheDataStream
s
(
&
f
);
...
...
@@ -289,7 +289,7 @@ void Cache::load()
>>
data
;
buffer
.
setBuffer
(
data
);
buffer
.
open
(
IO
_
ReadOnly
);
buffer
.
open
(
Q
IO
Device
::
ReadOnly
);
s
.
setDevice
(
&
buffer
);
if
(
checksum
!=
qChecksum
(
data
.
data
(),
data
.
size
()))
{
...
...
cache.h
View file @
cf046a30
...
...
@@ -18,12 +18,14 @@
#include
"stringhash.h"
//Added by qt3to4:
#include
<Q3ValueList>
class
Tag
;
class
Playlist
;
class
PlaylistCollection
;
typedef
QValueList
<
Playlist
*>
PlaylistList
;
typedef
Q
3
ValueList
<
Playlist
*>
PlaylistList
;
class
Cache
:
public
FileHandleHash
{
...
...
@@ -54,7 +56,7 @@ class CacheDataStream : public QDataStream
{
public:
CacheDataStream
(
QIODevice
*
d
)
:
QDataStream
(
d
),
m_cacheVersion
(
0
)
{}
CacheDataStream
(
QByteArray
a
,
int
mode
)
:
QDataStream
(
a
,
mode
),
m_cacheVersion
(
0
)
{}
CacheDataStream
(
QByteArray
&
a
,
int
mode
)
:
QDataStream
(
a
,
mode
),
m_cacheVersion
(
0
)
{}
virtual
~
CacheDataStream
()
{}
...
...
categoryreaderinterface.h
View file @
cf046a30
//Added by qt3to4:
#include
<Q3ValueList>
/***************************************************************************
begin : Sun Oct 31 2004
copyright : (C) 2004 by Michael Pyne
...
...
@@ -19,7 +21,7 @@
class
QString
;
template
<
class
T
>
class
QValueList
;
template
<
class
T
>
class
Q
3
ValueList
;
/**
* This class is used to map categories into values. You should implement the
...
...
@@ -75,7 +77,7 @@ public:
*/
virtual
QString
emptyText
(
TagType
category
)
const
=
0
;
virtual
QValueList
<
TagType
>
categoryOrder
()
const
=
0
;
virtual
Q
3
ValueList
<
TagType
>
categoryOrder
()
const
=
0
;
// You probably shouldn't reimplement this
virtual
QString
value
(
TagType
category
)
const
;
...
...
collectionlist.cpp
View file @
cf046a30
...
...
@@ -32,6 +32,11 @@
#include
"tag.h"
#include
"viewmode.h"
#include
"coverinfo.h"
//Added by qt3to4:
#include
<Q3ValueList>
#include
<QDragMoveEvent>
#include
<Q3CString>
#include
<QDropEvent>
using
namespace
ActionCollection
;
...
...
@@ -84,7 +89,7 @@ void CollectionList::initialize(PlaylistCollection *collection)
// public methods
////////////////////////////////////////////////////////////////////////////////
PlaylistItem
*
CollectionList
::
createItem
(
const
FileHandle
&
file
,
QListViewItem
*
,
bool
)
PlaylistItem
*
CollectionList
::
createItem
(
const
FileHandle
&
file
,
Q
3
ListViewItem
*
,
bool
)
{
// It's probably possible to optimize the line below away, but, well, right
// now it's more important to not load duplicate items.
...
...
@@ -124,13 +129,13 @@ void CollectionList::setupTreeViewEntries(ViewMode *viewMode) const
return
;
}
QValueList
<
int
>
columnList
;
Q
3
ValueList
<
int
>
columnList
;
columnList
<<
PlaylistItem
::
ArtistColumn
;
columnList
<<
PlaylistItem
::
GenreColumn
;
columnList
<<
PlaylistItem
::
AlbumColumn
;
QStringList
items
;
for
(
QValueList
<
int
>::
Iterator
colIt
=
columnList
.
begin
();
colIt
!=
columnList
.
end
();
++
colIt
)
{
for
(
Q
3
ValueList
<
int
>::
Iterator
colIt
=
columnList
.
begin
();
colIt
!=
columnList
.
end
();
++
colIt
)
{
items
.
clear
();
for
(
TagCountDictIterator
it
(
*
m_columnTags
[
*
colIt
]);
it
.
current
();
++
it
)
items
<<
it
.
currentKey
();
...
...
@@ -198,7 +203,7 @@ void CollectionList::slotCheckCache()
{
PlaylistItemList
invalidItems
;
for
(
QDictIterator
<
CollectionListItem
>
it
(
m_itemsDict
);
it
.
current
();
++
it
)
{
for
(
Q
3
DictIterator
<
CollectionListItem
>
it
(
m_itemsDict
);
it
.
current
();
++
it
)
{
if
(
!
it
.
current
()
->
checkCurrent
())
invalidItems
.
append
(
*
it
);
processEvents
();
...
...
@@ -361,7 +366,7 @@ void CollectionListItem::refresh()
if
(
id
!=
TrackNumberColumn
&&
id
!=
LengthColumn
)
{
// All columns other than track num and length need local-encoded data for sorting
QCString
lower
=
text
(
i
).
lower
().
local8Bit
();
Q
3
CString
lower
=
text
(
i
).
lower
().
local8Bit
();
// For some columns, we may be able to share some strings
...
...
@@ -428,7 +433,7 @@ void CollectionListItem::updateCollectionDict(const QString &oldPath, const QStr
void
CollectionListItem
::
repaint
()
const
{
QListViewItem
::
repaint
();
Q
3
ListViewItem
::
repaint
();
for
(
PlaylistItemList
::
ConstIterator
it
=
m_children
.
begin
();
it
!=
m_children
.
end
();
++
it
)
(
*
it
)
->
repaint
();
}
...
...
collectionlist.h
View file @
cf046a30
...
...
@@ -20,9 +20,12 @@
#include
<kdirwatch.h>
#include
<kfileitem.h>
#include
<qdict.h>
#include
<q
3
dict.h>
#include
<qclipboard.h>
#include
<qvaluevector.h>
#include
<q3valuevector.h>
//Added by qt3to4:
#include
<QDragMoveEvent>
#include
<QDropEvent>
#include
"playlist.h"
#include
"playlistitem.h"
...
...
@@ -37,8 +40,8 @@ class ViewMode;
* that hold the string.
*/
typedef
QDict
<
int
>
TagCountDict
;
typedef
QDictIterator
<
int
>
TagCountDictIterator
;
typedef
Q
3
Dict
<
int
>
TagCountDict
;
typedef
Q
3
DictIterator
<
int
>
TagCountDictIterator
;
/**
* We then have an array of dicts, one for each column in the list view. We
...
...
@@ -46,7 +49,7 @@ typedef QDictIterator<int> TagCountDictIterator;
* doesn't copy the case sensitivity setting.
*/
typedef
QValueVector
<
TagCountDict
*>
TagCountDicts
;
typedef
Q
3
ValueVector
<
TagCountDict
*>
TagCountDicts
;
/**
* This is the "collection", or all of the music files that have been opened
...
...
@@ -83,7 +86,7 @@ public:
CollectionListItem
*
lookup
(
const
QString
&
file
)
{
return
m_itemsDict
.
find
(
file
);
}
virtual
PlaylistItem
*
createItem
(
const
FileHandle
&
file
,
QListViewItem
*
=
0
,
Q
3
ListViewItem
*
=
0
,
bool
=
false
);
void
emitVisibleColumnsChanged
()
{
emit
signalVisibleColumnsChanged
();
}
...
...
@@ -151,7 +154,7 @@ private:
static
const
int
m_uniqueSetCount
=
3
;
static
CollectionList
*
m_list
;
QDict
<
CollectionListItem
>
m_itemsDict
;
Q
3
Dict
<
CollectionListItem
>
m_itemsDict
;
KDirWatch
*
m_dirWatch
;
TagCountDicts
m_columnTags
;
};
...
...
@@ -165,7 +168,7 @@ class CollectionListItem : public PlaylistItem
/**
* Needs access to the destructor, even though the destructor isn't used by QDict.
*/
friend
class
QDict
<
CollectionListItem
>
;
friend
class
Q
3
Dict
<
CollectionListItem
>
;
public:
virtual
void
refresh
();
...
...
coverdialog.cpp
View file @
cf046a30
...
...
@@ -23,6 +23,8 @@
#include
<qtimer.h>
#include
<qtoolbutton.h>
//Added by qt3to4:
#include
<Q3ValueList>
#include
"coverdialog.h"
#include
"covericonview.h"
...
...
@@ -34,21 +36,21 @@ using CoverUtility::CoverIconViewItem;
class
AllArtistsListViewItem
:
public
KListViewItem
{
public:
AllArtistsListViewItem
(
QListView
*
parent
)
:
AllArtistsListViewItem
(
Q
3
ListView
*
parent
)
:
KListViewItem
(
parent
,
i18n
(
"<All Artists>"
))
{
}
int
compare
(
QListViewItem
*
,
int
,
bool
)
const
int
compare
(
Q
3
ListViewItem
*
,
int
,
bool
)
const
{
return
-
1
;
// Always be at the top.
}
};
CoverDialog
::
CoverDialog
(
QWidget
*
parent
)
:
CoverDialogBase
(
parent
,
"juk_cover_dialog"
,
WType_Dialog
)
CoverDialogBase
(
parent
,
"juk_cover_dialog"
,
Qt
::
WType_Dialog
)
{
m_covers
->
setResizeMode
(
QIconView
::
Adjust
);
m_covers
->
setResizeMode
(
Q
3
IconView
::
Adjust
);
m_covers
->
setGridX
(
140
);
m_covers
->
setGridY
(
150
);
...
...
@@ -82,8 +84,8 @@ void CoverDialog::show()
// covers.
void
CoverDialog
::
loadCovers
()
{
QValueList
<
coverKey
>
keys
=
CoverManager
::
keys
();
QValueList
<
coverKey
>::
ConstIterator
it
;
Q
3
ValueList
<
coverKey
>
keys
=
CoverManager
::
keys
();
Q
3
ValueList
<
coverKey
>::
ConstIterator
it
;
int
i
=
0
;
for
(
it
=
keys
.
begin
();
it
!=
keys
.
end
();
++
it
)
{
...
...
@@ -97,7 +99,7 @@ void CoverDialog::loadCovers()
}
// TODO: Add a way to show cover art for tracks with no artist.
void
CoverDialog
::
slotArtistClicked
(
QListViewItem
*
item
)
void
CoverDialog
::
slotArtistClicked
(
Q
3
ListViewItem
*
item
)
{
m_covers
->
clear
();
...
...
@@ -107,8 +109,8 @@ void CoverDialog::slotArtistClicked(QListViewItem *item)
}
else
{
QString
artist
=
item
->
text
(
0
).
lower
();
QValueList
<
coverKey
>
keys
=
CoverManager
::
keys
();
QValueList
<
coverKey
>::
ConstIterator
it
;
Q
3
ValueList
<
coverKey
>
keys
=
CoverManager
::
keys
();
Q
3
ValueList
<
coverKey
>::
ConstIterator
it
;
for
(
it
=
keys
.
begin
();
it
!=
keys
.
end
();
++
it
)
{
CoverDataPtr
data
=
CoverManager
::
coverInfo
(
*
it
);
...
...
@@ -118,7 +120,7 @@ void CoverDialog::slotArtistClicked(QListViewItem *item)
}
}
void
CoverDialog
::
slotContextRequested
(
QIconViewItem
*
item
,
const
QPoint
&
pt
)
void
CoverDialog
::
slotContextRequested
(
Q
3
IconViewItem
*
item
,
const
QPoint
&
pt
)
{
static
KPopupMenu
*
menu
=
0
;
...
...
coverdialog.h
View file @
cf046a30
...
...
@@ -28,8 +28,8 @@ public:
virtual
void
show
();
public
slots
:
void
slotArtistClicked
(
QListViewItem
*
item
);
void
slotContextRequested
(
QIconViewItem
*
item
,
const
QPoint
&
pt
);
void
slotArtistClicked
(
Q
3
ListViewItem
*
item
);
void
slotContextRequested
(
Q
3
IconViewItem
*
item
,
const
QPoint
&
pt
);
private
slots
:
void
loadCovers
();
...
...
covericonview.cpp
View file @
cf046a30
...
...
@@ -18,7 +18,7 @@
using
CoverUtility
::
CoverIconViewItem
;
CoverIconViewItem
::
CoverIconViewItem
(
coverKey
id
,
QIconView
*
parent
)
:
CoverIconViewItem
::
CoverIconViewItem
(
coverKey
id
,
Q
3
IconView
*
parent
)
:
KIconViewItem
(
parent
),
m_id
(
id
)
{
CoverDataPtr
data
=
CoverManager
::
coverInfo
(
id
);
...
...
@@ -36,7 +36,7 @@ CoverIconViewItem *CoverIconView::currentItem() const
return
static_cast
<
CoverIconViewItem
*>
(
KIconView
::
currentItem
());
}
QDragObject
*
CoverIconView
::
dragObject
()
Q
3
DragObject
*
CoverIconView
::
dragObject
()
{
CoverIconViewItem
*
item
=
currentItem
();
if
(
item
)
...
...
covericonview.h
View file @
cf046a30
...
...
@@ -29,7 +29,7 @@ namespace CoverUtility
class
CoverIconViewItem
:
public
KIconViewItem
{
public:
CoverIconViewItem
(
coverKey
id
,
QIconView
*
parent
);
CoverIconViewItem
(
coverKey
id
,
Q
3
IconView
*
parent
);
coverKey
id
()
const
{
return
m_id
;
}
...
...
@@ -54,7 +54,7 @@ public:
CoverIconViewItem
*
currentItem
()
const
;
protected:
virtual
QDragObject
*
dragObject
();
virtual
Q
3
DragObject
*
dragObject
();
};
#endif
/* JUK_COVERICONVIEW_H */
...
...
coverinfo.cpp
View file @
cf046a30
...
...
@@ -22,6 +22,12 @@
#include
<qlayout.h>
#include
<qlabel.h>
#include
<qcursor.h>
//Added by qt3to4:
#include
<QPixmap>
#include
<QMouseEvent>
#include
<Q3Frame>
#include
<QHBoxLayout>
#include
<QEvent>
#include
"coverinfo.h"
#include
"tag.h"
...
...
@@ -29,13 +35,13 @@
struct
CoverPopup
:
public
QWidget
{
CoverPopup
(
const
QPixmap
&
image
,
const
QPoint
&
p
)
:
QWidget
(
0
,
0
,
WDestructiveClose
|
WX11BypassWM
)
QWidget
(
0
,
0
,
Qt
::
WDestructiveClose
|
Qt
::
WX11BypassWM
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
QLabel
*
label
=
new
QLabel
(
this
);
layout
->
addWidget
(
label
);
label
->
setFrameStyle
(
QFrame
::
Box
|
QFrame
::
Raised
);
label
->
setFrameStyle
(
Q
3
Frame
::
Box
|
Q
3
Frame
::
Raised
);
label
->
setLineWidth
(
1
);
label
->
setPixmap
(
image
);
...
...
coverinfo.h
View file @
cf046a30
...
...
@@ -16,6 +16,8 @@
#define COVERINFO_H
#include
<qimage.h>
//Added by qt3to4:
#include
<QPixmap>
#include
"filehandle.h"
#include
"covermanager.h"
...
...
covermanager.cpp
View file @
cf046a30
...
...
@@ -20,9 +20,11 @@
#include
<qimage.h>
#include
<qdir.h>
#include
<qdatastream.h>
#include
<qdict.h>
#include
<qcache.h>
#include
<q
3
dict.h>
#include
<q
3
cache.h>
#include
<qmime.h>
//Added by qt3to4:
#include
<Q3ValueList>
#include
<kdebug.h>
#include
<kstaticdeleter.h>
...
...
@@ -34,7 +36,7 @@
// This is a dictionary to map the track path to their ID. Otherwise we'd have
// to store this info with each CollectionListItem, which would break the cache
// of users who upgrade, and would just generally be a big mess.
typedef
QDict
<
coverKey
>
TrackLookupMap
;
typedef
Q
3
Dict
<
coverKey
>
TrackLookupMap
;
// This is responsible for making sure that the CoverManagerPrivate class
// gets properly destructed on shutdown.
...
...
@@ -43,7 +45,7 @@ static KStaticDeleter<CoverManagerPrivate> sd;
const
char
*
CoverDrag
::
mimetype
=
"application/x-juk-coverid"
;
// Caches the QPixmaps for the covers so that the covers are not all kept in
// memory for no reason.
typedef
QCache
<
QPixmap
>
CoverPixmapCache
;
typedef
Q
3
Cache
<
QPixmap
>
CoverPixmapCache
;
CoverManagerPrivate
*
CoverManager
::
m_data
=
0
;
...
...
@@ -146,7 +148,7 @@ void CoverManagerPrivate::saveCovers() const
kdDebug
()
<<
"Opening covers db: "
<<
coverLocation
()
<<
endl
;
if
(
!
file
.
open
(
IO
_
WriteOnly
))
{
if
(
!
file
.
open
(
Q
IO
Device
::
WriteOnly
))
{
kdError
()
<<
"Unable to save covers to disk!
\n
"
;
return
;
}
...
...
@@ -165,7 +167,7 @@ void CoverManagerPrivate::saveCovers() const
// Now write out the track mapping.
out
<<
Q_UINT32
(
tracks
.
count
());
QDictIterator
<
coverKey
>
trackMapIt
(
tracks
);
Q
3
DictIterator
<
coverKey
>
trackMapIt
(
tracks
);
while
(
trackMapIt
.
current
())
{
out
<<
trackMapIt
.
currentKey
()
<<
Q_UINT32
(
*
trackMapIt
.
current
());
++
trackMapIt
;
...
...
@@ -178,7 +180,7 @@ void CoverManagerPrivate::loadCovers()
QFile
file
(
coverLocation
());
if
(
!
file
.
open
(
IO
_
ReadOnly
))
{
if
(
!
file
.
open
(
Q
IO
Device
::
ReadOnly
))
{
// Guess we don't have any covers yet.
return
;
}
...
...
@@ -240,7 +242,7 @@ coverKey CoverManagerPrivate::nextId() const
//
// Implementation of CoverDrag
//
CoverDrag
::
CoverDrag
(
coverKey
id
,
QWidget
*
src
)
:
QDragObject
(
src
,
"coverDrag"
),
CoverDrag
::
CoverDrag
(
coverKey
id
,
QWidget
*
src
)
:
Q
3
DragObject
(
src
,
"coverDrag"
),
m_id
(
id
)
{
QPixmap
cover
=
CoverManager
::
coverFromId
(
id
);
...
...
@@ -262,7 +264,7 @@ QByteArray CoverDrag::encodedData(const char *mimetype) const
{
if
(
qstrcmp
(
CoverDrag
::
mimetype
,
mimetype
)
==
0
)
{
QByteArray
data
;
QDataStream
ds
(
data
,
IO
_
WriteOnly
);
QDataStream
ds
(
data
,
Q
IO
Device
::
WriteOnly
);
ds
<<
Q_UINT32
(
m_id
);
return
data
;
...
...
@@ -286,7 +288,7 @@ bool CoverDrag::decode(const QMimeSource *e, coverKey &id)
return
false
;
QByteArray
data
=
e
->
encodedData
(
mimetype
);
QDataStream
ds
(
data
,
IO
_
ReadOnly
);
QDataStream
ds
(
data
,
Q
IO
Device
::
ReadOnly
);
Q_UINT32
i
;
ds
>>
i
;
...
...
@@ -421,7 +423,7 @@ bool CoverManager::removeCover(coverKey id)
data
()
->
pixmapCache
.
remove
(
QString
(
"t%1"
).
arg
(
coverData
->
path
));
// Remove references to files that had that track ID.
QDictIterator
<
coverKey
>
it
(
data
()
->
tracks
);
Q
3
DictIterator
<
coverKey
>
it
(
data
()
->
tracks
);
for
(;
it
.
current
();
++
it
)
if
(
*
it
.
current
()
==
id
)
data
()
->
tracks
.
remove
(
it
.
currentKey
());
...
...
@@ -473,7 +475,7 @@ CoverDataMap::ConstIterator CoverManager::end()
return
data
()
->
covers
.
constEnd
();
}
QValueList
<
coverKey
>
CoverManager
::
keys
()
Q
3
ValueList
<
coverKey
>
CoverManager
::
keys
()
{
return
data
()
->
covers
.
keys
();
}
...
...
covermanager.h
View file @
cf046a30
...
...
@@ -19,7 +19,10 @@
#include
<ksharedptr.h>
#include
<qmap.h>
#include
<qdragobject.h>
#include
<q3dragobject.h>
//Added by qt3to4:
#include
<QPixmap>
#include
<Q3ValueList>
class
CoverManagerPrivate
;
class
QString
;
...
...
@@ -60,7 +63,7 @@ typedef QMap<coverKey, CoverDataPtr> CoverDataMap;
*
* @author Michael Pyne <michael.pyne@kdemail.net>
*/
class
CoverDrag
:
public
QDragObject
class
CoverDrag
:
public
Q
3
DragObject
{
public:
CoverDrag
(
coverKey
id
,
QWidget
*
src
);
...
...
@@ -214,7 +217,7 @@ public:
/**
* @return A list of all of the id's listed in the database.
*/
static
QValueList
<
coverKey
>
keys
();
static
Q
3
ValueList
<
coverKey
>
keys
();
/**
* Associates @p path with the cover identified by @id. No comparison of
...
...
deletedialog.cpp
View file @
cf046a30
...
...
@@ -24,8 +24,8 @@
#include
<qcheckbox.h>
#include
<qlayout.h>
#include
<qlabel.h>
#include
<qvbox.h>
#include
<qhbox.h>
#include
<q
3
vbox.h>
#include
<q
3
hbox.h>
#include
"deletedialog.h"
...
...
@@ -70,7 +70,7 @@ void DeleteWidget::slotShouldDelete(bool shouldDelete)
//////////////////////////////////////////////////////////////////////////////
DeleteDialog
::
DeleteDialog
(
QWidget
*
parent
,
const
char
*
name
)
:
KDialogBase
(
Swallow
,
WStyle_DialogBorder
,
parent
,
name
,
KDialogBase
(
Swallow
,
Qt
::
WStyle_DialogBorder
,
parent
,
name
,
true
/* modal */
,
i18n
(
"About to delete selected files"
),
Ok
|
Cancel
,
Cancel
/* Default */
,
true
/* separator */
),
m_trashGuiItem
(
i18n
(
"&Send to Trash"
),
"trashcan_full"
)
...
...
deletedialog.h
View file @
cf046a30
...
...
@@ -18,13 +18,15 @@
#include
<qcheckbox.h>
//Added by qt3to4:
#include
<QLabel>