2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 2.1.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
19
#include "ubuntubzr.h"
20
#include "ubuntuconstants.h"
21
#include <QCoreApplication>
23
using namespace Ubuntu::Internal;
25
UbuntuBzr::UbuntuBzr(QObject *parent) :
26
QObject(parent), m_bInitialized(false)
28
connect(&m_cmd,SIGNAL(finished(int)),this,SLOT(scriptExecuted(int)));
29
m_cmd.setWorkingDirectory(QCoreApplication::applicationDirPath());
32
void UbuntuBzr::initialize() {
33
m_cmd.start(QString(QLatin1String("%0/qtc_bzr_info")).arg(Ubuntu::Constants::UBUNTU_SCRIPTPATH));
36
void UbuntuBzr::scriptExecuted(int sta) {
37
QStringList data = QString(QString::fromLatin1(m_cmd.readAllStandardOutput())).trimmed().split(QLatin1String("\n"));
39
if (data.length()!=2) {
43
this->m_whoami = data.takeFirst();
44
this->m_launchpadId = data.takeFirst();
46
m_bInitialized = true;
47
emit initializedChanged();