# HG changeset patch # User Teemu Piippo # Date 1415146058 -7200 # Node ID d2b3c8ce881784dd3b399348159182f6e55b96a6 # Parent 00d76b281021ff22a9ace8409b20b436057643de# Parent f8e1852b91bcac160511b11d5372096ad5acffc3 - merged bfc with default diff -r 00d76b281021 -r d2b3c8ce8817 .gitignore --- a/.gitignore Tue Sep 09 01:17:36 2014 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -build -build_shared -build_debug -build_release -*.kdev4 -Makefile -Makefile.* -ldforge -ldforge_debug -*.dat -debug_lastOutput -debug_lastInput -.kdev_include_paths -*.cfg -Git.h -.kdev4 diff -r 00d76b281021 -r d2b3c8ce8817 .hgignore --- a/.hgignore Tue Sep 09 01:17:36 2014 +0300 +++ b/.hgignore Wed Nov 05 02:07:38 2014 +0200 @@ -16,3 +16,4 @@ .kdev4 .*~ *.orig +CMakeLists.txt.user diff -r 00d76b281021 -r d2b3c8ce8817 src/actions.cc --- a/src/actions.cc Tue Sep 09 01:17:36 2014 +0300 +++ b/src/actions.cc Wed Nov 05 02:07:38 2014 +0200 @@ -268,9 +268,6 @@ { for (LDObjectPtr obj : CurrentDocument()->objects()) obj->select(); - - ui->objectList->selectAll(); - refresh(); } // ============================================================================= @@ -296,9 +293,6 @@ if (colors.contains (obj->color())) obj->select(); } - - updateSelection(); - refresh(); } // ============================================================================= @@ -336,9 +330,6 @@ obj->select(); } - - updateSelection(); - refresh(); } // ============================================================================= diff -r 00d76b281021 -r d2b3c8ce8817 src/ldObject.cc --- a/src/ldObject.cc Tue Sep 09 01:17:36 2014 +0300 +++ b/src/ldObject.cc Wed Nov 05 02:07:38 2014 +0200 @@ -896,10 +896,12 @@ document().toStrongRef()->addToSelection (self()); // If this object is inverted with INVERTNEXT, pick the INVERTNEXT as well. + /* LDBFCPtr invertnext; if (previousIsInvertnext (invertnext)) invertnext->select(); + */ } // ============================================================================= diff -r 00d76b281021 -r d2b3c8ce8817 src/mainWindow.cc --- a/src/mainWindow.cc Tue Sep 09 01:17:36 2014 +0300 +++ b/src/mainWindow.cc Wed Nov 05 02:07:38 2014 +0200 @@ -560,17 +560,41 @@ void MainWindow::updateSelection() { g_isSelectionLocked = true; - - ui->objectList->clearSelection(); + QItemSelection itemselect; + int top = -1; + int bottom = -1; for (LDObjectPtr obj : Selection()) { if (obj->qObjListEntry == null) continue; - obj->qObjListEntry->setSelected (true); + int row = ui->objectList->row (obj->qObjListEntry); + + if (top == -1) + { + top = bottom = row; + } + else + { + if (row != bottom + 1) + { + itemselect.select (ui->objectList->model()->index (top, 0), + ui->objectList->model()->index (bottom, 0)); + top = -1; + } + + bottom = row; + } } + if (top != -1) + { + itemselect.select (ui->objectList->model()->index (top, 0), + ui->objectList->model()->index (bottom, 0)); + } + + ui->objectList->selectionModel()->select (itemselect, QItemSelectionModel::ClearAndSelect); g_isSelectionLocked = false; }