[vlc-commits] [Git][videolan/vlc][master] qt/covergenerator: Return the proper fileName directly

Jean-Baptiste Kempf gitlab at videolan.org
Sat Jun 19 17:45:37 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
2fc48e91 by Benjamin Arnaud at 2021-06-19T16:48:48+00:00
qt/covergenerator: Return the proper fileName directly

- - - - -


4 changed files:

- modules/gui/qt/medialibrary/mlgenremodel.cpp
- modules/gui/qt/medialibrary/mlgrouplistmodel.cpp
- modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
- modules/gui/qt/util/covergenerator.cpp


Changes:

=====================================
modules/gui/qt/medialibrary/mlgenremodel.cpp
=====================================
@@ -176,9 +176,7 @@ void MLGenreModel::onCover()
 
     MLGenre * genre = static_cast<MLGenre *> (item);
 
-    QString fileName = QUrl::fromLocalFile(generator->takeResult()).toString();
-
-    genre->setCover(fileName);
+    genre->setCover(generator->takeResult());
 
     genre->setGenerator(nullptr);
 


=====================================
modules/gui/qt/medialibrary/mlgrouplistmodel.cpp
=====================================
@@ -295,9 +295,7 @@ void MLGroupListModel::onCover()
 
     MLGroup * group = static_cast<MLGroup *> (item);
 
-    QString fileName = QUrl::fromLocalFile(generator->takeResult()).toString();
-
-    group->setCover(fileName);
+    group->setCover(generator->takeResult());
 
     group->setGenerator(nullptr);
 


=====================================
modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
=====================================
@@ -320,9 +320,7 @@ void MLPlaylistListModel::onCover()
 
     MLPlaylist * playlist = static_cast<MLPlaylist *> (item);
 
-    QString fileName = QUrl::fromLocalFile(generator->takeResult()).toString();
-
-    playlist->setCover(fileName);
+    playlist->setCover(generator->takeResult());
 
     playlist->setGenerator(nullptr);
 


=====================================
modules/gui/qt/util/covergenerator.cpp
=====================================
@@ -141,7 +141,7 @@ QString CoverGenerator::execute() /* override */
 
     if (dir.exists(fileName))
     {
-        return fileName;
+        return QUrl::fromLocalFile(fileName).toString();
     }
 
     QStringList thumbnails;
@@ -215,7 +215,7 @@ QString CoverGenerator::execute() /* override */
 
     image.save(fileName, "jpg");
 
-    return fileName;
+    return QUrl::fromLocalFile(fileName).toString();
 }
 
 //-------------------------------------------------------------------------------------------------



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2fc48e91884c2839ebf3876bacd04b1197716083

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2fc48e91884c2839ebf3876bacd04b1197716083
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list