Skip to content

Commit eec95d3

Browse files
adriwebjacobly0
authored andcommitted
Don't throttle during transfers.
1 parent 63ed155 commit eec95d3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

gui/qt/emuthread.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,17 @@ void EmuThread::sendFiles() {
232232
utf8Vars.push_back(string.toUtf8());
233233
args.push_back(utf8Vars.back());
234234
}
235+
m_backupThrottleForTransfers = m_throttle;
236+
setThrottle(false);
235237
emu_send_variables(args.data(), args.size(), m_sendLoc, &EmuThread::progressHandler, this);
236238
}
237239

238240
bool EmuThread::progressHandler(void *context, int value, int total) {
239-
emit reinterpret_cast<EmuThread *>(context)->linkProgress(value, total);
241+
EmuThread* emuThread = reinterpret_cast<EmuThread *>(context);
242+
if (value == 1 && total == 1) {
243+
emuThread->setThrottle(emuThread->m_backupThrottleForTransfers);
244+
}
245+
emit emuThread->linkProgress(value, total);
240246
return false;
241247
}
242248

gui/qt/emuthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public slots:
109109
emu_data_t m_loadType;
110110

111111
int m_speed, m_actualSpeed;
112-
bool m_throttle;
112+
bool m_throttle, m_backupThrottleForTransfers;
113113
std::chrono::steady_clock::time_point m_lastTime;
114114
std::mutex m_mutexSpeed;
115115
std::condition_variable m_cvSpeed;

0 commit comments

Comments
 (0)