Skip to content

Commit e68e603

Browse files
committed
add option: resolve symbol link target
1 parent 3619054 commit e68e603

File tree

5 files changed

+40
-42
lines changed

5 files changed

+40
-42
lines changed

src/Launchy/OptionDialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,9 @@ void OptionDialog::initGeneralWidget() {
670670
connect(m_pUi->cbAppStyle, SIGNAL(currentIndexChanged(int)),
671671
this, SLOT(onAppStyleChanged(int)));
672672

673+
m_pUi->genResolveSymLink->setChecked(g_settings->value(OPTION_RESOLVE_SYM_LINK,
674+
OPTION_RESOLVE_SYM_LINK_DEFAULT).toBool());
675+
673676
// suggestion list
674677
m_pUi->genDecorateText->setChecked(g_settings->value(OPTION_DECORATETEXT, OPTION_DECORATETEXT_DEFAULT).toBool());
675678

@@ -713,6 +716,7 @@ bool OptionDialog::saveGeneralSettings() {
713716
g_settings->setValue(OPTION_DRAGMODE, m_pUi->genShiftDrag->isChecked());
714717
g_settings->setValue(OPTION_SCREEN_INDEX, m_pUi->comboBoxScreenNumber->currentData().toInt());
715718
g_settings->setValue(OPTION_HIDE_TRAY_ICON, m_pUi->genHideTray->isChecked());
719+
g_settings->setValue(OPTION_RESOLVE_SYM_LINK, m_pUi->genResolveSymLink->isChecked());
716720

717721
g_settings->setValue(OPTION_CONDENSEDVIEW, m_pUi->genCondensed->currentIndex());
718722
g_settings->setValue(OPTION_AUTOSUGGESTDELAY, m_pUi->genAutoSuggestDelay->value());

src/Launchy/OptionDialog.ui

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<number>9</number>
8080
</property>
8181
<property name="bottomMargin">
82-
<number>6</number>
82+
<number>0</number>
8383
</property>
8484
<item>
8585
<widget class="QLabel" name="label">
@@ -108,13 +108,7 @@
108108
<property name="minimumSize">
109109
<size>
110110
<width>0</width>
111-
<height>29</height>
112-
</size>
113-
</property>
114-
<property name="maximumSize">
115-
<size>
116-
<width>16777215</width>
117-
<height>22</height>
111+
<height>24</height>
118112
</size>
119113
</property>
120114
<property name="frame">
@@ -143,13 +137,7 @@
143137
<property name="minimumSize">
144138
<size>
145139
<width>50</width>
146-
<height>29</height>
147-
</size>
148-
</property>
149-
<property name="maximumSize">
150-
<size>
151-
<width>16777215</width>
152-
<height>22</height>
140+
<height>24</height>
153141
</size>
154142
</property>
155143
</widget>
@@ -221,7 +209,7 @@
221209
<item>
222210
<layout class="QHBoxLayout" name="horizontalLayout_2">
223211
<property name="spacing">
224-
<number>6</number>
212+
<number>9</number>
225213
</property>
226214
<item>
227215
<widget class="QLabel" name="label_5">
@@ -319,6 +307,9 @@
319307
</item>
320308
<item>
321309
<layout class="QHBoxLayout" name="horizontalLayout_23">
310+
<property name="spacing">
311+
<number>9</number>
312+
</property>
322313
<item>
323314
<widget class="QLabel" name="label_25">
324315
<property name="text">
@@ -331,7 +322,7 @@
331322
<property name="minimumSize">
332323
<size>
333324
<width>0</width>
334-
<height>29</height>
325+
<height>24</height>
335326
</size>
336327
</property>
337328
</widget>
@@ -341,7 +332,7 @@
341332
<property name="minimumSize">
342333
<size>
343334
<width>0</width>
344-
<height>29</height>
335+
<height>24</height>
345336
</size>
346337
</property>
347338
<property name="text">
@@ -386,19 +377,19 @@
386377
<item>
387378
<layout class="QHBoxLayout" name="horizontalLayout_17">
388379
<property name="spacing">
389-
<number>12</number>
380+
<number>9</number>
390381
</property>
391382
<property name="leftMargin">
392383
<number>0</number>
393384
</property>
394385
<property name="topMargin">
395-
<number>6</number>
386+
<number>0</number>
396387
</property>
397388
<property name="rightMargin">
398-
<number>6</number>
389+
<number>0</number>
399390
</property>
400391
<property name="bottomMargin">
401-
<number>12</number>
392+
<number>0</number>
402393
</property>
403394
<item>
404395
<widget class="QLabel" name="label_23">
@@ -424,13 +415,7 @@
424415
<property name="minimumSize">
425416
<size>
426417
<width>85</width>
427-
<height>29</height>
428-
</size>
429-
</property>
430-
<property name="maximumSize">
431-
<size>
432-
<width>16777215</width>
433-
<height>22</height>
418+
<height>24</height>
434419
</size>
435420
</property>
436421
</widget>
@@ -450,6 +435,13 @@
450435
</item>
451436
</layout>
452437
</item>
438+
<item>
439+
<widget class="QCheckBox" name="genResolveSymLink">
440+
<property name="text">
441+
<string>Resolve symbol link</string>
442+
</property>
443+
</widget>
444+
</item>
453445
</layout>
454446
</widget>
455447
</item>
@@ -1069,11 +1061,8 @@
10691061
</property>
10701062
<property name="html">
10711063
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
1072-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
1064+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
10731065
p, li { white-space: pre-wrap; }
1074-
hr { height: 1px; border-width: 0; }
1075-
li.unchecked::marker { content: &quot;\2610&quot;; }
1076-
li.checked::marker { content: &quot;\2612&quot;; }
10771066
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Verdana'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
10781067
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
10791068
</property>
@@ -1203,6 +1192,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
12031192
<font>
12041193
<family>Verdana</family>
12051194
<pointsize>10</pointsize>
1195+
<weight>75</weight>
12061196
<bold>true</bold>
12071197
</font>
12081198
</property>
@@ -1223,6 +1213,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
12231213
<font>
12241214
<family>Verdana</family>
12251215
<pointsize>10</pointsize>
1216+
<weight>75</weight>
12261217
<bold>true</bold>
12271218
<kerning>true</kerning>
12281219
</font>
@@ -1379,6 +1370,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
13791370
<font>
13801371
<family>Verdana</family>
13811372
<pointsize>10</pointsize>
1373+
<weight>75</weight>
13821374
<bold>true</bold>
13831375
</font>
13841376
</property>
@@ -1399,6 +1391,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
13991391
<font>
14001392
<family>Verdana</family>
14011393
<pointsize>10</pointsize>
1394+
<weight>75</weight>
14021395
<bold>true</bold>
14031396
</font>
14041397
</property>
@@ -2123,6 +2116,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
21232116
<font>
21242117
<family>Verdana</family>
21252118
<pointsize>18</pointsize>
2119+
<weight>50</weight>
21262120
<bold>false</bold>
21272121
</font>
21282122
</property>
@@ -2158,6 +2152,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
21582152
<font>
21592153
<family>Verdana</family>
21602154
<pointsize>12</pointsize>
2155+
<weight>50</weight>
21612156
<bold>false</bold>
21622157
</font>
21632158
</property>

src/Launchy/OptionItem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ const int OPTION_FADEIN_DEFAULT = 10;
8383
const char* OPTION_FADEOUT = "GenOps/fadeout";
8484
const int OPTION_FADEOUT_DEFAULT = 20;
8585

86-
const char* OPTION_RESOLVE_SYM_LINK_TARGET = "GenOps/ResolveSymLinkTarget";
87-
const bool OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT = true;
86+
const char* OPTION_RESOLVE_SYM_LINK = "GenOps/ResolveSymLink";
87+
const bool OPTION_RESOLVE_SYM_LINK_DEFAULT = true;
8888

8989
const char* OPTION_SKIN = "GenOps/skin";
9090
const char* OPTION_SKIN_DEFAULT = "Default";

src/Launchy/OptionItem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ extern const int OPTION_FADEIN_DEFAULT;
9191
extern const char* OPTION_FADEOUT;
9292
extern const int OPTION_FADEOUT_DEFAULT;
9393

94-
extern const char* OPTION_RESOLVE_SYM_LINK_TARGET;
95-
extern const bool OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT;
94+
extern const char* OPTION_RESOLVE_SYM_LINK;
95+
extern const bool OPTION_RESOLVE_SYM_LINK_DEFAULT;
9696

9797
// skin
9898
extern const char* OPTION_SKIN;

src/Launchy/Windows/IconProviderWin.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ QIcon IconProviderWin::icon(const QFileInfo& info) const {
7777
}
7878
else {
7979

80-
bool bResolveSymLink
81-
= g_settings->value(OPTION_RESOLVE_SYM_LINK_TARGET,
82-
OPTION_RESOLVE_SYM_LINK_TARGET_DEFAULT).toBool();
83-
8480
QString filePath;
8581

8682
// resolve sym link target
87-
if (bResolveSymLink && info.isSymLink()) {
83+
if (info.isSymLink()
84+
&& g_settings->value(OPTION_RESOLVE_SYM_LINK,
85+
OPTION_RESOLVE_SYM_LINK_DEFAULT).toBool()) {
86+
8887
filePath = QDir::toNativeSeparators(info.symLinkTarget());
8988

9089
qDebug() << "IconProviderWin::icon, sym link, target path:" << filePath

0 commit comments

Comments
 (0)