2
* Copyright (C) 2011 Canonical, Ltd.
5
* Lukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
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.
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.
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/>.
22
#include "percentcoder.h"
24
PercentCoder::PercentCoder(QObject* parent) :
29
QString PercentCoder::encoded() const
31
QString string(QUrl::toPercentEncoding(m_string));
35
QString PercentCoder::unencoded() const
40
void PercentCoder::setEncoded(const QString &string)
42
QString str = QUrl::fromPercentEncoding(string.toAscii());
43
if (str != m_string) {
45
Q_EMIT stringChanged();
49
void PercentCoder::setUnencoded(const QString& string)
51
if (string != m_string) {
53
Q_EMIT stringChanged();
57
#include "percentcoder.moc"