comparison src/gui/window.cc @ 135:0a458cb26ff4

filesystem: move to using std::filesystem after C++17 switch old compilers will croak compiling this, but it's not like we *really* need to support them (they probably croak compiling Qt as well)
author Paper <mrpapersonic@gmail.com>
date Thu, 09 Nov 2023 18:01:56 -0500
parents 39521c47c7a3
children 28842a8d0c6b
comparison
equal deleted inserted replaced
134:54c9d36207db 135:0a458cb26ff4
62 setCentralWidget(main_widget.get()); 62 setCentralWidget(main_widget.get());
63 63
64 CreateBars(); 64 CreateBars();
65 65
66 QTimer* timer = new QTimer(this); 66 QTimer* timer = new QTimer(this);
67
68 /* this is very very stinky */
67 connect(timer, &QTimer::timeout, this, [this] { 69 connect(timer, &QTimer::timeout, this, [this] {
68 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING))); 70 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING)));
69 71
70 Filesystem::Path p = Track::Media::GetCurrentPlaying(); 72 std::filesystem::path path = Track::Media::GetCurrentPlaying();
71 std::unordered_map<std::string, std::string> elements = Track::Media::GetFileElements(p); 73 std::unordered_map<std::string, std::string> elements = Track::Media::GetFileElements(path);
72 int id = Anime::db.GetAnimeFromTitle(elements["title"]); 74 int id = Anime::db.GetAnimeFromTitle(elements["title"]);
73 if (id <= 0) { 75 if (id <= 0) {
74 page->SetDefault(); 76 page->SetDefault();
75 return; 77 return;
76 } 78 }