~ubuntu-branches/ubuntu/oneiric/kdesdk/oneiric-updates

« back to all changes in this revision

Viewing changes to kbugbuster/gui/buglvi.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers, Modestas Vainius, George Kiagiadakis, José Manuel Santamaría Lema, Pino Toscano
  • Date: 2011-04-27 12:23:44 UTC
  • mfrom: (1.1.58 upstream) (0.5.7 squeeze)
  • mto: (0.5.8 sid)
  • mto: This revision was merged to the branch mainline in revision 120.
  • Revision ID: james.westby@ubuntu.com-20110427122344-t9d1jf4lfnrl6hyv
Tags: 4:4.6.2-1
* New upstream release:
  - fixes plugin loading in kate sessions (Closes: #525853)
  - updates kate man page with respect to instance creation defaults
    (Closes: #598443)
  - fixes cursor position with static word-wrap in Kate (Closes: #570409)
  - xml2pot creates .pot files with the correct mimetype (Closes: #326060)
* Update installed files.
* Update lintian overrides.

[ Modestas Vainius ]
* Point debian/control Vcs fields to the new Git repository.
* Strip sequence numbers from debian/patches.
* Strip trailing whitespace in debian/copyright.
* Add kdeutils-dbg (<< 4:4.6) to kdesdk-dbg Breaks/Replaces (due to moved
  okteta).
* Add ${perl:Depends} to Depends of cervisia and kdesdk-kio-plugins.

[ George Kiagiadakis ]
* Add myself to uploaders.
* Refresh patch 02_append_kde.diff.
* Drop patch 03_kmtrace_compile.diff; fixed upstream in a better way.
* Add libkonq5-dev, libantlr-dev and antlr to build depends.
  (Closes: #505425)
* Bump kdepimlibs5-dev build dependency to version 4:4.6.
* Add new package: kdesdk-dolphin-plugins.

[ José Manuel Santamaría Lema ]
* Remove package kbugbuster.
* Enable DebianABIManager:
  - include DebianABIManager.cmake at the bottom of the main CMakeLists.txt
    (patch enable_debianabimanager.diff).
  - debian/control: managing all non-local unstable-BC libraries.
* Add packages for okteta:
  - okteta
  - okteta-dev
  - libkastencontrollers4
  - libkastencore4
  - libkastengui4
  - liboktetacore4
  - liboktetagui4
  - liboktetakastencontrollers4
  - liboktetakastencore4
  - liboktetakastengui4
* Add symbols files for new library packages.
* Bump kde-sc-dev-latest build dependency to 4:4.6.2.
* Bump pkg-kde-tools build dependency to 0.12.
* Switch debian/rules engine to dhmk based qt-kde-team/2/*
  - and remove cdbs from Build-Depends.
* Bump S-V to 3.9.1; update Replaces/Breaks/Conflicts.
* Add myself to Uploaders.

[ Pino Toscano ]
* Add build dependency on libqca2-dev.
* Do not ship kdesrc-build with kdesdk-scripts, it is packaged separately.
* Small updates to descriptions.
* Clean up Replaces/Breaks from the pre-squeeze era whenever possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    buglvi.cpp  -  Custom QListViewItem that holds a Bug object
3
 
 
4
 
    copyright   : (c) 2001 by Martijn Klingens
5
 
    email       : klingens@kde.org
6
 
 
7
 
    *************************************************************************
8
 
    *                                                                       *
9
 
    * This program is free software; you can redistribute it and/or modify  *
10
 
    * it under the terms of the GNU General Public License as published by  *
11
 
    * the Free Software Foundation; either version 2 of the License, or     *
12
 
    * (at your option) any later version.                                   *
13
 
    *                                                                       *
14
 
    *************************************************************************
15
 
*/
16
 
#include "buglvi.h"
17
 
 
18
 
#include <QFont>
19
 
#include <QPainter>
20
 
 
21
 
#include <kstringhandler.h>
22
 
#include <kdebug.h>
23
 
 
24
 
#include "bugsystem.h"
25
 
#include "bugserver.h"
26
 
 
27
 
using namespace KBugBusterMainWindow;
28
 
 
29
 
BugLVI::BugLVI( K3ListView *parent , const Bug &bug )
30
 
: K3ListViewItem( parent, bug.number() + "  ",
31
 
                 i18np( "1 day", "%1 days", bug.age() ),
32
 
                 bug.title(), //KStringHandler::csqueeze( bug.title(), 70 ),
33
 
                 Bug::statusLabel( bug.status() ),
34
 
                 Bug::severityLabel( bug.severity() ),
35
 
                 bug.submitter().fullName() )
36
 
{
37
 
    m_bug = bug;
38
 
 
39
 
    bool hasCommands = BugSystem::self()->server()->hasCommandsFor( bug );
40
 
    mCommandState = hasCommands ? BugCommand::Queued : BugCommand::None;
41
 
 
42
 
    if ( bug.age() == 0xFFFFFFFF )
43
 
        setText( 1, i18n( "Unknown" ) );
44
 
 
45
 
    Person developer = bug.developerTODO();
46
 
    if ( !developer.name.isEmpty() )
47
 
        setText( 3, i18n( "%1 (%2)", Bug::statusLabel( bug.status() ), developer.name ) );
48
 
}
49
 
 
50
 
BugLVI::~BugLVI()
51
 
{
52
 
}
53
 
 
54
 
QString BugLVI::key( int column, bool /* ascending */ ) const
55
 
{
56
 
    QString key;
57
 
 
58
 
    if ( column == 0 )
59
 
    {
60
 
        key = text( 0 ).rightJustified( 10, '0' );
61
 
    }
62
 
    else if ( column == 1 )
63
 
    {
64
 
        if ( m_bug.age() == 0xFFFFFFFF )
65
 
            key = '0';
66
 
        else
67
 
            key = QString::number( m_bug.age() ).rightJustified( 10, '0' );
68
 
    }
69
 
    else if ( column == 4 )
70
 
    {
71
 
        key = QString::number( 10 - m_bug.severity() );
72
 
        key += m_bug.number().rightJustified( 10, '0' );
73
 
    }
74
 
    else
75
 
    {
76
 
        key = text( column );
77
 
    }
78
 
 
79
 
    return key;
80
 
}
81
 
 
82
 
void BugLVI::paintCell(QPainter* p, const QColorGroup& cg,
83
 
                       int column, int width, int align)
84
 
{
85
 
    QColorGroup newCg = cg;
86
 
    if ( mCommandState == BugCommand::Queued ) {
87
 
        QFont font = p->font();
88
 
        font.setBold( true );
89
 
        p->setFont( font );
90
 
    } else if ( mCommandState == BugCommand::Sent ) {
91
 
        QFont font = p->font();
92
 
        font.setItalic( true );
93
 
        p->setFont( font );
94
 
    } else if ( m_bug.status() == Bug::Closed ) {
95
 
        // Different color for closed bugs
96
 
        newCg.setColor( QPalette::Text, cg.color( QPalette::Dark ) );
97
 
    }
98
 
 
99
 
    K3ListViewItem::paintCell( p, newCg, column, width, align );
100
 
}
101
 
 
102
 
void BugLVI::setCommandState( BugCommand::State state)
103
 
{
104
 
    mCommandState = state;
105
 
}
106
 
 
107
 
// vim: set et ts=4 sw=4 sts=4:
108