Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/collections/db/sql/SqlCollectionLocation.cpp
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #define DEBUG_PREFIX "SqlCollectionLocation" | 20 | #define DEBUG_PREFIX "SqlCollectionLocation" | ||
21 | 21 | | |||
22 | #include "SqlCollectionLocation.h" | 22 | #include "SqlCollectionLocation.h" | ||
23 | 23 | | |||
24 | #include "MetaTagLib.h" // for getting the uid | 24 | #include "MetaTagLib.h" // for getting the uid | ||
25 | #include "core/collections/CollectionLocationDelegate.h" | 25 | #include "core/collections/CollectionLocationDelegate.h" | ||
26 | #include <core/storage/SqlStorage.h> | 26 | #include <core/storage/SqlStorage.h> | ||
27 | #include "core/interfaces/Logger.h" | 27 | #include "core/logger/Logger.h" | ||
28 | #include "core/support/Components.h" | 28 | #include "core/support/Components.h" | ||
29 | #include "core/support/Debug.h" | 29 | #include "core/support/Debug.h" | ||
30 | #include "core/meta/Meta.h" | 30 | #include "core/meta/Meta.h" | ||
31 | #include "core/meta/support/MetaUtility.h" | 31 | #include "core/meta/support/MetaUtility.h" | ||
32 | #include "core/transcoding/TranscodingController.h" | 32 | #include "core/transcoding/TranscodingController.h" | ||
33 | #include "core-impl/collections/db/MountPointManager.h" | 33 | #include "core-impl/collections/db/MountPointManager.h" | ||
34 | #include "core-impl/collections/db/sql/SqlCollection.h" | 34 | #include "core-impl/collections/db/sql/SqlCollection.h" | ||
35 | #include "core-impl/collections/db/sql/SqlMeta.h" | 35 | #include "core-impl/collections/db/sql/SqlMeta.h" | ||
▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Line(s) | |||||
472 | SqlCollectionLocation::copyUrlsToCollection( const QMap<Meta::TrackPtr, QUrl> &sources, | 472 | SqlCollectionLocation::copyUrlsToCollection( const QMap<Meta::TrackPtr, QUrl> &sources, | ||
473 | const Transcoding::Configuration &configuration ) | 473 | const Transcoding::Configuration &configuration ) | ||
474 | { | 474 | { | ||
475 | DEBUG_BLOCK | 475 | DEBUG_BLOCK | ||
476 | m_sources = sources; | 476 | m_sources = sources; | ||
477 | 477 | | |||
478 | QString statusBarTxt = operationInProgressText( configuration, sources.count() ); | 478 | QString statusBarTxt = operationInProgressText( configuration, sources.count() ); | ||
479 | m_transferjob = new TransferJob( this, configuration ); | 479 | m_transferjob = new TransferJob( this, configuration ); | ||
480 | Amarok::Components::logger()->newProgressOperation( m_transferjob, statusBarTxt, this, | 480 | Amarok::Logger::newProgressOperation( m_transferjob, statusBarTxt, this, | ||
481 | &SqlCollectionLocation::slotTransferJobAborted ); | 481 | &SqlCollectionLocation::slotTransferJobAborted ); | ||
482 | connect( m_transferjob, &Collections::TransferJob::result, | 482 | connect( m_transferjob, &Collections::TransferJob::result, | ||
483 | this, &SqlCollectionLocation::slotTransferJobFinished ); | 483 | this, &SqlCollectionLocation::slotTransferJobFinished ); | ||
484 | m_transferjob->start(); | 484 | m_transferjob->start(); | ||
485 | } | 485 | } | ||
486 | 486 | | |||
487 | void | 487 | void | ||
488 | SqlCollectionLocation::removeUrlsFromCollection( const Meta::TrackList &sources ) | 488 | SqlCollectionLocation::removeUrlsFromCollection( const Meta::TrackList &sources ) | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 653 | { | |||
654 | if( QFile::exists( srcMoodFile.toLocalFile() ) ) | 654 | if( QFile::exists( srcMoodFile.toLocalFile() ) ) | ||
655 | KIO::del( srcMoodFile, KIO::HideProgressInfo ); | 655 | KIO::del( srcMoodFile, KIO::HideProgressInfo ); | ||
656 | 656 | | |||
657 | connect( job, &KIO::DeleteJob::result, this, &SqlCollectionLocation::slotRemoveJobFinished ); | 657 | connect( job, &KIO::DeleteJob::result, this, &SqlCollectionLocation::slotRemoveJobFinished ); | ||
658 | QString name = track->prettyName(); | 658 | QString name = track->prettyName(); | ||
659 | if( track->artist() ) | 659 | if( track->artist() ) | ||
660 | name = QString( "%1 - %2" ).arg( track->artist()->name(), track->prettyName() ); | 660 | name = QString( "%1 - %2" ).arg( track->artist()->name(), track->prettyName() ); | ||
661 | 661 | | |||
662 | Amarok::Components::logger()->newProgressOperation( job, i18n( "Removing: %1", name ) ); | 662 | Amarok::Logger::newProgressOperation( job, i18n( "Removing: %1", name ) ); | ||
663 | m_removejobs.insert( job, track ); | 663 | m_removejobs.insert( job, track ); | ||
664 | return true; | 664 | return true; | ||
665 | } | 665 | } | ||
666 | break; | 666 | break; | ||
667 | } | 667 | } | ||
668 | return false; | 668 | return false; | ||
669 | } | 669 | } | ||
670 | 670 | | |||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |