summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'partitionmanager.cpp')
-rw-r--r--partitionmanager.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 2e90ecc49..fdc3fba44 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1463,6 +1463,43 @@ void TWPartitionManager::Update_System_Details(void) {
DataManager::SetValue(TW_BACKUP_SP3_SIZE, backup_display_size);
}
#endif
+ } else {
+ // Handle unmountable partitions in case we reset defaults
+ if ((*iter)->Mount_Point == "/boot") {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_BOOT_SIZE, backup_display_size);
+ if ((*iter)->Backup_Size == 0) {
+ DataManager::SetValue(TW_HAS_BOOT_PARTITION, 0);
+ DataManager::SetValue(TW_BACKUP_BOOT_VAR, 0);
+ } else
+ DataManager::SetValue(TW_HAS_BOOT_PARTITION, 1);
+ } else if ((*iter)->Mount_Point == "/recovery") {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_RECOVERY_SIZE, backup_display_size);
+ if ((*iter)->Backup_Size == 0) {
+ DataManager::SetValue(TW_HAS_RECOVERY_PARTITION, 0);
+ DataManager::SetValue(TW_BACKUP_RECOVERY_VAR, 0);
+ } else
+ DataManager::SetValue(TW_HAS_RECOVERY_PARTITION, 1);
+ }
+#ifdef SP1_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP1_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP1_SIZE, backup_display_size);
+ }
+#endif
+#ifdef SP2_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP2_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP2_SIZE, backup_display_size);
+ }
+#endif
+#ifdef SP3_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP3_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP3_SIZE, backup_display_size);
+ }
+#endif
}
}
DataManager::SetValue(TW_BACKUP_DATA_SIZE, data_size);