]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / Dialog.cpp
index de358a63c0aece40b91637c0433e9310810c0201..32c47c61295333612b41f78a9048a7e8bff65a16 100644 (file)
@@ -25,6 +25,8 @@
 #include <QSettings>
 #include <QString>
 
+#include "support/assert.h"
+
 #include <string>
 
 using namespace std;
@@ -34,7 +36,7 @@ namespace lyx {
 namespace frontend {
 
 
-Dialog::Dialog(GuiView & lv, string const & name, QString const & title)
+Dialog::Dialog(GuiView & lv, QString const & name, QString const & title)
        : name_(name), title_(title), lyxview_(&lv)
 {}
 
@@ -43,15 +45,9 @@ Dialog::~Dialog()
 {}
 
 
-string const & Dialog::name() const
-{
-       return name_;
-}
-
-
 bool Dialog::canApply() const
 {
-       FuncRequest const fr(getLfun(), from_ascii(name_));
+       FuncRequest const fr(getLfun(), fromqstr(name_));
        FuncStatus const fs(getStatus(fr));
        return fs.enabled();
 }
@@ -66,13 +62,13 @@ void Dialog::dispatch(FuncRequest const & fr) const
 
 void Dialog::updateDialog() const
 {
-       dispatch(FuncRequest(LFUN_DIALOG_UPDATE, from_ascii(name_)));
+       dispatch(FuncRequest(LFUN_DIALOG_UPDATE, fromqstr(name_)));
 }
 
 
 void Dialog::disconnect() const
 {
-       lyxview_->disconnectDialog(name_);
+       lyxview_->disconnectDialog(fromqstr(name_));
 }
 
 
@@ -90,9 +86,9 @@ bool Dialog::isBufferReadonly() const
 }
 
 
-string const Dialog::bufferFilepath() const
+QString Dialog::bufferFilepath() const
 {
-       return buffer().filePath();
+       return toqstr(buffer().filePath());
 }
 
 
@@ -121,14 +117,14 @@ BufferView const * Dialog::bufferview() const
 
 Buffer & Dialog::buffer()
 {
-       BOOST_ASSERT(lyxview_->buffer());
+       LASSERT(lyxview_->buffer(), /**/);
        return *lyxview_->buffer();
 }
 
 
 Buffer const & Dialog::buffer() const
 {
-       BOOST_ASSERT(lyxview_->buffer());
+       LASSERT(lyxview_->buffer(), /**/);
        return *lyxview_->buffer();
 }
 
@@ -139,7 +135,7 @@ void Dialog::showData(string const & data)
                return;
 
        if (!initialiseParams(data)) {
-               LYXERR0("Dialog \"" << name()
+               LYXERR0("Dialog \"" << fromqstr(name())
                        << "\" failed to translate the data string passed to show()");
                return;
        }
@@ -173,7 +169,7 @@ void Dialog::updateData(string const & data)
                return;
 
        if (!initialiseParams(data)) {
-               LYXERR0("Dialog \"" << name()
+               LYXERR0("Dialog \"" << fromqstr(name())
                       << "\" could not be initialized");
                return;
        }
@@ -257,7 +253,7 @@ void Dialog::checkStatus()
 QString Dialog::sessionKey() const
 {
        return "view-" + QString::number(lyxview_->id())
-               + "/" + toqstr(name());
+               + "/" + name();
 }