mirror of
https://github.com/status-im/snorenotify.git
synced 2025-01-09 16:15:45 +00:00
fixed some issues and make compile with msvc10
This commit is contained in:
parent
ce59e355a2
commit
e2d0bc6d09
@ -40,6 +40,9 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
|
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF)
|
option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF)
|
||||||
option(WITH_WEBINTERFACE "Buld with WebInterface" OFF)
|
option(WITH_WEBINTERFACE "Buld with WebInterface" OFF)
|
||||||
|
@ -74,7 +74,7 @@ const uint &Notification::id() const
|
|||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &Notification::Notification::icon() const
|
const QString &Notification::icon() const
|
||||||
{
|
{
|
||||||
return _icon;
|
return _icon;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||||||
if(snarlInterface == NULL)
|
if(snarlInterface == NULL)
|
||||||
snarlInterface = _defautSnarlinetrface;
|
snarlInterface = _defautSnarlinetrface;
|
||||||
|
|
||||||
|
int id = notification->id();
|
||||||
wchar_t *title = toWchar(Notification::toPlainText(notification->title()));
|
wchar_t *title = toWchar(Notification::toPlainText(notification->title()));
|
||||||
wchar_t *text = toWchar(Notification::toPlainText(notification->text()));
|
wchar_t *text = toWchar(Notification::toPlainText(notification->text()));
|
||||||
wchar_t *icon = toWchar(notification->icon());
|
wchar_t *icon = toWchar(notification->icon());
|
||||||
@ -88,7 +90,7 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||||||
L"Text: \"%s\"\n"
|
L"Text: \"%s\"\n"
|
||||||
L"Timeout: \"%i\"\n"
|
L"Timeout: \"%i\"\n"
|
||||||
L"Icon: \"%s\"\n",title,text,notification->timeout(),icon);
|
L"Icon: \"%s\"\n",title,text,notification->timeout(),icon);
|
||||||
return snarlInterface->ShowMessage(title,text,notification->timeout(), icon);
|
id = snarlInterface->ShowMessage(title,text,notification->timeout(), icon);
|
||||||
}else{
|
}else{
|
||||||
//update message
|
//update message
|
||||||
wprintf(L"Updating SnarlMessage ID: \"%i\"\n"
|
wprintf(L"Updating SnarlMessage ID: \"%i\"\n"
|
||||||
@ -96,11 +98,12 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||||||
L"Text: \"%s\"\n"
|
L"Text: \"%s\"\n"
|
||||||
L"Icon: \"%s\"\n",notification->id(),title,text,icon);
|
L"Icon: \"%s\"\n",notification->id(),title,text,icon);
|
||||||
snarlInterface->UpdateMessage(notification->id(),title, text,icon);
|
snarlInterface->UpdateMessage(notification->id(),title, text,icon);
|
||||||
return notification->id();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] title;
|
delete[] title;
|
||||||
delete[] text;
|
delete[] text;
|
||||||
delete[] icon;
|
delete[] icon;
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Snarl_Backend::closeNotification(QSharedPointer<Notification> notification){
|
void Snarl_Backend::closeNotification(QSharedPointer<Notification> notification){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user