From 98201540a2b2213391b17e306a66088c7bca8e62 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Thu, 25 May 2023 11:13:02 -0400 Subject: [PATCH] Various fixes to remove unnecessary warnings. --- gpt4all-chat/database.cpp | 13 ++----------- gpt4all-chat/main.qml | 5 +---- gpt4all-chat/qml/LocalDocs.qml | 2 +- gpt4all-chat/qml/PopupDialog.qml | 2 -- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/gpt4all-chat/database.cpp b/gpt4all-chat/database.cpp index 296957d3..b5dd9b25 100644 --- a/gpt4all-chat/database.cpp +++ b/gpt4all-chat/database.cpp @@ -881,12 +881,7 @@ bool Database::addFolderToWatch(const QString &path) #if defined(DEBUG) qDebug() << "addFolderToWatch" << path; #endif - - if (!m_watcher->addPath(path)) { - qWarning() << "ERROR: Cannot add path to file watcher:" << path; - return false; - } - return true; + return m_watcher->addPath(path); } bool Database::removeFolderFromWatch(const QString &path) @@ -894,11 +889,7 @@ bool Database::removeFolderFromWatch(const QString &path) #if defined(DEBUG) qDebug() << "removeFolderFromWatch" << path; #endif - if (!m_watcher->removePath(path)) { - qWarning() << "ERROR: Cannot remove path from file watcher:" << path; - return false; - } - return true; + return m_watcher->removePath(path); } void Database::retrieveFromDB(const QString &uid, const QList &collections, const QString &text, int retrievalSize) diff --git a/gpt4all-chat/main.qml b/gpt4all-chat/main.qml index c693fe57..5a9afb4f 100644 --- a/gpt4all-chat/main.qml +++ b/gpt4all-chat/main.qml @@ -632,11 +632,8 @@ Window { onLinkActivated: function (link) { if (!link.startsWith("context://")) - return; - - console.log("link " + link); + return var integer = parseInt(link.split("://")[1]); - console.log("context is" + referencesContext[integer - 1]); referenceContextDialog.text = referencesContext[integer - 1]; referenceContextDialog.open(); } diff --git a/gpt4all-chat/qml/LocalDocs.qml b/gpt4all-chat/qml/LocalDocs.qml index 47c321f5..b6ef9ede 100644 --- a/gpt4all-chat/qml/LocalDocs.qml +++ b/gpt4all-chat/qml/LocalDocs.qml @@ -36,7 +36,7 @@ Item { FolderDialog { id: folderDialog title: "Please choose a directory" - currentFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation) + currentFolder: StandardPaths.writableLocation(StandardPaths.HomeLocation) onAccepted: { root.folder_path = selectedFolder } diff --git a/gpt4all-chat/qml/PopupDialog.qml b/gpt4all-chat/qml/PopupDialog.qml index 5ed0ea22..6df8be5d 100644 --- a/gpt4all-chat/qml/PopupDialog.qml +++ b/gpt4all-chat/qml/PopupDialog.qml @@ -21,8 +21,6 @@ Dialog { Row { anchors.centerIn: parent - width: childrenRect.width - height: childrenRect.height spacing: 20 Text {