Skip to content

Commit dc9ec86

Browse files
committed
core: remove filetype checking as qt will do this for us
1 parent 8c56cf9 commit dc9ec86

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/core/iconimageprovider.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <qsize.h>
1010
#include <qstring.h>
1111

12-
constexpr std::array<QAnyStringView, 2> ICON_FILETYPES = {"png", "xpm"}; // currently cannot open svg file
13-
1412
QPixmap
1513
IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& requestedSize) {
1614
QString iconName;
@@ -34,12 +32,7 @@ IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& re
3432

3533
auto icon = QIcon::fromTheme(iconName);
3634
if (icon.isNull() && !fallbackName.isEmpty()) icon = QIcon::fromTheme(fallbackName);
37-
if (icon.isNull() && !path.isEmpty()) {
38-
for (const auto& iconFiletype : ICON_FILETYPES){
39-
icon = QPixmap(QString("%1.%2").arg(path, iconFiletype));
40-
if (!icon.isNull()) break;
41-
}
42-
}
35+
if (icon.isNull() && !path.isEmpty()) icon = QPixmap(path);
4336

4437
auto targetSize = requestedSize.isValid() ? requestedSize : QSize(100, 100);
4538
if (targetSize.width() == 0 || targetSize.height() == 0) targetSize = QSize(2, 2);

0 commit comments

Comments
 (0)