Răsfoiți Sursa

Corrected bug

Nicole Portas 3 săptămâni în urmă
părinte
comite
e75c71265c
1 a modificat fișierele cu 7 adăugiri și 5 ștergeri
  1. 7 5
      MainWindow.cpp

+ 7 - 5
MainWindow.cpp

@@ -321,8 +321,8 @@ void MainWindow::run_backup_job(JobConfig config, std::string home_dir) {
     }
 
     fs::remove_all(temp_dir, ec);
-    queue_log("__UNLOCK_UI__");
     m_WorkerRunning = false;
+    queue_log("__UNLOCK_UI__");
 }
 
 void MainWindow::run_restore_job(JobConfig config, std::string home_dir) {
@@ -412,6 +412,7 @@ void MainWindow::run_restore_job(JobConfig config, std::string home_dir) {
         settings->set_boolean("disable-user-extensions", false);
     }
     fs::remove_all(temp_unpack, ec);
+    m_WorkerRunning = false; // FINALLY FIXED THIS BLOODY FLAG
     queue_log("__UNLOCK_UI__");
 }
 
@@ -520,11 +521,12 @@ bool MainWindow::extract_tar_archive(const std::string& ap, const std::string& d
         
         if (!abs) {
             std::string to_strip = "";
-            // Look at the archive name to figure out what base path we are stripping, 
-            // preventing sub-directories from triggering a false match.
+            // Look precisely at the archive name to match the exact stripping rule
             if (ap.find("extensions") != std::string::npos) to_strip = "/extensions/";
-            else if (ap.find("themes") != std::string::npos) to_strip = "/themes/";
-            else if (ap.find("icons") != std::string::npos) to_strip = "/icons/";
+            else if (ap.find("themes_legacy") != std::string::npos) to_strip = "/.themes/";
+            else if (ap.find("themes_xdg") != std::string::npos) to_strip = "/themes/";
+            else if (ap.find("icons_legacy") != std::string::npos) to_strip = "/.icons/";
+            else if (ap.find("icons_xdg") != std::string::npos) to_strip = "/icons/";
 
             if (!to_strip.empty()) {
                 size_t p = sp.find(to_strip);