Skip to content

Commit

Permalink
Fixed notification not being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 18, 2024
1 parent 251ed8f commit bbb6244
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/HeadsetControlQt/headsetcontrolqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <QFile>
#include <QDir>
#include <QMessageBox>
#include <QDebug>
#include <QStandardPaths>

#ifdef _WIN32
Expand All @@ -30,6 +29,7 @@ HeadsetControlQt::HeadsetControlQt(QWidget *parent)
, ui(new Ui::HeadsetControlQt)
, trayIcon(new QSystemTrayIcon(this))
, timer(new QTimer(this))
, notificationSent(false)
, firstRun(false)
{
ui->setupUi(this);
Expand Down Expand Up @@ -187,13 +187,11 @@ void HeadsetControlQt::updateHeadsetInfo()
process.start(headsetcontrolExecutable, QStringList() << "-o" << "json");

if (!process.waitForStarted()) {
qDebug() << "Failed to start process:" << process.errorString();
noDeviceFound();
return;
}

if (!process.waitForFinished()) {
qDebug() << "Process did not finish successfully:" << process.errorString();
noDeviceFound();
return;
}
Expand All @@ -216,11 +214,9 @@ void HeadsetControlQt::updateHeadsetInfo()
manageLEDBasedOnBattery(headsetInfo);
sendNotificationBasedOnBattery(headsetInfo);
} else {
qDebug() << "No devices found.";
noDeviceFound();
}
} else {
qDebug() << "No 'devices' key found in JSON.";
noDeviceFound();
}
}
Expand Down Expand Up @@ -428,13 +424,10 @@ void HeadsetControlQt::setSidetone()

void HeadsetControlQt::toggleWindow()
{
qDebug() << "Toggling window";
if (this->isVisible()) {
qDebug() << "Hiding window";
this->close();
trayIcon->contextMenu()->actions().first()->setText("Show");
} else {
qDebug() << "Showing window";
this->show();
trayIcon->contextMenu()->actions().first()->setText("Hide");
}
Expand Down

0 comments on commit bbb6244

Please sign in to comment.