diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dialog.cpp | 6 | ||||
-rw-r--r-- | src/main.cpp | 5 | ||||
-rw-r--r-- | src/xsession.cpp | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index 0de9e93..c07a71d 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -255,12 +255,14 @@ bool Dialog::selectSession(const QString& name) { for (int i = 0; i < model_[tab]->rowCount(root); ++i) { QModelIndex section(model_[tab]->index(i, 0, root)); if (!section.isValid()) { - break; + continue; } for (int j = 0; j < model_[tab]->rowCount(section); ++j) { QModelIndex index(model_[tab]->index(j, 0, section)); + if (!index.isValid()) + continue; SessionTreeItem* item = static_cast<SessionTreeItem*>(index.internalPointer()); - const Session* s(item->session()); + const Session* s = item->session(); if (s == NULL) { continue; } diff --git a/src/main.cpp b/src/main.cpp index d24b253..3e94d99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) { } QString size; - int width, height; + int width = VMCHOOSER_DEFAULT_WIDTH, height = VMCHOOSER_DEFAULT_HEIGHT; if (cmdOptions.contains("fullscreen")) { size = "fullscreen"; } else if (settings.contains("fullscreen")) { @@ -197,9 +197,6 @@ int main(int argc, char *argv[]) { << a.translate("Console", "vmchooser: invalid size argument").toUtf8().data() << std::endl; return EXIT_FAILURE; - } else { - width = VMCHOOSER_DEFAULT_WIDTH; - height = VMCHOOSER_DEFAULT_HEIGHT; } } diff --git a/src/xsession.cpp b/src/xsession.cpp index d9add84..3583079 100644 --- a/src/xsession.cpp +++ b/src/xsession.cpp @@ -134,6 +134,8 @@ QList<Session*> XSession::readSessions(const QString& path) { XSession* session = new XSession; if (session->init(fi.absoluteFilePath())) { retval.append(session); + } else { + delete session; } } return retval; |