Debian Codegraph @

src/collectiontree.cpp

raw symbols SCIP
1 /*
2 Copyright (C) 2005-2014 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 "collectiontree.h"cxx . . $ `<file>/src/collectiontree.h`/
19 #include "collectiontreeitem.h"cxx . . $ `<file>/src/collectiontreeitem.h`/
20 #include <QApplication>
21 #include <QHeaderView>
22 #include <QMenu>
23 #include <QMessageBox>
24 #include <QMouseEvent>
25 #include <QtGui>
26 #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= 0x050000
27 #include <QtConcurrent/QtConcurrent>
28 #else
29 #include <QtConcurrentRun>
30 #endif
31
32 struct CollectionTreePrivatecxx . . $ CollectionTreePrivate# {
33 CollectionDBcxx . . $ CollectionDB#* databasecxx . . $ CollectionTreePrivate#database.;
34 QListcxx . . $ QList#<Trackcxx . . $ Track#*> trackscxx . . $ CollectionTreePrivate#tracks.;
35 QStringcxx . . $ QString# filterStringcxx . . $ CollectionTreePrivate#filterString.;
36 QMutexcxx . . $ QMutex# mutexcxx . . $ CollectionTreePrivate#mutex.;
37 };
38
39 CollectionTreecxx . . $ CollectionTree#::CollectionTreecxx . . $ CollectionTree#CollectionTree(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent)
40 : QTreeWidgetcxx . . $ QTreeWidget#QTreeWidget(108f35f7aa7f3cf9).(parent)
41 , pcxx . . $ CollectionTree#p.(new CollectionTreePrivatecxx . . $ CollectionTreePrivate#)
42 {
43
44 pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database. = new CollectionDBcxx . . $ CollectionDB#();
45 pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->executeSqlcxx . . $ CollectionDB#executeSql(e1defb592416720d).("PRAGMA synchronous = OFF;"cxx . . $ QString#QString(85c52e162fed56f9).);
46
47 setSelectionModecxx . . $ QAbstractItemView#setSelectionMode(92c48cbe05de0e90).(QAbstractItemViewcxx . . $ QAbstractItemView#::ExtendedSelectioncxx . . $ QAbstractItemView#ExtendedSelection.);
48 setDragEnabledcxx . . $ QAbstractItemView#setDragEnabled(b45ddcbc8423892c).(true);
49 setRootIsDecoratedcxx . . $ QTreeView#setRootIsDecorated(b45ddcbc8423892c).(false);
50 setAcceptDropscxx . . $ QWidget#setAcceptDrops(b45ddcbc8423892c).(false);
51 setRootIsDecoratedcxx . . $ QTreeView#setRootIsDecorated(b45ddcbc8423892c).(true);
52
53 setAttributecxx . . $ QWidget#setAttribute(52fc7bf162518f7f).(Qtcxx . . $ Qt/::WA_MacShowFocusRectcxx . . $ Qt/WA_MacShowFocusRect., false);
54
55 QStringListcxx . . $ QStringList# headerscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
56 headers <<cxx . . $ QStringList#`operator<<`(85116071a693d053). trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Artist");
57
58 QTreeWidgetItemcxx . . $ QTreeWidgetItem#* headeritem = new QTreeWidgetItemcxx . . $ QTreeWidgetItem#QTreeWidgetItem(177359b07d5ec5a4).(headers);
59 headeritem->setTextAlignmentcxx . . $ QTreeWidgetItem#setTextAlignment(3e454b8ccf442868).(0, Qtcxx . . $ Qt/::AlignLeftcxx . . $ Qt/AlignLeft.);
60
61 setHeaderItemcxx . . $ QTreeWidget#setHeaderItem(7332f4628c1d1841).(headeritem);
62 setHeaderLabelscxx . . $ QTreeWidget#setHeaderLabels(631c0101495f0328).(headers);
63 headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->resizeSectioncxx . . $ QHeaderView#resizeSection(3e454b8ccf442868).(0, this->widthcxx . . $ QWidget#width(455f465bc33b4cdf).() - 50);
64 headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->setMinimumHeightcxx . . $ QWidget#setMinimumHeight(d4f767463ce0a6b3).(18);
65
66 connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
67 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(on_currentItemChanged(QTreeWidgetItem*)));
68
69 connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(itemExpanded(QTreeWidgetItem*)),
70 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(on_itemExpanded(QTreeWidgetItem*)));
71 }
72
73 CollectionTreecxx . . $ CollectionTree#::~cxx . . $ CollectionTree#`~CollectionTree`(ced63f7c635d850d).CollectionTreecxx . . $ CollectionTree#()
74 {
75 pcxx . . $ CollectionTree#p.->mutexcxx . . $ CollectionTreePrivate#mutex..tryLockcxx . . $ QMutex#tryLock(109becb148f4ca36).(2000);
76 delete pcxx . . $ CollectionTree#p.;
77 }
78
79 void CollectionTreecxx . . $ CollectionTree#::createTrunkcxx . . $ CollectionTree#createTrunk(49f6e7a06ebc5aa8).()
80 {
81 //qDebug() << Q_FUNC_INFO;
82 CollectionTreeItemcxx . . $ CollectionTreeItem#* item = nullptr;
83
84 clearcxx . . $ QTreeWidget#clear(49f6e7a06ebc5aa8).();
85
86 //add "ALL" node and select it
87 int countAll = pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->getCountcxx . . $ CollectionDB#getCount(f708dce9a8856c70).();
88 if (countAll < 1000 && countAll > 0) {
89 item = new CollectionTreeItemcxx . . $ CollectionTreeItem#(this);
90 setCurrentItemcxx . . $ QTreeWidget#setCurrentItem(7332f4628c1d1841).(item);
91 }
92
93 QListcxx . . $ QList#<QStringListcxx . . $ QStringList#> tagscxx . . $ QList#QList(ced63f7c635d850d).;
94
95 //Retrieve root nodes from database
96 switch (treeModecxx . . $ CollectionTree#treeMode.) {
97 case MODEGENREcxx . . $ CollectionTree#MODEGENRE.:
98 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectGenrescxx . . $ CollectionDB#selectGenres(c58e6b6884db9162).();
99 if (item)
100 item->setGenrecxx . . $ CollectionTreeItem#setGenre(7df51288a9ebd664).(QStringcxx . . $ QString#QString(ee6b7ef95d0103b6).::nullcxx . . $ QString#null.);
101 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QStringList tag, tags) {
102 item = new CollectionTreeItemcxx . . $ CollectionTreeItem#(this);
103 item->setGenrecxx . . $ CollectionTreeItem#setGenre(7df51288a9ebd664).(tagcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
104 }
105 headerItemcxx . . $ QTreeWidget#headerItem(faf259b556e61ea0).()->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(0, QStringcxx . . $ QString#QString(85c52e162fed56f9).(" %1 (%2)").argcxx . . $ QString#arg(bc823072288cbbb5).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Genre")).argcxx . . $ QString#arg(64ab2ed17cc11715).(tags.countcxx . . $ QList#count(455f465bc33b4cdf).()));
106 break;
107 break;
108 case MODEYEARcxx . . $ CollectionTree#MODEYEAR.:
109 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectYearscxx . . $ CollectionDB#selectYears(c58e6b6884db9162).();
110 if (item)
111 item->setYearcxx . . $ CollectionTreeItem#setYear(7df51288a9ebd664).(QStringcxx . . $ QString#QString(ee6b7ef95d0103b6).::nullcxx . . $ QString#null.);
112 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QStringList tag, tags) {
113 item = new CollectionTreeItemcxx . . $ CollectionTreeItem#(this);
114 item->setYearcxx . . $ CollectionTreeItem#setYear(7df51288a9ebd664).(tagcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
115 }
116 headerItemcxx . . $ QTreeWidget#headerItem(faf259b556e61ea0).()->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(0, QStringcxx . . $ QString#QString(85c52e162fed56f9).(" %1 (%2)").argcxx . . $ QString#arg(bc823072288cbbb5).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Year")).argcxx . . $ QString#arg(64ab2ed17cc11715).(tags.countcxx . . $ QList#count(455f465bc33b4cdf).()));
117 break;
118 break;
119 default:
120 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectArtistscxx . . $ CollectionDB#selectArtists(dd80deef3a1011c6).();
121 if (item)
122 item->setArtistcxx . . $ CollectionTreeItem#setArtist(7df51288a9ebd664).(QStringcxx . . $ QString#QString(ee6b7ef95d0103b6).::nullcxx . . $ QString#null.);
123 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QStringList tag, tags) {
124 item = new CollectionTreeItemcxx . . $ CollectionTreeItem#(this);
125 item->setArtistcxx . . $ CollectionTreeItem#setArtist(7df51288a9ebd664).(tagcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
126 }
127 headerItemcxx . . $ QTreeWidget#headerItem(faf259b556e61ea0).()->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(0, QStringcxx . . $ QString#QString(85c52e162fed56f9).(" %1 (%2)").argcxx . . $ QString#arg(bc823072288cbbb5).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Artist")).argcxx . . $ QString#arg(64ab2ed17cc11715).(tags.countcxx . . $ QList#count(455f465bc33b4cdf).()));
128 break;
129 }
130 }
131
132 void CollectionTreecxx . . $ CollectionTree#::on_itemExpandedcxx . . $ CollectionTree#on_itemExpanded(7332f4628c1d1841).(QTreeWidgetItemcxx . . $ QTreeWidgetItem#* item)
133 {
134 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `/usr/include/x86_64-linux-gnu/qt5/QtCore/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(eeec1a57ad6beb98). endlcxx . . $ QTextStreamFunctions/endl(e06208c9acdf85a).;
135 if (!item)
136 return;
137
138 if (item->childCountcxx . . $ QTreeWidgetItem#childCount(455f465bc33b4cdf).() == 0) {
139
140 QListcxx . . $ QList#<QStringListcxx . . $ QStringList#> tagscxx . . $ QList#QList(ced63f7c635d850d).;
141 CollectionTreeItemcxx . . $ CollectionTreeItem#* collItem = static_cast<CollectionTreeItemcxx . . $ CollectionTreeItem#*>(item);
142
143 QTreeWidgetItemcxx . . $ QTreeWidgetItem#::ChildIndicatorPolicycxx . . $ QTreeWidgetItem#ChildIndicatorPolicy# policy = QTreeWidgetItemcxx . . $ QTreeWidgetItem#::ShowIndicatorcxx . . $ QTreeWidgetItem#ShowIndicator.;
144
145 //Retrieve children from database
146 if (collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).() !=cxx . . $ `operator!=`(aa68d9f0d6cffae2). QStringcxx . . $ QString#::nullcxx . . $ QString#null.) {
147 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectAlbumscxx . . $ CollectionDB#selectAlbums(7bf9880d9b041173).(collItem->yearcxx . . $ CollectionTreeItem#year(4365c3963150523e).(), collItem->genrecxx . . $ CollectionTreeItem#genre(4365c3963150523e).(), collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).());
148 policy = QTreeWidgetItemcxx . . $ QTreeWidgetItem#::DontShowIndicatorcxx . . $ QTreeWidgetItem#DontShowIndicator.;
149 } else {
150 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectArtistscxx . . $ CollectionDB#selectArtists(dd80deef3a1011c6).(collItem->yearcxx . . $ CollectionTreeItem#year(4365c3963150523e).(), collItem->genrecxx . . $ CollectionTreeItem#genre(4365c3963150523e).());
151 }
152
153 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QStringList tag, tags) {
154 CollectionTreeItemcxx . . $ CollectionTreeItem#* child = new CollectionTreeItemcxx . . $ CollectionTreeItem#(item);
155
156 child->setYearcxx . . $ CollectionTreeItem#setYear(7df51288a9ebd664).(collItem->yearcxx . . $ CollectionTreeItem#year(4365c3963150523e).());
157 child->setGenrecxx . . $ CollectionTreeItem#setGenre(7df51288a9ebd664).(collItem->genrecxx . . $ CollectionTreeItem#genre(4365c3963150523e).());
158 child->setArtistcxx . . $ CollectionTreeItem#setArtist(7df51288a9ebd664).(collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).());
159
160 if (collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).() ==cxx . . $ `operator==`(aa68d9f0d6cffae2). QStringcxx . . $ QString#::nullcxx . . $ QString#null.)
161 child->setArtistcxx . . $ CollectionTreeItem#setArtist(7df51288a9ebd664).(tagcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
162 else
163 child->setAlbumcxx . . $ CollectionTreeItem#setAlbum(7df51288a9ebd664).(tagcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
164
165 child->setChildIndicatorPolicycxx . . $ QTreeWidgetItem#setChildIndicatorPolicy(f5c7fcdc7c4a1346).(policy);
166 item->addChildcxx . . $ QTreeWidgetItem#addChild(7332f4628c1d1841).(child);
167 }
168 }
169 }
170
171 void CollectionTreecxx . . $ CollectionTree#::triggerRandomSelectioncxx . . $ CollectionTree#triggerRandomSelection(49f6e7a06ebc5aa8).()
172 {
173 QFuturecxx . . $ QFuture#<void> future = QtConcurrentcxx . . $ QtConcurrent/::runcxx . . $ QtConcurrent/run(9abe719565b3cadf).(this, &CollectionTreecxx . . $ CollectionTree#::asynchronTriggerRandomSelectioncxx . . $ CollectionTree#asynchronTriggerRandomSelection(49f6e7a06ebc5aa8).);
174 }
175
176 void CollectionTreecxx . . $ CollectionTree#::asynchronTriggerRandomSelectioncxx . . $ CollectionTree#asynchronTriggerRandomSelection(49f6e7a06ebc5aa8).()
177 {
178 QMutexLockercxx . . $ QMutexLocker# lockercxx . . $ QMutexLocker#QMutexLocker(beb12293d355549c).(&pcxx . . $ CollectionTree#p.->mutexcxx . . $ CollectionTreePrivate#mutex.);
179 pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
180
181 // init qrand
182 QTimecxx . . $ QTime# time = QTimecxx . . $ QTime#::currentTimecxx . . $ QTime#currentTime(bd2fc2b92108c576).();
183 qsrandcxx . . $ qsrand(cb2f890c2fdad230).((uintcxx . . $ uint#)time.mseccxx . . $ QTime#msec(455f465bc33b4cdf).());
184
185 for (int i = 0; i < 15; i++) {
186
187 Trackcxx . . $ Track#* track;
188 int r = 0;
189
190 do {
191 QStringListcxx . . $ QStringList# tag = pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->getRandomEntrycxx . . $ CollectionDB#getRandomEntry(669a05bc42dd57cc).();
192 track = new Trackcxx . . $ Track#(tag);
193 r++;
194 } while (track->prettyLengthcxx . . $ Track#prettyLength(4365c3963150523e).() ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "?" && r < 3);
195
196 pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks..appendcxx . . $ QList#append(77d9f17553126ecb).(track);
197 }
198
199 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `/usr/include/x86_64-linux-gnu/qt5/QtCore/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks..countcxx . . $ QList#count(455f465bc33b4cdf).();
200 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionChangedcxx . . $ CollectionTree#selectionChanged(c2e0487a5277a49e).(pcxx . . $ QList#QList(3d2301cfd89f773a).->trackscxx . . $ CollectionTreePrivate#tracks.);
201 }
202
203 void CollectionTreecxx . . $ CollectionTree#::on_currentItemChangedcxx . . $ CollectionTree#on_currentItemChanged(7332f4628c1d1841).(QTreeWidgetItemcxx . . $ QTreeWidgetItem#* item)
204 {
205 QFuturecxx . . $ QFuture#<void> future = QtConcurrentcxx . . $ QtConcurrent/::runcxx . . $ QtConcurrent/run(99327172cea463ca).(this, &CollectionTreecxx . . $ CollectionTree#::asynchronCurrentItemChangedcxx . . $ CollectionTree#asynchronCurrentItemChanged(7332f4628c1d1841)., item);
206 }
207
208 void CollectionTreecxx . . $ CollectionTree#::asynchronCurrentItemChangedcxx . . $ CollectionTree#asynchronCurrentItemChanged(7332f4628c1d1841).(QTreeWidgetItemcxx . . $ QTreeWidgetItem#* item)
209 {
210 QMutexLockercxx . . $ QMutexLocker# lockercxx . . $ QMutexLocker#QMutexLocker(beb12293d355549c).(&pcxx . . $ CollectionTree#p.->mutexcxx . . $ CollectionTreePrivate#mutex.);
211
212 if (!item)
213 return;
214
215 QListcxx . . $ QList#<QStringListcxx . . $ QStringList#> tagscxx . . $ QList#QList(ced63f7c635d850d).;
216
217 CollectionTreeItemcxx . . $ CollectionTreeItem#* collItem = static_cast<CollectionTreeItemcxx . . $ CollectionTreeItem#*>(item);
218 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `/usr/include/x86_64-linux-gnu/qt5/QtCore/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Artist: " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). " Album: " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). collItem->albumcxx . . $ CollectionTreeItem#album(4365c3963150523e).() <<cxx . . $ QDebug#`operator<<`(eeec1a57ad6beb98). endlcxx . . $ QTextStreamFunctions/endl(e06208c9acdf85a).;
219
220 //Retrieve songs from database
221 tags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->selectTrackscxx . . $ CollectionDB#selectTracks(e2c73df4e0ebaeed).(collItem->yearcxx . . $ CollectionTreeItem#year(4365c3963150523e).(), collItem->genrecxx . . $ CollectionTreeItem#genre(4365c3963150523e).(), collItem->artistcxx . . $ CollectionTreeItem#artist(4365c3963150523e).(), collItem->albumcxx . . $ CollectionTreeItem#album(4365c3963150523e).());
222
223 //Show songs in parent's tracklist
224 pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
225
226 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `/usr/include/x86_64-linux-gnu/qt5/QtCore/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Song count: " <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). tags.countcxx . . $ QList#count(455f465bc33b4cdf).();
227
228 //add tags to this track list
229 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QStringList tag, tags) {
230 //qDebug() << Q_FUNC_INFO <<": is playlistitem; tags:"<<tags;
231 pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks..appendcxx . . $ QList#append(77d9f17553126ecb).(new Trackcxx . . $ Track#(tag));
232 }
233
234 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionChangedcxx . . $ CollectionTree#selectionChanged(c2e0487a5277a49e).(pcxx . . $ QList#QList(3d2301cfd89f773a).->trackscxx . . $ CollectionTreePrivate#tracks.);
235
236 //qDebug() << Q_FUNC_INFO << "[End]" << endl;
237 }
238
239 QStringcxx . . $ QString# CollectionTreecxx . . $ CollectionTree#::filtercxx . . $ CollectionTree#filter(4365c3963150523e).()
240 {
241 //ToDo: do we need this private variable
242 return pcxx . . $ QString#QString(132dd6869045752b).->filterStringcxx . . $ CollectionTreePrivate#filterString.;
243 }
244
245 void CollectionTreecxx . . $ CollectionTree#::setFiltercxx . . $ CollectionTree#setFilter(7df51288a9ebd664).(QStringcxx . . $ QString# filter)
246 {
247 pcxx . . $ CollectionTree#p.->filterStringcxx . . $ CollectionTreePrivate#filterString. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). filter;
248 pcxx . . $ CollectionTree#p.->databasecxx . . $ CollectionTreePrivate#database.->setFilterStringcxx . . $ CollectionDB#setFilterString(7df51288a9ebd664).(filtercxx . . $ QString#QString(132dd6869045752b).);
249 }
250
251 void CollectionTreecxx . . $ CollectionTree#::mousePressEventcxx . . $ CollectionTree#mousePressEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent#* e)
252 {
253 if (e->buttoncxx . . $ QMouseEvent#button(4a2598559eeedfc9).() == Qtcxx . . $ Qt/::LeftButtoncxx . . $ Qt/LeftButton.)
254 startPoscxx . . $ CollectionTree#startPos. =cxx . . $ QPoint#`operator=`(2950c70ea382b4e5). e->poscxx . . $ QMouseEvent#pos(75d69cfbd3c4b2dd).();
255
256 QTreeWidgetcxx . . $ QTreeWidget#::mousePressEventcxx . . $ QTreeView#mousePressEvent(702858a82d06265c).(e);
257
258 if (e->buttoncxx . . $ QMouseEvent#button(4a2598559eeedfc9).() == Qtcxx . . $ Qt/::RightButtoncxx . . $ Qt/RightButton.)
259 showContextMenucxx . . $ CollectionTree#showContextMenu(abbf99ae0f1fc9f0).(currentItemcxx . . $ QTreeWidget#currentItem(faf259b556e61ea0).(), currentColumncxx . . $ QTreeWidget#currentColumn(455f465bc33b4cdf).());
260 }
261
262 void CollectionTreecxx . . $ CollectionTree#::mouseMoveEventcxx . . $ CollectionTree#mouseMoveEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent#* event)
263 {
264
265 if (event->buttonscxx . . $ QMouseEvent#buttons(4523555da7f36dd2).() &cxx . . $ QFlags#`operator&`(2cc1994e0be6f18e). Qtcxx . . $ Qt/::LeftButtoncxx . . $ Qt/LeftButton.) {
266 int distance = (event->poscxx . . $ QMouseEvent#pos(75d69cfbd3c4b2dd).() -cxx . . $ operator-(e1fd31f94663a124). startPoscxx . . $ CollectionTree#startPos.).manhattanLengthcxx . . $ QPoint#manhattanLength(455f465bc33b4cdf).();
267 if (distance >= QApplicationcxx . . $ QApplication#::startDragDistancecxx . . $ QApplication#startDragDistance(b126dc7c1de90089).()) {
268 performDragcxx . . $ CollectionTree#performDrag(49f6e7a06ebc5aa8).();
269 }
270 }
271 }
272
273 void CollectionTreecxx . . $ CollectionTree#::performDragcxx . . $ CollectionTree#performDrag(49f6e7a06ebc5aa8).()
274 {
275
276 QByteArraycxx . . $ QByteArray# itemDatacxx . . $ QByteArray#QByteArray(ced63f7c635d850d).;
277 QDataStreamcxx . . $ QDataStream# dataStreamcxx . . $ QDataStream#QDataStream(3ec9af543aa5ce32).(&itemData, QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::WriteOnlycxx . . $ QIODevice#WriteOnly.);
278 QVectorcxx . . $ QVector#<QStringListcxx . . $ QStringList#> tagscxx . . $ QVector#QVector(ced63f7c635d850d).;
279 QPixmapcxx . . $ QPixmap# covercxx . . $ QPixmap#QPixmap(49f6e7a06ebc5aa8).;
280 int i = 0;
281
282 //iterate selected items
283 QListIteratorcxx . . $ QListIterator#<Trackcxx . . $ Track#*> itcxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(pcxx . . $ CollectionTree#p.->trackscxx . . $ CollectionTreePrivate#tracks.);
284 while (it.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).()) {
285 Trackcxx . . $ Track#* track = dynamic_cast<Trackcxx . . $ Track#*>(it.nextcxx . . $ QListIterator#next(1306adbac230aeaa).());
286 if (track->isValidcxx . . $ Track#isValid(c9857a73d68e59ba).()) {
287 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `/usr/include/x86_64-linux-gnu/qt5/QtCore/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). ": send Data:" <<cxx . . $ `operator<<`(56a6a0968dd55378). track->urlcxx . . $ Track#url(db502ccec337722f).();
288 QStringListcxx . . $ QStringList# tag = track->tagListcxx . . $ Track#tagList(669a05bc42dd57cc).();
289 tags <<cxx . . $ QVector#`operator<<`(85c729c83851d88d). tag;
290 if (i == 0)
291 cover =cxx . . $ QPixmap#`operator=`(4972951fe8d596b5). QPixmapcxx . . $ QPixmap#::fromImagecxx . . $ QPixmap#fromImage(e505d3bc722e23e8).(track->coverImagecxx . . $ Track#coverImage(89a140e6ec82607c).());
292 i++;
293 }
294 }
295
296 dataStream <<cxx . . $ `operator<<`(b50e33aa6f8dcfc6). tags;
297
298 QMimeDatacxx . . $ QMimeData#* mimeData = new QMimeDatacxx . . $ QMimeData#QMimeData(49f6e7a06ebc5aa8).;
299 mimeData->setDatacxx . . $ QMimeData#setData(88f4c41ca0e941aa).("text/playlistitem"cxx . . $ QString#QString(85c52e162fed56f9)., itemData);
300
301 QDragcxx . . $ QDrag#* drag = new QDragcxx . . $ QDrag#QDrag(749de1b6ae65bddd).(this);
302 drag->setMimeDatacxx . . $ QDrag#setMimeData(bd56712671a29709).(mimeData);
303
304 if (!cover.isNullcxx . . $ QPixmap#isNull(50ce9a9e25b4a850).())
305 drag->setPixmapcxx . . $ QDrag#setPixmap(8887f7d25b86c3f4).(cover.scaledcxx . . $ QPixmap#scaled(c50953aa0e7da3b9).(50, 50));
306
307 if (drag->execcxx . . $ QDrag#exec(75cdb370f853aec0).(Qtcxx . . $ Qt/::CopyActioncxx . . $ Qt/CopyAction. |cxx . . $ Qt/`operator|`(9c4cde3878d56341). Qtcxx . . $ Qt/::MoveActioncxx . . $ Qt/MoveAction., Qtcxx . . $ Qt/::CopyActioncxx . . $ Qt/CopyAction.) == Qtcxx . . $ Qt/::MoveActioncxx . . $ Qt/MoveAction.) {
308 }
309 }
310
311 void CollectionTreecxx . . $ CollectionTree#::showContextMenucxx . . $ CollectionTree#showContextMenu(abbf99ae0f1fc9f0).(QTreeWidgetItemcxx . . $ QTreeWidgetItem#* item, int col)
312 {
313
314 Q_UNUSEDcxx . . $ `<external>/15045578679651060896/qglobal.h:117:9`!(col);
315
316 //ToDo: create popup before first use
317 enum Idcxx . . $ CollectionTree#showContextMenu(abbf99ae0f1fc9f0).Id# { LOAD1cxx . . $ CollectionTree#showContextMenu(abbf99ae0f1fc9f0).LOAD1.,
318 LOAD2cxx . . $ CollectionTree#showContextMenu(abbf99ae0f1fc9f0).LOAD2. };
319
320 if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
321 return;
322
323 QMenucxx . . $ QMenu# popupcxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(this);
324
325 popup.setTitlecxx . . $ QMenu#setTitle(3520e46b33348bf6).(item->textcxx . . $ QTreeWidgetItem#text(3f3c3d0e9c0eb37f).(0));
326 popup.addActioncxx . . $ QMenu#addAction(f5cd3b2bf41abf4e).(stylecxx . . $ QIcon#QIcon(8887f7d25b86c3f4).()->standardPixmapcxx . . $ QStyle#standardPixmap(b3e2f1e2ad18f15e).(QStylecxx . . $ QStyle#::SP_MediaPlaycxx . . $ QStyle#SP_MediaPlay.), trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Add to PlayList&1"),
327 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onLoad1Triggered()), Qtcxx . . $ QKeySequence#QKeySequence(748afa4755bc9595).::Key_1cxx . . $ Qt/Key_1.); //, LOAD1
328 popup.addActioncxx . . $ QMenu#addAction(f5cd3b2bf41abf4e).(stylecxx . . $ QIcon#QIcon(8887f7d25b86c3f4).()->standardPixmapcxx . . $ QStyle#standardPixmap(b3e2f1e2ad18f15e).(QStylecxx . . $ QStyle#::SP_MediaPlaycxx . . $ QStyle#SP_MediaPlay.), trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Add to PlayList&2"),
329 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onLoad2Triggered()), Qtcxx . . $ QKeySequence#QKeySequence(748afa4755bc9595).::Key_2cxx . . $ Qt/Key_2.); //, LOAD2
330 popup.addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).();
331 popup.addActioncxx . . $ QMenu#addAction(f5cd3b2bf41abf4e).(stylecxx . . $ QIcon#QIcon(8887f7d25b86c3f4).()->standardPixmapcxx . . $ QStyle#standardPixmap(b3e2f1e2ad18f15e).(QStylecxx . . $ QStyle#::SP_BrowserReloadcxx . . $ QStyle#SP_BrowserReload.), trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Re-scan collection"),
332 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onRescanTriggered()), Qtcxx . . $ QKeySequence#QKeySequence(748afa4755bc9595).::Key_Rcxx . . $ Qt/Key_R.);
333
334 popup.execcxx . . $ QMenu#exec(2535b15b88c544d4).(QCursorcxx . . $ QCursor#::poscxx . . $ QCursor#pos(c189c43f91c31e1b).());
335 }
336
337 void CollectionTreecxx . . $ CollectionTree#::onLoad1Triggeredcxx . . $ CollectionTree#onLoad1Triggered(49f6e7a06ebc5aa8).()
338 {
339 Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! wantLoadcxx . . $ CollectionTree#wantLoad(25020fd11423df10).(pcxx . . $ QList#QList(3d2301cfd89f773a).->trackscxx . . $ CollectionTreePrivate#tracks., "Left"cxx . . $ QString#QString(85c52e162fed56f9).);
340 }
341
342 void CollectionTreecxx . . $ CollectionTree#::onLoad2Triggeredcxx . . $ CollectionTree#onLoad2Triggered(49f6e7a06ebc5aa8).()
343 {
344 Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! wantLoadcxx . . $ CollectionTree#wantLoad(25020fd11423df10).(pcxx . . $ QList#QList(3d2301cfd89f773a).->trackscxx . . $ CollectionTreePrivate#tracks., "Right"cxx . . $ QString#QString(85c52e162fed56f9).);
345 }
346
347 void CollectionTreecxx . . $ CollectionTree#::onRescanTriggeredcxx . . $ CollectionTree#onRescanTriggered(49f6e7a06ebc5aa8).()
348 {
349 Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! rescancxx . . $ CollectionTree#rescan(49f6e7a06ebc5aa8).();
350 }
351
352 void CollectionTreecxx . . $ CollectionTree#::showTrackInfocxx . . $ CollectionTree#showTrackInfo(c7ced298c7283c1a).(Trackcxx . . $ Track#* mb)
353 {
354 const QStringcxx . . $ QString# body = "<tr><td>%1</td><td>%2</td></tr>"cxx . . $ QString#QString(85c52e162fed56f9).;
355
356 QStringcxx . . $ QString#
357 str
358 = "<html><body><table STYLE=\"border-collapse: collapse\"> width=\"100%\" border=\"1\">"cxx . . $ QString#QString(85c52e162fed56f9).;
359 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Title"), mb->titlecxx . . $ Track#title(4365c3963150523e).());
360 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Artist"), mb->artistcxx . . $ Track#artist(4365c3963150523e).());
361 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Album"), mb->albumcxx . . $ Track#album(4365c3963150523e).());
362 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Genre"), mb->genrecxx . . $ Track#genre(4365c3963150523e).());
363 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Year"), mb->yearcxx . . $ Track#year(4365c3963150523e).());
364 str +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). body.argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Location"), mb->urlcxx . . $ Track#url(db502ccec337722f).().toStringcxx . . $ QUrl#toString(632475ebea3355f1).());
365 str +=cxx . . $ QString#`operator+=`(d02845eef0c33901). "</table></body></html>";
366
367 QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(0, trcxx . . $ CollectionTree#tr(75d9f1c324b4579d).("Meta Information"), str);
368 }
369
370 void CollectionTreecxx . . $ CollectionTree#::resizeEventcxx . . $ CollectionTree#resizeEvent(eeeec21cf8dc0387).(QResizeEventcxx . . $ QResizeEvent#*)
371 {
372 //QRect rec = p->collectiontree->geometry();
373 headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->resizeSectioncxx . . $ QHeaderView#resizeSection(3e454b8ccf442868).(0, this->widthcxx . . $ QWidget#width(455f465bc33b4cdf).() - 100);
374 }