Changeset View
Changeset View
Standalone View
Standalone View
shell/sessioncontroller.cpp
Show First 20 Lines • Show All 608 Lines • ▼ Show 20 Line(s) | 538 | { | |||
---|---|---|---|---|---|
609 | dialog.mainWidget()->layout()->setContentsMargins(0,0,0,0); | 609 | dialog.mainWidget()->layout()->setContentsMargins(0,0,0,0); | ||
610 | 610 | | |||
611 | const QModelIndex defaultSessionIndex = model->match(model->index(0, 0), Qt::DisplayRole, defaultSession, 1, Qt::MatchExactly).value(0); | 611 | const QModelIndex defaultSessionIndex = model->match(model->index(0, 0), Qt::DisplayRole, defaultSession, 1, Qt::MatchExactly).value(0); | ||
612 | view->selectionModel()->setCurrentIndex(proxy->mapFromSource(defaultSessionIndex), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); | 612 | view->selectionModel()->setCurrentIndex(proxy->mapFromSource(defaultSessionIndex), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); | ||
613 | view->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); | 613 | view->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); | ||
614 | ///@todo We need a way to get a proper size-hint from the view, but unfortunately, that only seems possible after the view was shown. | 614 | ///@todo We need a way to get a proper size-hint from the view, but unfortunately, that only seems possible after the view was shown. | ||
615 | dialog.resize(QSize(900, 600)); | 615 | dialog.resize(QSize(900, 600)); | ||
616 | 616 | | |||
617 | if(dialog.exec() != QDialog::Accepted) | 617 | if(dialog.exec() != QDialog::Accepted) // krazy:exclude=crashy | ||
618 | { | 618 | { | ||
619 | return QString(); | 619 | return QString(); | ||
620 | } | 620 | } | ||
621 | 621 | | |||
622 | QModelIndex selected = view->selectionModel()->currentIndex(); | 622 | QModelIndex selected = view->selectionModel()->currentIndex(); | ||
623 | if (!selected.isValid()) | 623 | if (!selected.isValid()) | ||
624 | return QString(); | 624 | return QString(); | ||
625 | 625 | | |||
Show All 33 Lines |