mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:27:45 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace PartitionEditor {
|
||||
|
||||
String PartitionModel::column_name(int column) const
|
||||
DeprecatedString PartitionModel::column_name(int column) const
|
||||
{
|
||||
switch (column) {
|
||||
case Column::Partition:
|
||||
|
@ -60,7 +60,7 @@ GUI::Variant PartitionModel::data(GUI::ModelIndex const& index, GUI::ModelRole r
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> PartitionModel::set_device_path(String const& path)
|
||||
ErrorOr<void> PartitionModel::set_device_path(DeprecatedString const& path)
|
||||
{
|
||||
auto file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly));
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ public:
|
|||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_partition_table->partitions_count(); }
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; }
|
||||
virtual String column_name(int) const override;
|
||||
virtual DeprecatedString column_name(int) const override;
|
||||
virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override;
|
||||
|
||||
ErrorOr<void> set_device_path(String const&);
|
||||
ErrorOr<void> set_device_path(DeprecatedString const&);
|
||||
|
||||
private:
|
||||
PartitionModel() = default;
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
#include <LibGUI/TableView.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static Vector<String> get_device_paths()
|
||||
static Vector<DeprecatedString> get_device_paths()
|
||||
{
|
||||
auto device_paths = Vector<String>();
|
||||
auto device_paths = Vector<DeprecatedString>();
|
||||
Core::DirIterator iterator("/dev", Core::DirIterator::SkipParentAndBaseDir);
|
||||
while (iterator.has_next()) {
|
||||
auto path = iterator.next_full_path();
|
||||
|
@ -61,13 +61,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(partition_model->set_device_path(device_paths.first()));
|
||||
|
||||
auto& device_combobox = *widget->find_descendant_of_type_named<GUI::ComboBox>("device_combobox");
|
||||
device_combobox.set_model(GUI::ItemListModel<String>::create(device_paths));
|
||||
device_combobox.set_model(GUI::ItemListModel<DeprecatedString>::create(device_paths));
|
||||
device_combobox.set_only_allow_values_from_model(true);
|
||||
device_combobox.set_selected_index(0);
|
||||
device_combobox.on_change = [&](auto const& path, auto const&) {
|
||||
auto result = partition_model->set_device_path(path);
|
||||
if (result.is_error())
|
||||
GUI::MessageBox::show_error(window, String::formatted("No partition table found for device {}", path));
|
||||
GUI::MessageBox::show_error(window, DeprecatedString::formatted("No partition table found for device {}", path));
|
||||
};
|
||||
|
||||
auto& partition_table_view = *widget->find_descendant_of_type_named<GUI::TableView>("partition_table_view");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue