mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Small cleanups
Add commented out options to subsurface.pro that enable debuging the planner. Remove obsolete comment. Clean up the selection tracking. Force the re-sort of the divelist inside the reload instead of explicitly calling it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5fb947681e
commit
da911993f1
3 changed files with 7 additions and 33 deletions
|
@ -994,14 +994,6 @@ void DivePlannerPointsModel::clear()
|
|||
{
|
||||
bool oldRecalc = setRecalc(false);
|
||||
|
||||
|
||||
|
||||
// FIXME -- need to get rid of stagingDIve
|
||||
// the following now uses displayed_dive !!!!
|
||||
|
||||
|
||||
|
||||
|
||||
CylindersModel::instance()->updateDive();
|
||||
if (rowCount() > 0) {
|
||||
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
|
||||
|
|
|
@ -774,32 +774,11 @@ void MainTab::acceptChanges()
|
|||
resetPallete();
|
||||
if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
|
||||
// now let's resort the dive list and make sure the newly added dive is still selected
|
||||
sort_table(&dive_table);
|
||||
MainWindow::instance()->dive_list()->unselectDives();
|
||||
selected_dive = -1;
|
||||
amount_selected = 0;
|
||||
MainWindow::instance()->dive_list()->reload(DiveTripModel::CURRENT, true);
|
||||
int newDiveNr = get_divenr(get_dive_by_uniq_id(addedId));
|
||||
MainWindow::instance()->dive_list()->selectDive(newDiveNr, true);
|
||||
#if 0
|
||||
// it's tricky to keep the right dive selected;
|
||||
// first remember which one is selected in the current sort order
|
||||
// and unselect all dives
|
||||
int rememberSelected = selected_dive;
|
||||
MainWindow::instance()->dive_list()->unselectDives();
|
||||
struct dive *d = get_dive(rememberSelected);
|
||||
// mark the previously selected dive as remembered (abusing the selected flag)
|
||||
// and then clear that flag out on the other side of the sort_table()
|
||||
d->selected = true;
|
||||
sort_table(&dive_table);
|
||||
for_each_dive (rememberSelected, d) {
|
||||
if (d->selected) {
|
||||
d->selected = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// refreshDisplay() will select the top dive if no dive was
|
||||
// selected - but that may not be the right one, so select the one
|
||||
// we remembered instead
|
||||
MainWindow::instance()->dive_list()->selectDive(rememberSelected, true);
|
||||
#endif
|
||||
editMode = NONE;
|
||||
MainWindow::instance()->refreshDisplay();
|
||||
MainWindow::instance()->graphics()->replot();
|
||||
|
|
|
@ -303,11 +303,14 @@ QMAKE_TARGET_COPYRIGHT = Linus Torvalds, Dirk Hohndel and others
|
|||
QMAKE_INFO_PLIST = packaging/macosx/Info.plist.in
|
||||
|
||||
OTHER_FILES += $$DESKTOPFILE $$ICON $$MANPAGE $$XSLT_FILES $$DOC_FILES $$MARBLEDIR \
|
||||
$$QMAKE_INFO_PLIST
|
||||
$$QMAKE_INFO_PLIST
|
||||
|
||||
include(subsurface-gen-version.pri)
|
||||
include(subsurface-install.pri)
|
||||
|
||||
# to debug planner issues
|
||||
#QMAKE_CFLAGS += -DDEBUG_PLAN=31
|
||||
#QMAKE_CXXFLAGS += -DDEBUG_PLAN=31
|
||||
# to build debuggable binaries on Windows, you need something like this
|
||||
#QMAKE_CFLAGS_RELEASE=$$QMAKE_CFLAGS_DEBUG -O0 -g
|
||||
#QMAKE_CXXFLAGS_RELEASE=$$QMAKE_CXXFLAGS_DEBUG -O0 -g
|
||||
|
|
Loading…
Add table
Reference in a new issue