summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/dub/dub/dubview.cpp
blob: e1e4713e59ff977d58c1919416d556560db9f576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
                          dubview.cpp  -  description
                             -------------------
    begin                : Tue Oct 23 01:44:51 EEST 2001
    copyright            : (C) 2001 by Eray Ozkural (exa)
    email                : erayo@cs.bilkent.edu.tr
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

// include files for Qt
#include <qprinter.h>
#include <qpainter.h>
#include <kdebug.h>

// application specific includes
#include "dubview.h"
#include "dubview.moc"
#include "dub.h"
#include "fileselectorwidget.h"

//DubView::DubView(QWidget *parent, const char *name) : QWidget(parent, name)
//{
//  setBackgroundMode(PaletteBase);
//}

DubView::DubView(QWidget *parent) : FileSelectorWidget(parent)
{
  kdDebug(90010) << "dub view cons" << endl;
  setBackgroundMode(PaletteBase);
}

DubView::~DubView()
{
}

void DubView::print(QPrinter *pPrinter)
{
  QPainter printpainter;
  printpainter.begin(pPrinter);

  // TODO: add your printing code here

  printpainter.end();
}
/** Return item list of view */
QPtrList<KFileItem>& DubView::items()
{
  return const_cast<QPtrList<KFileItem>&>( *dirOperator()->view()->items() );
}

/** Select a file */
void DubView::selectFile(KFileItem* file){
  dirOperator()->view()->setCurrentItem( file );
  dirOperator()->view()->ensureItemVisible( file );
}