Changeset View
Changeset View
Standalone View
Standalone View
krusader/filelisticon.cpp
- This file was moved from krusader/kicons.cpp.
1 | /***************************************************************************** | 1 | /***************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2000 Shie Erlich <erlich@users.sourceforge.net> * | 2 | * Copyright (C) 2018 Nikita Melnichenko <nikita+kde@melnichenko.name> * | ||
3 | * Copyright (C) 2000 Rafi Yanai <yanai@users.sourceforge.net> * | 3 | * Copyright (C) 2018 Krusader Krew [https://krusader.org] * | ||
4 | * Copyright (C) 2004-2018 Krusader Krew [https://krusader.org] * | | |||
5 | * * | 4 | * * | ||
6 | * This file is part of Krusader [https://krusader.org]. * | 5 | * This file is part of Krusader [https://krusader.org]. * | ||
7 | * * | 6 | * * | ||
8 | * Krusader is free software: you can redistribute it and/or modify * | 7 | * Krusader is free software: you can redistribute it and/or modify * | ||
9 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * | ||
10 | * the Free Software Foundation, either version 2 of the License, or * | 9 | * the Free Software Foundation, either version 2 of the License, or * | ||
11 | * (at your option) any later version. * | 10 | * (at your option) any later version. * | ||
12 | * * | 11 | * * | ||
13 | * Krusader is distributed in the hope that it will be useful, * | 12 | * Krusader is distributed in the hope that it will be useful, * | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
16 | * GNU General Public License for more details. * | 15 | * GNU General Public License for more details. * | ||
17 | * * | 16 | * * | ||
18 | * You should have received a copy of the GNU General Public License * | 17 | * You should have received a copy of the GNU General Public License * | ||
19 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | 18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | ||
20 | *****************************************************************************/ | 19 | *****************************************************************************/ | ||
21 | 20 | | |||
22 | #include "kicons.h" | 21 | #include "filelisticon.h" | ||
22 | | ||||
23 | #include "krglobal.h" | 23 | #include "krglobal.h" | ||
24 | #include "defaults.h" | 24 | #include "defaults.h" | ||
25 | 25 | | |||
26 | // QtCore | | |||
27 | #include <QString> | | |||
28 | // QtGui | | |||
29 | #include <QPixmap> | | |||
30 | // QtWidgets | | |||
31 | #include <QStyle> | | |||
32 | | ||||
33 | #include <KConfigCore/KSharedConfig> | 26 | #include <KConfigCore/KSharedConfig> | ||
34 | #include <KIconThemes/KIconLoader> | | |||
35 | 27 | | |||
36 | QPixmap FL_LOADICON(QString name) | 28 | | ||
29 | QSize FileListIcon::size() const | ||||
30 | { | ||||
31 | int linearSize = KConfigGroup(krConfig, "Look&Feel").readEntry("Filelist Icon Size", _FilelistIconSize).toInt(); | ||||
32 | return QSize(linearSize, linearSize); | ||||
33 | } | ||||
34 | | ||||
35 | QPixmap FileListIcon::pixmap() const | ||||
37 | { | 36 | { | ||
38 | KConfigGroup group(krConfig, "Look&Feel"); | 37 | return QIcon::pixmap(size()); | ||
39 | int size = (group.readEntry("Filelist Icon Size", _FilelistIconSize)).toInt(); | | |||
40 | return krLoader->loadIcon(name, KIconLoader::Desktop, size); | | |||
41 | } | 38 | } |