Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 371312 Details for
Bug 502494
kde-base/katepart-4.12.2 makes kate and kdevelop crash
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix KDE bug #236948
kate-a0a1b3ce-v2.patch (text/plain), 9.66 KB, created by
Thomas
on 2014-02-26 07:39:21 UTC
(
hide
)
Description:
patch to fix KDE bug #236948
Filename:
MIME Type:
Creator:
Thomas
Created:
2014-02-26 07:39:21 UTC
Size:
9.66 KB
patch
obsolete
>diff -Naur katepart-4.12.2.orig/part/completion/katecompletionmodel.cpp katepart-4.12.2/part/completion/katecompletionmodel.cpp >--- katepart-4.12.2.orig/part/completion/katecompletionmodel.cpp 2014-01-26 01:52:50.000000000 +0100 >+++ katepart-4.12.2/part/completion/katecompletionmodel.cpp 2014-02-25 21:34:30.000000000 +0100 >@@ -504,7 +504,7 @@ > return createIndex(row, 0, 0); > } > >-void KateCompletionModel::clearGroups( bool shouldReset ) >+void KateCompletionModel::clearGroups() > { > clearExpanding(); > m_ungrouped->clear(); >@@ -536,9 +536,6 @@ > > m_emptyGroups.append(m_bestMatches); > m_groupHash.insert(BestMatchesProperty, m_bestMatches); >- >- if(shouldReset) >- reset(); > } > > QSet<KateCompletionModel::Group*> KateCompletionModel::createItems(const HierarchicalModelHandler& _handler, const QModelIndex& i, bool notifyModel) { >@@ -577,9 +574,10 @@ > > void KateCompletionModel::createGroups() > { >+ beginResetModel(); > //After clearing the model, it has to be reset, else we will be in an invalid state while inserting > //new groups. >- clearGroups(true); >+ clearGroups(); > > bool has_groups=false; > foreach (CodeCompletionModel* sourceModel, m_completionModels) { >@@ -600,10 +598,7 @@ > makeGroupItemsUnique(); > > updateBestMatches(); >- >- reset(); >- >- emit contentGeometryChanged(); >+ endResetModel(); > } > > KateCompletionModel::Group* KateCompletionModel::createItem(const HierarchicalModelHandler& handler, const QModelIndex& sourceIndex, bool notifyModel) >@@ -660,9 +655,7 @@ > affectedGroups += createItems(handler, parent.isValid() ? parent.child(i, 0) : handler.model()->index(i, 0), true); > > foreach (Group* g, affectedGroups) >- hideOrShowGroup(g); >- >- emit contentGeometryChanged(); >+ hideOrShowGroup(g, true); > } > > void KateCompletionModel::slotRowsRemoved( const QModelIndex & parent, int start, int end ) >@@ -678,9 +671,7 @@ > } > > foreach (Group* g, affectedGroups) >- hideOrShowGroup(g); >- >- emit contentGeometryChanged(); >+ hideOrShowGroup(g, true); > } > > KateCompletionModel::Group* KateCompletionModel::fetchGroup( int attribute, const QString& scope, bool forceGrouping ) >@@ -938,31 +929,32 @@ > > m_currentMatch[model] = completion; > >- bool needsReset = false; >+ const bool resetModel = (changeType != Narrow); >+ if (resetModel) { >+ beginResetModel(); >+ } > > if (!hasGroups()) { >- needsReset |= changeCompletions(m_ungrouped, changeType); >+ changeCompletions(m_ungrouped, changeType, !resetModel); > } else { > foreach (Group* g, m_rowTable) { > if(g != m_argumentHints) >- needsReset |= changeCompletions(g, changeType); >+ changeCompletions(g, changeType, !resetModel); > } > foreach (Group* g, m_emptyGroups) { > if(g != m_argumentHints) >- needsReset |= changeCompletions(g, changeType); >+ changeCompletions(g, changeType, !resetModel); > } > } > > // NOTE: best matches are also updated in resort > resort(); > >- kDebug()<<"needsReset"<<needsReset; >- if(needsReset) >- reset(); >+ if (resetModel) { >+ endResetModel(); >+ } > > clearExpanding(); //We need to do this, or be aware of expanding-widgets while filtering. >- emit contentGeometryChanged(); >- kDebug(); > } > > QString KateCompletionModel::commonPrefixInternal(const QString &forcePrefix) const >@@ -1024,15 +1016,14 @@ > return commonPrefix; > } > >-bool KateCompletionModel::changeCompletions( Group * g, changeTypes changeType ) >+void KateCompletionModel::changeCompletions( Group * g, changeTypes changeType, bool notifyModel ) > { >- bool notifyModel = true; > if(changeType != Narrow) { >- notifyModel = false; > g->filtered = g->prefilter; > //In the "Broaden" or "Change" case, just re-filter everything, > //and don't notify the model. The model is notified afterwards through a reset(). > } >+ > //This code determines what of the filtered items still fit, and computes the ranges that were removed, giving > //them to beginRemoveRows(..) in batches > >@@ -1054,14 +1045,13 @@ > } > } > >- if(deleteUntil != -1) { >+ if(deleteUntil != -1 && notifyModel) { > beginRemoveRows(indexForGroup(g), 0, deleteUntil); > endRemoveRows(); > } > > g->filtered = newFiltered; > hideOrShowGroup(g, notifyModel); >- return !notifyModel; > } > > int KateCompletionModel::Group::orderNumber() const { >@@ -1193,7 +1183,9 @@ > { > if (m_sortingEnabled != enable) { > m_sortingEnabled = enable; >+ beginResetModel(); > resort(); >+ endResetModel(); > } > } > >@@ -1256,8 +1248,9 @@ > > void KateCompletionModel::setColumnMerges( const QList< QList < int > > & columnMerges ) > { >+ beginResetModel(); > m_columnMerges = columnMerges; >- reset(); >+ endResetModel(); > } > > int KateCompletionModel::translateColumn( int sourceColumn ) const >@@ -1557,7 +1550,9 @@ > { > if (m_sortingAlphabetical != alphabetical) { > m_sortingAlphabetical = alphabetical; >+ beginResetModel(); > resort(); >+ endResetModel(); > } > } > >@@ -1571,11 +1566,13 @@ > { > if (m_sortingCaseSensitivity != cs) { > m_sortingCaseSensitivity = cs; >+ beginResetModel(); > resort(); >+ endResetModel(); > } > } > >-void KateCompletionModel::resort( ) >+void KateCompletionModel::resort() > { > foreach (Group* g, m_rowTable) > g->resort(); >@@ -1585,7 +1582,6 @@ > > // call updateBestMatches here, so they are moved to the top again. > updateBestMatches(); >- emit contentGeometryChanged(); > } > > bool KateCompletionModel::Item::isValid( ) const >@@ -1654,6 +1650,7 @@ > > void KateCompletionModel::refilter( ) > { >+ beginResetModel(); > m_ungrouped->refilter(); > > foreach (Group* g, m_rowTable) >@@ -1667,6 +1664,7 @@ > updateBestMatches(); > > clearExpanding(); //We need to do this, or be aware of expanding-widgets while filtering. >+ endResetModel(); > } > > void KateCompletionModel::Group::refilter( ) >@@ -2048,20 +2046,19 @@ > if (!model || !m_completionModels.contains(model)) > return; > >+ beginResetModel(); > m_currentMatch.remove(model); > >- clearGroups(false); >+ clearGroups(); > > model->disconnect(this); > > m_completionModels.removeAll(model); >+ endResetModel(); > > if (!m_completionModels.isEmpty()) { > // This performs the reset > createGroups(); >- }else{ >- emit contentGeometryChanged(); >- reset(); > } > } > >@@ -2252,6 +2249,10 @@ > > void KateCompletionModel::clearCompletionModels() > { >+ if (m_completionModels.isEmpty()) >+ return; >+ >+ beginResetModel(); > foreach (CodeCompletionModel * model, m_completionModels) > model->disconnect(this); > >@@ -2260,6 +2261,7 @@ > m_currentMatch.clear(); > > clearGroups(); >+ endResetModel(); > } > > #include "katecompletionmodel.moc" >diff -Naur katepart-4.12.2.orig/part/completion/katecompletionmodel.h katepart-4.12.2/part/completion/katecompletionmodel.h >--- katepart-4.12.2.orig/part/completion/katecompletionmodel.h 2014-01-26 01:52:50.000000000 +0100 >+++ katepart-4.12.2/part/completion/katecompletionmodel.h 2014-02-25 21:30:39.000000000 +0100 >@@ -183,7 +183,6 @@ > void expandIndex(const QModelIndex& index); > //Emitted whenever something has changed about the group of argument-hints > void argumentHintsChanged(); >- void contentGeometryChanged(); > > public Q_SLOTS: > void setSortingEnabled(bool enable); >@@ -311,6 +310,7 @@ > > private: > QString commonPrefixInternal(const QString &forcePrefix) const; >+ /// @note performs model reset > void createGroups(); > ///Creates all sub-items of index i, or the item corresponding to index i. Returns the affected groups. > ///i must be an index in the source model >@@ -319,8 +319,9 @@ > ///i must be an index in the source model > QSet<Group*> deleteItems(const QModelIndex& i); > Group* createItem(const HierarchicalModelHandler&, const QModelIndex& i, bool notifyModel = false); >- void clearGroups(bool reset = true); >- void hideOrShowGroup(Group* g, bool notifyModel = true); >+ /// @note Make sure you're in a {begin,end}ResetModel block when calling this! >+ void clearGroups(); >+ void hideOrShowGroup(Group* g, bool notifyModel = false); > /// When forceGrouping is enabled, all given attributes will be used for grouping, regardless of the completion settings. > Group* fetchGroup(int attribute, const QString& scope = QString(), bool forceGrouping = false); > //If this returns nonzero on an index, the index is the header of the returned group >@@ -336,7 +337,7 @@ > }; > > //Returns whether the model needs to be reset >- bool changeCompletions(Group* g, changeTypes changeType); >+ void changeCompletions(Group* g, changeTypes changeType, bool notifyModel); > > bool hasCompletionModel() const; > >diff -Naur katepart-4.12.2.orig/part/completion/katecompletionwidget.cpp katepart-4.12.2/part/completion/katecompletionwidget.cpp >--- katepart-4.12.2.orig/part/completion/katecompletionwidget.cpp 2014-01-26 01:52:50.000000000 +0100 >+++ katepart-4.12.2/part/completion/katecompletionwidget.cpp 2014-02-25 21:30:39.000000000 +0100 >@@ -325,7 +325,8 @@ > > m_lastInvocationType = invocationType; > >- disconnect(this->model(), SIGNAL(contentGeometryChanged()), this, SLOT(modelContentChanged())); >+ disconnect(this->model(), SIGNAL(layoutChanged()), this, SLOT(modelContentChanged())); >+ disconnect(this->model(), SIGNAL(modelReset()), this, SLOT(modelContentChanged())); > > m_dontShowArgumentHints = true; > >@@ -412,7 +413,8 @@ > cursorPositionChanged(); > > if (!m_completionRanges.isEmpty()) { >- connect(this->model(), SIGNAL(contentGeometryChanged()), this, SLOT(modelContentChanged())); >+ connect(this->model(), SIGNAL(layoutChanged()), this, SLOT(modelContentChanged())); >+ connect(this->model(), SIGNAL(modelReset()), this, SLOT(modelContentChanged())); > //Now that all models have been notified, check whether the widget should be displayed instantly > modelContentChanged(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 502494
: 371312