diff options
Diffstat (limited to 'kpackage/cache.cpp')
-rw-r--r-- | kpackage/cache.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/kpackage/cache.cpp b/kpackage/cache.cpp index 1877728..a50e838 100644 --- a/kpackage/cache.cpp +++ b/kpackage/cache.cpp @@ -37,8 +37,8 @@ extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -cacheObj::cacheObj(const QString &Pbase, const QString &Plocation, const QString &PcacheFile, - const QString &Poption, bool Psubdirs) +cacheObj::cacheObj(const TQString &Pbase, const TQString &Plocation, const TQString &PcacheFile, + const TQString &Poption, bool Psubdirs) { base = Pbase; location = Plocation; @@ -50,48 +50,48 @@ cacheObj::cacheObj(const QString &Pbase, const QString &Plocation, const QString cacheObj::~cacheObj() {} -QString cacheObj::PDir() +TQString cacheObj::PDir() { struct stat buf; - stat(QFile::encodeName(QDir::homeDirPath()), &buf); + stat(TQFile::encodeName(TQDir::homeDirPath()), &buf); - QString tmpd = opts->CacheDir ; + TQString tmpd = opts->CacheDir ; - QDir d(tmpd); + TQDir d(tmpd); if (!d.exists()) { if (!d.mkdir(tmpd)) { KpMsgE(i18n("Cannot create folder %1").arg(tmpd),TRUE); tmpd = ""; } else { - chown(QFile::encodeName(tmpd),buf.st_uid,buf.st_gid); + chown(TQFile::encodeName(tmpd),buf.st_uid,buf.st_gid); } } return tmpd; } -QString cacheObj::CDir() +TQString cacheObj::CDir() { - QString tmpd = PDir(); + TQString tmpd = PDir(); if (!tmpd.isEmpty()) { struct stat buf; - stat(QFile::encodeName(tmpd),&buf); + stat(TQFile::encodeName(tmpd),&buf); tmpd += "dir/"; - QDir d(tmpd); + TQDir d(tmpd); if (!d.exists()) { if (!d.mkdir(tmpd)) { KpMsgE(i18n("Cannot create folder %1").arg(tmpd),TRUE); tmpd = ""; } else { - chown(QFile::encodeName(tmpd),buf.st_uid,buf.st_gid); + chown(TQFile::encodeName(tmpd),buf.st_uid,buf.st_gid); } } } return tmpd; } -int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) { +int cacheObj::newDCache(const TQString &url, const TQString &fn, TQString &fname) { KURL u(url); if ( !u.isValid() ) { @@ -99,7 +99,7 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) return -1; } - QString tmpd = cacheObj::CDir(); + TQString tmpd = cacheObj::CDir(); if (tmpd.isEmpty()) { return -1; } else { @@ -114,7 +114,7 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) return 1; } - QFileInfo f(fname); + TQFileInfo f(fname); if (f.exists() && f.size() > 0) { return 0;; @@ -126,42 +126,42 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) } } -void cacheObj::rmDCache(const QString &fn) { - QString tmpd = cacheObj::CDir(); +void cacheObj::rmDCache(const TQString &fn) { + TQString tmpd = cacheObj::CDir(); tmpd += fn; if (!tmpd.isEmpty()) { - unlink(QFile::encodeName(tmpd)); + unlink(TQFile::encodeName(tmpd)); } } void cacheObj::clearDCache() { - QString tmpd = cacheObj::CDir(); + TQString tmpd = cacheObj::CDir(); if (!tmpd.isEmpty()) { - QDir d(tmpd); + TQDir d(tmpd); CacheList cl(d) ; for (CacheList::iterator it = cl.begin() ; it != cl.end() ; ++it) { - QString s = tmpd; + TQString s = tmpd; s += *it; - unlink(QFile::encodeName(s)); + unlink(TQFile::encodeName(s)); } - unlink(QFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file + unlink(TQFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file } } void cacheObj::clearPCache() { - QString tmpd = cacheObj::PDir(); + TQString tmpd = cacheObj::PDir(); if (!tmpd.isEmpty()) { - QDir d(tmpd); + TQDir d(tmpd); CacheList cl(d); for (CacheList::iterator it = cl.begin() ; it != cl.end() ; ++it) { - QString s = tmpd ; + TQString s = tmpd ; s += *it; - unlink(QFile::encodeName(s)); + unlink(TQFile::encodeName(s)); } - unlink(QFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file + unlink(TQFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file } } @@ -178,7 +178,7 @@ LcacheObj::~LcacheObj() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -CacheList::CacheList (const QDir& dir) +CacheList::CacheList (const TQDir& dir) { CLFile.setName (dir.path() + "/kpackage_cachelist") ; read() ; @@ -188,8 +188,8 @@ void CacheList::read () { kdDebug() << "reading cachelist: " << CLFile.name() << "\n" ; if (CLFile.open (IO_ReadOnly)) { - QTextStream stream (&CLFile) ; - QString line ; + TQTextStream stream (&CLFile) ; + TQString line ; while (!stream.eof()) { line = stream.readLine() ; if (line[0] != '#') { // not a comment @@ -207,10 +207,10 @@ void CacheList::write () { kdDebug() << "writing cachelist: " << CLFile.name() << "\n" ; if (CLFile.open (IO_WriteOnly)) { - QTextStream stream (&CLFile) ; + TQTextStream stream (&CLFile) ; stream << "# This file contains a list of files that have been cached in this folder.\n" ; stream << "# Please only delete this if you want kpackage to forget what it has cached.\n" ; - for (QStringList::iterator it = begin() ; it != end() ; ++it) { + for (TQStringList::iterator it = begin() ; it != end() ; ++it) { stream << *it << "\n" ; } CLFile.close() ; @@ -220,7 +220,7 @@ void CacheList::write () } } -QString CacheList::getCLFileName () const +TQString CacheList::getCLFileName () const { return CLFile.name() ; } |