@@ -38,8 +38,8 @@ typedef NTSTATUS (NTAPI *PNTQUERYWNFSTATEDATA)(
38
38
_Inout_ PULONG BufferSize);
39
39
40
40
const QString SystemNotificationWindows::SNORETOAST_EXE = " SnoreToast.exe" ;
41
- const QString SystemNotificationWindows::SNORETOAST= [](){ return findSnoreToast (QDir::currentPath ()); }();
42
41
const QString SystemNotificationWindows::SNORETOAST_INSTALL= " -install" ;
42
+ const QString SystemNotificationWindows::APP_ID = " Moolticute" ;
43
43
const QString SystemNotificationWindows::NOTIFICATIONS_SETTING_REGENTRY = " HKEY_CURRENT_USER\\ SOFTWARE\\ Microsoft\\ Windows\\ CurrentVersion\\ Notifications\\ Settings" ;
44
44
const QString SystemNotificationWindows::DND_ENABLED_REGENTRY = " NOC_GLOBAL_SETTING_TOASTS_ENABLED" ;
45
45
const QString SystemNotificationWindows::TOAST_ENABLED_SETTING_REGPATH = " HKEY_CURRENT_USER\\ Software\\ Microsoft\\ Windows\\ CurrentVersion\\ PushNotifications" ;
@@ -101,7 +101,7 @@ void SystemNotificationWindows::createButtonChoiceNotification(const QString &ti
101
101
notificationMap->insert (notificationId, proc);
102
102
connect (proc, static_cast <CallbackType>(&QProcess::finished), this , &SystemNotificationWindows::callbackFunction);
103
103
QStringList choiceArgs = { " -t" , title, " -m" , text, " -b" , buttonString, " -id" , QString::number (notificationId++), " -p" , ICON, " -w" };
104
- proc->start (SNORETOAST , choiceArgs);
104
+ proc->start (getSnoreToast () , choiceArgs);
105
105
}
106
106
107
107
void SystemNotificationWindows::createTextBoxNotification (const QString &title, const QString text)
@@ -110,7 +110,7 @@ void SystemNotificationWindows::createTextBoxNotification(const QString &title,
110
110
notificationMap->insert (notificationId, proc);
111
111
QStringList textNotiArgs = { " -t" , title, " -m" , text, " -tb" , " -id" , QString::number (notificationId++), " -p" , ICON, " -w" };
112
112
connect (proc, static_cast <CallbackType>(&QProcess::finished), this , &SystemNotificationWindows::callbackFunction);
113
- proc->start (SNORETOAST , textNotiArgs);
113
+ proc->start (getSnoreToast () , textNotiArgs);
114
114
}
115
115
116
116
bool SystemNotificationWindows::displayLoginRequestNotification (const QString &service, QString &loginName, QString message)
@@ -155,6 +155,12 @@ bool SystemNotificationWindows::displayDomainSelectionNotification(const QString
155
155
}
156
156
}
157
157
158
+ QString SystemNotificationWindows::getSnoreToast ()
159
+ {
160
+ static const QString SNORE_TOAST = findSnoreToast (QDir::currentPath ());
161
+ return SNORE_TOAST;
162
+ }
163
+
158
164
QString SystemNotificationWindows::findSnoreToast (QString path)
159
165
{
160
166
QDirIterator it{path, QDirIterator::Subdirectories};
@@ -182,7 +188,7 @@ void SystemNotificationWindows::installSnoreToast()
182
188
{
183
189
if (IS_WIN10_OR_ABOVE)
184
190
{
185
- process->start (SNORETOAST , {SNORETOAST_INSTALL});
191
+ process->start (getSnoreToast () , {SNORETOAST_INSTALL});
186
192
}
187
193
}
188
194
0 commit comments