Debug: visible label docIndex/editMode/contentLen + qDebug in openDocument/setActiveIndex + loadContent console.log
This commit is contained in:
@@ -233,6 +233,18 @@ Item {
|
|||||||
placeholderText: qsTr("Документ не выбран")
|
placeholderText: qsTr("Документ не выбран")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Отладочный индикатор (временно)
|
||||||
|
Label {
|
||||||
|
visible: true
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: 4
|
||||||
|
font.pixelSize: 10
|
||||||
|
color: "#999"
|
||||||
|
text: "docIndex=" + pane.docIndex + " editMode=" + pane.editMode
|
||||||
|
+ " contentLen=" + editor.text.length
|
||||||
|
}
|
||||||
|
|
||||||
TextArea {
|
TextArea {
|
||||||
id: viewer
|
id: viewer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -251,11 +263,13 @@ Item {
|
|||||||
|
|
||||||
// ---------- Просмотр (режим просмотра) ----------
|
// ---------- Просмотр (режим просмотра) ----------
|
||||||
function loadContent() {
|
function loadContent() {
|
||||||
|
console.log("loadContent called: docIndex=" + pane.docIndex + " editMode=" + pane.editMode)
|
||||||
if (pane.docIndex >= 0) {
|
if (pane.docIndex >= 0) {
|
||||||
const c = documentManager.contentAt(pane.docIndex)
|
const c = documentManager.contentAt(pane.docIndex)
|
||||||
|
console.log("loadContent content=" + c.substring(0, 50) + "...")
|
||||||
editor.text = c
|
editor.text = c
|
||||||
pane.editorContent = c
|
pane.editorContent = c
|
||||||
console.log("loadContent docIndex=" + pane.docIndex + " len=" + c.length)
|
console.log("loadContent editor.text.length=" + editor.text.length)
|
||||||
} else {
|
} else {
|
||||||
editor.text = ""
|
editor.text = ""
|
||||||
pane.editorContent = ""
|
pane.editorContent = ""
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ QStringList DocumentManager::openTabs() const
|
|||||||
int DocumentManager::activeIndex() const { return m_active; }
|
int DocumentManager::activeIndex() const { return m_active; }
|
||||||
void DocumentManager::setActiveIndex(int index)
|
void DocumentManager::setActiveIndex(int index)
|
||||||
{
|
{
|
||||||
|
qDebug("setActiveIndex: from %d to %d", m_active, index);
|
||||||
if (m_active == index)
|
if (m_active == index)
|
||||||
return;
|
return;
|
||||||
m_active = index;
|
m_active = index;
|
||||||
@@ -91,6 +92,8 @@ int DocumentManager::openDocument(const QString &path)
|
|||||||
m_docs.append(doc);
|
m_docs.append(doc);
|
||||||
|
|
||||||
const int idx = m_docs.size() - 1;
|
const int idx = m_docs.size() - 1;
|
||||||
|
qDebug("openDocument: path=%s idx=%d content_len=%d",
|
||||||
|
qPrintable(clean), idx, content.length());
|
||||||
setActiveIndex(idx);
|
setActiveIndex(idx);
|
||||||
emit openTabsChanged();
|
emit openTabsChanged();
|
||||||
return idx;
|
return idx;
|
||||||
|
|||||||
Reference in New Issue
Block a user