Skip to content

Commit

Permalink
refactor + fixed warns
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Sep 2, 2024
1 parent 2389746 commit 3f810be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
9 changes: 5 additions & 4 deletions BigPictureTV.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QT += core gui
QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

Expand All @@ -14,9 +14,10 @@ GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
GIT_BRANCH = $$system(git branch --show-current)

DEFINES += \
GIT_COMMIT_ID=\"\"\"$$GIT_COMMIT_ID\"\"\" \
GIT_COMMIT_DATE=\"\"\"$$GIT_COMMIT_DATE\"\"\" \
GIT_BRANCH=\"\"\"$$GIT_BRANCH\"\"\" \
GIT_COMMIT_ID=\\"\"\"$$GIT_COMMIT_ID\\"\"\" \
GIT_COMMIT_DATE=\\"\"\"$$GIT_COMMIT_DATE\\"\"\" \
GIT_BRANCH=\\"\"\"$$GIT_BRANCH\\"\"\"



INCLUDEPATH += \
Expand Down
6 changes: 2 additions & 4 deletions src/BigPictureTV/bigpicturetv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ void BigPictureTV::createTrayIcon()

void BigPictureTV::checkWindowTitle()
{
if (target_window_mode == 1) {
if (custom_window_title == "") {
return;
}
if (target_window_mode == 1 && custom_window_title == "") {
return;
}

if (utils->isSunshineStreaming()) {
Expand Down
1 change: 0 additions & 1 deletion src/Configurator/configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ void Configurator::onAudioButtonClicked()
"Please check if PowerShell is installed and properly configured.");
QMessageBox::critical(this, status, message);
} else {
QString output = process.readAllStandardOutput();
QString errorOutput = process.readAllStandardError();
int exitCode = process.exitCode();

Expand Down
10 changes: 4 additions & 6 deletions src/NightLightSwitcher/NightLightSwitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool NightLightSwitcher::enabled() {
BYTE data[1024];
DWORD dataSize = sizeof(data);
if (RegQueryValueEx(hKey, L"Data", NULL, NULL, data, &dataSize) != ERROR_SUCCESS) {
std::wcerr << L"Failed to query registry value." << std::endl;
qDebug() << "Failed to query registry value.";
return false;
}

Expand All @@ -57,7 +57,7 @@ void NightLightSwitcher::toggle() {
BYTE data[1024];
DWORD dataSize = sizeof(data);
if (RegQueryValueEx(hKey, L"Data", NULL, NULL, data, &dataSize) != ERROR_SUCCESS) {
std::wcerr << L"Failed to query registry value." << std::endl;
qDebug() << "Failed to query registry value.";
return;
}

Expand Down Expand Up @@ -90,11 +90,9 @@ void NightLightSwitcher::toggle() {
}

// Set the modified data back to the registry
DWORD newDataSize = newData.size();
DWORD newDataSize = static_cast<DWORD>(newData.size());
if (RegSetValueEx(hKey, L"Data", 0, REG_BINARY, newData.data(), newDataSize) != ERROR_SUCCESS) {
std::wcerr << L"Failed to update registry value." << std::endl;
} else {
qDebug() << "Registry value updated successfully.";
qDebug() << "Failed to update registry value.";
}
}

Expand Down

0 comments on commit 3f810be

Please sign in to comment.