~holger-seelig/titania/4.0

« back to all changes in this revision

Viewing changes to Titania/Titania/Browser/X3DBrowserNotebook.cpp

  • Committer: Holger Seelig
  • Date: 2018-01-29 16:56:56 UTC
  • Revision ID: holger.seelig@yahoo.de-20180129165656-4rraq0q1qeioe8jm
Fixed Environment>Browser bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
X3DBrowserNotebook::X3DBrowserNotebook (const X3D::BrowserPtr & defaultBrowser) :
78
78
        X3DBrowserWindowInterface (),
 
79
                             page (),
79
80
                            pages (),
80
 
                             page (),
81
81
                      recentPages (),
82
82
                    masterBrowser (defaultBrowser),
83
83
                          browser (X3D::createBrowser (defaultBrowser)),
148
148
 
149
149
        const auto empty     = pages .empty ();
150
150
        auto       worldURLs = std::vector <std::string> ();
151
 
        auto       histories = std::vector <std::string> ();
152
151
        auto       recent    = std::vector <std::string> ();
153
152
 
154
153
        basic::split (std::back_inserter (worldURLs), getConfig () -> getItem <std::string> ("worldURL"), "\n");
155
 
        basic::split (std::back_inserter (histories), getConfig () -> getItem <std::string> ("history"),  "\n");
156
154
        basic::split (std::back_inserter (recent),    getConfig () -> getItem <std::string> ("recent"),   "\n");
157
155
 
158
156
        worldURLs = files_exists (worldURLs);
159
 
        histories = files_exists (histories);
160
157
        recent    = files_exists (recent);
161
158
 
162
159
        if (worldURLs .empty () and empty)
168
165
                        continue;
169
166
 
170
167
                const auto page = append (worldURLs [i]);
171
 
 
172
 
                if (i < histories .size ())
173
 
                        page -> getBrowserHistory () .fromString (histories [i]);
174
168
        }
175
169
 
176
170
        if (empty)
443
437
                setOutputStyle (scene, outputStyle);
444
438
                X3D::X3DEditor::setWorldURL (scene, worldURL, undoStep);
445
439
 
446
 
                X3D::FileGenerator::write (scene, worldURL, outputStyle, getAddMetadata (scene));
 
440
                X3D::FileGenerator::write (scene, worldURL, outputStyle, true);
447
441
 
448
442
                if (copy)
449
443
                        undoStep -> undo ();
572
566
        recentView -> loadPreview (getCurrentBrowser ());
573
567
 
574
568
        std::deque <std::string> worldURLs;
575
 
        std::deque <std::string> browserHistories;
576
569
        std::deque <std::string> recent;
577
570
 
578
571
        for (const auto & page : recentPages)
590
583
                if (not URL .empty ())
591
584
                        worldURLs .emplace_back (URL);
592
585
 
593
 
                browserHistories .emplace_back (page -> getBrowserHistory () .toString ());
594
 
 
595
586
                page -> shutdown ();
596
587
        }
597
588
 
611
602
 
612
603
        getConfig () -> setItem ("currentPage", currentPage);
613
604
        getConfig () -> setItem ("worldURL",    basic::join (worldURLs, "\n"));
614
 
        getConfig () -> setItem ("history",     basic::join (browserHistories, "\n"));
615
605
        getConfig () -> setItem ("recent",      basic::join (recent, "\n"));
616
606
 
617
607
        X3DBrowserWindowInterface::quit ();