Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/collections/umscollection/UmsCollectionLocation.cpp
Show All 12 Lines | |||||
13 | * You should have received a copy of the GNU General Public License along with * | 13 | * You should have received a copy of the GNU General Public License along with * | ||
14 | * this program. If not, see <http://www.gnu.org/licenses/>. * | 14 | * this program. If not, see <http://www.gnu.org/licenses/>. * | ||
15 | ****************************************************************************************/ | 15 | ****************************************************************************************/ | ||
16 | 16 | | |||
17 | #include "UmsCollectionLocation.h" | 17 | #include "UmsCollectionLocation.h" | ||
18 | 18 | | |||
19 | #include "core/support/Components.h" | 19 | #include "core/support/Components.h" | ||
20 | #include "core/support/Debug.h" | 20 | #include "core/support/Debug.h" | ||
21 | #include "core/interfaces/Logger.h" | 21 | #include "core/logger/Logger.h" | ||
22 | #include "core/transcoding/TranscodingController.h" | 22 | #include "core/transcoding/TranscodingController.h" | ||
23 | #include "core-impl/meta/file/File.h" | 23 | #include "core-impl/meta/file/File.h" | ||
24 | #include "transcoding/TranscodingJob.h" | 24 | #include "transcoding/TranscodingJob.h" | ||
25 | 25 | | |||
26 | #include <QDir> | 26 | #include <QDir> | ||
27 | #include <QUrl> | 27 | #include <QUrl> | ||
28 | 28 | | |||
29 | #include <KIO/CopyJob> | 29 | #include <KIO/CopyJob> | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 72 | { | |||
102 | connect( transferJob, &UmsTransferJob::sourceFileTransferDone, | 102 | connect( transferJob, &UmsTransferJob::sourceFileTransferDone, | ||
103 | this, &UmsCollectionLocation::slotTrackTransferred ); | 103 | this, &UmsCollectionLocation::slotTrackTransferred ); | ||
104 | connect( transferJob, &UmsTransferJob::fileTransferDone, | 104 | connect( transferJob, &UmsTransferJob::fileTransferDone, | ||
105 | m_umsCollection, &UmsCollection::slotTrackAdded ); | 105 | m_umsCollection, &UmsCollection::slotTrackAdded ); | ||
106 | connect( transferJob, &UmsTransferJob::finished, | 106 | connect( transferJob, &UmsTransferJob::finished, | ||
107 | this, &UmsCollectionLocation::slotCopyOperationFinished ); | 107 | this, &UmsCollectionLocation::slotCopyOperationFinished ); | ||
108 | 108 | | |||
109 | QString loggerText = operationInProgressText( configuration, sources.count(), m_umsCollection->prettyName() ); | 109 | QString loggerText = operationInProgressText( configuration, sources.count(), m_umsCollection->prettyName() ); | ||
110 | Amarok::Components::logger()->newProgressOperation( transferJob, loggerText, transferJob, | 110 | Amarok::Logger::newProgressOperation( transferJob, loggerText, transferJob, | ||
111 | &UmsTransferJob::slotCancel ); | 111 | &UmsTransferJob::slotCancel ); | ||
112 | transferJob->start(); | 112 | transferJob->start(); | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | void | 115 | void | ||
116 | UmsCollectionLocation::removeUrlsFromCollection( const Meta::TrackList &sources ) | 116 | UmsCollectionLocation::removeUrlsFromCollection( const Meta::TrackList &sources ) | ||
117 | { | 117 | { | ||
118 | QList<QUrl> sourceUrls; | 118 | QList<QUrl> sourceUrls; | ||
119 | foreach( const Meta::TrackPtr track, sources ) | 119 | foreach( const Meta::TrackPtr track, sources ) | ||
120 | { | 120 | { | ||
121 | QUrl trackUrl = track->playableUrl(); | 121 | QUrl trackUrl = track->playableUrl(); | ||
122 | m_sourceUrlToTrackMap.insert( trackUrl, track ); | 122 | m_sourceUrlToTrackMap.insert( trackUrl, track ); | ||
123 | sourceUrls.append( trackUrl ); | 123 | sourceUrls.append( trackUrl ); | ||
124 | } | 124 | } | ||
125 | 125 | | |||
126 | QString loggerText = i18np( "Removing one track from %2", | 126 | QString loggerText = i18np( "Removing one track from %2", | ||
127 | "Removing %1 tracks from %2", sourceUrls.count(), | 127 | "Removing %1 tracks from %2", sourceUrls.count(), | ||
128 | m_umsCollection->prettyName() ); | 128 | m_umsCollection->prettyName() ); | ||
129 | KIO::DeleteJob *delJob = KIO::del( sourceUrls, KIO::HideProgressInfo ); | 129 | KIO::DeleteJob *delJob = KIO::del( sourceUrls, KIO::HideProgressInfo ); | ||
130 | Amarok::Components::logger()->newProgressOperation( delJob, loggerText, delJob, &KIO::DeleteJob::kill, Qt::AutoConnection, KIO::Job::Quietly ); | 130 | Amarok::Logger::newProgressOperation( delJob, loggerText, delJob, &KIO::DeleteJob::kill, Qt::AutoConnection, KIO::Job::Quietly ); | ||
131 | 131 | | |||
132 | connect( delJob, &KIO::DeleteJob::finished, this, &UmsCollectionLocation::slotRemoveOperationFinished ); | 132 | connect( delJob, &KIO::DeleteJob::finished, this, &UmsCollectionLocation::slotRemoveOperationFinished ); | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | void | 135 | void | ||
136 | UmsCollectionLocation::slotTrackTransferred( const QUrl &sourceTrackUrl ) | 136 | UmsCollectionLocation::slotTrackTransferred( const QUrl &sourceTrackUrl ) | ||
137 | { | 137 | { | ||
138 | Meta::TrackPtr sourceTrack = m_sourceUrlToTrackMap.value( sourceTrackUrl ); | 138 | Meta::TrackPtr sourceTrack = m_sourceUrlToTrackMap.value( sourceTrackUrl ); | ||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |