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 @@ -228,8 +228,8 @@ void SearchBarLineEdit::updateCompletion()
228228{
229229 mp_typingTimer->stop ();
230230 clearSuggestions ();
231- WebView* current = KiwixApp::instance ()->getTabWidget ()-> currentWebView ();
232- if (!current || current-> url ().isEmpty () || m_searchbarInput.isEmpty ()) {
231+ const auto & multiZim = KiwixApp::instance ()->getSearchBar (). getMultiZimButton ();
232+ if (multiZim. getZimIds ().isEmpty () || m_searchbarInput.isEmpty ()) {
233233 hideSuggestions ();
234234 return ;
235235 }
@@ -302,7 +302,9 @@ void SearchBarLineEdit::openCompletion(const QModelIndex &index)
302302 if (index.isValid ())
303303 {
304304 const QUrl url = index.data (Qt::UserRole).toUrl ();
305- QTimer::singleShot (0 , [=](){KiwixApp::instance ()->openUrl (url, false );});
305+ const auto app = KiwixApp::instance ();
306+ const bool newTab = app->getTabWidget ()->currentWebView () == nullptr ;
307+ QTimer::singleShot (0 , [=](){KiwixApp::instance ()->openUrl (url, newTab);});
306308 }
307309}
308310
You can’t perform that action at this time.
0 commit comments