]> sigrok.org Git - pulseview.git/commitdiff
MainWindow: Make session naming consistent
authorSoeren Apel <redacted>
Mon, 12 Sep 2016 19:42:59 +0000 (21:42 +0200)
committerSoeren Apel <redacted>
Sun, 4 Dec 2016 13:37:36 +0000 (14:37 +0100)
pv/mainwindow.cpp

index a8f093bccd6eb051c533452b3e86b490625b2bff..98ca7bada700ce1c7b6391ff6fb63a6dce6e0697 100644 (file)
@@ -227,8 +227,8 @@ shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
 
 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);