Debian Codegraph @

src/collectionwidget.cpp

raw symbols SCIP
1 /*
2 Copyright (C) 2005-2019 Mario Stephan <[email protected]>
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published
6 by the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include "collectionwidget.h"cxx . . $ `<file>/src/collectionwidget.h`/
19 #include "collectiontree.h"cxx . . $ `<file>/src/collectiontree.h`/
20 #include "collectionupdater.h"cxx . . $ `<file>/src/collectionupdater.h`/
21 #include "modeselector.h"cxx . . $ `<file>/src/modeselector.h`/
22 #include "progressbar.h"cxx . . $ `<file>/src/progressbar.h`/
23 #include "track.h"cxx . . $ `<file>/src/track.h`/
24
25 #include <QDropEvent>
26 #include <QLabel>
27 #include <QMenu>
28 #include <QPixmap>
29 #include <QPushButton>
30 #include <QTimerEvent>
31 #include <QVBoxLayout>
32 #include <QtGui>
33
34 class CollectionWidgetPrivatecxx . . $ CollectionWidgetPrivate# {
35 public:
36 QMenucxx . . $ QMenu#* actionsMenucxx . . $ CollectionWidgetPrivate#actionsMenu.;
37 QActioncxx . . $ QAction#* actionScancxx . . $ CollectionWidgetPrivate#actionScan.;
38 CollectionTreecxx . . $ CollectionTree#* collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.;
39 ProgressBarcxx . . $ ProgressBar#* progresscxx . . $ CollectionWidgetPrivate#progress.;
40 CollectionUpdatercxx . . $ CollectionUpdater#* updatercxx . . $ CollectionWidgetPrivate#updater.;
41 QTimercxx . . $ QTimer#* timercxx . . $ CollectionWidgetPrivate#timer.;
42 QToolButtoncxx . . $ QToolButton#* buttoncxx . . $ CollectionWidgetPrivate#button.;
43 SearchEditcxx . . $ SearchEdit#* searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.;
44 ModeSelectorcxx . . $ ModeSelector#* modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.;
45 };
46
47 CollectionWidgetcxx . . $ CollectionWidget#::CollectionWidgetcxx . . $ CollectionWidget#CollectionWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent)
48 : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent)
49 {
50 pcxx . . $ CollectionWidget#p. = new CollectionWidgetPrivatecxx . . $ CollectionWidgetPrivate#;
51
52 QPushButtoncxx . . $ QPushButton#* pushRandom = new QPushButtoncxx . . $ QPushButton#QPushButton(108f35f7aa7f3cf9).();
53 QPixmapcxx . . $ QPixmap# pixmap2cxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":shuffle.png"cxx . . $ QString#QString(85c52e162fed56f9).);
54 pushRandom->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(8887f7d25b86c3f4).(pixmap2));
55 pushRandom->setIconSizecxx . . $ QAbstractButton#setIconSize(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(27, 27));
56 pushRandom->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(40);
57 pushRandom->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).(
58 "QPushButton { border: none; padding: 0px; margin-left: 5px;max-height: "cxx . . $ QString#QString(85c52e162fed56f9).
59 "20px; margin-right: 5px;}");
60 pushRandom->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ CollectionWidget#tr(75d9f1c324b4579d).("Random Tracks"));
61
62 pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit. = new SearchEditcxx . . $ SearchEdit#();
63 pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(
64 trcxx . . $ CollectionWidget#tr(75d9f1c324b4579d).("Enter space-separated terms to filter collection"));
65
66 QVBoxLayoutcxx . . $ QVBoxLayout#* mainLayout = new QVBoxLayoutcxx . . $ QVBoxLayout#;
67 QWidgetcxx . . $ QWidget#* headWidget = new QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(this);
68 headWidget->setMaximumHeightcxx . . $ QWidget#setMaximumHeight(d4f767463ce0a6b3).(38);
69
70 QHBoxLayoutcxx . . $ QHBoxLayout#* headWidgetLayout = new QHBoxLayoutcxx . . $ QHBoxLayout#;
71 headWidgetLayout->setMargincxx . . $ QLayout#setMargin(d4f767463ce0a6b3).(0);
72 headWidgetLayout->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(1);
73
74 headWidgetLayout->addSpacerItemcxx . . $ QBoxLayout#addSpacerItem(a5ccb5246ece79a7).(
75 new QSpacerItemcxx . . $ QSpacerItem#QSpacerItem(bce5685a9a3bd999).(10, 0, QSizePolicycxx . . $ QSizePolicy#::Fixedcxx . . $ QSizePolicy#Fixed., QSizePolicycxx . . $ QSizePolicy#::Expandingcxx . . $ QSizePolicy#Expanding.));
76 headWidgetLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.);
77 headWidgetLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(pushRandom);
78 headWidget->setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(headWidgetLayout);
79
80 pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater. = new CollectionUpdatercxx . . $ CollectionUpdater#();
81
82 pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer. = new QTimercxx . . $ QTimer#QTimer(749de1b6ae65bddd).(this);
83 pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer.->setIntervalcxx . . $ QTimer#setInterval(d4f767463ce0a6b3).(300);
84 pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer.->setSingleShotcxx . . $ QTimer#setSingleShot(b45ddcbc8423892c).(true);
85
86 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree. = new CollectionTreecxx . . $ CollectionTree#(this);
87 pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect. = new ModeSelectorcxx . . $ ModeSelector#(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.);
88
89 headWidget->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).();
90 mainLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(headWidget);
91
92 mainLayout->setMargincxx . . $ QLayout#setMargin(d4f767463ce0a6b3).(0);
93 mainLayout->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(0);
94
95 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pushRandom, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.,
96 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(triggerRandomSelection()));
97
98 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(modeChanged(ModeSelector::modeType)), this,
99 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onModeSelected(ModeSelector::modeType)));
100
101 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textChanged(const QString&)), this,
102 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onSetFilterTimeout()));
103
104 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(trackDropped(QString)), this,
105 SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(trackDropped(QString)));
106
107 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(selectionChanged(QList<Track*>)), this,
108 SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(selectionChanged(QList<Track*>)));
109
110 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(wantLoad(QList<Track*>, QString)), this,
111 SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(wantLoad(QList<Track*>, QString)));
112
113 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(changesDone()), pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.,
114 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(createTrunk()));
115 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(rescan()), pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(scan()));
116
117 connectcxx . . $ QObject#connect(f4332061c7e4ca89).(pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(timeout()), SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onSetFilter()));
118
119 setFocusProxycxx . . $ QWidget#setFocusProxy(108f35f7aa7f3cf9).(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.); // default object to get focus
120 setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(400);
121
122 // Pogressbar for re-read collection
123 pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress. = new ProgressBarcxx . . $ ProgressBar#(this);
124 pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress.->setValuecxx . . $ ProgressBar#setValue(d4f767463ce0a6b3).(0);
125 pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress.->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).("* { margin-bottom: 3px; }"cxx . . $ QString#QString(85c52e162fed56f9).);
126
127 mainLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.);
128
129 // Read config values
130 QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).;
131 pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.->setModecxx . . $ ModeSelector#setMode(4ba5068bf871ee9).(static_cast<ModeSelectorcxx . . $ ModeSelector#::modeTypecxx . . $ ModeSelector#modeType#>(
132 settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("TreeMode"cxx . . $ QString#QString(85c52e162fed56f9)., ModeSelectorcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).::MODENONEcxx . . $ ModeSelector#MODENONE.).toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).()));
133
134 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->createTrunkcxx . . $ CollectionTree#createTrunk(49f6e7a06ebc5aa8).();
135 setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(mainLayout);
136
137 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(progressChanged(int)), pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress.,
138 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setValue(int)));
139 connectcxx . . $ QObject#connect(158df1d9a01a3410).(pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stopped()), pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(stop()));
140 pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.->showcxx . . $ QWidget#show(49f6e7a06ebc5aa8).();
141 }
142
143 CollectionWidgetcxx . . $ CollectionWidget#::~cxx . . $ CollectionWidget#`~CollectionWidget`(ced63f7c635d850d).CollectionWidgetcxx . . $ CollectionWidget#()
144 {
145 QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).;
146 settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("TreeMode"cxx . . $ QString#QString(85c52e162fed56f9)., pcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->treeModecxx . . $ CollectionTree#treeMode.);
147 delete pcxx . . $ CollectionWidget#p.;
148 }
149
150 void CollectionWidgetcxx . . $ CollectionWidget#::scancxx . . $ CollectionWidget#scan(49f6e7a06ebc5aa8).()
151 {
152 if (pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress.->isHiddencxx . . $ QWidget#isHidden(50ce9a9e25b4a850).()) {
153 QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).;
154 pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater.->setDirectoryListcxx . . $ CollectionUpdater#setDirectoryList(259d7dd017a80eae).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("Dirs"cxx . . $ QString#QString(85c52e162fed56f9).).toStringListcxx . . $ QVariant#toStringList(e1dbd5c4feadc8f5).(), true);
155 }
156 }
157
158 void CollectionWidgetcxx . . $ CollectionWidget#::onModeSelectedcxx . . $ CollectionWidget#onModeSelected(4ba5068bf871ee9).(ModeSelectorcxx . . $ ModeSelector#::modeTypecxx . . $ ModeSelector#modeType# value)
159 {
160 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->treeModecxx . . $ CollectionTree#treeMode. = static_cast<CollectionTreecxx . . $ CollectionTree#::modeTypecxx . . $ CollectionTree#modeType#>(value);
161 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->createTrunkcxx . . $ CollectionTree#createTrunk(49f6e7a06ebc5aa8).();
162 }
163
164 void CollectionWidgetcxx . . $ CollectionWidget#::onSetFilterTimeoutcxx . . $ CollectionWidget#onSetFilterTimeout(49f6e7a06ebc5aa8).()
165 {
166 if (pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer.->isActivecxx . . $ QTimer#isActive(50ce9a9e25b4a850).())
167 pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer.->stopcxx . . $ QTimer#stop(49f6e7a06ebc5aa8).();
168 pcxx . . $ CollectionWidget#p.->timercxx . . $ CollectionWidgetPrivate#timer.->startcxx . . $ QTimer#start(49f6e7a06ebc5aa8).();
169 }
170
171 void CollectionWidgetcxx . . $ CollectionWidget#::onSetFiltercxx . . $ CollectionWidget#onSetFilter(49f6e7a06ebc5aa8).()
172 {
173 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->setFiltercxx . . $ CollectionTree#setFilter(7df51288a9ebd664).(pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).());
174 pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->createTrunkcxx . . $ CollectionTree#createTrunk(49f6e7a06ebc5aa8).();
175 }
176
177 void CollectionWidgetcxx . . $ CollectionWidget#::onSetClickedcxx . . $ CollectionWidget#onSetClicked(49f6e7a06ebc5aa8).()
178 {
179 pcxx . . $ CollectionWidget#p.->actionsMenucxx . . $ CollectionWidgetPrivate#actionsMenu.->popupcxx . . $ QMenu#popup(371d674a5bfc952e).(QCursorcxx . . $ QCursor#::poscxx . . $ QCursor#pos(c189c43f91c31e1b).(), nullptr);
180 }
181
182 bool CollectionWidgetcxx . . $ CollectionWidget#::hasItemscxx . . $ CollectionWidget#hasItems(c9857a73d68e59ba).()
183 {
184 return (pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->topLevelItemCountcxx . . $ QTreeWidget#topLevelItemCount(455f465bc33b4cdf).() > 0);
185 }
186
187 void CollectionWidgetcxx . . $ CollectionWidget#::loadSettingscxx . . $ CollectionWidget#loadSettings(49f6e7a06ebc5aa8).()
188 {
189 QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).;
190 pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater.->setDoMonitorcxx . . $ CollectionUpdater#setDoMonitor(b45ddcbc8423892c).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("Monitor"cxx . . $ QString#QString(85c52e162fed56f9).).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).());
191 pcxx . . $ CollectionWidget#p.->updatercxx . . $ CollectionWidgetPrivate#updater.->setDirectoryListcxx . . $ CollectionUpdater#setDirectoryList(259d7dd017a80eae).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("Dirs"cxx . . $ QString#QString(85c52e162fed56f9).).toStringListcxx . . $ QVariant#toStringList(e1dbd5c4feadc8f5).());
192 }
193
194 void CollectionWidgetcxx . . $ CollectionWidget#::setFilterTextcxx . . $ CollectionWidget#setFilterText(7df51288a9ebd664).(QStringcxx . . $ QString# strFilter)
195 {
196 pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(strFilter);
197 onSetFiltercxx . . $ CollectionWidget#onSetFilter(49f6e7a06ebc5aa8).();
198 }
199
200 QStringcxx . . $ QString# CollectionWidgetcxx . . $ CollectionWidget#::filterTextcxx . . $ CollectionWidget#filterText(4365c3963150523e).() { return pcxx . . $ CollectionWidget#p.->searchEditcxx . . $ CollectionWidgetPrivate#searchEdit.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); }
201
202 void CollectionWidgetcxx . . $ CollectionWidget#::resizeEventcxx . . $ CollectionWidget#resizeEvent(eeeec21cf8dc0387).(QResizeEventcxx . . $ QResizeEvent#*)
203 {
204 QRectcxx . . $ QRect# rec = pcxx . . $ CollectionWidget#p.->collectiontreecxx . . $ CollectionWidgetPrivate#collectiontree.->geometrycxx . . $ QWidget#geometry(f4023511c62cad66).();
205 #if defined(Q_OS_DARWIN)
206 int y = 39;
207 #else
208 int y = 41;
209 #endif
210 pcxx . . $ CollectionWidget#p.->progresscxx . . $ CollectionWidgetPrivate#progress.->setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(0, y, rec.widthcxx . . $ QRect#width(ea6fe5115c70a13f).() - 20, 20);
211 pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.->setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(rec.widthcxx . . $ QRect#width(ea6fe5115c70a13f).() - pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.->widthcxx . . $ QWidget#width(455f465bc33b4cdf).(), 0,
212 pcxx . . $ CollectionWidget#p.->modeSelectcxx . . $ CollectionWidgetPrivate#modeSelect.->widthcxx . . $ QWidget#width(455f465bc33b4cdf).(), 20);
213 }
214
215 SearchEditcxx . . $ SearchEdit#::SearchEditcxx . . $ SearchEdit#SearchEdit(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent)
216 : QLineEditcxx . . $ QLineEdit#QLineEdit(108f35f7aa7f3cf9).(parent)
217 {
218 QPixmapcxx . . $ QPixmap# searchIconcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":search.png"cxx . . $ QString#QString(85c52e162fed56f9).);
219 QLabelcxx . . $ QLabel#* lbl = new QLabelcxx . . $ QLabel#(this);
220 lbl->setScaledContentscxx . . $ QLabel#setScaledContents(b45ddcbc8423892c).(true);
221 lbl->setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(searchIcon);
222 lbl->setFixedSizecxx . . $ QWidget#setFixedSize(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(23, 23));
223 lbl->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).("QLabel { border: none; padding: 0px; margin-left: 9px; "cxx . . $ QString#QString(85c52e162fed56f9).
224 "margin-top: 11px; margin-right: 3px}");
225 clearButtoncxx . . $ SearchEdit#clearButton. = new QToolButtoncxx . . $ QToolButton#(this);
226 QPixmapcxx . . $ QPixmap# pixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":clear_left.png"cxx . . $ QString#QString(85c52e162fed56f9).);
227 clearButtoncxx . . $ SearchEdit#clearButton.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(8887f7d25b86c3f4).(pixmap));
228 clearButtoncxx . . $ SearchEdit#clearButton.->setIconSizecxx . . $ QAbstractButton#setIconSize(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(18, 18));
229 clearButtoncxx . . $ SearchEdit#clearButton.->setCursorcxx . . $ QWidget#setCursor(abdcfda6ee8376ea).(Qtcxx . . $ QCursor#QCursor(1a9232e7b845eb22).::ArrowCursorcxx . . $ Qt/ArrowCursor.);
230 clearButtoncxx . . $ SearchEdit#clearButton.->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).("QToolButton { border: none; padding: 0px; "cxx . . $ QString#QString(85c52e162fed56f9).
231 "margin-right: 2px; margin-top: 3px;}");
232 clearButtoncxx . . $ SearchEdit#clearButton.->hidecxx . . $ QWidget#hide(49f6e7a06ebc5aa8).();
233 setAttributecxx . . $ QWidget#setAttribute(52fc7bf162518f7f).(Qtcxx . . $ Qt/::WA_MacShowFocusRectcxx . . $ Qt/WA_MacShowFocusRect., false);
234 connectcxx . . $ QObject#connect(158df1d9a01a3410).(clearButtoncxx . . $ SearchEdit#clearButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(clear()));
235 connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textChanged(const QString&)), this,
236 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(updateCloseButton(const QString&)));
237 int frameWidth = stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->pixelMetriccxx . . $ QStyle#pixelMetric(83914974d8fbce56).(QStylecxx . . $ QStyle#::PM_DefaultFrameWidthcxx . . $ QStyle#PM_DefaultFrameWidth.);
238 // setStyleSheet(QString("QLineEdit { padding-right: %1px; }
239 // ").arg(clearButton->sizeHint().width() + frameWidth + 1));
240 QSizecxx . . $ QSize# msz = minimumSizeHintcxx . . $ QLineEdit#minimumSizeHint(4b3b776e5ee2b367).();
241 setMinimumSizecxx . . $ QWidget#setMinimumSize(3e454b8ccf442868).(
242 qMaxcxx . . $ qMax(2a338fce5842aa6a).(msz.widthcxx . . $ QSize#width(ea6fe5115c70a13f).(), clearButtoncxx . . $ SearchEdit#clearButton.->sizeHintcxx . . $ QToolButton#sizeHint(4b3b776e5ee2b367).().heightcxx . . $ QSize#height(ea6fe5115c70a13f).() + frameWidth * 2 + 2),
243 qMaxcxx . . $ qMax(2a338fce5842aa6a).(msz.heightcxx . . $ QSize#height(ea6fe5115c70a13f).(),
244 clearButtoncxx . . $ SearchEdit#clearButton.->sizeHintcxx . . $ QToolButton#sizeHint(4b3b776e5ee2b367).().heightcxx . . $ QSize#height(ea6fe5115c70a13f).() + frameWidth * 2 + 2));
245 }
246 SearchEditcxx . . $ SearchEdit#::~cxx . . $ SearchEdit#`~SearchEdit`(ced63f7c635d850d).SearchEditcxx . . $ SearchEdit#() {}
247
248 void SearchEditcxx . . $ SearchEdit#::dragEnterEventcxx . . $ SearchEdit#dragEnterEvent(f87bde08e579de69).(QDragEnterEventcxx . . $ QDragEnterEvent#* event)
249 {
250 if (event->mimeDatacxx . . $ QDropEvent#mimeData(30712b663b74d9e6).()->hasFormatcxx . . $ QMimeData#hasFormat(f3b39adf77d9c36c).("text/playlistitem"cxx . . $ QString#QString(85c52e162fed56f9).))
251 event->acceptcxx . . $ QDragMoveEvent#accept(49f6e7a06ebc5aa8).();
252 }
253
254 void SearchEditcxx . . $ SearchEdit#::dropEventcxx . . $ SearchEdit#dropEvent(163a41ccaa120447).(QDropEventcxx . . $ QDropEvent#* event)
255 {
256 if (event->mimeDatacxx . . $ QDropEvent#mimeData(30712b663b74d9e6).()->hasFormatcxx . . $ QMimeData#hasFormat(f3b39adf77d9c36c).("text/playlistitem"cxx . . $ QString#QString(85c52e162fed56f9).)) {
257
258 // decode playlistitem
259 QByteArraycxx . . $ QByteArray# itemData = event->mimeDatacxx . . $ QDropEvent#mimeData(30712b663b74d9e6).()->datacxx . . $ QMimeData#data(e72629479c734b12).("text/playlistitem"cxx . . $ QString#QString(85c52e162fed56f9).);
260 QDataStreamcxx . . $ QDataStream# streamcxx . . $ QDataStream#QDataStream(3ec9af543aa5ce32).(&itemData, QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly.);
261 QVectorcxx . . $ QVector#<QStringListcxx . . $ QStringList#> tagscxx . . $ QVector#QVector(ced63f7c635d850d).;
262
263 stream >>cxx . . $ `operator>>`(8508fe2a7e8affa8). tags;
264 event->setDropActioncxx . . $ QDropEvent#setDropAction(6d3c9a803d42a7e2).(Qtcxx . . $ Qt/::CopyActioncxx . . $ Qt/CopyAction.);
265 event->acceptcxx . . $ QEvent#accept(49f6e7a06ebc5aa8).();
266
267 if (tags.countcxx . . $ QVector#count(455f465bc33b4cdf).() > 0) {
268 Trackcxx . . $ Track#* track = new Trackcxx . . $ Track#(tags[cxx . . $ QVector#`operator[]`(7a0ef1c7079e8533).0]);
269 this->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(track->artistcxx . . $ Track#artist(4365c3963150523e).());
270 }
271
272 } else
273 event->ignorecxx . . $ QEvent#ignore(49f6e7a06ebc5aa8).();
274 }
275
276 void SearchEditcxx . . $ SearchEdit#::resizeEventcxx . . $ SearchEdit#resizeEvent(eeeec21cf8dc0387).(QResizeEventcxx . . $ QResizeEvent#*)
277 {
278 QSizecxx . . $ QSize# sz = clearButtoncxx . . $ SearchEdit#clearButton.->sizeHintcxx . . $ QToolButton#sizeHint(4b3b776e5ee2b367).();
279 int frameWidth = stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->pixelMetriccxx . . $ QStyle#pixelMetric(83914974d8fbce56).(QStylecxx . . $ QStyle#::PM_DefaultFrameWidthcxx . . $ QStyle#PM_DefaultFrameWidth.);
280 clearButtoncxx . . $ SearchEdit#clearButton.->movecxx . . $ QWidget#move(3e454b8ccf442868).(rectcxx . . $ QWidget#rect(d857385bac04cbf7).().rightcxx . . $ QRect#right(ea6fe5115c70a13f).() - frameWidth - sz.widthcxx . . $ QSize#width(ea6fe5115c70a13f).(),
281 (rectcxx . . $ QWidget#rect(d857385bac04cbf7).().bottomcxx . . $ QRect#bottom(ea6fe5115c70a13f).() + 2 - sz.heightcxx . . $ QSize#height(ea6fe5115c70a13f).()) / 2);
282 }
283
284 // esc key for clean up
285 void SearchEditcxx . . $ SearchEdit#::keyPressEventcxx . . $ SearchEdit#keyPressEvent(c92999c1b6b09cc0).(QKeyEventcxx . . $ QKeyEvent#* e)
286 {
287
288 if (e->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Escapecxx . . $ Qt/Key_Escape.)
289 this->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
290 else
291 QLineEditcxx . . $ QLineEdit#::keyPressEventcxx . . $ QLineEdit#keyPressEvent(c92999c1b6b09cc0).(e);
292 }
293
294 void SearchEditcxx . . $ SearchEdit#::updateCloseButtoncxx . . $ SearchEdit#updateCloseButton(3520e46b33348bf6).(const QStringcxx . . $ QString#& text)
295 {
296 clearButtoncxx . . $ SearchEdit#clearButton.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(!text.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).());
297 }