]> git.lyx.org Git - features.git/commitdiff
Getting rid of Application::createView()
authorAbdelrazak Younes <younes@lyx.org>
Sat, 24 Nov 2007 08:51:11 +0000 (08:51 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 24 Nov 2007 08:51:11 +0000 (08:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21760 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyX.cpp
src/frontends/Application.h
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiApplication.h

index 695fccc6242736ac95951acada2f053bf8e7e57a..3b31906084f6529bfc6ba5815f68625ae8c608d9 100644 (file)
@@ -626,7 +626,7 @@ void LyX::execBatchCommands()
 void LyX::restoreGuiSession()
 {
        // create the main window
-       pimpl_->application_->createView(geometryArg);
+       pimpl_->lyxfunc_.dispatch(FuncRequest(LFUN_WINDOW_NEW, geometryArg));
 
        // if there is no valid class list, do not load any file. 
        if (textclasslist.empty())
index c6d254d68e0d0793f3a6c09461631b7819b53156..1e84718678b53b4b386b1616fd55e3ca837ff95e 100644 (file)
@@ -209,10 +209,6 @@ public:
        * @param fd socket descriptor (file/socket/etc)
        */
        virtual void unregisterSocketCallback(int fd) = 0;
-
-       /// Create the main window with given geometry settings.
-       /// \param geometry_arg: only for Windows platform.
-       virtual void createView(std::string const & geometry_arg = std::string()) = 0;
 };
 
 } // namespace frontend
index 96ba02433d811d7aa4a029ce0bdfd8d638e76021..ee1c7db1e6c614795a6dfbcb88547d4a12170b3f 100644 (file)
@@ -242,7 +242,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
        switch(cmd.action) {
 
        case LFUN_WINDOW_NEW:
-               createView();
+               createView(toqstr(cmd.argument()));
                break;
 
        case LFUN_WINDOW_CLOSE:
@@ -305,7 +305,7 @@ static void updateIds(map<int, GuiView *> const & stdmap, vector<int> & ids)
 }
 
 
-void GuiApplication::createView(string const & geometry_arg)
+void GuiApplication::createView(QString const & geometry_arg)
 {
        updateIds(views_, view_ids_);
        int id = 0;
@@ -318,12 +318,12 @@ void GuiApplication::createView(string const & geometry_arg)
        theLyXFunc().setLyXView(view);
 
        view->show();
-       if (!geometry_arg.empty()) {
+       if (!geometry_arg.isEmpty()) {
 #ifdef Q_WS_WIN
                int x, y;
                int w, h;
                QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
-               re.indexIn(toqstr(geometry_arg.c_str()));
+               re.indexIn(geometry_arg);
                w = re.cap(1).toInt();
                h = re.cap(2).toInt();
                x = re.cap(3).toInt();
index 99bc12b175b347a28638f040a2a4c56bb0ea1d38..d47926f4b441eeb66a546a772b3d619f6173bc0f 100644 (file)
@@ -70,7 +70,6 @@ public:
        virtual void updateColor(ColorCode col);
        virtual void registerSocketCallback(int fd, SocketCallback func);
        void unregisterSocketCallback(int fd);
-       void createView(std::string const & geometry_arg = std::string());
        //@}
 
        /// Methods inherited from \c QApplication class
@@ -79,6 +78,9 @@ public:
        void commitData(QSessionManager & sm);
        //@}
 
+       /// Create the main window with given geometry settings.
+       /// \param geometry_arg: only for Windows platform.
+       void createView(QString const & geometry_arg);
        ///
        GuiView const * currentView() const { return current_view_; }
        ///