Skip to content

Commit

Permalink
qt: use ModelRecoveryAgent for main playlist list model
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzun authored and fcartegnie committed Oct 21, 2024
1 parent 3ca309e commit e009cc4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/gui/qt/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ extern "C" char **environ;
#include "maininterface/compositor.hpp"
#include "util/vlctick.hpp"
#include "util/shared_input_item.hpp"
#include "util/model_recovery_agent.hpp"
#include "network/networkmediamodel.hpp"
#include "playlist/playlist_common.hpp"
#include "playlist/playlist_item.hpp"
Expand Down Expand Up @@ -1017,6 +1018,15 @@ static void *Thread( void *obj )
p_intf->p_mainPlayerController = new PlayerController(p_intf);
p_intf->p_mainPlaylistController = new vlc::playlist::PlaylistController(p_intf->p_playlist);

std::unique_ptr<ModelRecoveryAgent> playlistModelRecoveryAgent;
QMetaObject::invokeMethod(&app, [&playlistModelRecoveryAgent, p_intf]() {
try {
playlistModelRecoveryAgent = std::make_unique<ModelRecoveryAgent>(p_intf->mainSettings,
QStringLiteral("Playlist"),
p_intf->p_mainPlaylistController);
} catch (...){ }
}, Qt::QueuedConnection);

/* Create the normal interface in non-DP mode */
#ifdef _WIN32
p_intf->p_mi = new MainCtxWin32(p_intf);
Expand Down Expand Up @@ -1096,6 +1106,8 @@ static void *Thread( void *obj )
app.exec();

msg_Dbg( p_intf, "QApp exec() finished" );

playlistModelRecoveryAgent.reset();
return ThreadCleanup( p_intf, CLEANUP_APP_TERMINATED );
}

Expand Down

0 comments on commit e009cc4

Please sign in to comment.