projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MainWindow: Make session naming consistent
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index 787e1acf96dfc9bc7a0e372001f5118e68025a85..98ca7bada700ce1c7b6391ff6fb63a6dce6e0697 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-163,7
+163,7
@@
shared_ptr<pv::view::View> MainWindow::get_active_view() const
if (entry.first.get() == dock)
return entry.second;
if (entry.first.get() == dock)
return entry.second;
- return
shared_ptr<pv::view::View>()
;
+ return
nullptr
;
}
shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
}
shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
@@
-227,8
+227,8
@@
shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
shared_ptr<Session> MainWindow::add_session()
{
shared_ptr<Session> MainWindow::add_session()
{
-
int id = sessions_.size()
;
- QString name = tr("Untitled-%1").arg(
id + 1
);
+
static int last_session_id = 1
;
+ QString name = tr("Untitled-%1").arg(
last_session_id++
);
shared_ptr<Session> session = make_shared<Session>(device_manager_, name);
shared_ptr<Session> session = make_shared<Session>(device_manager_, name);
@@
-260,7
+260,7
@@
void MainWindow::remove_session(shared_ptr<Session> session)
// Update the window title if there is no view left to
// generate focus change events
if (sessions_.empty())
// Update the window title if there is no view left to
// generate focus change events
if (sessions_.empty())
-
on_session_name_changed(
);
+
setWindowTitle(WindowTitle
);
}
void MainWindow::setup_ui()
}
void MainWindow::setup_ui()