-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spatial Bookmark Manager crash #56493
Labels
Comments
yljxhh
added
the
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
label
Feb 23, 2024
While I cannot replicate the Crash on my system, I can see that there is an issue removing multiple items using the Spatial Bookmark Manager: bookmarks.mp4Ping @elpaso. |
All I can see is a warning diff --git a/src/core/qgsbookmarkmodel.cpp b/src/core/qgsbookmarkmodel.cpp
index e1b2dabd5c8..5e833d3e601 100644
--- a/src/core/qgsbookmarkmodel.cpp
+++ b/src/core/qgsbookmarkmodel.cpp
@@ -222,11 +222,9 @@ bool QgsBookmarkManagerModel::setData( const QModelIndex &index, const QVariant
return false;
}
-bool QgsBookmarkManagerModel::insertRows( int, int count, const QModelIndex &parent )
+bool QgsBookmarkManagerModel::insertRows( int, int count, const QModelIndex & )
{
// append
- const int oldCount = mManager->bookmarks().count();
- beginInsertRows( parent, oldCount, oldCount + count );
bool result = true;
for ( int i = 0; i < count; ++i )
{
@@ -236,14 +234,11 @@ bool QgsBookmarkManagerModel::insertRows( int, int count, const QModelIndex &par
mBlocked = false;
result &= res;
}
- endInsertRows();
return result;
}
-bool QgsBookmarkManagerModel::removeRows( int row, int count, const QModelIndex &parent )
+bool QgsBookmarkManagerModel::removeRows( int row, int count, const QModelIndex & )
{
- beginRemoveRows( parent, row, row + count );
-
const QList< QgsBookmark > appBookmarks = mManager->bookmarks();
const QList< QgsBookmark > projectBookmarks = mProjectManager->bookmarks();
for ( int r = row + count - 1; r >= row; --r )
@@ -253,7 +248,6 @@ bool QgsBookmarkManagerModel::removeRows( int row, int count, const QModelIndex
else
mManager->removeBookmark( appBookmarks.at( r ).id() );
}
- endRemoveRows();
return true;
} |
elpaso
added a commit
to elpaso/QGIS
that referenced
this issue
Feb 23, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix qgis#56493
nyalldawson
pushed a commit
that referenced
this issue
Feb 25, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
qgis-bot
pushed a commit
that referenced
this issue
Feb 25, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
qgis-bot
pushed a commit
that referenced
this issue
Feb 25, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
nyalldawson
pushed a commit
that referenced
this issue
Feb 26, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
nyalldawson
pushed a commit
that referenced
this issue
Feb 26, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
nyalldawson
pushed a commit
that referenced
this issue
Mar 27, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
nyalldawson
pushed a commit
that referenced
this issue
Mar 27, 2024
rows inserted/added was fired twice (once by the manager and once by the model), confusing the proxy model. Also count was wrong by 1 in beginInsertRows( parent, oldCount, oldCount + count ) and beginRemoveRows, but now these two calls have been removed completely. Fix #56493
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What is the bug or the crash?
A crash happened when using Spatial Bookmark Manager.
Steps to reproduce the issue
User Feedback
1 open Spatial Bookmark Manager,
2 then,add 6 bookmarks,
3 after that, delete the 4 and 5 bookmarks at the same time,
4 then, add a new bookmark.
5 oops, may cause a crash!
Report Details
Python Stack Trace
Stack Trace
QGIS Info
QGIS Version: 3.28.4-Firenze
QGIS code revision: fd0fb72
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.6.2
Running against GDAL: 3.6.2
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22621
Versions
QGIS Info
QGIS Version: 3.28.4-Firenze
QGIS code revision: fd0fb72
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.6.2
Running against GDAL: 3.6.2
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22621
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: