Commit ea56c229 authored by Laurent Montel's avatar Laurent Montel

Qt3support--

svn path=/trunk/KDE/kdemultimedia/juk/; revision=652516
parent 73c0d84a
......@@ -84,9 +84,9 @@ void Cache::save()
QDataStream fs(&f);
Q_INT32 checksum = qChecksum(data.data(), data.size());
qint32 checksum = qChecksum(data.data(), data.size());
fs << Q_INT32(m_currentVersion)
fs << qint32(m_currentVersion)
<< checksum
<< data;
......@@ -106,7 +106,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
QDataStream fs(&f);
Q_INT32 version;
qint32 version;
fs >> version;
switch(version) {
......@@ -117,7 +117,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
// we want to get a byte array with just the checksummed data.
QByteArray data;
Q_UINT16 checksum;
quint16 checksum;
fs >> checksum >> data;
if(checksum != qChecksum(data.data(), data.size()))
......@@ -129,7 +129,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
while(!s.atEnd()) {
Q_INT32 playlistType;
qint32 playlistType;
s >> playlistType;
Playlist *playlist = 0;
......@@ -175,7 +175,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
break;
}
if(version == 2) {
Q_INT32 sortColumn;
qint32 sortColumn;
s >> sortColumn;
if(playlist)
playlist->setSorting(sortColumn);
......@@ -217,33 +217,33 @@ void Cache::savePlaylists(const PlaylistList &playlists)
for(PlaylistList::ConstIterator it = playlists.begin(); it != playlists.end(); ++it) {
if(*it) {
if(dynamic_cast<HistoryPlaylist *>(*it)) {
s << Q_INT32(History)
s << qint32(History)
<< *static_cast<HistoryPlaylist *>(*it);
}
else if(dynamic_cast<SearchPlaylist *>(*it)) {
s << Q_INT32(Search)
s << qint32(Search)
<< *static_cast<SearchPlaylist *>(*it);
}
else if(dynamic_cast<UpcomingPlaylist *>(*it)) {
if(!action<KToggleAction>("saveUpcomingTracks")->isChecked())
continue;
s << Q_INT32(Upcoming)
s << qint32(Upcoming)
<< *static_cast<UpcomingPlaylist *>(*it);
}
else if(dynamic_cast<FolderPlaylist *>(*it)) {
s << Q_INT32(Folder)
s << qint32(Folder)
<< *static_cast<FolderPlaylist *>(*it);
}
else {
s << Q_INT32(Normal)
s << qint32(Normal)
<< *(*it);
}
s << Q_INT32((*it)->sortColumn());
s << qint32((*it)->sortColumn());
}
}
QDataStream fs(&f);
fs << Q_INT32(playlistCacheVersion);
fs << qint32(playlistCacheVersion);
fs << qChecksum(data.data(), data.size());
fs << data;
......@@ -277,7 +277,7 @@ void Cache::load()
CacheDataStream s(&f);
Q_INT32 version;
qint32 version;
s >> version;
QBuffer buffer;
......@@ -289,7 +289,7 @@ void Cache::load()
case 1: {
s.setCacheVersion(1);
Q_INT32 checksum;
qint32 checksum;
s >> checksum
>> data;
......
......@@ -157,20 +157,20 @@ void CoverManagerPrivate::saveCovers() const
QDataStream out(&file);
// Write out the version and count
out << Q_UINT32(0) << Q_UINT32(covers.count());
out << quint32(0) << quint32(covers.count());
// Write out the data
for(CoverDataMap::ConstIterator it = covers.begin(); it != covers.end(); ++it) {
out << Q_UINT32(it.key());
out << quint32(it.key());
out << *it.value();
}
// Now write out the track mapping.
out << Q_UINT32(tracks.count());
out << quint32(tracks.count());
Q3DictIterator<coverKey> trackMapIt(tracks);
while(trackMapIt.current()) {
out << trackMapIt.currentKey() << Q_UINT32(*trackMapIt.current());
out << trackMapIt.currentKey() << quint32(*trackMapIt.current());
++trackMapIt;
}
}
......@@ -187,7 +187,7 @@ void CoverManagerPrivate::loadCovers()
}
QDataStream in(&file);
Q_UINT32 count, version;
quint32 count, version;
// First thing we'll read in will be the version.
// Only version 0 is defined for now.
......@@ -201,9 +201,9 @@ void CoverManagerPrivate::loadCovers()
// Read in the count next, then the data.
in >> count;
for(Q_UINT32 i = 0; i < count; ++i) {
for(quint32 i = 0; i < count; ++i) {
// Read the id, and 3 QStrings for every 1 of the count.
Q_UINT32 id;
quint32 id;
CoverDataPtr data(new CoverData);
in >> id;
......@@ -214,9 +214,9 @@ void CoverManagerPrivate::loadCovers()
}
in >> count;
for(Q_UINT32 i = 0; i < count; ++i) {
for(quint32 i = 0; i < count; ++i) {
QString path;
Q_UINT32 id;
quint32 id;
in >> path >> id;
......@@ -276,7 +276,7 @@ QByteArray CoverDrag::encodedData(const char *mimetype) const
QByteArray data;
QDataStream ds(&data, QIODevice::WriteOnly);
ds << Q_UINT32(m_id);
ds << quint32(m_id);
return data;
}
else if(qstrcmp(mimetype, "image/png") == 0) {
......@@ -306,7 +306,7 @@ bool CoverDrag::decode(const QMimeSource *e, coverKey &id)
QByteArray data = e->encodedData(mimetype);
QDataStream ds(&data, QIODevice::ReadOnly);
Q_UINT32 i;
quint32 i;
ds >> i;
id = (coverKey) i;
......
......@@ -124,7 +124,7 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p)
{
PlaylistItemList l = const_cast<HistoryPlaylist *>(&p)->items();
s << Q_INT32(l.count());
s << qint32(l.count());
for(PlaylistItemList::ConstIterator it = l.begin(); it != l.end(); ++it) {
const HistoryPlaylistItem *i = static_cast<HistoryPlaylistItem *>(*it);
......@@ -137,7 +137,7 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p)
QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p)
{
Q_INT32 count;
qint32 count;
s >> count;
HistoryPlaylistItem *after = 0;
......
......@@ -269,7 +269,7 @@ bool PlaylistSearch::Component::operator==(const Component &v) const
QDataStream &operator<<(QDataStream &s, const PlaylistSearch &search)
{
s << search.components()
<< Q_INT32(search.searchMode());
<< qint32(search.searchMode());
return s;
}
......@@ -286,7 +286,7 @@ QDataStream &operator>>(QDataStream &s, PlaylistSearch &search)
for(; it != components.end(); ++it)
search.addComponent(*it);
Q_INT32 mode;
qint32 mode;
s >> mode;
search.setSearchMode(PlaylistSearch::SearchMode(mode));
......@@ -299,7 +299,7 @@ QDataStream &operator<<(QDataStream &s, const PlaylistSearch::Component &c)
<< (c.isPatternSearch() ? c.pattern().pattern() : c.query())
<< c.isCaseSensitive()
<< c.columns()
<< Q_INT32(c.matchMode());
<< qint32(c.matchMode());
return s;
}
......@@ -310,7 +310,7 @@ QDataStream &operator>>(QDataStream &s, PlaylistSearch::Component &c)
QString pattern;
bool caseSensitive;
ColumnList columns;
Q_INT32 mode;
qint32 mode;
s >> patternSearch
>> pattern
......
......@@ -147,10 +147,10 @@ CacheDataStream &Tag::read(CacheDataStream &s)
{
switch(s.cacheVersion()) {
case 1: {
Q_INT32 track;
Q_INT32 year;
Q_INT32 bitrate;
Q_INT32 seconds;
qint32 track;
qint32 year;
qint32 bitrate;
qint32 seconds;
s >> m_title
>> m_artist
......@@ -264,12 +264,12 @@ QDataStream &operator<<(QDataStream &s, const Tag &t)
<< t.artist()
<< t.album()
<< t.genre()
<< Q_INT32(t.track())
<< Q_INT32(t.year())
<< qint32(t.track())
<< qint32(t.year())
<< t.comment()
<< Q_INT32(t.bitrate())
<< qint32(t.bitrate())
<< t.lengthString()
<< Q_INT32(t.seconds());
<< qint32(t.seconds());
return s;
}
......
......@@ -240,7 +240,7 @@ QDataStream &operator<<(QDataStream &s, const UpcomingPlaylist &p)
{
PlaylistItemList l = const_cast<UpcomingPlaylist *>(&p)->items();
s << Q_INT32(l.count());
s << qint32(l.count());
for(PlaylistItemList::ConstIterator it = l.begin(); it != l.end(); ++it)
s << (*it)->file().absFilePath();
......@@ -252,11 +252,11 @@ QDataStream &operator>>(QDataStream &s, UpcomingPlaylist &p)
{
QString fileName;
PlaylistItem *newItem = 0;
Q_INT32 count;
qint32 count;
s >> count;
for(Q_INT32 i = 0; i < count; ++i) {
for(qint32 i = 0; i < count; ++i) {
s >> fileName;
newItem = p.createItem(FileHandle(fileName), newItem, false);
}
......
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