File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ const int OPTION_FADEIN_DEFAULT = 10;
83
83
const char * OPTION_FADEOUT = " GenOps/fadeout" ;
84
84
const int OPTION_FADEOUT_DEFAULT = 20 ;
85
85
86
+ const char * OPTION_RESOLVE_SYM_LINK_TARGET = " GenOps/ResolveSymLinkTarget" ;
87
+ const bool OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT = true ;
88
+
86
89
const char * OPTION_SKIN = " GenOps/skin" ;
87
90
const char * OPTION_SKIN_DEFAULT = " Default" ;
88
91
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ extern const int OPTION_FADEIN_DEFAULT;
91
91
extern const char * OPTION_FADEOUT;
92
92
extern const int OPTION_FADEOUT_DEFAULT;
93
93
94
+ extern const char * OPTION_RESOLVE_SYM_LINK_TARGET;
95
+ extern const bool OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT;
96
+
94
97
// skin
95
98
extern const char * OPTION_SKIN;
96
99
extern const char * OPTION_SKIN_DEFAULT;
Original file line number Diff line number Diff line change 36
36
37
37
#include < QProcessEnvironment>
38
38
39
+ #include " LaunchyLib/LaunchyLib.h"
40
+
41
+ #include " OptionItem.h"
39
42
#include " UtilWin.h"
40
43
41
44
namespace launchy {
@@ -74,6 +77,23 @@ QIcon IconProviderWin::icon(const QFileInfo& info) const {
74
77
}
75
78
else {
76
79
80
+ bool bResolveSymLink
81
+ = g_settings->value (OPTION_RESOLVE_SYM_LINK_TARGET,
82
+ OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT).toBool ();
83
+
84
+ QString filePath;
85
+
86
+ // resolve sym link target
87
+ if (bResolveSymLink && info.isSymLink ()) {
88
+ filePath = QDir::toNativeSeparators (info.symLinkTarget ());
89
+
90
+ qDebug () << " IconProviderWin::icon, sym link, target path:" << filePath
91
+ << " file path:" << info.filePath ();
92
+ }
93
+ else {
94
+ filePath = QDir::toNativeSeparators (info.filePath ());
95
+ }
96
+
77
97
unsigned int flags = SHGFI_ICON | SHGFI_SYSICONINDEX | SHGFI_ICONLOCATION;
78
98
79
99
if (m_preferredSize <= 16 ) {
@@ -89,7 +109,6 @@ QIcon IconProviderWin::icon(const QFileInfo& info) const {
89
109
flags |= SHIL_JUMBO;
90
110
}
91
111
92
- QString filePath = QDir::toNativeSeparators (info.filePath ());
93
112
94
113
qDebug () << " IconProviderWin::icon, file path:" << filePath
95
114
<< " , flags:" << flags;
You can’t perform that action at this time.
0 commit comments