Skip to content
/ snoretoast Public

Commit 4744ab7

Browse files
committed
try to display the notification even if the system reports they are disabled
1 parent 6564598 commit 4744ab7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void help(const std::wstring &error)
7777

7878
void version()
7979
{
80-
std::wcout << L"SnoreToast version 0.3.99" << std::endl
80+
std::wcout << L"SnoreToast version "<< SnoreToasts::version() << std::endl
8181
<< L"Copyright (C) 2015 Patrick von Reth <vonreth@kde.org>" << std::endl
8282
<< L"SnoreToast is free software: you can redistribute it and/or modify" << std::endl
8383
<< L"it under the terms of the GNU Lesser General Public License as published by" << std::endl

src/snoretoasts.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ void SnoreToasts::printXML()
309309
HSTRING string;
310310
s->GetXml(&string);
311311
PCWSTR str = WindowsGetStringRawBuffer(string, NULL);
312-
std::wcout << L"------------------------" << std::endl
312+
std::wcout << L"------------------------" << std::endl
313+
<< L"SnoreToast " << version() << std::endl
314+
<< L"------------------------" << std::endl
313315
<< m_appID << std::endl
314316
<< L"------------------------" << std::endl
315317
<< str << std::endl
@@ -333,7 +335,6 @@ HRESULT SnoreToasts::createToast()
333335
if (setting == NotificationSetting_Enabled) {
334336
hr = setEventHandler(m_notification);
335337
} else {
336-
hr = E_FAIL;
337338
std::wcout << L"Notifications are disabled" << std::endl
338339
<< L"Reason: ";
339340

@@ -365,3 +366,7 @@ HRESULT SnoreToasts::createToast()
365366
return hr;
366367
}
367368

369+
370+
std::wstring SnoreToasts::version(){
371+
return L"0.3.99";
372+
}

src/snoretoasts.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class SnoreToasts
5151
Dismissed,
5252
Timeout
5353
};
54+
55+
static std::wstring version();
56+
5457
SnoreToasts(const std::wstring &appID);
5558
~SnoreToasts();
5659

0 commit comments

Comments
 (0)