@@ -50,15 +50,15 @@ Item {
5050 }
5151
5252 onActiveChanged: {
53- if (! active) {
54- SessionData .addLauncherHistory (searchQuery);
53+ ClipboardService .invalidateLauncherSearchCache ();
54+ if (active)
55+ return ;
5556
56- sections = [];
57- flatModel = [];
58- selectedItem = null ;
59- _clearModeCache ();
60- ClipboardService .invalidateLauncherSearchCache ();
61- }
57+ SessionData .addLauncherHistory (searchQuery);
58+ sections = [];
59+ flatModel = [];
60+ selectedItem = null ;
61+ _clearModeCache ();
6262 }
6363
6464 onSearchModeChanged: {
@@ -276,9 +276,23 @@ Item {
276276 property string appCategory: " "
277277 property var appCategories: []
278278
279+ function builtInSectionViewPref (sectionId ) {
280+ switch (sectionId) {
281+ case " clipboard" :
282+ return getPluginViewPref (" dms_clipboard_search" );
283+ case " settings" :
284+ return getPluginViewPref (" dms_settings_search" );
285+ default :
286+ return null ;
287+ }
288+ }
289+
279290 function getSectionViewMode (sectionId ) {
280291 if (sectionId === " browse_plugins" )
281292 return " list" ;
293+ var builtInPref = builtInSectionViewPref (sectionId);
294+ if (builtInPref? .enforced )
295+ return builtInPref .mode ;
282296 if (pluginViewPreferences[sectionId]? .enforced )
283297 return pluginViewPreferences[sectionId].mode ;
284298 if (sectionViewModes[sectionId])
@@ -302,6 +316,8 @@ Item {
302316 function setSectionViewMode (sectionId , mode ) {
303317 if (sectionId === " browse_plugins" )
304318 return ;
319+ if (builtInSectionViewPref (sectionId)? .enforced )
320+ return ;
305321 if (pluginViewPreferences[sectionId]? .enforced )
306322 return ;
307323 sectionViewModes = Object .assign ({}, sectionViewModes, {
@@ -325,6 +341,8 @@ Item {
325341 function canChangeSectionViewMode (sectionId ) {
326342 if (sectionId === " browse_plugins" )
327343 return false ;
344+ if (builtInSectionViewPref (sectionId)? .enforced )
345+ return false ;
328346 return ! pluginViewPreferences[sectionId]? .enforced ;
329347 }
330348
@@ -713,6 +731,7 @@ Item {
713731 if (triggerMatch .isBuiltIn ) {
714732 var builtInItems = AppSearchService .getBuiltInLauncherItems (triggerMatch .pluginId , triggerMatch .query );
715733 for (var j = 0 ; j < builtInItems .length ; j++ ) {
734+ builtInItems[j]._preScored = 1000 - j;
716735 allItems .push (transformBuiltInSearchItem (builtInItems[j], triggerMatch .pluginId ));
717736 }
718737 }
@@ -1217,8 +1236,12 @@ Item {
12171236 }
12181237
12191238 function transformBuiltInSearchItem (item , pluginId ) {
1220- if (pluginId === " dms_clipboard_search" || item .type === " clipboard" )
1221- return transformClipboardEntry (item .data || item);
1239+ if (pluginId === " dms_clipboard_search" || item .type === " clipboard" ) {
1240+ var transformed = transformClipboardEntry (item .data || item);
1241+ if (item ._preScored !== undefined )
1242+ transformed ._preScored = item ._preScored ;
1243+ return transformed;
1244+ }
12221245 return transformBuiltInLauncherItem (item, pluginId);
12231246 }
12241247
0 commit comments