File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ void AnalysisRunner::run()
118
118
a->before ();
119
119
120
120
121
- while (reader.next () && !mCancel )
121
+ while (reader.next () && !isCanceled () )
122
122
{
123
123
124
124
// check if first sequence is valid..Means it's probably a good file
@@ -217,10 +217,17 @@ int AnalysisRunner::sequenceCount() const
217
217
218
218
void AnalysisRunner::cancel ()
219
219
{
220
+ QMutexLocker locker (&mMutex );
220
221
mCancel = true ;
221
222
mStatus = Canceled;
222
223
}
223
224
225
+ bool AnalysisRunner::isCanceled ()
226
+ {
227
+ QMutexLocker locker (&mMutex );
228
+ return mCancel ;
229
+ }
230
+
224
231
qint64 AnalysisRunner::fileSize () const
225
232
{
226
233
return mFileSize ;
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ class AnalysisRunner : public QRunnable
89
89
int sequenceCount () const ;
90
90
91
91
void cancel ();
92
+ bool isCanceled ();
92
93
93
94
qint64 fileSize () const ;
94
95
@@ -127,6 +128,7 @@ class AnalysisRunner : public QRunnable
127
128
int mDuration = 0 ;
128
129
Status mStatus = Waiting;
129
130
bool mCancel = false ;
131
+ QMutex mMutex ;
130
132
131
133
132
134
You can’t perform that action at this time.
0 commit comments