fixed some issues and make compile with msvc10

This commit is contained in:
Patrick von Reth 2010-09-20 15:44:39 +02:00
parent ce59e355a2
commit e2d0bc6d09
3 changed files with 82 additions and 76 deletions

View File

@ -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)

View File

@ -74,7 +74,7 @@ const uint &Notification::id() const
return _id;
}
const QString &Notification::Notification::icon() const
const QString &Notification::icon() const
{
return _icon;
}

View File

@ -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){