aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-30 13:06:35 +0100
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-30 13:06:35 +0100
commitfac3a657a39bb9c3e9fa3c0b3ff22533b2e7e3ba (patch)
treeccd8ebede33d7d8b7385b7d67c4ad172dc6d0607 /libqmenumodel
parentfd715d4758a1ebf92c30b7194af39fd7e924a473 (diff)
parent035b6086485dcd3b42abc5d1fab2b155ccd16027 (diff)
downloadqmenumodel-fac3a657a39bb9c3e9fa3c0b3ff22533b2e7e3ba.tar.gz
qmenumodel-fac3a657a39bb9c3e9fa3c0b3ff22533b2e7e3ba.tar.bz2
qmenumodel-fac3a657a39bb9c3e9fa3c0b3ff22533b2e7e3ba.zip
Used utf8 instead of latin1 for strings.
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/converter.cpp6
-rw-r--r--libqmenumodel/src/qdbusactiongroup.cpp14
-rw-r--r--libqmenumodel/src/qdbusmenumodel.cpp4
-rw-r--r--libqmenumodel/src/qdbusobject.cpp2
-rw-r--r--libqmenumodel/src/qmenumodel.cpp6
5 files changed, 16 insertions, 16 deletions
diff --git a/libqmenumodel/src/converter.cpp b/libqmenumodel/src/converter.cpp
index c2b8fb1..75733ce 100644
--- a/libqmenumodel/src/converter.cpp
+++ b/libqmenumodel/src/converter.cpp
@@ -37,7 +37,7 @@ QVariant Converter::toQVariant(GVariant *value)
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_STRING)) {
gsize size = 0;
const gchar *v = g_variant_get_string(value, &size);
- result.setValue(QString::fromLatin1(v, size));
+ result.setValue(QString::fromUtf8(v, size));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_VARDICT)) {
GVariantIter iter;
GVariant *vvalue;
@@ -47,7 +47,7 @@ QVariant Converter::toQVariant(GVariant *value)
g_variant_iter_init (&iter, value);
while (g_variant_iter_loop (&iter, "{sv}", &key, &vvalue))
{
- qmap.insert(QString::fromLatin1(key), toQVariant(vvalue));
+ qmap.insert(QString::fromUtf8(key), toQVariant(vvalue));
}
result.setValue(qmap);
@@ -117,7 +117,7 @@ GVariant* Converter::toGVariant(const QVariant &value)
result = g_variant_new_int32(value.toInt());
break;
case QVariant::String:
- result = g_variant_new_string(value.toString().toLatin1());
+ result = g_variant_new_string(value.toString().toUtf8().data());
break;
case QVariant::UInt:
result = g_variant_new_uint32(value.toUInt());
diff --git a/libqmenumodel/src/qdbusactiongroup.cpp b/libqmenumodel/src/qdbusactiongroup.cpp
index 6d3515a..756bb76 100644
--- a/libqmenumodel/src/qdbusactiongroup.cpp
+++ b/libqmenumodel/src/qdbusactiongroup.cpp
@@ -83,7 +83,7 @@ QStateAction *QDBusActionGroup::action(const QString &name)
QVariant QDBusActionGroup::actionState(const QString &name)
{
QVariant result;
- GVariant *state = g_action_group_get_action_state(m_actionGroup, name.toLatin1());
+ GVariant *state = g_action_group_get_action_state(m_actionGroup, name.toUtf8().data());
result = Converter::toQVariant(state);
if (state) {
g_variant_unref(state);
@@ -95,7 +95,7 @@ QVariant QDBusActionGroup::actionState(const QString &name)
bool QDBusActionGroup::hasAction(const QString &name)
{
if (m_actionGroup) {
- return g_action_group_has_action(m_actionGroup, name.toLatin1());
+ return g_action_group_has_action(m_actionGroup, name.toUtf8().data());
} else {
return false;
}
@@ -121,8 +121,8 @@ void QDBusActionGroup::serviceVanish(GDBusConnection *)
void QDBusActionGroup::serviceAppear(GDBusConnection *connection)
{
GDBusActionGroup *ag = g_dbus_action_group_get(connection,
- busName().toLatin1(),
- objectPath().toLatin1());
+ busName().toUtf8().data(),
+ objectPath().toUtf8().data());
setActionGroup(ag);
if (ag == NULL) {
stop();
@@ -160,7 +160,7 @@ void QDBusActionGroup::setActionGroup(GDBusActionGroup *ag)
g_signal_handler_disconnect(m_actionGroup, m_signalActionAddId);
g_signal_handler_disconnect(m_actionGroup, m_signalActionRemovedId);
g_signal_handler_disconnect(m_actionGroup, m_signalStateChangedId);
- m_signalActionAddId = m_signalActionRemovedId = m_signalStateChangedId = 0;
+ m_signalActionAddId = m_signalActionRemovedId = m_signalStateChangedId = 0;
clear();
}
@@ -207,14 +207,14 @@ void QDBusActionGroup::clear()
void QDBusActionGroup::updateActionState(const QString &name, const QVariant &state)
{
if (m_actionGroup != NULL) {
- g_action_group_change_action_state(m_actionGroup, name.toLatin1(), Converter::toGVariant(state));
+ g_action_group_change_action_state(m_actionGroup, name.toUtf8().data(), Converter::toGVariant(state));
}
}
void QDBusActionGroup::activateAction(const QString &name, const QVariant &parameter)
{
if (m_actionGroup != NULL) {
- g_action_group_activate_action(m_actionGroup, name.toLatin1(), Converter::toGVariant(parameter));
+ g_action_group_activate_action(m_actionGroup, name.toUtf8().data(), Converter::toGVariant(parameter));
}
}
diff --git a/libqmenumodel/src/qdbusmenumodel.cpp b/libqmenumodel/src/qdbusmenumodel.cpp
index f3da989..97990b4 100644
--- a/libqmenumodel/src/qdbusmenumodel.cpp
+++ b/libqmenumodel/src/qdbusmenumodel.cpp
@@ -96,8 +96,8 @@ void QDBusMenuModel::serviceVanish(GDBusConnection *)
void QDBusMenuModel::serviceAppear(GDBusConnection *connection)
{
GMenuModel *model = reinterpret_cast<GMenuModel*>(g_dbus_menu_model_get(connection,
- busName().toLatin1(),
- objectPath().toLatin1()));
+ busName().toUtf8().data(),
+ objectPath().toUtf8().data()));
setMenuModel(model);
if (model == NULL) {
stop();
diff --git a/libqmenumodel/src/qdbusobject.cpp b/libqmenumodel/src/qdbusobject.cpp
index 3748dc8..c586972 100644
--- a/libqmenumodel/src/qdbusobject.cpp
+++ b/libqmenumodel/src/qdbusobject.cpp
@@ -155,7 +155,7 @@ void QDBusObject::connect()
} else if ((m_busType > DBusEnums::None) && !m_objectPath.isEmpty() && !m_busName.isEmpty()) {
GBusType type = m_busType == DBusEnums::SessionBus ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM;
m_watchId = g_bus_watch_name (type,
- m_busName.toLatin1(),
+ m_busName.toUtf8().data(),
G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
QDBusObject::onServiceAppeared,
QDBusObject::onServiceVanished,
diff --git a/libqmenumodel/src/qmenumodel.cpp b/libqmenumodel/src/qmenumodel.cpp
index a45e5ff..f0c2274 100644
--- a/libqmenumodel/src/qmenumodel.cpp
+++ b/libqmenumodel/src/qmenumodel.cpp
@@ -156,10 +156,10 @@ QVariant QMenuModel::getStringAttribute(const QModelIndex &index,
gchar* value = NULL;
g_menu_model_get_item_attribute(m_menuModel,
index.row(),
- attribute.toLatin1(),
+ attribute.toUtf8().data(),
"s", &value);
if (value) {
- result = QVariant(QString::fromLatin1(value));
+ result = QVariant(QString::fromUtf8(value));
g_free(value);
}
return result;
@@ -173,7 +173,7 @@ QVariant QMenuModel::getLink(const QModelIndex &index,
link = g_menu_model_get_item_link(m_menuModel,
index.row(),
- linkName.toLatin1());
+ linkName.toUtf8().data());
if (link) {
QMenuModel *other = new QMenuModel(link, const_cast<QMenuModel*>(this));