| 661 | } |
| 662 | |
| 663 | bool |
| 664 | SequenceFileDialog::restoreState(const QByteArray & state, |
| 665 | bool restoreDirectory, |
| 666 | bool* directoryRestored) |
| 667 | { |
| 668 | QByteArray sd = state; |
| 669 | QDataStream stream(&sd, QIODevice::ReadOnly); |
| 670 | |
| 671 | *directoryRestored = false; |
| 672 | if ( stream.atEnd() ) { |
| 673 | return false; |
| 674 | } |
| 675 | QByteArray splitterState; |
| 676 | QByteArray headerData; |
| 677 | QList<QUrl> bookmarks; |
| 678 | QStringList history; |
| 679 | QString currentDirectory; |
| 680 | QString relativeChoice; |
| 681 | int sequenceMode_i; |
| 682 | stream >> splitterState |
| 683 | >> bookmarks |
| 684 | >> history |
| 685 | >> currentDirectory |
| 686 | >> headerData |
| 687 | >> relativeChoice |
| 688 | >> sequenceMode_i; |
| 689 | if ( !_centerSplitter->restoreState(splitterState) ) { |
| 690 | return false; |
| 691 | } |
| 692 | QList<int> list = _centerSplitter->sizes(); |
| 693 | if ( (list.count() >= 2) && (list.at(0) == 0) && (list.at(1) == 0) ) { |
| 694 | for (int i = 0; i < list.count(); ++i) { |
| 695 | list[i] = _centerSplitter->widget(i)->sizeHint().width(); |
| 696 | } |
| 697 | _centerSplitter->setSizes(list); |
| 698 | } |
| 699 | |
| 700 | |
| 701 | for (int i = 0; i < _relativeChoice->count(); ++i) { |
| 702 | if (_relativeChoice->itemText(i) == relativeChoice) { |
| 703 | _relativeChoice->setCurrentIndex(i); |
| 704 | break; |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | _sequenceButton->setCurrentIndex(sequenceMode_i); |
| 709 | |
| 710 | std::map<std::string, std::string> envVar; |
| 711 | _gui->getApp()->getProject()->getEnvironmentVariables(envVar); |
| 712 | |
| 713 | std::vector<QUrl> stdBookMarks; |
| 714 | QStringList expandedVars; |
| 715 | for (std::map<std::string, std::string>::iterator it = envVar.begin(); it != envVar.end(); ++it) { |
| 716 | QString var( QString::fromUtf8( it->second.c_str() ) ); |
| 717 | if ( (it->first != NATRON_OCIO_ENV_VAR_NAME) && !var.isEmpty() ) { |
| 718 | ///The variable may be nested |
| 719 | Project::expandVariable(envVar, it->second); |
| 720 | expandedVars.push_back(var); |
nothing calls this directly
no test coverage detected