# # # patch "guitone/src/model/Branches.cpp" # from [d01c1d28d8f4aa2b0b509170703816b26bf06bba] # to [03b6d0c302c44ce56d79708d399915017de022dd] # # patch "guitone/src/model/Changeset.cpp" # from [4c5c242b954885b24d1c6d566a4850408076d36f] # to [3965e92b77fe505cd39b8020371b5b4301abe1a5] # # patch "guitone/src/model/Changeset.h" # from [74dcd9bfe67b89a639def7bea232b997ec810f30] # to [134eaff1af754bbad82c69f94283726f877fe59f] # # patch "guitone/src/model/ChangesetModel.cpp" # from [4d2f708a0de95674dec1b8782b8c09ba6b579496] # to [8d3446c1e5ffc2d7833ae95977cfd1102ba36d70] # # patch "guitone/src/model/ChangesetModel.h" # from [3e76b4cefafadb9beac069dd93ede41054633f3e] # to [ed80a0f9a38c30510b972799582844cfea5cebae] # # patch "guitone/src/model/ContentDiff.cpp" # from [4cb868e9bf2d592db68a2988e25100cfb961a40e] # to [ed1cab0b3cf18d5b5e1143a54c492162ffd74ac8] # # patch "guitone/src/model/ContentDiff.h" # from [99ff6b80a5441f7dbc235c1c94aa934d323d6e64] # to [91ee6ba1a90506ce0890d45c4f55d9b146b2d871] # # patch "guitone/src/model/GetBranchLog.cpp" # from [73ca4a607d8a2a2c4cb9190d9ec12411a794906a] # to [2fd72e38075643a2b197a8462639223dc28a90c2] # # patch "guitone/src/model/GetBranchLog.h" # from [9246d87a81b2746aa9e5b8bc87a2f1b0e4037499] # to [587b649b723ef13d37f4af59eb507a80f897aa4b] # # patch "guitone/src/model/Inventory.cpp" # from [27456152285ea14d09b7fe5efb57882a12d33e31] # to [a0d82c89e6bf1bd36905705407d5b1ee218b6dbe] # # patch "guitone/src/model/InventoryItem.cpp" # from [b76305f5557db8c5c251b2fdca465caf4cd43f72] # to [4b6ac761fc478cf202bc86740b946768d981593b] # # patch "guitone/src/model/Keys.cpp" # from [9b85862fecee28770b89e2d878c3d8905b10ae9a] # to [ae3255cc13f2b76714902714988f6897b63888cf] # # patch "guitone/src/model/Keys.h" # from [567079b9a6945b988e79b7a98c2826e075fd0246] # to [ec91d41ed02623eb0faeb9fa38cf0d58d956f617] # # patch "guitone/src/util/DiffParser.cpp" # from [9ae72b02eea243a234cc236b83ff0502cfadaa46] # to [f7ac523f4b9ade1887d3c5e3debd202e9d34c49e] # # patch "guitone/src/util/DiffParser.h" # from [840c46e6c28d2ddc361d0277d00cdda611c2e670] # to [e8f97b0c38907a7742f69ec562e738df29d0b5e5] # # patch "guitone/src/view/InventoryView.cpp" # from [dc7b20564cdc3bd26e1dd4f498729f15198509f1] # to [3b3886681d092579103a09217f644185825dcccf] # # patch "guitone/src/view/MainWindow.cpp" # from [59056dbbe09d50ff14081d1e7158cae80178da75] # to [afd38108e4c954aac375ecbbc360268d4640320a] # # patch "guitone/src/view/dialogs/DatabaseView.cpp" # from [46f48c4b9060cb37cb8a28f6b652a599e131ffa9] # to [3d5573b018937f06a2878a4de4a2cb73b0ad16d5] # # patch "guitone/src/view/dialogs/KeyManagement.cpp" # from [a57f544194f11df59d66b4dd2447c24ff899ae9d] # to [27bd83f704e427aad4b933ba741b79ef3edeb5dc] # # patch "guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp" # from [4577dc3fa56e55ccfe2cbcfe3e31a413f9148f80] # to [243bf7f2245e9b956cdd1c8f8008c09a8ac1f238] # ============================================================ --- guitone/src/model/Branches.cpp d01c1d28d8f4aa2b0b509170703816b26bf06bba +++ guitone/src/model/Branches.cpp 03b6d0c302c44ce56d79708d399915017de022dd @@ -144,7 +144,7 @@ QStandardItem * Branches::branchFromInde QStandardItem * Branches::branchFromIndex(const QModelIndex& index) const { if(index.isValid()) - return (QStandardItem *) index.internalPointer(); + return static_cast(index.internalPointer()); else return 0; } ============================================================ --- guitone/src/model/Changeset.cpp 4c5c242b954885b24d1c6d566a4850408076d36f +++ guitone/src/model/Changeset.cpp 3965e92b77fe505cd39b8020371b5b4301abe1a5 ============================================================ --- guitone/src/model/Changeset.h 74dcd9bfe67b89a639def7bea232b997ec810f30 +++ guitone/src/model/Changeset.h 134eaff1af754bbad82c69f94283726f877fe59f ============================================================ --- guitone/src/model/ChangesetModel.cpp 4d2f708a0de95674dec1b8782b8c09ba6b579496 +++ guitone/src/model/ChangesetModel.cpp 8d3446c1e5ffc2d7833ae95977cfd1102ba36d70 @@ -55,7 +55,8 @@ void ChangesetModel::setBranch(QString b if(branchInfo->revisions.count() == 0) { branchInfo->certsRead = 0; - GetBranchLog *glog = new GetBranchLog(branch, this); + GetBranchLog *glog = new GetBranchLog(branch, this); + Q_UNUSED(glog); } else reset(); ============================================================ --- guitone/src/model/ChangesetModel.h 3e76b4cefafadb9beac069dd93ede41054633f3e +++ guitone/src/model/ChangesetModel.h ed80a0f9a38c30510b972799582844cfea5cebae @@ -117,3 +117,4 @@ private slots: }; #endif //CHANGESETMODE_H + ============================================================ --- guitone/src/model/ContentDiff.cpp 4cb868e9bf2d592db68a2988e25100cfb961a40e +++ guitone/src/model/ContentDiff.cpp ed1cab0b3cf18d5b5e1143a54c492162ffd74ac8 @@ -34,8 +34,8 @@ ContentDiff::~ContentDiff() ContentDiff::~ContentDiff() { if (diffParser) delete diffParser; - foreach(ListLine *it, lines) - delete it; + qDeleteAll(lines); + lines.clear(); delete mtnDelegate; } ============================================================ --- guitone/src/model/ContentDiff.h 99ff6b80a5441f7dbc235c1c94aa934d323d6e64 +++ guitone/src/model/ContentDiff.h 91ee6ba1a90506ce0890d45c4f55d9b146b2d871 @@ -47,8 +47,8 @@ struct ListLine } inline ~ListLine() { - foreach(ListLine *it, lines) - delete it; + qDeleteAll(lines); + lines.clear(); } void addChild(ListLine * l) { lines.append(l); l->parent = this; } ============================================================ --- guitone/src/model/GetBranchLog.cpp 73ca4a607d8a2a2c4cb9190d9ec12411a794906a +++ guitone/src/model/GetBranchLog.cpp 2fd72e38075643a2b197a8462639223dc28a90c2 ============================================================ --- guitone/src/model/GetBranchLog.h 9246d87a81b2746aa9e5b8bc87a2f1b0e4037499 +++ guitone/src/model/GetBranchLog.h 587b649b723ef13d37f4af59eb507a80f897aa4b ============================================================ --- guitone/src/model/Inventory.cpp 27456152285ea14d09b7fe5efb57882a12d33e31 +++ guitone/src/model/Inventory.cpp a0d82c89e6bf1bd36905705407d5b1ee218b6dbe @@ -116,7 +116,7 @@ void Inventory::parseOutput() // FIXME: we shouldn't really add a workspace root item here, but // mtn automate inventory currently doesn't print the root workspace dir - InventoryItem* workspace = new InventoryItem(rootItem, ".", 0, true, true); + InventoryItem * workspace = new InventoryItem(rootItem, ".", 0, true, true); Monotone * mtn = Monotone::singleton(); workspace->setLabel(mtn->getNormalizedWorkspacePath()); rootItem->appendChild(workspace); ============================================================ --- guitone/src/model/InventoryItem.cpp b76305f5557db8c5c251b2fdca465caf4cd43f72 +++ guitone/src/model/InventoryItem.cpp 4b6ac761fc478cf202bc86740b946768d981593b @@ -57,6 +57,7 @@ InventoryItem::~InventoryItem() InventoryItem::~InventoryItem() { qDeleteAll(children); + children.clear(); } ============================================================ --- guitone/src/model/Keys.cpp 9b85862fecee28770b89e2d878c3d8905b10ae9a +++ guitone/src/model/Keys.cpp ae3255cc13f2b76714902714988f6897b63888cf @@ -50,13 +50,12 @@ void Keys::parseOutput() { StanzaParser parser(AutomateCommand::data); StanzaList list = parser.getStanzas(); - Key * key; for (int i=0, size = list.size(); i < size; ++i) { Stanza stanza = list.at(i); - key = new Key(); + Key key; bool isItem = false; for (int j=0, size2 = stanza.size(); j < size2; j++) @@ -71,21 +70,21 @@ void Keys::parseOutput() if (entry.sym == "name") { Q_ASSERT(entry.vals.size() == 1); - key->name = entry.vals.at(0); + key.name = entry.vals.at(0); continue; } if (entry.sym == "public_hash") { Q_ASSERT(entry.vals.size() == 1); - key->public_hash = entry.vals.at(0); + key.public_hash = entry.vals.at(0); continue; } if (entry.sym == "private_hash") { Q_ASSERT(entry.vals.size() == 1); - key->private_hash = entry.vals.at(0); + key.private_hash = entry.vals.at(0); continue; } @@ -95,13 +94,13 @@ void Keys::parseOutput() { if (entry.vals.at(k) == "database") { - key->public_locations |= Key::Database; + key.public_locations |= Key::Database; continue; } if (entry.vals.at(k) == "keystore") { - key->public_locations |= Key::Keystore; + key.public_locations |= Key::Keystore; continue; } @@ -119,13 +118,13 @@ void Keys::parseOutput() { if (entry.vals.at(k) == "database") { - key->private_locations |= Key::Database; + key.private_locations |= Key::Database; continue; } if (entry.vals.at(k) == "keystore") { - key->private_locations |= Key::Keystore; + key.private_locations |= Key::Keystore; continue; } @@ -169,15 +168,15 @@ QVariant Keys::data(const QModelIndex &i int row = index.row(); if (row >= keys.size()) return QVariant(); - Key * key = keys.at(row); + Key key(keys.at(row)); switch (index.column()) { - case 0: return QVariant(key->name); - case 1: return QVariant(key->public_hash); - case 2: return QVariant(key->private_hash); - case 3: return QVariant(getLocationString(key->public_locations)); - case 4: return QVariant(getLocationString(key->private_locations)); + case 0: return QVariant(key.name); + case 1: return QVariant(key.public_hash); + case 2: return QVariant(key.private_hash); + case 3: return QVariant(getLocationString(key.public_locations)); + case 4: return QVariant(getLocationString(key.private_locations)); } return QVariant(); @@ -227,8 +226,8 @@ QModelIndex Keys::index(int row, int col } if (row >= keys.size()) return QModelIndex(); - Key * key = keys.at(row); - return createIndex(row, column, key); + Key key(keys.at(row)); + return createIndex(row, column, &key); } QModelIndex Keys::parent(const QModelIndex& index) const ============================================================ --- guitone/src/model/Keys.h 567079b9a6945b988e79b7a98c2826e075fd0246 +++ guitone/src/model/Keys.h ec91d41ed02623eb0faeb9fa38cf0d58d956f617 @@ -36,7 +36,7 @@ struct Key { int private_locations; Key() : public_locations(0), private_locations(0) {}; }; -typedef QList KeyList; +typedef QList KeyList; class Keys : public QAbstractItemModel, public AutomateCommand { ============================================================ --- guitone/src/util/DiffParser.cpp 9ae72b02eea243a234cc236b83ff0502cfadaa46 +++ guitone/src/util/DiffParser.cpp f7ac523f4b9ade1887d3c5e3debd202e9d34c49e @@ -30,8 +30,8 @@ DiffParser::~DiffParser() DiffParser::~DiffParser() { - foreach(Diff *it, fileDiffs.values()) - delete it; + qDeleteAll(fileDiffs); + fileDiffs.clear(); } void DiffParser::parse(const QString & input) ============================================================ --- guitone/src/util/DiffParser.h 840c46e6c28d2ddc361d0277d00cdda611c2e670 +++ guitone/src/util/DiffParser.h e8f97b0c38907a7742f69ec562e738df29d0b5e5 @@ -36,11 +36,11 @@ struct DiffHunk struct DiffHunk { QList lines; - inline ~DiffHunk() - { - foreach(DiffLine *it, lines) - delete it; - } + inline ~DiffHunk() + { + qDeleteAll(lines); + lines.clear(); + } int leftStart; int leftCount; int rightStart; @@ -50,11 +50,11 @@ struct Diff struct Diff { QList hunks; - inline ~Diff() - { - foreach(DiffHunk *it, hunks) - delete it; - } + inline ~Diff() + { + qDeleteAll(hunks); + hunks.clear(); + } bool is_binary; }; ============================================================ --- guitone/src/view/InventoryView.cpp dc7b20564cdc3bd26e1dd4f498729f15198509f1 +++ guitone/src/view/InventoryView.cpp 3b3886681d092579103a09217f644185825dcccf @@ -36,14 +36,14 @@ InventoryView::InventoryView(QWidget* pa : TreeView(parent) { setSelectionMode(QAbstractItemView::ExtendedSelection); - setDragEnabled(true); - setDropIndicatorShown(true); - setSortingEnabled(true); + setDragEnabled(true); + setDropIndicatorShown(true); + setSortingEnabled(true); sortByColumn(0, Qt::AscendingOrder); - header()->setClickable(true); + header()->setClickable(true); - createAndConnectContextActions(); + createAndConnectContextActions(); connect( this, SIGNAL(doubleClicked(const QModelIndex &)), @@ -64,27 +64,40 @@ void InventoryView::setType(Type t) type = t; if (type == FileList) - { + { disconnect( this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &)) ); - setRootIsDecorated(false); - setItemsExpandable(false); + setRootIsDecorated(false); + setItemsExpandable(false); } - else - { + else + { connect( this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &)) ); setRootIsDecorated(true); - setItemsExpandable(true); + setItemsExpandable(true); } } -InventoryView::~InventoryView() {} +InventoryView::~InventoryView() +{ + delete actChdir; + delete actOpen; + delete actAdd; + delete actRemove; + delete actCommit; + delete actIgnore; + delete actUnignore; + delete actRevert; + delete actFileDiff; + delete actRevisionDiff; + delete actRename; +} // ensure that we only accept sortfilterproxymodels void InventoryView::setModel(QAbstractItemModel * model) @@ -217,27 +230,27 @@ void InventoryView::createAndConnectCont void InventoryView::createAndConnectContextActions(void) { actChdir = new QAction(tr("&Go into"), this); - actChdir->setStatusTip(tr("Go into the directory")); + actChdir->setStatusTip(tr("Go into the directory")); connect(actChdir, SIGNAL(triggered()), this, SLOT(slotChdir())); actOpen = new QAction(tr("&Open"), this); - actOpen->setStatusTip(tr("Open in default program")); + actOpen->setStatusTip(tr("Open in default program")); connect(actOpen, SIGNAL(triggered()), this, SLOT(slotOpen())); - actAdd = new QAction(tr("&Add"), this); - actAdd->setStatusTip(tr("Add to workspace")); + actAdd = new QAction(tr("&Add"), this); + actAdd->setStatusTip(tr("Add to workspace")); connect(actAdd, SIGNAL(triggered()), this, SLOT(slotAdd())); - actRemove = new QAction(tr("&Remove"), this); - actRemove->setStatusTip(tr("Remove from workspace")); + actRemove = new QAction(tr("&Remove"), this); + actRemove->setStatusTip(tr("Remove from workspace")); connect(actRemove, SIGNAL(triggered()), this, SLOT(slotRemove())); - actCommit = new QAction(tr("&Commit"), this); - actCommit->setStatusTip(tr("Commit")); + actCommit = new QAction(tr("&Commit"), this); + actCommit->setStatusTip(tr("Commit")); connect(actCommit, SIGNAL(triggered()), this, SLOT(slotCommit())); - actIgnore = new QAction(tr("I&gnore"), this); - actIgnore->setStatusTip(tr("Ignore file")); + actIgnore = new QAction(tr("I&gnore"), this); + actIgnore->setStatusTip(tr("Ignore file")); connect(actIgnore, SIGNAL(triggered()), this, SLOT(slotIgnore())); actUnignore = new QAction(tr("&Unignore"), this); @@ -264,7 +277,7 @@ void InventoryView::slotChdir() void InventoryView::slotChdir() { QItemSelectionModel *selectionModel = this->selectionModel(); - QList list(selectionModel->selectedIndexes()); + QList list(selectionModel->selectedIndexes()); Q_ASSERT(list.size() > 0); emit directoryChanged(list[0]); @@ -296,7 +309,7 @@ void InventoryView::changeDirectory(cons QModelIndex proxyFolderIndex = static_cast(model())->mapFromSource(source); - // expand the selection if needed + // expand the selection if needed if (item->hasChildDirs()) { expand(proxyFolderIndex); @@ -344,17 +357,17 @@ void InventoryView::slotAdd(void) void InventoryView::slotAdd(void) { - qDebug("InventoryView::slotAdd!!!"); + qDebug("InventoryView::slotAdd!!!"); } void InventoryView::slotRemove(void) { - qDebug("InventoryView::slotRemove!!!"); + qDebug("InventoryView::slotRemove!!!"); } void InventoryView::slotCommit(void) { - qDebug("InventoryView::slotCommit!!!"); + qDebug("InventoryView::slotCommit!!!"); } void InventoryView::slotRevert(void) @@ -375,7 +388,7 @@ void InventoryView::slotIgnore(void) // void InventoryView::slotIgnore(void) { - qDebug("InventoryView::slotIgnore!!!"); + qDebug("InventoryView::slotIgnore!!!"); } void InventoryView::slotUnignore(void) @@ -419,14 +432,14 @@ QModelIndex InventoryView::getSingleSele QModelIndex InventoryView::getSingleSelection() { QItemSelectionModel *selectionModel = this->selectionModel(); - QList list(selectionModel->selectedIndexes()); - - if (list.size() == 0) - { - qDebug("InventoryView::getSingleSelection: No item selected."); - return QModelIndex(); - } + QList list(selectionModel->selectedIndexes()); + if (list.size() == 0) + { + qDebug("InventoryView::getSingleSelection: No item selected."); + return QModelIndex(); + } + if (list.size() > 1) { qDebug("InventoryView::getSingleSelection: Multiple items selected, only returning the first."); ============================================================ --- guitone/src/view/MainWindow.cpp 59056dbbe09d50ff14081d1e7158cae80178da75 +++ guitone/src/view/MainWindow.cpp afd38108e4c954aac375ecbbc360268d4640320a @@ -62,7 +62,7 @@ bool MainWindow::init() // catch critical errors from the Monotone class connect( - mtn, SIGNAL(criticalError(const QString &)), + mtn, SIGNAL(criticalError(const QString &)), this, SLOT(criticalMtnError(const QString &)) ); @@ -93,13 +93,13 @@ bool MainWindow::init() invModel = new Inventory(this); attrModel = new Attributes(this); - // ProxyModels - proxyModelFolderTree = new InventoryProxyModel(this, true); - proxyModelFileList = new InventoryProxyModel(this, false); - proxyModelFolderTree->setSourceModel(invModel); - proxyModelFileList->setSourceModel(invModel); + // ProxyModels + proxyModelFolderTree = new InventoryProxyModel(this, true); + proxyModelFileList = new InventoryProxyModel(this, false); + proxyModelFolderTree->setSourceModel(invModel); + proxyModelFileList->setSourceModel(invModel); - // tree and list views + // tree and list views treeView->setModel(proxyModelFolderTree); treeView->setType(InventoryView::FolderTree); listView->setModel(proxyModelFileList); @@ -128,9 +128,9 @@ bool MainWindow::init() // load recent workspace and database lists - updatePreviousWorkspacesMenu(); + updatePreviousWorkspacesMenu(); updatePreviousDatabasesMenu(); - + // set the data for some menu elements actionAll_files->setData(QVariant(InventoryProxyModel::All)); actionAll_changed_files->setData(QVariant(InventoryProxyModel::Changed)); @@ -147,11 +147,11 @@ bool MainWindow::init() // after laying out everything, restore the splitter views mainSplitter->init(); listSplitter->init(); - + restoreGeometry(Settings::getWindowGeometry("MainWindow")); // - // try to load the most recent workspace or database, if there are any + // try to load the most recent workspace or database, if there are any // if everything fails, load nothing and hide the appropriate menus // QStringList workspaces = Settings::getItemList("RecentWorkspaceList"); @@ -171,25 +171,32 @@ bool MainWindow::init() return true; } -MainWindow::~MainWindow() {} +MainWindow::~MainWindow() +{ + delete invModel; + delete attrModel; + delete proxyModelFolderTree; + delete proxyModelFileList; + delete Monotone::singleton(); +} void MainWindow::quit() { - delete this; - Settings::sync(); + delete this; + Settings::sync(); } void MainWindow::criticalMtnError(const QString & msg) { - if (gotError == false) - { - gotError = true; + if (gotError == false) + { + gotError = true; // restore the normal cursor qApp->restoreOverrideCursor(); - QMessageBox::critical(NULL, tr("Critical Monotone Error"), - msg, QMessageBox::Ok, 0, 0); + QMessageBox::critical(NULL, tr("Critical Monotone Error"), + msg, QMessageBox::Ok, 0, 0); switchMode(None); } @@ -197,7 +204,7 @@ void MainWindow::on_actionOpen_Workspace void MainWindow::on_actionOpen_Workspace_triggered() { - QString fn = QFileDialog::getExistingDirectory(this, tr("Select your workspace...")); + QString fn = QFileDialog::getExistingDirectory(this, tr("Select your workspace...")); if (fn.isEmpty()) { @@ -205,12 +212,12 @@ void MainWindow::on_actionOpen_Workspace return; } - loadWorkspace(fn); + loadWorkspace(fn); } bool MainWindow::loadWorkspace(QString fn) { - Monotone * mtn = Monotone::singleton(); + Monotone * mtn = Monotone::singleton(); if (!mtn->loadWorkspace(fn)) { @@ -239,19 +246,19 @@ bool MainWindow::loadWorkspace(QString f switchMode(Workspace); - // add the workspace to the recent workspace list + // add the workspace to the recent workspace list // FIXME: the amount of recent workspaces should be made configurable - Settings::addItemToList("RecentWorkspaceList", mtn->getNormalizedWorkspacePath(), 5); - updatePreviousWorkspacesMenu(); - + Settings::addItemToList("RecentWorkspaceList", mtn->getNormalizedWorkspacePath(), 5); + updatePreviousWorkspacesMenu(); + statusBar()->showMessage(tr("Loading workspace..."), 2000 ); return true; } void MainWindow::resizeEvent(QResizeEvent * event) { - if (windowState() == Qt::WindowNoState) - curSize = size(); + if (windowState() == Qt::WindowNoState) + curSize = size(); event->accept(); } @@ -293,7 +300,7 @@ bool MainWindow::loadDatabase(QString fn switchMode(Database); Settings::addItemToList("RecentDatabaseList", fn, 5); - updatePreviousDatabasesMenu(); + updatePreviousDatabasesMenu(); return true; } @@ -386,7 +393,7 @@ void MainWindow::openRecentWorkspace() QAction *action = qobject_cast(sender()); if (action) { - loadWorkspace(action->data().toString()); + loadWorkspace(action->data().toString()); } } @@ -396,59 +403,59 @@ void MainWindow::openRecentDatabase() QAction *action = qobject_cast(sender()); if (action) { - loadDatabase(action->data().toString()); + loadDatabase(action->data().toString()); } } void MainWindow::updatePreviousWorkspacesMenu() { - // clear previous actions - menuRecent_Workspaces->clear(); - - QStringList previousWs = Settings::getItemList("RecentWorkspaceList"); - int elemCount = previousWs.size(); - if (elemCount == 0) - { - menuRecent_Workspaces->addAction(tr("No previous workspaces available.")); - return; - } + // clear previous actions + menuRecent_Workspaces->clear(); + + QStringList previousWs = Settings::getItemList("RecentWorkspaceList"); + int elemCount = previousWs.size(); + if (elemCount == 0) + { + menuRecent_Workspaces->addAction(tr("No previous workspaces available.")); + return; + } - QAction *act; - // add the new actions - for (int i = 0; i < elemCount; ++i) - { - act = menuRecent_Workspaces->addAction( - tr("&%1 %2").arg(i + 1).arg(previousWs[i]), - this, - SLOT(openRecentWorkspace()) - ); - act->setData(previousWs[i]); + QAction *act; + // add the new actions + for (int i = 0; i < elemCount; ++i) + { + act = menuRecent_Workspaces->addAction( + tr("&%1 %2").arg(i + 1).arg(previousWs[i]), + this, + SLOT(openRecentWorkspace()) + ); + act->setData(previousWs[i]); } } void MainWindow::updatePreviousDatabasesMenu() { - // clear previous actions - menuRecent_Databases->clear(); - - QStringList previousDb = Settings::getItemList("RecentDatabaseList"); - int elemCount = previousDb.size(); - if (elemCount == 0) - { - menuRecent_Databases->addAction(tr("No previous databases available.")); - return; - } + // clear previous actions + menuRecent_Databases->clear(); + + QStringList previousDb = Settings::getItemList("RecentDatabaseList"); + int elemCount = previousDb.size(); + if (elemCount == 0) + { + menuRecent_Databases->addAction(tr("No previous databases available.")); + return; + } - QAction *act; - // add the new actions - for (int i = 0; i < elemCount; ++i) - { - act = menuRecent_Databases->addAction( - tr("&%1 %2").arg(i + 1).arg(previousDb[i]), - this, - SLOT(openRecentDatabase()) - ); - act->setData(previousDb[i]); + QAction *act; + // add the new actions + for (int i = 0; i < elemCount; ++i) + { + act = menuRecent_Databases->addAction( + tr("&%1 %2").arg(i + 1).arg(previousDb[i]), + this, + SLOT(openRecentDatabase()) + ); + act->setData(previousDb[i]); } } ============================================================ --- guitone/src/view/dialogs/DatabaseView.cpp 46f48c4b9060cb37cb8a28f6b652a599e131ffa9 +++ guitone/src/view/dialogs/DatabaseView.cpp 3d5573b018937f06a2878a4de4a2cb73b0ad16d5 @@ -65,6 +65,8 @@ DatabaseView::~DatabaseView() DatabaseView::~DatabaseView() { + delete changesetModel; + if (branchModel) delete branchModel; Settings::setBool("DatabaseViewTree", tree); } ============================================================ --- guitone/src/view/dialogs/KeyManagement.cpp a57f544194f11df59d66b4dd2447c24ff899ae9d +++ guitone/src/view/dialogs/KeyManagement.cpp 27bd83f704e427aad4b933ba741b79ef3edeb5dc @@ -71,7 +71,12 @@ KeyManagement::KeyManagement(QWidget* pa popupMenu->addAction(act); } -KeyManagement::~KeyManagement() {} +KeyManagement::~KeyManagement() +{ + delete model; + qDeleteAll(popupMenu->findChildren()); + delete popupMenu; +} void KeyManagement::generateKeypair() { ============================================================ --- guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp 4577dc3fa56e55ccfe2cbcfe3e31a413f9148f80 +++ guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp 243bf7f2245e9b956cdd1c8f8008c09a8ac1f238 @@ -228,6 +228,8 @@ void SwitchWorkspaceRevision::setComplet { QString selector = selectorBox->itemData(index).toString(); + if (selectorCompleter) delete selectorCompleter; + if (selector == "t") { tagsModel->readTags(QString());