fixed encoding issues
This commit is contained in:
parent
8651ffba4f
commit
93536f2070
|
@ -46,10 +46,10 @@ void Growl_Backend::registerApplication(Application *application){
|
|||
for (int i = 0 ; i < alertCount; ++i){
|
||||
QString name = aList.at(i)->name();
|
||||
n[i] = new char[name.length()+1];
|
||||
strcpy(n[i],name.toAscii().constData());
|
||||
strcpy(n[i],name.toUtf8().constData());
|
||||
}
|
||||
|
||||
_applications.insert(application->name(),new Growl(GROWL_TCP,NULL,application->name().toAscii().constData(),(const char**)n,application->alerts().count()));
|
||||
_applications.insert(application->name(),new Growl(GROWL_TCP,NULL,application->name().toUtf8().constData(),(const char**)n,application->alerts().count()));
|
||||
|
||||
for (int i = 0 ; i < alertCount; ++i){
|
||||
delete [] n[i];
|
||||
|
@ -72,7 +72,7 @@ int Growl_Backend::notify(QSharedPointer<Notification> notification){
|
|||
QString title=Notification::toPlainText(notification->title());
|
||||
QString text=Notification::toPlainText(notification->text());
|
||||
qDebug()<<"Notify Growl:"<<notification->application()<<title;
|
||||
growl->Notify(notification->alert().toAscii().constData(),title.toAscii().constData(),text.toAscii().constData(),"",notification->icon().toAscii().constData());
|
||||
growl->Notify(notification->alert().toUtf8().constData(),title.toUtf8().constData(),text.toUtf8().constData(),"",notification->icon().toUtf8().constData());
|
||||
return ++id;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,12 +51,12 @@ void Snarl_Backend::registerApplication(Application *application){
|
|||
Snarl::SnarlInterface *snarlInterface = new Snarl::SnarlInterface();
|
||||
_applications.insert(application->name(),snarlInterface);
|
||||
|
||||
const char *appName = strdup(application->name().toAscii().constData());
|
||||
const char *icon = strdup(application->icon().toAscii().constData());
|
||||
const char *appName = strdup(application->name().toUtf8().constData());
|
||||
const char *icon = strdup(application->icon().toUtf8().constData());
|
||||
snarlInterface->RegisterApp(appName,icon,icon);
|
||||
|
||||
foreach(Alert *alert,application->alerts()){
|
||||
snarlInterface->RegisterAlert(appName,alert->name().toAscii().constData());
|
||||
snarlInterface->RegisterAlert(appName,alert->name().toUtf8().constData());
|
||||
}
|
||||
delete [] appName;
|
||||
delete [] icon;
|
||||
|
@ -77,9 +77,9 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||
snarlInterface = _defautSnarlinetrface;
|
||||
|
||||
int id = notification->id();
|
||||
const char *title = strdup(Notification::toPlainText(notification->title()).toAscii().constData());
|
||||
const char *text = strdup(Notification::toPlainText(notification->text()).toAscii().constData());
|
||||
const char *icon = strdup(notification->icon().toAscii().constData());
|
||||
const char *title = strdup(Notification::toPlainText(notification->title()).toUtf8().constData());
|
||||
const char *text = strdup(Notification::toPlainText(notification->text()).toUtf8().constData());
|
||||
const char *icon = strdup(notification->icon().toUtf8().constData());
|
||||
|
||||
if(notification->id()==0){
|
||||
printf("Calling SnarlMessage\n"
|
||||
|
|
Loading…
Reference in New Issue