24.11.2017 10:20, Eike Ziller пишет:
Sounds much like https://bugreports.qt.io/browse/QTCREATORBUG-15594
Yes, it is that problem. Only I do not understand why all the discussion
was reduced to discussing the shortcomings of QSettings?! Instead of
figuring out why the save function is called so often. In fact, the save
function is called for each mouse movement. I analyzed your code and
wrote a small patch that solves this problem. The patch is attached.
--
BR, Pavel
Br, Eike
On Nov 23, 2017, at 18:38, Карелин Павел <[email protected]> wrote:
23.11.2017 13:54, Konstantin Tokarev пишет:
23.11.2017, 11:56, "Карелин Павел" <[email protected]>:
Hi, everybody
Sometimes, during debugging, I need to change the width of the columns
in the debugger (see the picture, red frame).
In this case, the configuration file is overwritten multiple times (I
think so).
This claim can and should be proven (or disproven) with strace or similar tool
More than 40 requests per second to the file QtCreator.ini. Is it convincing
enough?
strace -t -f ./qtcreator.sh 2>&1 | grep -P 'open.*QtCreator\.ini.*O_RDWR' >
/tmp/QtCreator.ini.access
cat QtCreator.ini.access | grep '19:39:57' | wc -l
42
cat QtCreator.ini.access | grep '19:40:12' | wc -l
47
The hard drive is annoyingly cracking.
You may want to use SSD, they don't crack
You have a special sense of humor ...
Is it possible to reduce the frequency of overwriting settings?
FWIW this software can help with any application that you think is writing too
often:
https://wiki.archlinux.org/index.php/Anything-sync-daemon
Provided that in QtCreator this problem in principle will not be solved
(apparently all work on SSD), then yes - the tool will help.
I use QtCreator 4.4, gitrev: 6afdb8bdf957909d086684ada10cf86f132c3efe
--
BR, Pavel Karelin
,
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator
<QtCreator.ini.access>_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator
>From 96b1982bc3b663b9cd7c2b9ee0df516e8843c2a8 Mon Sep 17 00:00:00 2001
From: Pavel Karelin <[email protected]>
Date: Sun, 26 Nov 2017 17:44:55 +0300
Subject: [PATCH] Decrease the frequency of the function call saveState()
---
src/libs/utils/basetreeview.cpp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp
index abe01ada6e..6ba8f93ef2 100644
--- a/src/libs/utils/basetreeview.cpp
+++ b/src/libs/utils/basetreeview.cpp
@@ -50,7 +50,7 @@ class BaseTreeViewPrivate : public QObject
{
public:
explicit BaseTreeViewPrivate(BaseTreeView *parent)
- : q(parent), m_settings(0), m_expectUserChanges(false), m_progressIndicator(0)
+ : q(parent), m_settings(0), m_expectUserChanges(false), m_sectionWasResized(false), m_progressIndicator(0)
{}
bool eventFilter(QObject *, QEvent *event)
@@ -62,6 +62,13 @@ public:
if (me->buttons() & Qt::LeftButton)
m_expectUserChanges = true;
}
+ if (event->type() == QEvent::MouseButtonRelease) {
+ QMouseEvent *me = static_cast<QMouseEvent *>(event);
+ if ((me->button() == Qt::LeftButton) && m_sectionWasResized) {
+ m_sectionWasResized = false;
+ saveState();
+ }
+ }
return false;
}
@@ -122,9 +129,10 @@ public:
{
if (m_expectUserChanges) {
m_userHandled[logicalIndex] = newSize;
- saveState();
+ //saveState();
m_expectUserChanges = false;
}
+ m_sectionWasResized = true;
}
@@ -212,6 +220,7 @@ public:
QSettings *m_settings;
QString m_settingsKey;
bool m_expectUserChanges;
+ bool m_sectionWasResized;
ProgressIndicator *m_progressIndicator;
};
--
2.15.0
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator