diff options
Diffstat (limited to 'krename/batchrenamer.h')
-rw-r--r-- | krename/batchrenamer.h | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/krename/batchrenamer.h b/krename/batchrenamer.h index 1eae7c6..11e4ca9 100644 --- a/krename/batchrenamer.h +++ b/krename/batchrenamer.h @@ -18,13 +18,13 @@ #ifndef BATCHRENAMER_H #define BATCHRENAMER_H -#include <qdatetime.h> -#include <qvaluelist.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> #include <kurl.h> -class QFile; -class QProgressDialog; -class QString; +class TQFile; +class TQProgressDialog; +class TQString; /* How many diferrent users and groups * KRename supports. Values over 1000 @@ -45,9 +45,9 @@ enum { }; typedef struct fileentry { - QString name; // filename - QString directory; // directory - QString extension; // extension + TQString name; // filename + TQString directory; // directory + TQString extension; // extension KURL url; }; @@ -66,12 +66,12 @@ typedef struct data { */ typedef struct manualchanges { KURL url; // input filename - QString user; // name the user wants + TQString user; // name the user wants }; typedef struct replacestrings { - QString find; // Text to replace - QString replace; // Replace with + TQString tqfind; // Text to tqreplace + TQString tqreplace; // Replace with bool reg; // is it a reg expression ? }; @@ -85,57 +85,57 @@ typedef struct tCounterValues { *@author Dominik Seichter */ -class QObject; -class QListView; +class TQObject; +class TQListView; class ProgressDialog; class PluginLoader; class BatchRenamer { public: BatchRenamer(); ~BatchRenamer(); - void processFiles( ProgressDialog* p, QObject* object ); - void createPreview( QListView* list ); + void processFiles( ProgressDialog* p, TQObject* object ); + void createPreview( TQListView* list ); - inline void setText( const QString & t ) { text = t; doEscape( text, false ); } - inline void setExText( const QString & t ) { extext = t; } + inline void setText( const TQString & t ) { text = t; doEscape( text, false ); } + inline void setExText( const TQString & t ) { extext = t; } inline void setDirname( const KURL & url ) { dirname = url; } - inline void setUndoScript( const QString & t ) { m_undoScript = t; } + inline void setUndoScript( const TQString & t ) { m_undoScript = t; } inline void setUndo( bool b ) { undo = b; } inline void setOverwrite( bool b ) { overwrite = b; } inline void setIndex( int i ) { m_index = i; } inline void setStep( int s ) { m_step = s; } inline void setResetCounter( bool r ) { m_reset = r; } - inline void setSkipList( const QValueList<int> & s ) { m_skip = s; } - inline void setReplaceList( const QValueList<replacestrings> & r ) { m_replace = r; } + inline void setSkipList( const TQValueList<int> & s ) { m_skip = s; } + inline void setReplaceList( const TQValueList<replacestrings> & r ) { m_tqreplace = r; } - inline void setFiles( const QValueList<data> & f ) { m_files = f; } //TODO: use a pointer for more speed - inline QValueList<data> files() const { return m_files; } - inline void setChanges( const QValueList<manualchanges> & m ) { m_changes = m; } + inline void setFiles( const TQValueList<data> & f ) { m_files = f; } //TODO: use a pointer for more speed + inline TQValueList<data> files() const { return m_files; } + inline void setChanges( const TQValueList<manualchanges> & m ) { m_changes = m; } inline void setMode( int m) { m_mode = m; } inline int mode() const { return m_mode; } // Since 2.1 public, because plugins may want to access them to: - QString findAndProcess( const QString & token, QString text, const QString & replace ); - - QString findNumbers( QString text, int count, int i ); - QString findStar( const QString & oldname, QString text ); - QString findBrackets( QString oldname, QString text, int i ); - QString findToken( QString oldname, QString token, int i ); - QString processToken( QString token, QString oldname, int i ); - QString findPartStrings( QString oldname, QString token ); - static QString findDirName( QString token, QString path ); - QString findLength( const QString & token, const QString & name ); - QString findReplace( QString text ); // text is here already the new filename ! - QString doReplace( QString text, QString find, QString replace, bool reg ); // text is here already the new filename ! - - QString processString( QString text, QString oldname, int i ); + TQString findAndProcess( const TQString & token, TQString text, const TQString & tqreplace ); + + TQString findNumbers( TQString text, int count, int i ); + TQString findStar( const TQString & oldname, TQString text ); + TQString findBrackets( TQString oldname, TQString text, int i ); + TQString findToken( TQString oldname, TQString token, int i ); + TQString processToken( TQString token, TQString oldname, int i ); + TQString findPartStrings( TQString oldname, TQString token ); + static TQString findDirName( TQString token, TQString path ); + TQString findLength( const TQString & token, const TQString & name ); + TQString findReplace( TQString text ); // text is here already the new filename ! + TQString doReplace( TQString text, TQString tqfind, TQString tqreplace, bool reg ); // text is here already the new filename ! + + TQString processString( TQString text, TQString oldname, int i ); - static QString & doEscape( QString & text, bool filename = true ); - static QString & unEscape( QString & text ); - static void escape( QString & text, const QString & token, const QString & sequence ); + static TQString & doEscape( TQString text, bool filename = true ); + static TQString & unEscape( TQString & text ); + static void escape( TQString & text, const TQString & token, const TQString & sequence ); - static QString buildFilename( fileentry* entry, bool dir = true ); + static TQString buildFilename( fileentry* entry, bool dir = true ); private: /** @@ -147,42 +147,42 @@ class BatchRenamer { int getCharacters( int n ) ; void work( ProgressDialog* p ); - void writeUndoScript( QTextStream* t ); + void writeUndoScript( TQTextStream* t ); void parseSubdirs( data* f ); - void findNumberAppendix( QString & text, int pos, int* start, int* step ); + void findNumberAppendix( TQString & text, int pos, int* start, int* step ); /** resets all counters to there start value if the directory name at @p i * in m_files changes. * The caller has to check m_reset before calling this function. */ void findCounterReset( int i ); - QString parsePlugins( int i, const QString & text, int type ); + TQString parsePlugins( int i, const TQString & text, int type ); bool applyManualChanges( int i ); - QString text; // template + TQString text; // template KURL dirname; // destination dir - QString extext; // Extension template - QString m_undoScript; // Filename of undoscript + TQString extext; // Extension template + TQString m_undoScript; // Filename of undoscript bool undo; // create an undo script int m_index; // index for numbers int m_step; // step for numbers bool m_reset; // reset counter on new directories bool overwrite; // overwrite existing files int m_mode; // renaming mode - QValueList<int> m_skip; // Numbers to skip - QValueList<replacestrings> m_replace; // Replace strings - QValueList<data> m_files; - QValueList<manualchanges> m_changes; // User made changes + TQValueList<int> m_skip; // Numbers to skip + TQValueList<replacestrings> m_tqreplace; // Replace strings + TQValueList<data> m_files; + TQValueList<manualchanges> m_changes; // User made changes PluginLoader* plug; // a is used in find number and // required for skipping. int m_counter_index; - QValueList<tCounterValues> m_counters; + TQValueList<tCounterValues> m_counters; protected: - QFile* f; - QTime t; - QProgressDialog* progress; + TQFile* f; + TQTime t; + TQProgressDialog* progress; }; #endif |