1
Index: b/src/kiledocmanager.cpp
2
===================================================================
3
--- a/src/kiledocmanager.cpp 2010-04-08 01:30:11.000000000 +0200
4
+++ b/src/kiledocmanager.cpp 2010-04-09 10:13:09.000000000 +0200
6
/*****************************************************************************
7
* Copyright (C) 2004 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net) *
8
-* (C) 2006-2010 by Michel Ludwig (michel.ludwig@kdemail.net) *
9
+* (C) 2006-2009 by Michel Ludwig (michel.ludwig@kdemail.net) *
10
* (C) 2007 by Holger Danielsson (holger.danielsson@versanet.de) *
11
******************************************************************************/
15
removeTextDocumentInfo(oldinfo);
17
- emit(updateStructure(false, newinfo));
18
+ emit(updateStructure(true, newinfo));
21
bool Manager::removeTextDocumentInfo(TextInfo *docinfo, bool closingproject /* = false */)
23
KTextEditor::Document *doc = createDocument(url, docinfo, encoding, mode, highlight);
25
m_ki->structureWidget()->clean(docinfo);
26
+ m_ki->structureWidget()->update(docinfo, true);
31
m_ki->texKonsole()->sync();
33
emit(documentModificationStatusChanged(doc, doc->isModified(), KTextEditor::ModificationInterface::OnDiskUnmodified));
35
+ //updatestructure if active document changed from modified to unmodified (typically after a save)
36
+ if (!doc->isModified()) {
37
+ emit(updateStructure(true, textInfoFor(doc)));
41
bool Manager::fileSaveAll(bool amAutoSaving, bool disUntitled)
43
This may look superfluos but actually it is not, in the case of multiple modified docs it ensures that the structure view keeps synchronized with the currentTextView
44
And if we only have one masterdoc or none nothing goes wrong.
46
- emit(updateStructure(false, NULL));
47
+ emit(updateStructure(false,NULL));
48
m_currentlySavingAll = false;
49
return !oneSaveFailed;
52
item->loadDocumentAndViewSettings();
55
- emit(updateStructure(false, NULL));
56
+ emit(updateStructure(true, 0L));
57
emit(updateModeStatus());
58
// update undefined references in this file
59
emit(updateReferences(textInfoFor(realurl.toLocalFile())));
63
bool ret = view->document()->documentSave();
64
- emit(updateStructure(false, textInfoFor(view->document())));
69
mapItem(docinfo, item);
71
//docinfo->updateStruct(m_kwStructure->level());
72
- emit(updateStructure(false, docinfo));
73
+ emit(updateStructure(true, docinfo));
78
kp->buildProjectTree();
81
- emit(updateStructure(false, NULL));
82
+ emit(updateStructure(false, 0L));
83
emit(updateModeStatus());
84
// update undefined references in all project files
85
updateProjectReferences(kp);
88
//ok, we have a project and an existing file
89
KILE_DEBUG() << "\tadd file: " << filename;
90
- m_ki->viewManager()->updateStructure(false);
91
+ m_ki->viewManager()->updateStructure(true);
94
url.setPath(filename);
95
Index: b/src/documentinfo.cpp
96
===================================================================
97
--- a/src/documentinfo.cpp 2010-03-01 00:00:13.000000000 +0100
98
+++ b/src/documentinfo.cpp 2010-04-09 10:12:23.000000000 +0200
100
begin : Sun Jul 20 2003
101
copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
102
(C) 2005-2007 by Holger Danielsson (holger.danielsson@versanet.de)
103
- (C) 2006-2010 by Michel Ludwig (michel.ludwig@kdemail.net)
104
+ (C) 2006-2009 by Michel Ludwig (michel.ludwig@kdemail.net)
105
*********************************************************************************************/
107
/***************************************************************************
115
- m_config(KGlobal::config().data()),
116
- documentTypePromotionAllowed(true)
117
+Info::Info() : m_bIsRoot(false), m_config(KGlobal::config().data()), documentTypePromotionAllowed(true)
119
updateStructLevelInfo();
122
documentTypePromotionAllowed = b;
125
-bool Info::isDirty() const
130
-void Info::setDirty(bool b)
141
void Info::slotCompleted()
144
emit completed(this);
148
connect(m_doc, SIGNAL(documentNameChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged()));
149
connect(m_doc, SIGNAL(documentUrlChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged()));
150
connect(m_doc, SIGNAL(completed()), this, SLOT(slotCompleted()));
151
- connect(m_doc, SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(makeDirtyIfModified()));
152
// this could be a KatePart bug, and as "work-around" we manually set the highlighting mode again
153
connect(m_doc, SIGNAL(completed()), this, SLOT(activateDefaultMode()));
154
setMode(m_defaultMode);
159
-void TextInfo::makeDirtyIfModified()
161
- if(m_doc && m_doc->isModified()) {
166
const long* TextInfo::getStatistics(KTextEditor::View *view)
168
/* [0] = #c in words, [1] = #c in latex commands and environments,
169
@@ -1360,7 +1336,6 @@
170
emit(doneUpdating());
171
emit(isrootChanged(isLaTeXRoot()));
172
emit(parsingCompleted());
176
void LaTeXInfo::checkChangedDeps()
177
@@ -1471,7 +1446,6 @@
179
emit(parsingCompleted());
180
emit(doneUpdating());
184
Type BibInfo::getType()
185
Index: b/src/widgets/structurewidget.cpp
186
===================================================================
187
--- a/src/widgets/structurewidget.cpp 2010-02-07 22:46:31.000000000 +0100
188
+++ b/src/widgets/structurewidget.cpp 2010-04-09 10:12:23.000000000 +0200
190
begin : Sun Dec 28 2003
191
copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net
192
2005-2007 by Holger Danielsson (holger.danielsson@versanet.de)
193
- 2008-2010 by Michel Ludwig (michel.ludwig@kdemail.net)
194
+ 2008 by Michel Ludwig (michel.ludwig@kdemail.net)
195
*************************************************************************************************/
197
/***************************************************************************
198
@@ -948,10 +948,10 @@
200
void StructureWidget::update(KileDocument::Info *docinfo)
202
- update(docinfo, false);
203
+ update(docinfo, true);
206
- void StructureWidget::update(KileDocument::Info *docinfo, bool forceParsing, bool activate /* =true */)
207
+ void StructureWidget::update(KileDocument::Info *docinfo, bool parse, bool activate /* =true */)
209
KILE_DEBUG() << "==KileWidget::StructureWidget::update(" << docinfo << ")=============";
211
@@ -961,24 +961,18 @@
215
- bool needParsing = forceParsing || m_docinfo->isDirty() || !viewExistsFor(docinfo);
217
+ bool needParsing = parse || ( ! viewExistsFor(m_docinfo) );
219
//find structview-item for this docinfo
220
StructureView *view = viewFor(m_docinfo);
222
- m_default->activate();
226
if(needParsing) { //need to reparse the doc
227
int xtop = view->horizontalScrollBar()->value();
228
int ytop = view->verticalScrollBar()->value();
229
//KILE_DEBUG() << "\tStructure::update parsing doc";
230
- // avoid flickering when parsing
231
- view->setUpdatesEnabled(false);
233
m_docinfo->updateStruct();
234
- view->setUpdatesEnabled(true);
235
view->showReferences(m_ki);
236
view->horizontalScrollBar()->setValue(xtop);
237
view->verticalScrollBar()->setValue(ytop);
238
Index: b/src/widgets/structurewidget.h
239
===================================================================
240
--- a/src/widgets/structurewidget.h 2010-02-07 22:46:31.000000000 +0100
241
+++ b/src/widgets/structurewidget.h 2010-04-09 10:12:23.000000000 +0200
243
begin : Sun Dec 28 2003
244
copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
245
2005-2007 by Holger Danielsson (holger.danielsson@versanet.de)
246
- 2008-2010 by Michel Ludwig (michel.ludwig@kdemail.net)
247
+ 2008 by Michel Ludwig (michel.ludwig@kdemail.net)
248
**************************************************************************************************/
250
/***************************************************************************
251
Index: b/src/documentinfo.h
252
===================================================================
253
--- a/src/documentinfo.h 2010-02-07 22:46:31.000000000 +0100
254
+++ b/src/documentinfo.h 2010-04-09 10:12:23.000000000 +0200
256
/*************************************************************************************
257
begin : Sun Jul 20 2003
258
copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
259
- (C) 2006-2010 by Michel Ludwig (michel.ludwig@kdemail.net)
260
+ (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
261
*************************************************************************************/
263
/***************************************************************************
265
virtual bool isDocumentTypePromotionAllowed();
266
void setDocumentTypePromotionAllowed(bool b);
269
- * Returns true iff new parsing is required.
271
- bool isDirty() const;
272
- void setDirty(bool b);
276
* Never call this function directly, use KileWidget::Structure::update(KileDocument::Info *, bool) instead
282
QStringList m_labels;
283
QStringList m_bibItems;
284
QStringList m_deps, m_depsPrev;
286
void slotViewDestroyed(QObject *object);
287
void activateDefaultMode();
289
- void makeDirtyIfModified();
292
KTextEditor::Document *m_doc;
294
long *m_arStatistics;
295
QString m_defaultMode;
296
QHash<KTextEditor::View*, QList<QObject*> > m_eventFilterHash;
297
Index: b/src/kile.cpp
298
===================================================================
299
--- a/src/kile.cpp 2010-04-04 18:56:54.000000000 +0200
300
+++ b/src/kile.cpp 2010-04-09 10:12:23.000000000 +0200
302
/****************************************************************************************
303
begin : sam jui 13 09:50:06 CEST 2002
304
copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
305
- (C) 2007-2010 by Michel Ludwig (michel.ludwig@kdemail.net)
306
+ (C) 2007-2009 by Michel Ludwig (michel.ludwig@kdemail.net)
307
(C) 2007 Holger Danielsson (holger.danielsson@versanet.de)
308
(C) 2009 Thomas Braun (thomas.braun@virtuell-zuhause.de)
309
****************************************************************************************/