Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
609ae4f2
Commit
609ae4f2
authored
Dec 08, 2010
by
hjk
Browse files
bineditor: add a facility to invalidate the cache from the outside
This is necessary to handle "live updates". Originally done by ck.
parent
b9f92c29
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/bineditor/bineditor.cpp
View file @
609ae4f2
...
...
@@ -1264,7 +1264,10 @@ void BinEditor::changeData(int position, uchar character, bool highNibble)
cmd
.
character
=
(
uchar
)
dataAt
(
position
);
cmd
.
highNibble
=
highNibble
;
if
(
!
highNibble
&&
!
m_undoStack
.
isEmpty
()
&&
m_undoStack
.
top
().
position
==
position
&&
m_undoStack
.
top
().
highNibble
)
{
if
(
!
highNibble
&&
!
m_undoStack
.
isEmpty
()
&&
m_undoStack
.
top
().
position
==
position
&&
m_undoStack
.
top
().
highNibble
)
{
// compress
cmd
.
character
=
m_undoStack
.
top
().
character
;
m_undoStack
.
pop
();
...
...
@@ -1400,6 +1403,11 @@ void BinEditor::setNewWindowRequestAllowed()
m_canRequestNewWindow
=
true
;
}
void
BinEditor
::
updateContents
()
{
setLazyData
(
baseAddress
()
+
cursorPosition
(),
dataSize
(),
m_blockSize
);
}
QPoint
BinEditor
::
offsetToPos
(
int
offset
)
{
const
int
x
=
m_labelWidth
+
(
offset
%
16
)
*
m_columnWidth
;
...
...
src/plugins/bineditor/bineditor.h
View file @
609ae4f2
...
...
@@ -73,6 +73,7 @@ public:
inline
int
lazyDataBlockSize
()
const
{
return
m_blockSize
;
}
Q_INVOKABLE
void
addLazyData
(
quint64
block
,
const
QByteArray
&
data
);
Q_INVOKABLE
void
setNewWindowRequestAllowed
();
Q_INVOKABLE
void
updateContents
();
bool
save
(
const
QString
&
oldFileName
,
const
QString
&
newFileName
);
void
zoomIn
(
int
range
=
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment