///////////////////////////////////////////////////////////////////////////////
// MuldeR's Utilities for Qt
-// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
{ \
return false; \
} \
- if(!(p->initialized || initialize())) \
+ if(!(MUTILS_BOOLIFY(p->initialized) || initialize())) \
{ \
qWarning("Taskbar initialization failed!"); \
return false; \
Taskbar7_Private(void)
{
taskbarList = NULL;
- supported = false;
- initialized = false;
}
ITaskbarList3 *taskbarList;
- volatile bool supported;
- volatile bool initialized;
+ QAtomicInt supported;
+ QAtomicInt initialized;
};
}
{
MUTILS_THROW("Taskbar7: Window pointer must not be NULL!");
}
- if(!(p->supported = (OS::os_version() >= OS::Version::WINDOWS_WIN70)))
+ if (!p->supported)
{
- qWarning("Taskbar7: Taskbar progress not supported on this platform.");
+ if (OS::os_version() >= OS::Version::WINDOWS_WIN70)
+ {
+ p->supported.ref();
+ }
+ else
+ {
+ qWarning("Taskbar7: Taskbar progress not supported on this platform.");
+ }
}
}
p->taskbarList = ptbl;
}
- while(!p->initialized)
+ if(!p->initialized)
{
bool okay = false;
for(int i = 0; i < 8; i++)
qWarning("ITaskbarList3::HrInit() has failed!");
return false;
}
- p->initialized = true;
+ p->initialized.ref(); /*success*/
}
return true;