- fix: Error message when save bookmarks.

This commit is contained in:
Roy Qu 2023-04-25 19:28:17 +08:00
parent 61f4b84b13
commit 9275f9750c
2 changed files with 14 additions and 2 deletions

View File

@ -745,7 +745,13 @@ void Debugger::save(const QString &filename, const QString& projectFolder)
foreach (const PWatchVar& watchVar, watchVars) {
watchVarCompareSet.insert(watchVar->expression);
}
std::shared_ptr<DebugConfig> pConfig = load(filename, forProject);
std::shared_ptr<DebugConfig> pConfig;
try {
pConfig = load(filename, forProject);
} catch (FileError& e) {
}
QFile file(filename);
if (file.open(QFile::WriteOnly | QFile::Truncate)) {
foreach (const PBreakpoint& breakpoint, pConfig->breakpoints) {

View File

@ -226,7 +226,13 @@ void BookmarkModel::save(const QString &filename, const QString& projectFolder)
QString key = QString("%1-%2").arg(filename).arg(bookmark->line);
compareHash.insert(key,i);
}
QList<PBookmark> fileBookmarks=load(filename, t,&fileTimestamp);
QList<PBookmark> fileBookmarks;
try {
fileBookmarks=load(filename, t,&fileTimestamp);
} catch (FileError& e) {
}
QFile file(filename);
if (file.open(QFile::WriteOnly | QFile::Truncate)) {