[gnote] Move check for empty uri out of thread



commit 20ac96dba4d3833e59c915cdedcab4b65f14e8db
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Thu Sep 5 22:33:35 2019 +0300

    Move check for empty uri out of thread

 src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp 
b/src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp
index 9f5736b3..dc69b853 100644
--- a/src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp
+++ b/src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp
@@ -203,13 +203,13 @@ bool GvfsSyncServiceAddin::save_configuration(const sigc::slot<void, bool, Glib:
   Glib::ustring sync_uri = m_uri_entry->get_text();
   std::exception_ptr save_exception;
 
+  if(sync_uri == "") {
+    ERR_OUT(_("The URI is empty"));
+    throw gnote::sync::GnoteSyncException(_("URI field is empty."));
+  }
+
   // TODO: this is hacky, need to make save into a proper async operation
   Glib::Thread::create([this, &save_exception, sync_uri]() {
-    if(sync_uri == "") {
-      ERR_OUT(_("The URI is empty"));
-      throw gnote::sync::GnoteSyncException(_("URI field is empty."));
-    }
-
     auto path = Gio::File::create_for_uri(sync_uri);
     if(!mount(path))
       throw gnote::sync::GnoteSyncException(_("Could not mount the path: %s. Please, check your settings"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]