diff options
Diffstat (limited to 'src/fileaccess.h')
-rw-r--r-- | src/fileaccess.h | 152 |
1 files changed, 77 insertions, 75 deletions
diff --git a/src/fileaccess.h b/src/fileaccess.h index 77b70bf..787ca65 100644 --- a/src/fileaccess.h +++ b/src/fileaccess.h @@ -11,17 +11,17 @@ #ifndef FILEACCESS_H #define FILEACCESS_H -#include <qdialog.h> -#include <qfileinfo.h> +#include <tqdialog.h> +#include <tqfileinfo.h> #include <kprogress.h> #include <kio/job.h> #include <kio/jobclasses.h> #include <kurldrag.h> #include <list> -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> -bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ); +bool wildcardMultiMatch( const TQString& wildcard, const TQString& testString, bool bCaseSensitive ); class t_DirectoryList; @@ -30,8 +30,8 @@ class FileAccess public: FileAccess(); ~FileAccess(); - FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) - void setFile( const QString& name, bool bWantToWrite=false ); + FileAccess( const TQString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) + void setFile( const TQString& name, bool bWantToWrite=false ); bool isValid() const; bool isFile() const; @@ -44,43 +44,43 @@ public: bool isWritable() const; bool isExecutable() const; bool isHidden() const; - QString readLink() const; + TQString readLink() const; - QDateTime created() const; - QDateTime lastModified() const; - QDateTime lastRead() const; + TQDateTime created() const; + TQDateTime lastModified() const; + TQDateTime lastRead() const; - QString fileName() const; // Just the name-part of the path, without parent directories - QString filePath() const; // The path-string that was used during construction - QString prettyAbsPath() const; + TQString fileName() const; // Just the name-part of the path, without tqparent directories + TQString filePath() const; // The path-string that was used during construction + TQString prettyAbsPath() const; KURL url() const; - QString absFilePath() const; + TQString absFilePath() const; bool isLocal() const; bool readFile(void* pDestBuffer, unsigned long maxLength ); bool writeFile(const void* pSrcBuffer, unsigned long length ); bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool copyFile( const QString& destUrl ); - bool createBackup( const QString& bakExtension ); + const TQString& filePattern, const TQString& fileAntiPattern, + const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool copyFile( const TQString& destUrl ); + bool createBackup( const TQString& bakExtension ); - static QString tempFileName(); - static bool removeTempFile( const QString& ); + static TQString tempFileName(); + static bool removeTempFile( const TQString& ); bool removeFile(); - static bool removeFile( const QString& ); - static bool makeDir( const QString& ); - static bool removeDir( const QString& ); - static bool exists( const QString& ); - static QString cleanDirPath( const QString& ); - - //bool chmod( const QString& ); - bool rename( const QString& ); - static bool symLink( const QString& linkTarget, const QString& linkLocation ); - - void addPath( const QString& txt ); - QString getStatusText(); + static bool removeFile( const TQString& ); + static bool makeDir( const TQString& ); + static bool removeDir( const TQString& ); + static bool exists( const TQString& ); + static TQString cleanDirPath( const TQString& ); + + //bool chmod( const TQString& ); + bool rename( const TQString& ); + static bool symLink( const TQString& linkTarget, const TQString& linkLocation ); + + void addPath( const TQString& txt ); + TQString getStatusText(); private: void setUdsEntry( const KIO::UDSEntry& e ); KURL m_url; @@ -88,9 +88,9 @@ private: bool m_bValidData; unsigned long m_size; - QDateTime m_modificationTime; - QDateTime m_accessTime; - QDateTime m_creationTime; + TQDateTime m_modificationTime; + TQDateTime m_accessTime; + TQDateTime m_creationTime; bool m_bReadable; bool m_bWritable; bool m_bExecutable; @@ -101,14 +101,14 @@ private: bool m_bHidden; long m_fileType; // for testing only - QString m_linkTarget; - QString m_user; - QString m_group; - QString m_name; - QString m_path; - QString m_absFilePath; - QString m_localCopy; - QString m_statusText; // Might contain an error string, when the last operation didn't succeed. + TQString m_linkTarget; + TQString m_user; + TQString m_group; + TQString m_name; + TQString m_path; + TQString m_absFilePath; + TQString m_localCopy; + TQString m_statusText; // Might contain an error string, when the last operation didn't succeed. friend class FileAccessJobHandler; }; @@ -117,24 +117,25 @@ class t_DirectoryList : public std::list<FileAccess> {}; -class FileAccessJobHandler : public QObject +class FileAccessJobHandler : public TQObject { Q_OBJECT + TQ_OBJECT public: FileAccessJobHandler( FileAccess* pFileAccess ); bool get( void* pDestBuffer, long maxLength ); bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 ); bool stat(int detailLevel=2, bool bWantToWrite=false ); - bool copyFile( const QString& dest ); - bool rename( const QString& dest ); + bool copyFile( const TQString& dest ); + bool rename( const TQString& dest ); bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool mkDir( const QString& dirName ); - bool rmDir( const QString& dirName ); - bool removeFile( const QString& dirName ); - bool symLink( const QString& linkTarget, const QString& linkLocation ); + const TQString& filePattern, const TQString& fileAntiPattern, + const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool mkDir( const TQString& dirName ); + bool rmDir( const TQString& dirName ); + bool removeFile( const TQString& dirName ); + bool symLink( const TQString& linkTarget, const TQString& linkLocation ); private: FileAccess* m_pFileAccess; @@ -145,39 +146,40 @@ private: char* m_pTransferBuffer; // Needed during get or put long m_maxLength; - QString m_filePattern; - QString m_fileAntiPattern; - QString m_dirAntiPattern; + TQString m_filePattern; + TQString m_fileAntiPattern; + TQString m_dirAntiPattern; t_DirectoryList* m_pDirList; bool m_bFindHidden; bool m_bRecursive; bool m_bFollowDirLinks; - bool scanLocalDirectory( const QString& dirName, t_DirectoryList* dirList ); + bool scanLocalDirectory( const TQString& dirName, t_DirectoryList* dirList ); private slots: void slotStatResult( KIO::Job* ); void slotSimpleJobResult( KIO::Job* pJob ); void slotPutJobResult( KIO::Job* pJob ); - void slotGetData(KIO::Job*,const QByteArray&); - void slotPutData(KIO::Job*, QByteArray&); + void slotGetData(KIO::Job*,const TQByteArray&); + void slotPutData(KIO::Job*, TQByteArray&); - void slotListDirInfoMessage( KIO::Job*, const QString& msg ); + void slotListDirInfoMessage( KIO::Job*, const TQString& msg ); void slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ); void slotPercent( KIO::Job* pJob, unsigned long percent ); }; -class ProgressDialog : public QDialog +class ProgressDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - ProgressDialog( QWidget* pParent ); + ProgressDialog( TQWidget* pParent ); void setStayHidden( bool bStayHidden ); - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true ); void setMaxNofSteps( int dMaxNofSteps ); @@ -192,13 +194,13 @@ public: void setSubRangeTransformation( double dMin, double dMax ); void exitEventLoop(); - void enterEventLoop( KIO::Job* pJob, const QString& jobInfo ); + void enterEventLoop( KIO::Job* pJob, const TQString& jobInfo ); bool wasCancelled(); void show(); void hide(); - virtual void timerEvent(QTimerEvent*); + virtual void timerEvent(TQTimerEvent*); private: struct ProgressLevelData @@ -221,16 +223,16 @@ private: KProgress* m_pProgressBar; KProgress* m_pSubProgressBar; - QLabel* m_pInformation; - QLabel* m_pSubInformation; - QLabel* m_pSlowJobInfo; - QPushButton* m_pAbortButton; + TQLabel* m_pInformation; + TQLabel* m_pSubInformation; + TQLabel* m_pSlowJobInfo; + TQPushButton* m_pAbortButton; void recalc(bool bRedrawUpdate); - QTime m_t1; - QTime m_t2; + TQTime m_t1; + TQTime m_t2; bool m_bWasCancelled; KIO::Job* m_pJob; - QString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. + TQString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. bool m_bStayHidden; protected: virtual void reject(); @@ -246,8 +248,8 @@ public: ProgressProxy(); ~ProgressProxy(); - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true ); void setMaxNofSteps( int dMaxNofSteps ); |