BuildLogViewer/BuildStatus.cpp
author John Kern <johnk@symbian.org>
Thu, 26 Aug 2010 14:34:34 -0700
changeset 40 edc0144719a1
parent 2 6894bf2709c0
permissions -rwxr-xr-x
removed invariant from data() and rowCount(). Performance should be ok now.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
#include "BuildStatus.h"
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
BuildStatus::BuildStatus(QObject *parent)
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
{
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
    setParent(parent);
2
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
     6
    this->m_packageName = new QString("<unknown>");
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
     7
    this->m_PresentStatus = new QString("Pass");
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
     8
    this->m_status = true;
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
}
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
void BuildStatus::setTime(QDateTime w)
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
{
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
    this->m_when = w;
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
}
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
2
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    16
QString BuildStatus::time()
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
{
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
    return this->m_when.toString();
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
}
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
void BuildStatus::setName(QString n)
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
{
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
    if (m_packageName)
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
    {
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
        delete m_packageName;
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
        m_packageName = NULL;
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
    }
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
    m_packageName = new QString(n);
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
}
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
2
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    31
const QString *BuildStatus::name()
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    32
{
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    33
    return m_packageName;
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    34
}
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    35
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    36
void BuildStatus::setStatus (bool n )
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
{
2
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    38
    m_status = n ;
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    39
    if (!m_status)
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    40
    {
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    41
        this->m_PresentStatus = new QString("Failed");
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    42
    }
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
}
2
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    44
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    45
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    46
const QString  *BuildStatus::status()
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    47
{
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    48
    return this->m_PresentStatus;
6894bf2709c0 add some regex to parse status information.
John Kern <johnk@symbian.org>
parents: 1
diff changeset
    49
}