diff options
Diffstat (limited to 'partitionmanager.cpp')
-rw-r--r-- | partitionmanager.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp index db054d28d..73e22852d 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -78,14 +78,11 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) if (partition->Process_Fstab_Line(line, Display_Error)) { if (!Found_Settings_Storage && partition->Is_Settings_Storage) { Found_Settings_Storage = true; - Partitions.push_back(partition); - DataManager::SetValue("tw_settings_path", partition->Storage_Path); - DataManager::SetValue("tw_storage_path", partition->Storage_Path); - LOGINFO("Settings storage is '%s'\n", partition->Storage_Path.c_str()); + Setup_Settings_Storage_Partition(partition); } else { partition->Is_Settings_Storage = false; - Partitions.push_back(partition); } + Partitions.push_back(partition); } else { delete partition; } @@ -95,14 +92,7 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) std::vector<TWPartition*>::iterator iter; for (iter = Partitions.begin(); iter != Partitions.end(); iter++) { if ((*iter)->Is_Storage) { - (*iter)->Is_Settings_Storage = true; -#ifndef RECOVERY_SDCARD_ON_DATA - (*iter)->Setup_AndSec(); -#endif - Found_Settings_Storage = true; - DataManager::SetValue("tw_settings_path", (*iter)->Storage_Path); - DataManager::SetValue("tw_storage_path", (*iter)->Storage_Path); - LOGINFO("Settings storage is '%s'\n", (*iter)->Storage_Path.c_str()); + Setup_Settings_Storage_Partition((*iter)); break; } } @@ -148,6 +138,15 @@ int TWPartitionManager::Write_Fstab(void) { return true; } +void TWPartitionManager::Setup_Settings_Storage_Partition(TWPartition* Part) { +#ifndef RECOVERY_SDCARD_ON_DATA + Part->Setup_AndSec(); +#endif + DataManager::SetValue("tw_settings_path", Part->Storage_Path); + DataManager::SetValue("tw_storage_path", Part->Storage_Path); + LOGINFO("Settings storage is '%s'\n", Part->Storage_Path.c_str()); +} + void TWPartitionManager::Output_Partition_Logging(void) { std::vector<TWPartition*>::iterator iter; |