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)
|
||||
|
||||
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_WEBINTERFACE "Buld with WebInterface" OFF)
|
||||
|
|
|
@ -74,7 +74,7 @@ const uint &Notification::id() const
|
|||
return _id;
|
||||
}
|
||||
|
||||
const QString &Notification::Notification::icon() const
|
||||
const QString &Notification::icon() const
|
||||
{
|
||||
return _icon;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <QtCore>
|
||||
#include <QTextEdit>
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <wchar.h>
|
||||
|
||||
|
@ -78,6 +79,7 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||
if(snarlInterface == NULL)
|
||||
snarlInterface = _defautSnarlinetrface;
|
||||
|
||||
int id = notification->id();
|
||||
wchar_t *title = toWchar(Notification::toPlainText(notification->title()));
|
||||
wchar_t *text = toWchar(Notification::toPlainText(notification->text()));
|
||||
wchar_t *icon = toWchar(notification->icon());
|
||||
|
@ -88,7 +90,7 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||
L"Text: \"%s\"\n"
|
||||
L"Timeout: \"%i\"\n"
|
||||
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{
|
||||
//update message
|
||||
wprintf(L"Updating SnarlMessage ID: \"%i\"\n"
|
||||
|
@ -96,11 +98,12 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||
L"Text: \"%s\"\n"
|
||||
L"Icon: \"%s\"\n",notification->id(),title,text,icon);
|
||||
snarlInterface->UpdateMessage(notification->id(),title, text,icon);
|
||||
return notification->id();
|
||||
}
|
||||
|
||||
delete[] title;
|
||||
delete[] text;
|
||||
delete[] icon;
|
||||
return id;
|
||||
}
|
||||
|
||||
void Snarl_Backend::closeNotification(QSharedPointer<Notification> notification){
|
||||
|
|
Loading…
Reference in New Issue