~fboucault/unity-2d/a11y_lens_navigation_bar

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/indicatorentrywidget.cpp

  • Committer: Tarmac
  • Author(s): Florian Boucault
  • Date: 2011-09-05 06:16:42 UTC
  • mfrom: (694.1.2 dash_encoding_global_fix)
  • Revision ID: tarmac-20110905061642-1eisu4e1nr7mojev
[dash] Fix encoding and decoding of strings coming from and passed to the backend so that searches containing non-ascii characters work.

Reverted revision 677. It was introducing QStringFromUtf8StdString that has
the same result as QString::fromStdString with the codec for C-strings set to UTF-8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
// Local
25
25
#include <cairoutils.h>
26
26
#include <debug_p.h>
27
 
#include <global.h>
28
27
#include <gscopedpointer.h>
29
28
#include <gimageutils.h>
30
29
#include <panelstyle.h>
45
44
static const int ICON_SIZE = 22;
46
45
 
47
46
using namespace unity::indicator;
48
 
using namespace Unity2d;
49
47
 
50
48
IndicatorEntryWidget::IndicatorEntryWidget(const Entry::Ptr& entry)
51
49
: m_entry(entry)
294
292
            UQ_WARNING << "Failed to decode image";
295
293
        }
296
294
    } else if (type == GTK_IMAGE_ICON_NAME) {
297
 
        QString name = QStringFromUtf8StdString(m_entry->image_data());
 
295
        QString name = QString::fromStdString(m_entry->image_data());
298
296
        QIcon icon = QIcon::fromTheme(name);
299
297
        pix = icon.pixmap(ICON_SIZE, ICON_SIZE);
300
298
    } else if (type == GTK_IMAGE_GICON) {
301
 
        QString name = QStringFromUtf8StdString(m_entry->image_data());
 
299
        QString name = QString::fromStdString(m_entry->image_data());
302
300
        QImage image = GImageUtils::imageForIconString(name, ICON_SIZE);
303
301
        if (image.isNull()) {
304
302
            UQ_WARNING << "Failed to load icon from" << name;