From 30766f57381937b2968d7b6a2ce5680f8a12fa2b Mon Sep 17 00:00:00 2001 From: Le Tan Date: Sun, 23 Oct 2016 19:49:21 +0800 Subject: [PATCH] remove "name" parameter in directory config file Signed-off-by: Le Tan --- src/vdirectorytree.cpp | 3 +-- src/vmainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vdirectorytree.cpp b/src/vdirectorytree.cpp index 294ee516..a218d5e2 100644 --- a/src/vdirectorytree.cpp +++ b/src/vdirectorytree.cpp @@ -350,7 +350,7 @@ void VDirectoryTree::deleteDirectory() QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Are you sure you want to delete directory \"%1\"?") .arg(curItemName), QMessageBox::Ok | QMessageBox::Cancel, this); msgBox.setInformativeText(tr("This will delete any files under this directory.")); - msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Cancel); if (msgBox.exec() == QMessageBox::Ok) { deleteDirectoryAndUpdateTree(curItem); } @@ -378,7 +378,6 @@ QTreeWidgetItem* VDirectoryTree::createDirectoryAndUpdateTree(QTreeWidgetItem *p QJsonObject configJson; configJson["version"] = "1"; - configJson["name"] = name; configJson["sub_directories"] = QJsonArray(); configJson["files"] = QJsonArray(); diff --git a/src/vmainwindow.cpp b/src/vmainwindow.cpp index cde3940f..5c833bdb 100644 --- a/src/vmainwindow.cpp +++ b/src/vmainwindow.cpp @@ -274,7 +274,7 @@ void VMainWindow::onDeleteNotebookBtnClicked() QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Are you sure you want to delete notebook \"%1\"?") .arg(curName), QMessageBox::Ok | QMessageBox::Cancel, this); msgBox.setInformativeText(QString("This will delete any files in this notebook (\"%1\").").arg(curPath)); - msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Cancel); if (msgBox.exec() == QMessageBox::Ok) { vnote->removeNotebook(curName); }