Fix and install smb2rdc action
[kdenetwork.git] / kget / patches / kget-extendableitemdelegateanimation.diff
blob78e76b8b6e16e7b8bacf644ec5b02c4858e0a507
1 Index: ui/kextendableitemdelegateanimation.cpp
2 ===================================================================
3 --- ui/kextendableitemdelegateanimation.cpp (revision 0)
4 +++ ui/kextendableitemdelegateanimation.cpp (revision 0)
5 @@ -0,0 +1,62 @@
6 +/* This file is part of the KDE project
8 + Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
10 + This program is free software; you can redistribute it and/or
11 + modify it under the terms of the GNU General Public
12 + License as published by the Free Software Foundation; either
13 + version 2 of the License, or (at your option) any later version.
14 +*/
16 +#include "kextendableitemdelegateanimation.h"
18 +#include "kextendableitemdelegate.h"
20 +#include <QStyleOptionViewItem>
21 +#include <KDebug>
23 +KExtendableItemDelegateAnimation::KExtendableItemDelegateAnimation(QObject *parent, KExtendableItemDelegate *itemDelegate,
24 + QWidget *widget, const QModelIndex &index)
25 + : QObject(parent),
26 + m_itemDelegate(itemDelegate),
27 + m_widget(widget),
28 + m_index(index)
30 + kDebug(5001);
31 + timeLine = new QTimeLine(500, this);
32 + timeLine->setFrameRange(0, 50);
33 + start();
36 +KExtendableItemDelegateAnimation::~KExtendableItemDelegateAnimation()
38 + kDebug(5001);
39 + if (timeLine)
40 + delete timeLine;
41 + timeLine = 0;
44 +void KExtendableItemDelegateAnimation::start()
46 + kDebug(5001);
47 + connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(nextFrame(int)));
48 + connect(timeLine, SIGNAL(finished()), this, SLOT(stop()));
49 + timeLine->start();
52 +void KExtendableItemDelegateAnimation::stop()
54 + timeLine->stop();
55 + deleteLater();
58 +void KExtendableItemDelegateAnimation::nextFrame(int frame)
60 + kDebug(5001);
61 + QStyleOptionViewItem option;
62 + m_widget->setGeometry(0, 0, 800, frame * 4);
63 + QStyleOption styleOption;
64 + styleOption.initFrom(m_widget);
65 + option.rect = styleOption.rect;
66 + m_itemDelegate->updateExtenderGeometry(m_widget, option, m_index);
68 Index: ui/kextendableitemdelegateanimation.h
69 ===================================================================
70 --- ui/kextendableitemdelegateanimation.h (revision 0)
71 +++ ui/kextendableitemdelegateanimation.h (revision 0)
72 @@ -0,0 +1,40 @@
73 +/* This file is part of the KDE project
75 + Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
77 + This program is free software; you can redistribute it and/or
78 + modify it under the terms of the GNU General Public
79 + License as published by the Free Software Foundation; either
80 + version 2 of the License, or (at your option) any later version.
81 +*/
82 +#ifndef KEXTENDABLEITEMDELEGATEANIMATION_H
83 +#define KEXTENDABLEITEMDELEGATEANIMATION_H
85 +#include <QObject>
86 +#include <QTimeLine>
87 +#include <QModelIndex>
89 +class QWidget;
90 +class KExtendableItemDelegate;
92 +class KExtendableItemDelegateAnimation : public QObject
94 + Q_OBJECT
95 + public:
96 + KExtendableItemDelegateAnimation(QObject *parent, KExtendableItemDelegate *itemDelegate, QWidget *widget, const QModelIndex &index);
97 + ~KExtendableItemDelegateAnimation();
99 + public slots:
100 + void start();
101 + void stop();
102 + void nextFrame(int);
104 + private:
105 + QTimeLine *timeLine;
107 + const QModelIndex &m_index;
108 + KExtendableItemDelegate *m_itemDelegate;
109 + QWidget *m_widget;
112 +#endif
113 Index: ui/transfersviewdelegate.cpp
114 ===================================================================
115 --- ui/transfersviewdelegate.cpp (revision 762997)
116 +++ ui/transfersviewdelegate.cpp (working copy)
117 @@ -12,6 +12,7 @@
118 #include "ui/transfersviewdelegate.h"
120 #include "transferdetails.h"
121 +#include "kextendableitemdelegateanimation.h"
122 #include "core/kget.h"
123 #include "core/transferhandler.h"
124 #include "core/transfergrouphandler.h"
125 @@ -473,6 +474,7 @@
127 m_editingIndexes.append(index);
128 extendItem(widget, index);
129 + new KExtendableItemDelegateAnimation(this, this, widget, index);
131 else {
132 m_editingIndexes.removeAll(index);
133 Index: CMakeLists.txt
134 ===================================================================
135 --- CMakeLists.txt (revision 762997)
136 +++ CMakeLists.txt (working copy)
137 @@ -70,6 +70,7 @@
138 ui/viewscontainer.cpp
139 ui/newtransferdialog.cpp
140 ui/kextendableitemdelegate.cpp
141 + ui/kextendableitemdelegateanimation.cpp
142 ui/transferhistory.cpp
143 mainwindow.cpp
144 main.cpp