Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes

copyThread Class Reference

Thread for do the copy. More...

#include <CopyThread.h>

Collaboration diagram for copyThread:
Collaboration graph

List of all members.

Public Types

enum  currentStat { Stopped, Paused, Running }

Public Slots

void addEntryToDirList (const QDir &theDir)
 Add one entry to dir list.
void addEntryToEmptyDestinationDirList (const QDir &theDir)
 add one entry to empty dir destination list
void addToList (quint64 id, const QFileInfo &source, qint64 size, const QFileInfo &destination)
 Add item to list.
QString getCopySpeed ()
 get copy speed in byte per second
int getProgressionPercent (const int max=100)
 return the progression percent
int getProgressionPercentTotal (const int max=100)
void insterAtEndWithoutCount (copyItemInternal theItem)
void pauseCopy ()
void resumeCopy ()
bool setBlockSize (const int block=64)
 set block size
void setKeepDate (const int)
 set keep date
void setMaxSpeed (int tempMaxSpeed)
 Set the max speed.
void setMovingMode (const bool setMove)
 Set if in copy or move mode.
void setPreallocateFileSize (const bool prealloc)
 set prealoc file size
void setRightCopy (const int doRightCopy)
 Set the copy info and options before runing.
void setThreadWrite (int useWriteThread)
void skipCurrentFile ()
void stopTheCopy ()
 Query for stop the current thread.


void allThreadIsFinishNow ()
 all write thread is finish
void errorOnFile (int, QString, QString, quint64)
 error on file or folder, bouton enable, file path, error message
void fileIsExists (QString, QString)
 signal emited when file exists, Source, Destination
void fileIsSame (QString)
 signal emited when file is same
void isInPauseOrNot ()
 wait in pause
void queryNewWriteThread ()
 query new write thread
void queryStartThread (int)
 for restart write after it have been closed

Public Member Functions

bool allThreadIsFinish ()
 copyThread (Main_window *parent)
 Initialise the copy thread.
void errorAction (int action)
 set action on error
void fileExistsAction (int action)
 set action on file exist
QString getCurrentFileCopied ()
 get current file copied as String as Name and
currentStat getCurrentStat ()
 return the statut
int getNumberOfItemRemoved ()
 number of item removed
QString getSyntetizedStringFrom ()
 return string to
QString getSyntetizedStringTo ()
 return text overall
QString getTextOverall ()
 return text overall
int lenghtOfCopyList ()
 lenght string from
returnIdsTransaction moveDown (QList< int > ids)
returnIdsTransaction moveUp (QList< int > ids)
QList< copyItemInternalputAtEndAfterError ()
returnIdsTransaction putOnBottom (QList< int > ids)
returnIdsTransaction putOnTop (QList< int > ids)
QString remainingTime ()
void removeItems (QList< int > ids)
 ~copyThread ()
 The destructor.

Static Public Member Functions

static QString intToQtringSize (double nb)
 Return string for the.

Protected Member Functions

void run ()
 Run the copy.
void stop ()
 Stop the copy thread.

Private Slots

void createNewWriteThread ()
 create new write thread object
void newWriteThreadFinish ()
 write thread have finish
void post_operation ()
 do the operation after stop the copy thread
void pre_operation ()
 do the operation before start the copy thread
void putFirstFileAtEnd ()
 call when the file should be put at the end
void startWriteThread (int id)
 for restart write thread which have been stop
void timeOfTheBlockCopyFinished ()
 the time allocated for copy this block is finish
void writeThreadOperationFinish ()
 call when the write thread have end their task

Private Member Functions

void checkIfNeedWaitOneWriteThread (WriteThread *)
 check if need wait one write thread
void checkIfNeedWaitWriteThread ()
 check if need wait write thread
int errorOnFileAndWait (int, QString, QString, quint64)
 error on file or folder, bouton enable, file path, error message, and wait
void flush ()
 Flush the last thread.
void removeAllFolderEmpty (const QDir &TheDir)
 Remove all the source empty folder.
bool tryOpenFileInSpecialMode (QFile *theFile, QIODevice::OpenMode theModeShouldBeUsed)
 try open file in special mode
void waitNeedAction ()
 wait because need action

Static Private Member Functions

static QString adaptStr (float nb)
 return the right string precision

Private Attributes

volatile int actionAfterUnlock
 For action after unlock the mutex.
volatile int blockSizeCurrent
 The current size of the buffer.
QTimer clockForTheCopySpeed
 For the speed throttling.
bool copyHadBegin
 Store if copy had begin.
qint64 currentFileSize
qint64 currentFileTotPos
QFile destinationFile
 For have global copie progression.
QList< QDir > emptyDestDir
 List of empty destination should be created.
QString errorMessageInCopy
 The message error.
qint64 firstScanCur
 Store curent size at first scan.
qint64 firstScanTot
 Store total size at first scan.
QTime intervalCopySpeed
 For detect the interval beteew 2 copy speed mesurement.
volatile bool keepDate
 For keep date file.
volatile int maxSpeed
 The max speed in MB/s, 0 for no limit.
volatile bool movingMode
 Set if is in moving mode.
volatile int MultForBigSpeed
 Multiple for count the number of block needed.
QMutex MultiThread_ThreadList
 For be thread safe while operate on copy list.
QMutex MultiThreadCopyList
 For be thread safe while operate on copy list.
bool needRemoveFileToList
volatile int numberOfBlockCopied
 Multiple for count the number of block copied.
int NumberOfFileCopied
 For number of file to copied.
int NumberOfFileTot
 For number of file to copy.
int numberOfItemRemoved
 For unmber of item removed.
 Store the parrent.
volatile bool preallocation
 Flag for know if need preallocation.
qint64 previousSizeReturned
 Previous size returned.
QList< copyItemInternalputAtEnd
volatile bool RightCopy
 Do rights copy.
bool skipThecurrentFile
 Skip the current file.
QList< QDir > sourceDirList
 List of source dir for delete it in moving mode.
QFile sourceFile
 For have global copie progression.
volatile bool stopIt
 For store the stop query.
volatile bool stopped
QString syntetizedStringCurrentFile
 For store sytetized string for current file.
QString syntetizedStringFrom
 For store sytetized string for From:
QString syntetizedStringOverall
 For store sytetized string for overall.
QString syntetizedStringTo
 For store sytetized string for To:
QTime tempTimeElapsed
QList< copyItemInternaltheCopyList
currentStat theCurrentStat
 The current stat.
QList< WriteThread * > theWriteThreadList
 For store the write thread list.
int timeCopyElapsed
 Time copy elapsed.
qint64 totalCopiedSize
 The copied, read or manipuled size.
QString translationDay
QString translationDays
QString translationErrorDate
 Store the translation of error in date.
QString translationErrorDestinationWrite
 Store the translation of error in open destination in write.
QString translationErrorPermissions
 Store the translation of error in permissions.
QString translationErrorReadSource
 Store the translation of error in read source.
QString translationErrorRemove
 Store the translation of error in removing.
QString translationErrorResize
 Store the translation of error in resizing.
QString translationErrorSourceRead
 Store the translation of error in open source in read.
QString translationErrorSourceReadWrite
 Store the translation of error in open source in read write.
QString translationErrorWriting
 Store the translation of error in writing.
QString translationHour
QString translationHours
QString translationMinute
QString translationMinutes
QString translationOfCopyOf
 Store the "copy of " translated.
QString translationSecond
QString translationSeconds
volatile bool useWriteThread
 For set if need write thread.
QSemaphore waitAction
volatile bool waitInPause
 Wait in pause the thread.
QSemaphore waitNewClockForSpeed
QSemaphore waitNewWriteThread
 For wiat the new write thread.
QSemaphore * writeThreadSem

Detailed Description

Thread for do the copy.

This thread do the copy, it store the permanently options, and use shared memory for get and set the variable, and use signal/slot for the events.

Definition at line 44 of file CopyThread.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index