texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 30 Nov 2022 13:36:43 -0500 (EST)

branch: old/qt-info
commit d7e80c77933b5cea2faaf278fdcf763329d9dda1
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Apr 19 00:57:31 2019 +0100

    block non-existent index entries
---
 js/docbrowser/core.cpp       | 20 +++++++-------------
 js/docbrowser/core.h         |  1 -
 js/docbrowser/mainwindow.cpp |  1 +
 js/docbrowser/mainwindow.ui  |  5 ++---
 4 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/js/docbrowser/core.cpp b/js/docbrowser/core.cpp
index 37024752c6..ee7597fdc4 100644
--- a/js/docbrowser/core.cpp
+++ b/js/docbrowser/core.cpp
@@ -42,7 +42,10 @@ Core::load_manual (const char *manual)
 void
 Core::activate_input (const QString &arg)
 {
-  emit set_current_url (index_data[arg].toString());
+  if (index_data.contains(arg))
+    emit set_current_url (index_data[arg].toString());
+  else
+    ; /* error message? */
 }
 
 void
@@ -57,19 +60,10 @@ Core::do_search (const QString &arg)
 void
 Core::show_text_input (const QString &input, const QJsonObject &data)
 {
-  if (input == "regexp-search")
-    {
-      input_search = 1;
-      clear_prompt();
-    }
-  else
+  if (index_data.isEmpty())
     {
-      input_search = 0;
-      if (index_data.isEmpty())
-        {
-          index_data = data.toVariantMap();
-          main_window->populate_combo(index_data);
-        }
+      index_data = data.toVariantMap();
+      main_window->populate_combo(index_data);
     }
   main_window->show_prompt();
 }
diff --git a/js/docbrowser/core.h b/js/docbrowser/core.h
index b36dd273fb..3874b5d73e 100644
--- a/js/docbrowser/core.h
+++ b/js/docbrowser/core.h
@@ -35,7 +35,6 @@ public slots:
 private:
     MainWindow *main_window;
     QVariantMap index_data;
-    bool input_search;
 
     void clear_prompt ();
 };
diff --git a/js/docbrowser/mainwindow.cpp b/js/docbrowser/mainwindow.cpp
index 1a5bdad13e..161b05d4b7 100644
--- a/js/docbrowser/mainwindow.cpp
+++ b/js/docbrowser/mainwindow.cpp
@@ -222,6 +222,7 @@ MainWindow::show_prompt()
   ui->promptLabel->setVisible(true);
   ui->promptCombo->setVisible(true);
   ui->promptCombo->setFocus();
+  ui->promptCombo->lineEdit()->selectAll();
 }
 
 
diff --git a/js/docbrowser/mainwindow.ui b/js/docbrowser/mainwindow.ui
index 1d1c4705fb..b779935fe4 100644
--- a/js/docbrowser/mainwindow.ui
+++ b/js/docbrowser/mainwindow.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>754</width>
-    <height>407</height>
+    <height>312</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -39,7 +39,7 @@
          </sizepolicy>
         </property>
         <property name="editable">
-         <bool>false</bool>
+         <bool>true</bool>
         </property>
        </widget>
       </item>
@@ -94,7 +94,6 @@
     </item>
    </layout>
   </widget>
-  <widget class="QStatusBar" name="statusBar"/>
   <action name="actionQuit">
    <property name="text">
     <string>quit</string>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]