octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65312] "__run_test_suite__" ran in GUI hangs


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #65312] "__run_test_suite__" ran in GUI hangs Octave in some configurations
Date: Wed, 14 Feb 2024 15:36:47 -0500 (EST)

Follow-up Comment #21, bug#65312 (group octave):

It really seems to be the icon provider that is causing this slowdown. With
this dummy icon provider (that doesn't provide any icons), switching
directories is as fast as with Qt5 and the test suite runs with regular
speed:

diff -r 92a2e883af17 libgui/src/files-dock-widget.cc
--- a/libgui/src/files-dock-widget.cc   Wed Feb 14 15:07:28 2024 +0100
+++ b/libgui/src/files-dock-widget.cc   Wed Feb 14 21:32:05 2024 +0100
@@ -177,6 +177,29 @@
   }
 };
 
+class null_file_icon_provider : public QFileIconProvider
+{
+public:
+  null_file_icon_provider ()
+  {
+    null_icon = QIcon ();
+  }
+
+  QIcon icon (IconType) const
+  {
+    return null_icon;
+  }
+  
+  QIcon icon (const QFileInfo &) const
+  {
+    return null_icon;
+  }
+
+private:
+  QIcon null_icon;
+
+};
+
 files_dock_widget::files_dock_widget (QWidget *p)
   : octave_dock_widget ("FilesDockWidget", p)
 {
@@ -315,6 +338,9 @@
   QModelIndex rootPathIndex
     = m_file_system_model->setRootPath (startup_dir.absolutePath ());
 
+  m_file_icon_provider = new null_file_icon_provider ();
+  m_file_system_model->setIconProvider (m_file_icon_provider);
+
   // Attach the model to the QTreeView and set the root index
   m_file_tree_view = new FileTreeViewer (container);
   m_file_tree_view->setSelectionMode (QAbstractItemView::ExtendedSelection);
diff -r 92a2e883af17 libgui/src/files-dock-widget.h
--- a/libgui/src/files-dock-widget.h    Wed Feb 14 15:07:28 2024 +0100
+++ b/libgui/src/files-dock-widget.h    Wed Feb 14 21:32:05 2024 +0100
@@ -29,6 +29,7 @@
 #include <QAction>
 #include <QComboBox>
 #include <QDate>
+#include <QFileIconProvider>
 #include <QFileSystemModel>
 #include <QList>
 #include <QListView>
@@ -210,6 +211,7 @@
   //! The file system model.
 
   QFileSystemModel *m_file_system_model;
+  QFileIconProvider *m_file_icon_provider;
 
   //! The file system view.
   //!@{




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65312>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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