Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/collections/umscollection/UmsCollectionLocation.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 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::Components::logger()->newProgressOperation( transferJob, loggerText, transferJob, | ||
111 | SLOT(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, SLOT(kill()) ); | 130 | Amarok::Components::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 |