summaryrefslogtreecommitdiffstats
path: root/dcoprss/cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dcoprss/cache.cpp')
-rw-r--r--dcoprss/cache.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/dcoprss/cache.cpp b/dcoprss/cache.cpp
index 9c80a9a3..c4a566aa 100644
--- a/dcoprss/cache.cpp
+++ b/dcoprss/cache.cpp
@@ -28,14 +28,14 @@
#include <kdebug.h>
#include <kstandarddirs.h>
-#include <qdatastream.h>
-#include <qfile.h>
+#include <tqdatastream.h>
+#include <tqfile.h>
bool CacheEntry::isValid() const
{
// Cache entries get invalid after on hour. One shouldn't hardcode this
// but for now it'll do.
- return m_timeStamp.secsTo( QDateTime::currentDateTime() ) < 3600;
+ return m_timeStamp.secsTo( TQDateTime::currentDateTime() ) < 3600;
}
Cache *Cache::m_instance = 0;
@@ -47,14 +47,14 @@ Cache &Cache::self()
return *m_instance;
}
-QString Cache::getCacheKey( const QString &server, const QString &method,
- const QValueList<QVariant> &args )
+TQString Cache::getCacheKey( const TQString &server, const TQString &method,
+ const TQValueList<TQVariant> &args )
{
- QString key;
- key = server + QString::fromLatin1( "__" );
- key += method + QString::fromLatin1( "__" );
- QValueList<QVariant>::ConstIterator it = args.begin();
- QValueList<QVariant>::ConstIterator end = args.end();
+ TQString key;
+ key = server + TQString::fromLatin1( "__" );
+ key += method + TQString::fromLatin1( "__" );
+ TQValueList<TQVariant>::ConstIterator it = args.begin();
+ TQValueList<TQVariant>::ConstIterator end = args.end();
for ( ; it != end; ++it )
key += KXMLRPC::Query::marshal( *it );
@@ -73,56 +73,56 @@ Cache::~Cache()
void Cache::load()
{
- QFile file( cacheFileName() );
+ TQFile file( cacheFileName() );
if ( !file.open( IO_ReadOnly ) ) {
kdDebug() << "Failed to open cache file " << cacheFileName() << endl;
return;
}
- QDataStream stream( &file );
+ TQDataStream stream( &file );
while ( !stream.atEnd() ) {
- QString key;
+ TQString key;
stream >> key;
CacheEntry *entry = new CacheEntry;
stream >> *entry;
- QDict<CacheEntry>::insert( key, entry );
+ TQDict<CacheEntry>::insert( key, entry );
}
}
void Cache::save()
{
- QFile file( cacheFileName() );
+ TQFile file( cacheFileName() );
if ( !file.open( IO_WriteOnly ) ) {
kdDebug() << "Failed to open cache file " << cacheFileName() << endl;
return;
}
- QDataStream stream( &file );
+ TQDataStream stream( &file );
- QDictIterator<CacheEntry> it( *this );
+ TQDictIterator<CacheEntry> it( *this );
for ( ; it.current() != 0; ++it )
stream << it.currentKey() << *it.current();
}
-void Cache::touch( const QString &key )
+void Cache::touch( const TQString &key )
{
CacheEntry *entry = find( key );
if ( !entry )
return;
- entry->m_timeStamp = QDateTime::currentDateTime();
+ entry->m_timeStamp = TQDateTime::currentDateTime();
}
-void Cache::insert( const QString &key, const KXMLRPC::Query::Result &result )
+void Cache::insert( const TQString &key, const KXMLRPC::Query::Result &result )
{
CacheEntry *entry = new CacheEntry;
- entry->m_timeStamp = QDateTime::currentDateTime();
+ entry->m_timeStamp = TQDateTime::currentDateTime();
entry->m_result = result;
- QDict<CacheEntry>::insert( key, entry );
+ TQDict<CacheEntry>::insert( key, entry );
}
-QString Cache::cacheFileName() const
+TQString Cache::cacheFileName() const
{
return locateLocal( "appdata", "cache/dcoprss.cache" );
}