| 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 | |
| 19 | #include "playlistbrowser.h"cxx . . $ `<file>/src/playlistbrowser.h`/ |
| 20 | #include "playlistwidget.h"cxx . . $ `<file>/src/playlistwidget.h`/ |
| 21 | #include "collectiondb.h"cxx . . $ `<file>/src/collectiondb.h`/ |
| 22 | #include "track.h"cxx . . $ `<file>/src/track.h`/ |
| 23 | |
| 24 | #include <QtXml> |
| 25 | #include <QListWidget> |
| 26 | #include <QPushButton> |
| 27 | #include <QVBoxLayout> |
| 28 | #include <QInputDialog> |
| 29 | |
| 30 | class Trackcxx . . $ Track#; |
| 31 | |
| 32 | class PlaylistBrowsertPrivatecxx . . $ PlaylistBrowsertPrivate# |
| 33 | { |
| 34 | public: |
| 35 | QListWidgetcxx . . $ QListWidget#* listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.; |
| 36 | PlaylistWidgetcxx . . $ PlaylistWidget#* currentPlaylistcxx . . $ PlaylistBrowsertPrivate#currentPlaylist.; |
| 37 | CollectionDBcxx . . $ CollectionDB#* databasecxx . . $ PlaylistBrowsertPrivate#database.; |
| 38 | QStringcxx . . $ QString# directorycxx . . $ PlaylistBrowsertPrivate#directory.; |
| 39 | |
| 40 | }; |
| 41 | |
| 42 | |
| 43 | PlaylistBrowsercxx . . $ PlaylistBrowser#::PlaylistBrowsercxx . . $ PlaylistBrowser#PlaylistBrowser(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) : |
| 44 | QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent) |
| 45 | { |
| 46 | pcxx . . $ PlaylistBrowser#p. = new PlaylistBrowsertPrivatecxx . . $ PlaylistBrowsertPrivate#; |
| 47 | |
| 48 | QPushButtoncxx . . $ QPushButton#* pushSave =new QPushButtoncxx . . $ QPushButton#QPushButton(108f35f7aa7f3cf9).(); |
| 49 | pushSave->setGeometrycxx . . $ QWidget#setGeometry(22ba0428947158b).(QRectcxx . . $ QRect#QRect(2261ffe5112eab06).(1,1,60,25)); |
| 50 | pushSave->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(60); |
| 51 | pushSave->setMinimumWidthcxx . . $ QWidget#setMinimumWidth(d4f767463ce0a6b3).(60); |
| 52 | pushSave->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("+"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 53 | QFontcxx . . $ QFont# pushFont = pushSavecxx . . $ QFont#QFont(d0a4bd0c8524b912).->fontcxx . . $ QWidget#font(c5040538afc47120).(); |
| 54 | pushFont.setBoldcxx . . $ QFont#setBold(b45ddcbc8423892c).(true); |
| 55 | pushFont.setPointSizecxx . . $ QFont#setPointSize(d4f767463ce0a6b3).(pushFont.pointSizecxx . . $ QFont#pointSize(455f465bc33b4cdf).()+4); |
| 56 | pushSave->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(pushFont); |
| 57 | |
| 58 | pushSave->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).("QPushButton { border: none; padding-top: -3px; margin-left: 8px;max-height: 20px; margin-right: 28px;}"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 59 | pushSave->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).( "Add a new list and store current tracks" )); |
| 60 | connectcxx . . $ QObject#connect(158df1d9a01a3410).( pushSave,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()),this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onPushSave())); |
| 61 | |
| 62 | QVBoxLayoutcxx . . $ QVBoxLayout# *mainLayout = new QVBoxLayoutcxx . . $ QVBoxLayout#; |
| 63 | QWidgetcxx . . $ QWidget# *headWidget = new QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(this); |
| 64 | headWidget->setMaximumHeightcxx . . $ QWidget#setMaximumHeight(d4f767463ce0a6b3).(35); |
| 65 | headWidget->setMinimumHeightcxx . . $ QWidget#setMinimumHeight(d4f767463ce0a6b3).(25); |
| 66 | |
| 67 | QHBoxLayoutcxx . . $ QHBoxLayout# *headWidgetLayout = new QHBoxLayoutcxx . . $ QHBoxLayout#; |
| 68 | headWidgetLayout->setMargincxx . . $ QLayout#setMargin(d4f767463ce0a6b3).(0); |
| 69 | headWidgetLayout->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(1); |
| 70 | headWidgetLayout->setAlignmentcxx . . $ QLayoutItem#setAlignment(9d0000d583057bbf).(Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::AlignRightcxx . . $ Qt/AlignRight.); |
| 71 | |
| 72 | headWidgetLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(pushSave); |
| 73 | headWidget->setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(headWidgetLayout); |
| 74 | |
| 75 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists. = new QListWidgetcxx . . $ QListWidget#QListWidget(108f35f7aa7f3cf9).(); |
| 76 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->setAttributecxx . . $ QWidget#setAttribute(52fc7bf162518f7f).(Qtcxx . . $ Qt/::WA_MacShowFocusRectcxx . . $ Qt/WA_MacShowFocusRect., false); |
| 77 | |
| 78 | pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database. = new CollectionDBcxx . . $ CollectionDB#(); |
| 79 | pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->executeSqlcxx . . $ CollectionDB#executeSql(e1defb592416720d).( "PRAGMA synchronous = OFF;"cxx . . $ QString#QString(85c52e162fed56f9). ); |
| 80 | |
| 81 | updateListscxx . . $ PlaylistBrowser#updateLists(49f6e7a06ebc5aa8).(); |
| 82 | |
| 83 | headWidget->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 84 | mainLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(headWidget); |
| 85 | mainLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 86 | |
| 87 | mainLayout->setMargincxx . . $ QLayout#setMargin(d4f767463ce0a6b3).(0); |
| 88 | mainLayout->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(0); |
| 89 | |
| 90 | setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(400); |
| 91 | |
| 92 | pcxx . . $ PlaylistBrowser#p.->directorycxx . . $ PlaylistBrowsertPrivate#directory. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 93 | |
| 94 | setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(mainLayout); |
| 95 | |
| 96 | } |
| 97 | |
| 98 | PlaylistBrowsercxx . . $ PlaylistBrowser#::~cxx . . $ PlaylistBrowser#`~PlaylistBrowser`(ced63f7c635d850d).PlaylistBrowsercxx . . $ PlaylistBrowser#() |
| 99 | { |
| 100 | QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).; |
| 101 | //settings.setValue("",p->); |
| 102 | delete pcxx . . $ PlaylistBrowser#p.; |
| 103 | } |
| 104 | |
| 105 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::updateListscxx . . $ PlaylistBrowser#updateLists(49f6e7a06ebc5aa8).() |
| 106 | { |
| 107 | // Read config values |
| 108 | QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).; |
| 109 | pcxx . . $ PlaylistBrowser#p.->directorycxx . . $ PlaylistBrowsertPrivate#directory. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("editPlaylistRoot"cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QVariant#QVariant(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 110 | |
| 111 | // Insert dynamic lists |
| 112 | PlaylistWidgetcxx . . $ PlaylistWidget#* list; |
| 113 | QListWidgetItemcxx . . $ QListWidgetItem#* itm; |
| 114 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->clearcxx . . $ QListWidget#clear(49f6e7a06ebc5aa8).(); |
| 115 | |
| 116 | //Top Tracks List |
| 117 | list = new PlaylistWidgetcxx . . $ PlaylistWidget#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 118 | list->setNamecxx . . $ PlaylistWidget#setName(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Top Tracks")); |
| 119 | list->setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).("TopTracks"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 120 | list->setDescriptioncxx . . $ PlaylistWidget#setDescription(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Most played tracks")); |
| 121 | list->setRemovablecxx . . $ PlaylistWidget#setRemovable(b45ddcbc8423892c).(false); |
| 122 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(loadDatabaseList())); |
| 123 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(started()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(playDatabaseList())); |
| 124 | |
| 125 | itm = new QListWidgetItemcxx . . $ QListWidgetItem#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 126 | |
| 127 | itm->setSizeHintcxx . . $ QListWidgetItem#setSizeHint(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(0,70)); |
| 128 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->addItemcxx . . $ QListWidget#addItem(13c1c8ad030616f4).(itm); |
| 129 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->setItemWidgetcxx . . $ QListWidget#setItemWidget(52e0224c3872482c).(itm,list); |
| 130 | |
| 131 | //Last Tracks List |
| 132 | list = new PlaylistWidgetcxx . . $ PlaylistWidget#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 133 | list->setNamecxx . . $ PlaylistWidget#setName(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Last Tracks")); |
| 134 | list->setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).("LastTracks"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 135 | list->setDescriptioncxx . . $ PlaylistWidget#setDescription(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Recently played tracks")); |
| 136 | list->setRemovablecxx . . $ PlaylistWidget#setRemovable(b45ddcbc8423892c).(false); |
| 137 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(loadDatabaseList())); |
| 138 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(started()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(playDatabaseList())); |
| 139 | |
| 140 | itm = new QListWidgetItemcxx . . $ QListWidgetItem#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 141 | |
| 142 | itm->setSizeHintcxx . . $ QListWidgetItem#setSizeHint(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(0,70)); |
| 143 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->addItemcxx . . $ QListWidget#addItem(13c1c8ad030616f4).(itm); |
| 144 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->setItemWidgetcxx . . $ QListWidget#setItemWidget(52e0224c3872482c).(itm,list); |
| 145 | |
| 146 | //Favorites Tracks List |
| 147 | list = new PlaylistWidgetcxx . . $ PlaylistWidget#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 148 | list->setNamecxx . . $ PlaylistWidget#setName(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Favorites Tracks")); |
| 149 | list->setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).("FavoritesTracks"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 150 | list->setDescriptioncxx . . $ PlaylistWidget#setDescription(7df51288a9ebd664).(trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("High rated tracks")); |
| 151 | list->setRemovablecxx . . $ PlaylistWidget#setRemovable(b45ddcbc8423892c).(false); |
| 152 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(loadDatabaseList())); |
| 153 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(started()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(playDatabaseList())); |
| 154 | |
| 155 | itm = new QListWidgetItemcxx . . $ QListWidgetItem#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 156 | |
| 157 | itm->setSizeHintcxx . . $ QListWidgetItem#setSizeHint(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(0,70)); |
| 158 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->addItemcxx . . $ QListWidget#addItem(13c1c8ad030616f4).(itm); |
| 159 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->setItemWidgetcxx . . $ QListWidget#setItemWidget(52e0224c3872482c).(itm,list); |
| 160 | |
| 161 | // read stored lists |
| 162 | QListcxx . . $ QList#<QStringListcxx . . $ QStringList#> listData = pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->selectPlaylistDatacxx . . $ CollectionDB#selectPlaylistData(c58e6b6884db9162).(); |
| 163 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! ( QStringList data, listData) { |
| 164 | QStringcxx . . $ QString# name = datacxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 165 | int count = data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).1].toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 166 | int sum = data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2].toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 167 | QDateTimecxx . . $ QDateTime# date(QDateTimecxx . . $ QDateTime#::fromTime_tcxx . . $ QDateTime#fromTime_t(686234f0e09491be).( data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3].toIntcxx . . $ QString#toInt(d7972accae11ee1f).() )); |
| 168 | |
| 169 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "add playlist: " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). name; |
| 170 | list = new PlaylistWidgetcxx . . $ PlaylistWidget#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 171 | list->setNamecxx . . $ PlaylistWidget#setName(7df51288a9ebd664).( namecxx . . $ QString#QString(132dd6869045752b). ); |
| 172 | list->setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).( name ); |
| 173 | list->setDescriptioncxx . . $ PlaylistWidget#setDescription(7df51288a9ebd664).( date.toStringcxx . . $ QDateTime#toString(5555d9024dcf93fb).("yyyy-MM-dd"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107). " " |
| 174 | +cxx . . $ operator+(fab9b4f80031f353). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(count) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("tracks") +cxx . . $ operator+(3d22f08efddf8107). " " |
| 175 | +cxx . . $ operator+(fab9b4f80031f353). Trackcxx . . $ Track#::prettyTimecxx . . $ Track#prettyTime(dbfc6ea7cdb6729e).( sum ,true) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("hours")); |
| 176 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(loadDatabaseList())); |
| 177 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(started()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(playDatabaseList())); |
| 178 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(list,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(deleted()),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(removeDatabaseList())); |
| 179 | |
| 180 | itm = new QListWidgetItemcxx . . $ QListWidgetItem#(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.); |
| 181 | |
| 182 | itm->setSizeHintcxx . . $ QListWidgetItem#setSizeHint(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(0,70)); |
| 183 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->addItemcxx . . $ QListWidget#addItem(13c1c8ad030616f4).(itm); |
| 184 | pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->setItemWidgetcxx . . $ QListWidget#setItemWidget(52e0224c3872482c).(itm,list); |
| 185 | } |
| 186 | |
| 187 | //// read saved lists |
| 188 | //QDir rDir( p->directory ); |
| 189 | //rDir.setFilter(QDir::Files | QDir::NoDotDot | QDir::NoDot | QDir::Readable); |
| 190 | //QStringList filters; |
| 191 | // filters << "*.xspf"; |
| 192 | //rDir.setNameFilters(filters); |
| 193 | //QFileInfoList filelist = rDir.entryInfoList(); |
| 194 | |
| 195 | //Q_FOREACH (const QFileInfo fi, filelist) { |
| 196 | // if ( fi.isFile() ) { |
| 197 | // qDebug() << Q_FUNC_INFO << "add playlist: " << fi.fileName(); |
| 198 | // list = new PlaylistWidget(p->listPlaylists); |
| 199 | // list->setName(fi.fileName().replace(".xspf","")); |
| 200 | // list->setObjectName(fi.fileName()); |
| 201 | |
| 202 | // QPair<int,int> count = readFileValues( p->directory+"/"+fi.fileName()); |
| 203 | // list->setDescription( fi.lastModified().toString("yyyy-MM-dd") + " " |
| 204 | // + QString::number(count.first) + " " + tr("tracks") + " " |
| 205 | // + Track::prettyTime( count.second ,true) + " " + tr("hours")); |
| 206 | // connect(list,SIGNAL(activated()),this,SLOT(loadFileList())); |
| 207 | // connect(list,SIGNAL(started()),this,SLOT(playFileList())); |
| 208 | // connect(list,SIGNAL(deleted()),this,SLOT(removeFileList())); |
| 209 | |
| 210 | // itm = new QListWidgetItem(p->listPlaylists); |
| 211 | |
| 212 | // itm->setSizeHint(QSize(0,70)); |
| 213 | // p->listPlaylists->addItem(itm); |
| 214 | // p->listPlaylists->setItemWidget(itm,list); |
| 215 | // } |
| 216 | |
| 217 | //} |
| 218 | |
| 219 | |
| 220 | } |
| 221 | |
| 222 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::playDatabaseListcxx . . $ PlaylistBrowser#playDatabaseList(49f6e7a06ebc5aa8).() |
| 223 | { |
| 224 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 225 | |
| 226 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 227 | |
| 228 | onSelectionChangedcxx . . $ PlaylistBrowser#onSelectionChanged(fc4366e0c308bc3).(item); |
| 229 | |
| 230 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionStartedcxx . . $ PlaylistBrowser#selectionStarted(c2e0487a5277a49e).(selectedTrackscxx . . $ PlaylistBrowser#selectedTracks(90c909b7da9f26e2).()); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::loadDatabaseListcxx . . $ PlaylistBrowser#loadDatabaseList(49f6e7a06ebc5aa8).() |
| 235 | { |
| 236 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 237 | |
| 238 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 239 | onSelectionChangedcxx . . $ PlaylistBrowser#onSelectionChanged(fc4366e0c308bc3).(item); |
| 240 | |
| 241 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionChangedcxx . . $ PlaylistBrowser#selectionChanged(c2e0487a5277a49e).(selectedTrackscxx . . $ PlaylistBrowser#selectedTracks(90c909b7da9f26e2).()); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | |
| 246 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::removeDatabaseListcxx . . $ PlaylistBrowser#removeDatabaseList(49f6e7a06ebc5aa8).() |
| 247 | { |
| 248 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 249 | |
| 250 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 251 | |
| 252 | QStringcxx . . $ QString# senderName = item->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); |
| 253 | |
| 254 | pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->removePlaylistcxx . . $ CollectionDB#removePlaylist(7df51288a9ebd664).(senderNamecxx . . $ QString#QString(132dd6869045752b).); |
| 255 | updateListscxx . . $ PlaylistBrowser#updateLists(49f6e7a06ebc5aa8).(); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | QListcxx . . $ QList#<Trackcxx . . $ Track#*> PlaylistBrowsercxx . . $ PlaylistBrowser#::selectedTrackscxx . . $ PlaylistBrowser#selectedTracks(90c909b7da9f26e2).() |
| 260 | { |
| 261 | QStringcxx . . $ QString# senderName = pcxx . . $ PlaylistBrowser#p.->currentPlaylistcxx . . $ PlaylistBrowsertPrivate#currentPlaylist.->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); |
| 262 | QListcxx . . $ QList#<QStringListcxx . . $ QStringList#> selectedTagscxx . . $ QList#QList(ced63f7c635d850d).; |
| 263 | |
| 264 | //Retrieve songs from database |
| 265 | if (senderName ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "TopTracks") |
| 266 | selectedTags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->selectHotTrackscxx . . $ CollectionDB#selectHotTracks(c58e6b6884db9162).(); |
| 267 | else if (senderName ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "FavoritesTracks") |
| 268 | selectedTags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->selectFavoritesTrackscxx . . $ CollectionDB#selectFavoritesTracks(c58e6b6884db9162).(); |
| 269 | else if (senderName ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "LastTracks") |
| 270 | selectedTags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->selectLastTrackscxx . . $ CollectionDB#selectLastTracks(c58e6b6884db9162).(); |
| 271 | else |
| 272 | selectedTags =cxx . . $ QList#`operator=`(fb6690361a2f6b44). pcxx . . $ PlaylistBrowser#p.->databasecxx . . $ PlaylistBrowsertPrivate#database.->selectPlaylistTrackscxx . . $ CollectionDB#selectPlaylistTracks(b852ae6b10e970c6).(senderNamecxx . . $ QString#QString(132dd6869045752b).); |
| 273 | |
| 274 | QListcxx . . $ QList#<Trackcxx . . $ Track#*> trackscxx . . $ QList#QList(ced63f7c635d850d).; |
| 275 | |
| 276 | tracks.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 277 | |
| 278 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Song count: " <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). selectedTags.countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 279 | |
| 280 | //add tags to this track list |
| 281 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! ( QStringList tag, selectedTags) { |
| 282 | tracks.appendcxx . . $ QList#append(77d9f17553126ecb).( new Trackcxx . . $ Track#Track(631c0101495f0328).(tag)); |
| 283 | } |
| 284 | |
| 285 | return trackscxx . . $ QList#QList(88d75cd4b19cb2d1). ; |
| 286 | } |
| 287 | |
| 288 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::onSelectionChangedcxx . . $ PlaylistBrowser#onSelectionChanged(fc4366e0c308bc3).(PlaylistWidgetcxx . . $ PlaylistWidget#* item) |
| 289 | { |
| 290 | pcxx . . $ PlaylistBrowser#p.->currentPlaylistcxx . . $ PlaylistBrowsertPrivate#currentPlaylist. = item; |
| 291 | for (int d=0;d<pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->countcxx . . $ QListWidget#count(455f465bc33b4cdf).();d++) |
| 292 | ((PlaylistWidgetcxx . . $ PlaylistWidget#*)pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->itemWidgetcxx . . $ QListWidget#itemWidget(3462cd2a987f129b).(pcxx . . $ PlaylistBrowser#p.->listPlaylistscxx . . $ PlaylistBrowsertPrivate#listPlaylists.->itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(d)))->deactivatecxx . . $ PlaylistWidget#deactivate(49f6e7a06ebc5aa8).(); |
| 293 | |
| 294 | item->activatecxx . . $ PlaylistWidget#activate(49f6e7a06ebc5aa8).(); |
| 295 | } |
| 296 | |
| 297 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::onPushSavecxx . . $ PlaylistBrowser#onPushSave(49f6e7a06ebc5aa8).() |
| 298 | { |
| 299 | |
| 300 | // QFileDialog dialog(this); |
| 301 | // dialog.setDefaultSuffix("xspf"); |
| 302 | // QString fileName = dialog.getSaveFileName(this, |
| 303 | // tr("Save Play List"), p->directory, |
| 304 | // tr("Playlists (*.xspf);;All Files (*)")); |
| 305 | |
| 306 | // // Bad workaround for Linux (Mac and Windows work with defaultSuffix) |
| 307 | // if (!fileName.endsWith(".xspf")) |
| 308 | // fileName += ".xspf"; |
| 309 | |
| 310 | // emit savePlaylists(fileName); |
| 311 | |
| 312 | QInputDialogcxx . . $ QInputDialog#* dialog = new QInputDialogcxx . . $ QInputDialog#(this, Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::Dialogcxx . . $ Qt/Dialog.); |
| 313 | dialog->setWindowTitlecxx . . $ QWidget#setWindowTitle(3520e46b33348bf6).( trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Save Play List") ); |
| 314 | dialog->setLabelTextcxx . . $ QInputDialog#setLabelText(3520e46b33348bf6).( trcxx . . $ PlaylistBrowser#tr(75d9f1c324b4579d).("Enter a name for the new list") ); |
| 315 | dialog->resizecxx . . $ QWidget#resize(3e454b8ccf442868).(350,100); |
| 316 | dialog->execcxx . . $ QDialog#exec(b126dc7c1de90089).(); |
| 317 | QStringcxx . . $ QString# listName = dialog->textValuecxx . . $ QInputDialog#textValue(6ef7b6c27b00b43d).(); |
| 318 | if ( !listName.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() ) |
| 319 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! storePlaylistscxx . . $ PlaylistBrowser#storePlaylists(7df51288a9ebd664).(listNamecxx . . $ QString#QString(132dd6869045752b).); |
| 320 | } |
| 321 | |
| 322 | // obsolate: save list into files |
| 323 | |
| 324 | QListcxx . . $ QList#<Trackcxx . . $ Track#*> PlaylistBrowsercxx . . $ PlaylistBrowser#::readFileListcxx . . $ PlaylistBrowser#readFileList(30a9f07b54b5c495).(QStringcxx . . $ QString# filename) |
| 325 | { |
| 326 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).( filename ); |
| 327 | QListcxx . . $ QList#<Trackcxx . . $ Track#*> trackscxx . . $ QList#QList(ced63f7c635d850d).; |
| 328 | |
| 329 | tracks.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 330 | |
| 331 | if( file.opencxx . . $ QFile#open(dca164408be960c8).( QFilecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly. ) ) |
| 332 | { |
| 333 | QTextStreamcxx . . $ QTextStream# streamcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).( &file ); |
| 334 | |
| 335 | stream.setCodeccxx . . $ QTextStream#setCodec(1f30447839ed391).( QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("utf8") ); |
| 336 | QDomDocumentcxx . . $ QDomDocument# dcxx . . $ QDomDocument#QDomDocument(49f6e7a06ebc5aa8).; |
| 337 | if( !d.setContentcxx . . $ QDomDocument#setContent(5b338a9da9a4e0fe).(stream.readAllcxx . . $ QTextStream#readAll(4365c3963150523e).()) ) { qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Could not load XML\n"; return trackscxx . . $ QList#QList(88d75cd4b19cb2d1).; } |
| 338 | |
| 339 | QDomNodecxx . . $ QDomNode# n = d.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).( "playlist"cxx . . $ QString#QString(85c52e162fed56f9). ).namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).( "trackList"cxx . . $ QString#QString(85c52e162fed56f9). ).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).(); |
| 340 | |
| 341 | const QStringcxx . . $ QString# TRACKcxx . . $ QString#QString(85c52e162fed56f9).( "track" ); //so we don't construct the QStrings all the time |
| 342 | const QStringcxx . . $ QString# URLcxx . . $ QString#QString(85c52e162fed56f9).( "url" ); |
| 343 | const QStringcxx . . $ QString# CURRENTcxx . . $ QString#QString(85c52e162fed56f9).( "current" ); |
| 344 | const QStringcxx . . $ QString# NEXTcxx . . $ QString#QString(85c52e162fed56f9).( "next" ); |
| 345 | |
| 346 | |
| 347 | while( !n.isNullcxx . . $ QDomNode#isNull(50ce9a9e25b4a850).() ) |
| 348 | { |
| 349 | if( n.nodeNamecxx . . $ QDomNode#nodeName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). TRACK ) { |
| 350 | const QDomElementcxx . . $ QDomElement# e = n.toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).(); |
| 351 | if( e.isNullcxx . . $ QDomNode#isNull(50ce9a9e25b4a850).() ) { |
| 352 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Element '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). n.nodeNamecxx . . $ QDomNode#nodeName(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "' is null, skipping."; |
| 353 | continue; |
| 354 | } |
| 355 | |
| 356 | //qDebug() << "Add from xml url='" << e.attribute( URL ); |
| 357 | Trackcxx . . $ Track# *track = new Trackcxx . . $ Track#Track(49f6e7a06ebc5aa8).(); |
| 358 | track->setUrlcxx . . $ Track#setUrl(fe09fe9c2ffe9947).( QUrlcxx . . $ QUrl#::fromLocalFilecxx . . $ QUrl#fromLocalFile(daf4b0201622af21).(e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("location"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).())); |
| 359 | track->setArtistcxx . . $ Track#setArtist(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("creator"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).()); |
| 360 | track->setTitlecxx . . $ Track#setTitle(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("title"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).()); |
| 361 | track->setAlbumcxx . . $ Track#setAlbum(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("album"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).()); |
| 362 | track->setTracknumbercxx . . $ Track#setTracknumber(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("trackNum"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).()); |
| 363 | track->setGenrecxx . . $ Track#setGenre(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).( "genre"cxx . . $ QString#QString(85c52e162fed56f9). )); |
| 364 | track->setYearcxx . . $ Track#setYear(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).( "year"cxx . . $ QString#QString(85c52e162fed56f9). )); |
| 365 | track->setLengthcxx . . $ Track#setLength(7df51288a9ebd664).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("duration"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).()); |
| 366 | track->setCountercxx . . $ Track#setCounter(7df51288a9ebd664).("0"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 367 | if ( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).( "isAutoDjSelection"cxx . . $ QString#QString(85c52e162fed56f9). ) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."1" ) |
| 368 | track->setFlagscxx . . $ Track#setFlags(e362d3aff087b916).( track->flagscxx . . $ Track#flags(6ce10c0cf6a51a1f).() |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). Trackcxx . . $ Track#::isAutoDjSelectioncxx . . $ Track#isAutoDjSelection. ); |
| 369 | if ( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).( "isOnFirstPlayer"cxx . . $ QString#QString(85c52e162fed56f9). ) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."1" ) |
| 370 | track->setFlagscxx . . $ Track#setFlags(e362d3aff087b916).( track->flagscxx . . $ Track#flags(6ce10c0cf6a51a1f).() |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). Trackcxx . . $ Track#::isOnFirstPlayercxx . . $ Track#isOnFirstPlayer. ); |
| 371 | if ( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).( "isOnSecondPlayer"cxx . . $ QString#QString(85c52e162fed56f9). ) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."1" ) |
| 372 | track->setFlagscxx . . $ Track#setFlags(e362d3aff087b916).( track->flagscxx . . $ Track#flags(6ce10c0cf6a51a1f).() |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). Trackcxx . . $ Track#::isOnSecondPlayercxx . . $ Track#isOnSecondPlayer. ); |
| 373 | track->setRatecxx . . $ Track#setRate(d4f767463ce0a6b3).( e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("extension"cxx . . $ QString#QString(85c52e162fed56f9).).toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).().attributecxx . . $ QDomElement#attribute(11b1083083847b8e).("Rating"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).() ); |
| 374 | |
| 375 | tracks.appendcxx . . $ QList#append(77d9f17553126ecb).(track); |
| 376 | |
| 377 | } |
| 378 | n =cxx . . $ QDomNode#`operator=`(942bdfb15aedefaf). n.nextSiblingcxx . . $ QDomNode#nextSibling(573df4c535fc6ee7).(); |
| 379 | } |
| 380 | } |
| 381 | file.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); |
| 382 | |
| 383 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "End " <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`!; |
| 384 | |
| 385 | return trackscxx . . $ QList#QList(88d75cd4b19cb2d1).; |
| 386 | } |
| 387 | |
| 388 | QPaircxx . . $ QPair#<int,int> PlaylistBrowsercxx . . $ PlaylistBrowser#::readFileValuescxx . . $ PlaylistBrowser#readFileValues(e3cc6c6bb6857fbc).(QStringcxx . . $ QString# filename) |
| 389 | { |
| 390 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).( filename ); |
| 391 | QPaircxx . . $ QPair#<int,int> paircxx . . $ QPair#QPair(7d94e3e767b7b77f).; |
| 392 | |
| 393 | int duration=0; |
| 394 | int count=0; |
| 395 | |
| 396 | if( file.opencxx . . $ QFile#open(dca164408be960c8).( QFilecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly. ) ) |
| 397 | { |
| 398 | QTextStreamcxx . . $ QTextStream# streamcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).( &file ); |
| 399 | |
| 400 | stream.setCodeccxx . . $ QTextStream#setCodec(1f30447839ed391).( QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("utf8") ); |
| 401 | QDomDocumentcxx . . $ QDomDocument# dcxx . . $ QDomDocument#QDomDocument(49f6e7a06ebc5aa8).; |
| 402 | if( !d.setContentcxx . . $ QDomDocument#setContent(5b338a9da9a4e0fe).(stream.readAllcxx . . $ QTextStream#readAll(4365c3963150523e).()) ) { qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Could not load XML\n"; return pair; } |
| 403 | |
| 404 | QDomNodecxx . . $ QDomNode# n = d.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).( "playlist"cxx . . $ QString#QString(85c52e162fed56f9). ).namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).( "trackList"cxx . . $ QString#QString(85c52e162fed56f9). ).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).(); |
| 405 | |
| 406 | const QStringcxx . . $ QString# TRACKcxx . . $ QString#QString(85c52e162fed56f9).( "track" ); |
| 407 | |
| 408 | |
| 409 | while( !n.isNullcxx . . $ QDomNode#isNull(50ce9a9e25b4a850).() ) |
| 410 | { |
| 411 | if( n.nodeNamecxx . . $ QDomNode#nodeName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). TRACK ) { |
| 412 | const QDomElementcxx . . $ QDomElement# e = n.toElementcxx . . $ QDomNode#toElement(654df8c29726cab1).(); |
| 413 | if( e.isNullcxx . . $ QDomNode#isNull(50ce9a9e25b4a850).() ) { |
| 414 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Element '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). n.nodeNamecxx . . $ QDomNode#nodeName(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "' is null, skipping."; |
| 415 | continue; |
| 416 | } |
| 417 | |
| 418 | duration+= e.namedItemcxx . . $ QDomNode#namedItem(e7ddab27ad92952b).("duration"cxx . . $ QString#QString(85c52e162fed56f9).).firstChildcxx . . $ QDomNode#firstChild(573df4c535fc6ee7).().nodeValuecxx . . $ QDomNode#nodeValue(6ef7b6c27b00b43d).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 419 | count++; |
| 420 | |
| 421 | } |
| 422 | n =cxx . . $ QDomNode#`operator=`(942bdfb15aedefaf). n.nextSiblingcxx . . $ QDomNode#nextSibling(573df4c535fc6ee7).(); |
| 423 | } |
| 424 | } |
| 425 | file.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); |
| 426 | |
| 427 | pair.firstcxx . . $ QPair#first. = count; |
| 428 | pair.secondcxx . . $ QPair#second. = duration; |
| 429 | |
| 430 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "End " <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`!; |
| 431 | |
| 432 | return pair; |
| 433 | } |
| 434 | |
| 435 | |
| 436 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::playFileListcxx . . $ PlaylistBrowser#playFileList(49f6e7a06ebc5aa8).() |
| 437 | { |
| 438 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 439 | |
| 440 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 441 | |
| 442 | onSelectionChangedcxx . . $ PlaylistBrowser#onSelectionChanged(fc4366e0c308bc3).(item); |
| 443 | |
| 444 | QStringcxx . . $ QString# senderName = item->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); |
| 445 | |
| 446 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionStartedcxx . . $ PlaylistBrowser#selectionStarted(c2e0487a5277a49e).( readFileListcxx . . $ PlaylistBrowser#readFileList(30a9f07b54b5c495).( pcxx . . $ PlaylistBrowser#p.->directorycxx . . $ PlaylistBrowsertPrivate#directory.+cxx . . $ operator+(3d22f08efddf8107)."/"+cxx . . $ operator+(fab9b4f80031f353).senderName) ); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::loadFileListcxx . . $ PlaylistBrowser#loadFileList(49f6e7a06ebc5aa8).() |
| 451 | { |
| 452 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 453 | |
| 454 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 455 | |
| 456 | onSelectionChangedcxx . . $ PlaylistBrowser#onSelectionChanged(fc4366e0c308bc3).(item); |
| 457 | |
| 458 | QStringcxx . . $ QString# senderName = item->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); |
| 459 | |
| 460 | //Retrieve songs from file |
| 461 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! selectionChangedcxx . . $ PlaylistBrowser#selectionChanged(c2e0487a5277a49e).( readFileListcxx . . $ PlaylistBrowser#readFileList(30a9f07b54b5c495).( pcxx . . $ PlaylistBrowser#p.->directorycxx . . $ PlaylistBrowsertPrivate#directory.+cxx . . $ operator+(3d22f08efddf8107)."/"+cxx . . $ operator+(fab9b4f80031f353).senderName) ); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | void PlaylistBrowsercxx . . $ PlaylistBrowser#::removeFileListcxx . . $ PlaylistBrowser#removeFileList(49f6e7a06ebc5aa8).() |
| 466 | { |
| 467 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). Q_FUNC_INFOcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:240:11`! ; |
| 468 | |
| 469 | if(PlaylistWidgetcxx . . $ PlaylistWidget#* item = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<PlaylistWidgetcxx . . $ PlaylistWidget#*>(QObjectcxx . . $ QObject#::sendercxx . . $ QObject#sender(2dbb680a34285c44).())){ |
| 470 | |
| 471 | QStringcxx . . $ QString# senderName = item->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); |
| 472 | |
| 473 | QFilecxx . . $ QFile#::removecxx . . $ QFile#remove(e1defb592416720d).( pcxx . . $ PlaylistBrowser#p.->directorycxx . . $ PlaylistBrowsertPrivate#directory.+cxx . . $ operator+(3d22f08efddf8107)."/"+cxx . . $ operator+(fab9b4f80031f353).senderName ); |
| 474 | updateListscxx . . $ PlaylistBrowser#updateLists(49f6e7a06ebc5aa8).(); |
| 475 | } |
| 476 | } |