Remove #ifndef __MINGW32__ from Windows notifications

It uses C++/WinRT nowadays just like all other code so there's no point in #ifndef'ing only it
This commit is contained in:
Ilya Fedin 2024-10-31 02:35:11 +04:00 committed by John Preston
parent e0a0d9c039
commit ebd0c3696a
2 changed files with 0 additions and 16 deletions

View file

@ -37,7 +37,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <shellapi.h> #include <shellapi.h>
#include <strsafe.h> #include <strsafe.h>
#ifndef __MINGW32__
#include <winrt/Windows.Foundation.h> #include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Data.Xml.Dom.h> #include <winrt/Windows.Data.Xml.Dom.h>
#include <winrt/Windows.UI.Notifications.h> #include <winrt/Windows.UI.Notifications.h>
@ -48,12 +47,9 @@ using namespace winrt::Windows::UI::Notifications;
using namespace winrt::Windows::Data::Xml::Dom; using namespace winrt::Windows::Data::Xml::Dom;
using namespace winrt::Windows::Foundation; using namespace winrt::Windows::Foundation;
using winrt::com_ptr; using winrt::com_ptr;
#endif // !__MINGW32__
namespace Platform { namespace Platform {
namespace Notifications { namespace Notifications {
#ifndef __MINGW32__
namespace { namespace {
constexpr auto kQuerySettingsEachMs = 1000; constexpr auto kQuerySettingsEachMs = 1000;
@ -376,7 +372,6 @@ bool SkipFlashBounceForCustom() {
} }
} // namespace } // namespace
#endif // !__MINGW32__
void MaybePlaySoundForCustom(Fn<void()> playSound) { void MaybePlaySoundForCustom(Fn<void()> playSound) {
if (!SkipSoundForCustom()) { if (!SkipSoundForCustom()) {
@ -405,15 +400,11 @@ bool WaitForInputForCustom() {
} }
bool Supported() { bool Supported() {
#ifndef __MINGW32__
if (!Checked) { if (!Checked) {
Checked = true; Checked = true;
Check(); Check();
} }
return InitSucceeded; return InitSucceeded;
#endif // !__MINGW32__
return false;
} }
bool Enforced() { bool Enforced() {
@ -425,7 +416,6 @@ bool ByDefault() {
} }
void Create(Window::Notifications::System *system) { void Create(Window::Notifications::System *system) {
#ifndef __MINGW32__
if (Core::App().settings().nativeNotifications() && Supported()) { if (Core::App().settings().nativeNotifications() && Supported()) {
auto result = std::make_unique<Manager>(system); auto result = std::make_unique<Manager>(system);
if (result->init()) { if (result->init()) {
@ -433,11 +423,9 @@ void Create(Window::Notifications::System *system) {
return; return;
} }
} }
#endif // !__MINGW32__
system->setManager(nullptr); system->setManager(nullptr);
} }
#ifndef __MINGW32__
class Manager::Private { class Manager::Private {
public: public:
explicit Private(Manager *instance); explicit Private(Manager *instance);
@ -992,7 +980,6 @@ void Manager::doMaybeFlashBounce(Fn<void()> flashBounce) {
flashBounce(); flashBounce();
} }
} }
#endif // !__MINGW32__
} // namespace Notifications } // namespace Notifications
} // namespace Platform } // namespace Platform

View file

@ -14,8 +14,6 @@ struct ToastActivation;
namespace Platform { namespace Platform {
namespace Notifications { namespace Notifications {
#ifndef __MINGW32__
class Manager : public Window::Notifications::NativeManager { class Manager : public Window::Notifications::NativeManager {
public: public:
Manager(Window::Notifications::System *system); Manager(Window::Notifications::System *system);
@ -54,7 +52,6 @@ private:
const std::unique_ptr<Private> _private; const std::unique_ptr<Private> _private;
}; };
#endif // !__MINGW32__
} // namespace Notifications } // namespace Notifications
} // namespace Platform } // namespace Platform