summaryrefslogtreecommitdiffstats
path: root/juk/cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'juk/cache.cpp')
-rw-r--r--juk/cache.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/juk/cache.cpp b/juk/cache.cpp
index 3f37ee4a..ada9334b 100644
--- a/juk/cache.cpp
+++ b/juk/cache.cpp
@@ -20,8 +20,8 @@
#include <kactionclasses.h>
#include <kdebug.h>
-#include <qdir.h>
-#include <qbuffer.h>
+#include <tqdir.h>
+#include <tqbuffer.h>
#include "cache.h"
#include "tag.h"
@@ -66,23 +66,23 @@ Cache *Cache::instance()
void Cache::save()
{
- QString dirName = KGlobal::dirs()->saveLocation("appdata");
- QString cacheFileName = dirName + "cache.new";
+ TQString dirName = KGlobal::dirs()->saveLocation("appdata");
+ TQString cacheFileName = dirName + "cache.new";
- QFile f(cacheFileName);
+ TQFile f(cacheFileName);
if(!f.open(IO_WriteOnly))
return;
- QByteArray data;
- QDataStream s(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream s(data, IO_WriteOnly);
for(Iterator it = begin(); it != end(); ++it) {
s << (*it).absFilePath();
s << *it;
}
- QDataStream fs(&f);
+ TQDataStream fs(&f);
Q_INT32 checksum = qChecksum(data.data(), data.size());
@@ -92,19 +92,19 @@ void Cache::save()
f.close();
- QDir(dirName).rename("cache.new", "cache");
+ TQDir(dirName).rename("cache.new", "cache");
}
void Cache::loadPlaylists(PlaylistCollection *collection) // static
{
- QString playlistsFile = KGlobal::dirs()->saveLocation("appdata") + "playlists";
+ TQString playlistsFile = KGlobal::dirs()->saveLocation("appdata") + "playlists";
- QFile f(playlistsFile);
+ TQFile f(playlistsFile);
if(!f.open(IO_ReadOnly))
return;
- QDataStream fs(&f);
+ TQDataStream fs(&f);
Q_INT32 version;
fs >> version;
@@ -116,7 +116,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
// Our checksum is only for the values after the version and checksum so
// we want to get a byte array with just the checksummed data.
- QByteArray data;
+ TQByteArray data;
Q_UINT16 checksum;
fs >> checksum >> data;
@@ -125,7 +125,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
// Create a new stream just based on the data.
- QDataStream s(data, IO_ReadOnly);
+ TQDataStream s(data, IO_ReadOnly);
while(!s.atEnd()) {
@@ -204,15 +204,15 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
void Cache::savePlaylists(const PlaylistList &playlists)
{
- QString dirName = KGlobal::dirs()->saveLocation("appdata");
- QString playlistsFile = dirName + "playlists.new";
- QFile f(playlistsFile);
+ TQString dirName = KGlobal::dirs()->saveLocation("appdata");
+ TQString playlistsFile = dirName + "playlists.new";
+ TQFile f(playlistsFile);
if(!f.open(IO_WriteOnly))
return;
- QByteArray data;
- QDataStream s(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream s(data, IO_WriteOnly);
for(PlaylistList::ConstIterator it = playlists.begin(); it != playlists.end(); ++it) {
if(*it) {
@@ -242,19 +242,19 @@ void Cache::savePlaylists(const PlaylistList &playlists)
}
}
- QDataStream fs(&f);
+ TQDataStream fs(&f);
fs << Q_INT32(playlistCacheVersion);
fs << qChecksum(data.data(), data.size());
fs << data;
f.close();
- QDir(dirName).rename("playlists.new", "playlists");
+ TQDir(dirName).rename("playlists.new", "playlists");
}
bool Cache::cacheFileExists() // static
{
- return QFile::exists(KGlobal::dirs()->saveLocation("appdata") + "cache");
+ return TQFile::exists(KGlobal::dirs()->saveLocation("appdata") + "cache");
}
////////////////////////////////////////////////////////////////////////////////
@@ -268,9 +268,9 @@ Cache::Cache() : FileHandleHash()
void Cache::load()
{
- QString cacheFileName = KGlobal::dirs()->saveLocation("appdata") + "cache";
+ TQString cacheFileName = KGlobal::dirs()->saveLocation("appdata") + "cache";
- QFile f(cacheFileName);
+ TQFile f(cacheFileName);
if(!f.open(IO_ReadOnly))
return;
@@ -280,7 +280,7 @@ void Cache::load()
Q_INT32 version;
s >> version;
- QBuffer buffer;
+ TQBuffer buffer;
// Do the version specific stuff.
@@ -289,7 +289,7 @@ void Cache::load()
s.setCacheVersion(1);
Q_INT32 checksum;
- QByteArray data;
+ TQByteArray data;
s >> checksum
>> data;
@@ -314,7 +314,7 @@ void Cache::load()
// Read the cached tags.
while(!s.atEnd()) {
- QString fileName;
+ TQString fileName;
s >> fileName;
fileName.squeeze();