diff options
Diffstat (limited to 'src/common/global/purl.h')
-rw-r--r-- | src/common/global/purl.h | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/src/common/global/purl.h b/src/common/global/purl.h index 6cbf38b..a0ee295 100644 --- a/src/common/global/purl.h +++ b/src/common/global/purl.h @@ -10,27 +10,23 @@ #define PURL_H #include "common/global/global.h" -#if QT_VERSION<0x040000 -# include <qhttp.h> -#else -# include <QtNetwork/QHttp> -# include <QDateTime> -#endif +# include <tqhttp.h> #include "common/global/log.h" #include "common/common/purl_base.h" namespace PURL { //---------------------------------------------------------------------------- -class Http : public QHttp +class Http : public TQHttp { Q_OBJECT + TQ_OBJECT public: - Http(const QString &hostname); - QHttpResponseHeader _header; + Http(const TQString &hostname); + TQHttpResponseHeader _header; private slots: - void responseHeaderReceivedSlot(const QHttpResponseHeader &rh) { _header = rh; } + void responseHeaderReceivedSlot(const TQHttpResponseHeader &rh) { _header = rh; } }; class Url; @@ -43,21 +39,21 @@ enum SeparatorType { UnixSeparator, WindowsSeparator }; class Base { public: - Base(const QString &filepath = QString::null); + Base(const TQString &filepath = TQString()); Base(const KURL &url); bool operator <(const Base &url) const { return _url<url._url; } bool operator ==(const Base &url) const; bool operator !=(const Base &url) const { return !(_url==url._url); } const KURL &kurl() const { return _url; } - QString pretty() const; + TQString pretty() const; bool isEmpty() const { return _url.isEmpty(); } bool isLocal() const; - QString path(SeparatorType type = UnixSeparator) const; // with ending '/' unless empty path - QString unterminatedPath(SeparatorType type = UnixSeparator) const; // no ending '/' + TQString path(SeparatorType type = UnixSeparator) const; // with ending '/' unless empty path + TQString unterminatedPath(SeparatorType type = UnixSeparator) const; // no ending '/' Directory directory() const; bool isInto(const Directory &dir) const; bool isRelative() const { return _relative; } - bool exists(QDateTime *lastModified = 0) const; + bool exists(TQDateTime *lastModified = 0) const; protected: bool _relative; @@ -75,42 +71,42 @@ public: Url() {} Url(const KURL &url) : Base(url) {} // add correct extension if filename has no extension - Url(const Directory &path, const QString &filename, FileType type); - Url(const Directory &path, const QString &filepath); - static Url fromPathOrUrl(const QString &s); + Url(const Directory &path, const TQString &filename, FileType type); + Url(const Directory &path, const TQString &filepath); + static Url fromPathOrUrl(const TQString &s); Url toFileType(FileType type) const { return toExtension(type.data().extensions[0]); } - Url toExtension(const QString &extension) const; - Url appendExtension(const QString &extension) const; + Url toExtension(const TQString &extension) const; + Url appendExtension(const TQString &extension) const; const FileType::Data &data() const { return fileType().data(); } FileType fileType() const; - QString basename() const; // filename without extension - QString filename() const; // filename without path - QString filepath(SeparatorType type = UnixSeparator) const; // filename with path - QString relativeTo(const Directory &dir, SeparatorType type = UnixSeparator) const; + TQString basename() const; // filename without extension + TQString filename() const; // filename without path + TQString filepath(SeparatorType type = UnixSeparator) const; // filename with path + TQString relativeTo(const Directory &dir, SeparatorType type = UnixSeparator) const; Url toAbsolute(const Directory &dir) const; #if !defined(NO_KDE) bool isDosFile() const; bool create(Log::Generic &log) const; // do not overwrite - bool write(const QString &text, Log::Generic &log) const; + bool write(const TQString &text, Log::Generic &log) const; bool copyTo(const Url &destination, Log::Generic &log) const; // do not overwrite bool del(Log::Generic &log) const; #endif private: - Url(const QString &filepath) : Base(filepath) {} + Url(const TQString &filepath) : Base(filepath) {} }; extern bool findExistingUrl(Url &url); // may transform extension's case if needed //---------------------------------------------------------------------------- -class UrlList : public QValueList<Url> +class UrlList : public TQValueList<Url> { public: UrlList() {} UrlList(const Url &url) { append(url); } - UrlList(const QValueList<Url> &list) : QValueList<Url>(list) {} + UrlList(const TQValueList<Url> &list) : TQValueList<Url>(list) {} #if !defined(NO_KDE) UrlList(const KURL::List &list); #endif @@ -120,11 +116,11 @@ public: class Directory : public Base { public: - Directory(const QString &path = QString::null); - QStringList files(const QString &filter) const; - Url findMatchingFilename(const QString &filename) const; + Directory(const TQString &path = TQString()); + TQStringList files(const TQString &filter) const; + Url findMatchingFilename(const TQString &filename) const; Directory up() const; - Directory down(const QString &path) const; + Directory down(const TQString &path) const; static Directory current(); #if !defined(NO_KDE) bool create(Log::Generic &log) const; |