mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 03:41:27 +02:00
* Let MetadataEditor call Result's doneEditing() method.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "database/DatabaseCommand_Resolve.h"
|
||||
#include "database/DatabaseCommand_AllTracks.h"
|
||||
#include "database/DatabaseCommand_AddFiles.h"
|
||||
#include "filemetadata/MetadataEditor.h"
|
||||
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
@@ -211,7 +212,13 @@ Result::toVariant() const
|
||||
QString
|
||||
Result::toString() const
|
||||
{
|
||||
return QString( "Result(%1) %2\t%3 - %4 %5" ).arg( id() ).arg( score() ).arg( artist().isNull() ? QString() : artist()->name() ).arg( track() ).arg( url() );
|
||||
return QString( "Result(%1, score: %2) %3 - %4%5 (%6)" )
|
||||
.arg( id() )
|
||||
.arg( score() )
|
||||
.arg( artist().isNull() ? QString() : artist()->name() )
|
||||
.arg( track() )
|
||||
.arg( album().isNull() || album()->name().isEmpty() ? "" : QString( " on %1" ).arg( album()->name() ) )
|
||||
.arg( url() );
|
||||
}
|
||||
|
||||
|
||||
@@ -363,3 +370,11 @@ Result::setResolvedBy( Tomahawk::Resolver* resolver )
|
||||
{
|
||||
m_resolvedBy = QWeakPointer< Tomahawk::Resolver >( resolver );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Result::doneEditing()
|
||||
{
|
||||
m_query.clear();
|
||||
emit updated();
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "DllMacro.h"
|
||||
|
||||
class MetadataEditor;
|
||||
class DatabaseCommand_Resolve;
|
||||
class DatabaseCommand_AllTracks;
|
||||
class DatabaseCommand_AddFiles;
|
||||
@@ -44,6 +45,7 @@ class DLLEXPORT Result : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class ::MetadataEditor;
|
||||
friend class ::DatabaseCommand_Resolve;
|
||||
friend class ::DatabaseCommand_AllTracks;
|
||||
friend class ::DatabaseCommand_AddFiles;
|
||||
@@ -124,12 +126,14 @@ public slots:
|
||||
signals:
|
||||
// emitted when the collection this result comes from is going offline/online:
|
||||
void statusChanged();
|
||||
void updated();
|
||||
|
||||
private slots:
|
||||
void onOffline();
|
||||
void onOnline();
|
||||
|
||||
void onResolverRemoved( Tomahawk::Resolver* resolver );
|
||||
void doneEditing();
|
||||
|
||||
private:
|
||||
// private constructor
|
||||
|
Reference in New Issue
Block a user