fix applying end() on init
This commit is contained in:
@@ -104,10 +104,12 @@ void HyprsunsetManager::toggle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HyprsunsetManager::start() {
|
void HyprsunsetManager::start() {
|
||||||
if (m_enabled)
|
if (m_enabled && m_initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_initialized = true;
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
|
|
||||||
emit enabledChanged();
|
emit enabledChanged();
|
||||||
|
|
||||||
m_process.setProgram("hyprctl");
|
m_process.setProgram("hyprctl");
|
||||||
@@ -116,10 +118,12 @@ void HyprsunsetManager::start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HyprsunsetManager::end() {
|
void HyprsunsetManager::end() {
|
||||||
if (!m_enabled)
|
if (!m_enabled && m_initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_initialized = true;
|
||||||
m_enabled = false;
|
m_enabled = false;
|
||||||
|
|
||||||
emit enabledChanged();
|
emit enabledChanged();
|
||||||
|
|
||||||
m_process.setProgram("hyprctl");
|
m_process.setProgram("hyprctl");
|
||||||
|
|||||||
@@ -48,10 +48,11 @@ void manualToggleChanged();
|
|||||||
private:
|
private:
|
||||||
int m_startTime;
|
int m_startTime;
|
||||||
int m_endTime;
|
int m_endTime;
|
||||||
bool m_enabled;
|
bool m_enabled = false;
|
||||||
bool m_manualToggle = false;
|
bool m_manualToggle = false;
|
||||||
bool m_activeAuto;
|
bool m_activeAuto;
|
||||||
bool m_startAllowed;
|
bool m_startAllowed = false;
|
||||||
|
bool m_initialized = false;
|
||||||
QTimer m_startCooldown;
|
QTimer m_startCooldown;
|
||||||
int m_temp;
|
int m_temp;
|
||||||
QProcess m_process;
|
QProcess m_process;
|
||||||
|
|||||||
Reference in New Issue
Block a user