~ubuntu-branches/ubuntu/oneiric/unity-2d/oneiric-updates

« back to all changes in this revision

Viewing changes to libunity-2d-private/Unity2d/plugin.cpp

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-09-09 13:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20110909135022-eijgm2xpq5veyll9
Tags: upstream-4.6.1
ImportĀ upstreamĀ versionĀ 4.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
#include <QDeclarativeContext>
74
74
#include <QGraphicsEffect>
75
75
#include <QAbstractListModel>
 
76
#include <QTextCodec>
76
77
 
77
78
// QtDee
78
79
#include "deelistmodel.h"
186
187
    /* Configure translations */
187
188
    Unity2dTr::init("unity-2d", INSTALL_PREFIX "/share/locale");
188
189
    Unity2dTr::qmlInit(engine->rootContext());
 
190
 
 
191
    /* Define the charset that Qt assumes C-strings (char *) and std::string to be in.
 
192
       After that definition, using QString::fromStdString and QString::toStdString
 
193
       will properly convert from and to std::string encoded in UTF-8 as it is
 
194
       the case in Unity's shared backend.
 
195
 
 
196
       Ref.: http://developer.qt.nokia.com/wiki/QtStrings
 
197
    */
 
198
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
189
199
}
190
200
 
191
201
Q_EXPORT_PLUGIN2(Unity2d, Unity2dPlugin);