mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Disable multitasking to avoid crashes
This commit is contained in:
parent
93d263de7c
commit
bcad3ac9da
@ -69,7 +69,8 @@ public:
|
||||
AppWideSetting(Preferences *pref)
|
||||
: PrefSettings(pref)
|
||||
{
|
||||
m_multithreading = initPref(STR_IS_Multithreading, idealThreads() > 1).toBool();
|
||||
// m_multithreading = initPref(STR_IS_Multithreading, idealThreads() > 1).toBool();
|
||||
m_multithreading = false; // too dangerous to allow
|
||||
m_showPerformance = initPref(STR_US_ShowPerformance, false).toBool();
|
||||
m_showDebug = initPref(STR_US_ShowDebug, false).toBool();
|
||||
initPref(STR_AS_CalendarVisible, true);
|
||||
@ -182,7 +183,8 @@ public:
|
||||
void setProfileName(QString name) { setPref(STR_GEN_Profile, m_profileName=name); }
|
||||
void setAutoLaunchImport(bool b) { setPref(STR_US_AutoLaunchImport, b); }
|
||||
void setCacheSessions(bool c) { setPref(STR_IS_CacheSessions, m_cacheSessions=c); }
|
||||
void setMultithreading(bool b) { setPref(STR_IS_Multithreading, m_multithreading = b); }
|
||||
// force multithreading to false until proven OK
|
||||
void setMultithreading(bool b) { Q_UNUSED(b) setPref(STR_IS_Multithreading, m_multithreading = false); }
|
||||
void setShowDebug(bool b) { setPref(STR_US_ShowDebug, m_showDebug=b); }
|
||||
void setShowPerformance(bool b) { setPref(STR_US_ShowPerformance, m_showPerformance=b); }
|
||||
//! \brief Sets whether to display the (Daily View) Calendar
|
||||
|
@ -380,14 +380,16 @@ bool Machine::unlinkDay(Day * d)
|
||||
|
||||
QString Machine::getPixmapPath()
|
||||
{
|
||||
if (!loader()) return "";
|
||||
if (!loader())
|
||||
return "";
|
||||
return loader()->getPixmapPath(info.series);
|
||||
}
|
||||
|
||||
QPixmap & Machine::getPixmap()
|
||||
{
|
||||
static QPixmap pm;
|
||||
if (!loader()) return pm;
|
||||
if (!loader())
|
||||
return pm;
|
||||
return loader()->getPixmap(info.series);
|
||||
}
|
||||
|
||||
@ -901,16 +903,21 @@ void Machine::runTasks()
|
||||
return;
|
||||
|
||||
QThreadPool * threadpool = QThreadPool::globalInstance();
|
||||
//int m_totaltasks=m_tasklist.size();
|
||||
//int m_currenttask=0;
|
||||
// if (loader()) emit loader()->setProgressMax(m_totaltasks);
|
||||
/***********************************************************
|
||||
int m_totaltasks=m_tasklist.size();
|
||||
int m_currenttask=0;
|
||||
if (loader())
|
||||
emit loader()->setProgressMax(m_totaltasks);
|
||||
***********************************************************/
|
||||
while (!m_tasklist.isEmpty()) {
|
||||
if (threadpool->tryStart(m_tasklist.at(0))) {
|
||||
m_tasklist.pop_front();
|
||||
/* if (loader()) {
|
||||
/************************************************************
|
||||
if (loader()) {
|
||||
emit loader()->setProgressValue(++m_currenttask);
|
||||
QApplication::processEvents();
|
||||
}*/
|
||||
}
|
||||
***************************************************************/
|
||||
}
|
||||
}
|
||||
QThreadPool::globalInstance()->waitForDone(-1);
|
||||
@ -1060,17 +1067,22 @@ bool Machine::LoadSummary(ProgressDialog * progress)
|
||||
QMap<qint64, Session *>::iterator it;
|
||||
int cnt = 0;
|
||||
bool loadSummaries = profile->session->preloadSummaries();
|
||||
qDebug() << "PreloadSummaries is " << (loadSummaries ? "true" : "false");
|
||||
qDebug() << "Queue task loader is " << (loader() ? "" : "not ") << "available";
|
||||
// sleep(1);
|
||||
|
||||
//progress->setMessage(QObject::tr("Queueing Open Tasks"));
|
||||
//QApplication::processEvents();
|
||||
// progress->setMessage(QObject::tr("Queueing Open Tasks"));
|
||||
// QApplication::processEvents();
|
||||
|
||||
// progress->setMaximum(sess_order.size());
|
||||
|
||||
// progress->setMaximum(sess_order.size());
|
||||
for (it = sess_order.begin(); it != it_end; ++it, ++cnt) {
|
||||
//
|
||||
/* if ((cnt % 100) == 0) {
|
||||
/****************************************************************
|
||||
if ((cnt % 100) == 0) {
|
||||
progress->setValue(cnt);
|
||||
//QApplication::processEvents();
|
||||
} */
|
||||
}
|
||||
*****************************************************************/
|
||||
Session * sess = it.value();
|
||||
if (!AddSession(sess)) {
|
||||
delete sess;
|
||||
|
@ -142,6 +142,11 @@ bool processFile( QString fullpath ) {
|
||||
QTextStream instr(&fl);
|
||||
QTextStream outstr(&tmp);
|
||||
while (instr.readLineInto(&line)) {
|
||||
if (line.contains("EnableMultithreading")) {
|
||||
if (line.contains("true")) {
|
||||
line.replace("true","false");
|
||||
}
|
||||
}
|
||||
line.replace("SleepyHead","OSCAR");
|
||||
outstr << line;
|
||||
}
|
||||
|
@ -217,7 +217,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
|
||||
|
||||
ui->skipEmptyDays->setChecked(profile->general->skipEmptyDays());
|
||||
ui->showUnknownFlags->setChecked(profile->general->showUnknownFlags());
|
||||
ui->enableMultithreading->setChecked(AppSetting->multithreading());
|
||||
// ui->enableMultithreading->setChecked(AppSetting->multithreading());
|
||||
ui->enableMultithreading->setVisible(false);
|
||||
ui->removeCardNotificationCheckbox->setChecked(AppSetting->removeCardReminder());
|
||||
ui->cacheSessionData->setChecked(AppSetting->cacheSessions());
|
||||
ui->preloadSummaries->setChecked(profile->session->preloadSummaries());
|
||||
|
Loading…
Reference in New Issue
Block a user