~ubuntu-branches/ubuntu/intrepid/gwenview/intrepid

« back to all changes in this revision

Viewing changes to src/gvfiledetailviewitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Martin
  • Date: 2005-04-06 11:33:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050406113306-7zovl7z0io5bacpd
Tags: 1.2.0-1
* New upstream release.
  + Fixes crashes when using "Back" to navigate. (Closes: #301811)
* Enable KIPI support.
* Add a doc-base file for the handbook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim: set tabstop=4 shiftwidth=4 noexpandtab
 
2
/* This file is based on kfiledetailview.cpp from the KDE libs. Original
 
3
   copyright follows.
 
4
*/
 
5
/* This file is part of the KDE libraries
 
6
   Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
 
7
                 2000, 2001 Carsten Pfeiffer <pfeiffer@kde.org>
 
8
 
 
9
   This library is free software; you can redistribute it and/or
 
10
   modify it under the terms of the GNU Library General Public
 
11
   License as published by the Free Software Foundation; either
 
12
   version 2 of the License, or (at your option) any later version.
 
13
 
 
14
   This library is distributed in the hope that it will be useful,
 
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
   Library General Public License for more details.
 
18
 
 
19
   You should have received a copy of the GNU Library General Public License
 
20
   along with this library; see the file COPYING.LIB.   If not, write to
 
21
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
22
   Boston, MA 02111-1307, USA.
 
23
*/
 
24
 
 
25
// KDE includes
 
26
#include <kglobal.h>
 
27
#include <klocale.h>
 
28
 
 
29
// Our includes
 
30
#include "gvfiledetailview.h"
 
31
#include "gvfiledetailviewitem.h"
 
32
 
 
33
 
 
34
void GVFileDetailViewItem::init()
 
35
{
 
36
        setPixmap( COL_NAME, inf->pixmap(KIcon::SizeSmall));
 
37
 
 
38
        setText( COL_NAME, inf->text() );
 
39
        setText( COL_SIZE, KGlobal::locale()->formatNumber( inf->size(), 0));
 
40
        setText( COL_DATE,      inf->timeString() );
 
41
        setText( COL_PERM,      inf->permissionsString() );
 
42
        setText( COL_OWNER, inf->user() );
 
43
        setText( COL_GROUP, inf->group() );
 
44
}
 
45
 
 
46
void GVFileDetailViewItem::paintCell(QPainter* p,const QColorGroup & cg,int column,int width,int align)
 
47
{
 
48
        QColorGroup myCG=cg;
 
49
        GVFileDetailView* view=static_cast<GVFileDetailView*>(listView());
 
50
        GVFileDetailViewItem* viewedItem=view->viewItem(view->shownFileItem());
 
51
        if (viewedItem==this) {
 
52
                myCG.setColor(QColorGroup::Text, view->shownFileItemColor());
 
53
                myCG.setColor(QColorGroup::HighlightedText, view->shownFileItemColor());
 
54
        }
 
55
        KListViewItem::paintCell(p,myCG,column,width,align);
 
56
}