mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 13:21:52 +02:00
save/restore folder when loading playlists
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "LoadXSPFDialog.h"
|
||||
#include "tomahawksettings.h"
|
||||
|
||||
#include "ui_LoadXSPFDialog.h"
|
||||
#include <QFileDialog>
|
||||
@@ -44,7 +45,10 @@ LoadXSPFDialog::~LoadXSPFDialog()
|
||||
void
|
||||
LoadXSPFDialog::getLocalFile()
|
||||
{
|
||||
QString url = QFileDialog::getOpenFileName( this, tr( "Load XSPF File" ), QDir::homePath(), tr( "XSPF Files (*.xspf)" ) );
|
||||
const QString path = TomahawkSettings::instance()->importXspfPath();
|
||||
QString url = QFileDialog::getOpenFileName( this, tr( "Load XSPF File" ), path, tr( "XSPF Files (*.xspf)" ) );
|
||||
TomahawkSettings::instance()->setImportXspfPath( QFileInfo( url ).absoluteDir().absolutePath() );
|
||||
|
||||
m_ui->lineEdit->setText( url );
|
||||
}
|
||||
|
||||
|
@@ -1121,3 +1121,20 @@ TomahawkSettings::updateIndex()
|
||||
DatabaseCommand* cmd = new DatabaseCommand_UpdateSearchIndex();
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
TomahawkSettings::importXspfPath() const
|
||||
{
|
||||
if ( contains( "importXspfPath" ) )
|
||||
return value( "importXspfPath" ).toString();
|
||||
else
|
||||
return QDir::homePath();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::setImportXspfPath( const QString& path )
|
||||
{
|
||||
setValue( "importXspfPath", path );
|
||||
}
|
||||
|
@@ -198,6 +198,9 @@ public:
|
||||
PrivateListeningMode privateListeningMode() const;
|
||||
void setPrivateListeningMode( PrivateListeningMode mode );
|
||||
|
||||
void setImportXspfPath( const QString& path );
|
||||
QString importXspfPath() const;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
|
||||
|
Reference in New Issue
Block a user