~andreagrandi/unity-2d/trash-nautilus-setting-oneiric

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Alberto Mardegan
  • Date: 2011-08-30 20:32:45 UTC
  • mfrom: (672.5.1 lenses-unicode)
  • Revision ID: tarmac-20110830203245-o3noi57uvs4mmvu6
[dash] Convert UnityCore UTF-8 strings to QStrings

Add a tiny global function to perform the conversion, and use it throughout the project.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical, Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Alberto Mardegan <alberto.mardegan@canonical.com>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; version 3.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
// local
 
21
#include "global.h"
 
22
 
 
23
namespace Unity2d {
 
24
 
 
25
QString QStringFromUtf8StdString(std::string s)
 
26
{
 
27
    return QString::fromUtf8(s.c_str());
 
28
}
 
29
 
 
30
};
 
31