File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,8 @@ void SearchBarLineEdit::updateCompletion()
237237{
238238 mp_typingTimer->stop ();
239239 clearSuggestions ();
240- WebView* current = KiwixApp::instance ()->getTabWidget ()-> currentWebView ();
241- if (!current || current-> url ().isEmpty () || m_searchbarInput.isEmpty ()) {
240+ const auto & multiZim = KiwixApp::instance ()->getSearchBar (). getMultiZimButton ();
241+ if (multiZim. getZimIds ().isEmpty () || m_searchbarInput.isEmpty ()) {
242242 hideSuggestions ();
243243 return ;
244244 }
@@ -311,7 +311,9 @@ void SearchBarLineEdit::openCompletion(const QModelIndex &index)
311311 if (index.isValid ())
312312 {
313313 const QUrl url = index.data (Qt::UserRole).toUrl ();
314- QTimer::singleShot (0 , [=](){KiwixApp::instance ()->openUrl (url, false );});
314+ const auto app = KiwixApp::instance ();
315+ const bool newTab = app->getTabWidget ()->currentWebView () == nullptr ;
316+ QTimer::singleShot (0 , [=](){KiwixApp::instance ()->openUrl (url, newTab);});
315317 }
316318}
317319
You can’t perform that action at this time.
0 commit comments