mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-09 20:50:43 +00:00
Remove the m_machopened flag from Profile, which caused newly created profiles
to act differently from profiles after a subsequent application launch. It was only getting set at the end of Profile::OpenMachines, which was only called by the Profile constructor, and which wouldn't succeed on a newly created profile, having no files to open. Therefore, the only way for the flag to be set was to quit and re-launch the application after creating the profile. The flag's only remaining use was to make sure that OpenMachines() wasn't getting called twice and trampling an existing list of machines, so the check there was changed from looking at a brittle flag to looking at the actual list of machines. A critical warning was also added to the check, since OpenMachines() is only getting called from the Profile constructor and therefore can't be invoked twice unless a new bug has been introduced.
This commit is contained in:
parent
e3e67438ea
commit
84b900ca90
@ -37,8 +37,7 @@ Profile *p_profile;
|
||||
|
||||
Profile::Profile(QString path)
|
||||
: is_first_day(true),
|
||||
m_opened(false),
|
||||
m_machopened(false)
|
||||
m_opened(false)
|
||||
{
|
||||
p_name = STR_GEN_Profile;
|
||||
|
||||
@ -146,8 +145,10 @@ void Profile::addLock()
|
||||
|
||||
bool Profile::OpenMachines()
|
||||
{
|
||||
if (m_machopened)
|
||||
if (m_machlist.size() > 0) {
|
||||
qCritical() << "Skipping redundant call to Profile::OpenMachines";
|
||||
return true;
|
||||
}
|
||||
|
||||
QString filename = p_path+"machines.xml";
|
||||
QFile file(filename);
|
||||
@ -239,7 +240,6 @@ bool Profile::OpenMachines()
|
||||
elem = elem.nextSiblingElement();
|
||||
}
|
||||
|
||||
m_machopened = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,6 @@ class Profile : public Preferences
|
||||
QDate m_last;
|
||||
|
||||
bool m_opened;
|
||||
bool m_machopened;
|
||||
|
||||
QHash<QString, QHash<QString, Machine *> > MachineList;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user