============================================================================
| 954 | |
| 955 | //============================================================================ |
| 956 | bool CDockAreaWidget::restoreState(CDockingStateReader& s, CDockAreaWidget*& CreatedWidget, |
| 957 | bool Testing, CDockContainerWidget* Container) |
| 958 | { |
| 959 | bool Ok; |
| 960 | #ifdef ADS_DEBUG_PRINT |
| 961 | int Tabs = s.attributes().value("Tabs").toInt(&Ok); |
| 962 | if (!Ok) |
| 963 | { |
| 964 | return false; |
| 965 | } |
| 966 | #endif |
| 967 | |
| 968 | QString CurrentDockWidget = s.attributes().value("Current").toString(); |
| 969 | ADS_PRINT("Restore NodeDockArea Tabs: " << Tabs << " Current: " |
| 970 | << CurrentDockWidget); |
| 971 | |
| 972 | auto DockManager = Container->dockManager(); |
| 973 | CDockAreaWidget* DockArea = nullptr; |
| 974 | if (!Testing) |
| 975 | { |
| 976 | DockArea = new CDockAreaWidget(DockManager, Container); |
| 977 | const auto AllowedAreasAttribute = s.attributes().value("AllowedAreas"); |
| 978 | if (!AllowedAreasAttribute.isEmpty()) |
| 979 | { |
| 980 | DockArea->setAllowedAreas((DockWidgetArea)AllowedAreasAttribute.toInt(nullptr, 16)); |
| 981 | } |
| 982 | |
| 983 | const auto FlagsAttribute = s.attributes().value("Flags"); |
| 984 | if (!FlagsAttribute.isEmpty()) |
| 985 | { |
| 986 | DockArea->setDockAreaFlags((CDockAreaWidget::DockAreaFlags)FlagsAttribute.toInt(nullptr, 16)); |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | while (s.readNextStartElement()) |
| 991 | { |
| 992 | if (s.name() != QLatin1String("Widget")) |
| 993 | { |
| 994 | continue; |
| 995 | } |
| 996 | |
| 997 | auto ObjectName = s.attributes().value("Name"); |
| 998 | if (ObjectName.isEmpty()) |
| 999 | { |
| 1000 | return false; |
| 1001 | } |
| 1002 | |
| 1003 | bool Closed = s.attributes().value("Closed").toInt(&Ok); |
| 1004 | if (!Ok) |
| 1005 | { |
| 1006 | return false; |
| 1007 | } |
| 1008 | |
| 1009 | s.skipCurrentElement(); |
| 1010 | CDockWidget* DockWidget = DockManager->findDockWidget(ObjectName.toString()); |
| 1011 | if (!DockWidget || Testing) |
| 1012 | { |
| 1013 | continue; |
nothing calls this directly
no test coverage detected