diff options
Diffstat (limited to 'src/frontend/display/bthtmljsobject.cpp')
-rw-r--r-- | src/frontend/display/bthtmljsobject.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/frontend/display/bthtmljsobject.cpp b/src/frontend/display/bthtmljsobject.cpp index 195564e..119c2a8 100644 --- a/src/frontend/display/bthtmljsobject.cpp +++ b/src/frontend/display/bthtmljsobject.cpp @@ -2,14 +2,14 @@ * * This file is part of BibleTime's source code, http://www.bibletime.info/. * -* Copyright 1999-2009 by the BibleTime developers. +* Copyright 1999-2011 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ #include "frontend/display/bthtmljsobject.h" -#include <boost/scoped_ptr.hpp> +#include <QSharedPointer> #include <QObject> #include "backend/config/cbtconfig.h" #include "backend/keys/cswordkey.h" @@ -18,6 +18,7 @@ #include "frontend/cdragdrop.h" #include "frontend/cinfodisplay.h" #include "frontend/display/bthtmlreaddisplay.h" +#include "bibletime.h" using namespace InfoDisplay; @@ -28,7 +29,10 @@ using namespace InfoDisplay; // Access to DOM objects is implemented in Javascript and is communicated back to c++ through this class BtHtmlJsObject::BtHtmlJsObject(BtHtmlReadDisplay* display) - : m_display(display) { + : m_display(display) +{ + m_dndData.isDragging = false; + m_dndData.mousePressed = false; } void BtHtmlJsObject::moveToAnchor(const QString& anchor) { @@ -36,13 +40,6 @@ void BtHtmlJsObject::moveToAnchor(const QString& anchor) { emit gotoAnchor(anchor); } -void BtHtmlJsObject::setBodyEditable(bool editable) { - if (editable) - emit setDocumentEditable(); - else - emit setDocumentNotEditable(); -} - void BtHtmlJsObject::mouseDownLeft(const QString& url, const int& x, const int& y) { m_dndData.mousePressed = true; m_dndData.isDragging = false; @@ -75,7 +72,6 @@ void BtHtmlJsObject::mouseDownRight(const QString& url, const QString& lemma) { // The mouse move event starts in the javascript function "mouseMoveHandler" in bthtml.js. It calls this function void BtHtmlJsObject::mouseMoveEvent(const QString& attributes, const int& x, const int& y, const bool& shiftKey) { - /// \bug Valgrind reports uninitialized m_dndData or m_dndData member: if (!m_dndData.isDragging && m_dndData.mousePressed) { // If we have not started dragging, but the mouse button is down, create a the mime data QPoint current(x, y); @@ -92,9 +88,9 @@ void BtHtmlJsObject::mouseMoveEvent(const QString& attributes, const int& x, con BTMimeData* mimedata = new BTMimeData(moduleName, keyName, QString::null); drag->setMimeData(mimedata); //add real Bible text from module/key - if (CSwordModuleInfo* module = CPointers::backend()->findModuleByName(moduleName)) { - boost::scoped_ptr<CSwordKey> key( CSwordKey::createInstance(module) ); - key->key( keyName ); + if (CSwordModuleInfo *module = CSwordBackend::instance()->findModuleByName(moduleName)) { + QSharedPointer<CSwordKey> key( CSwordKey::createInstance(module) ); + key->setKey(keyName); mimedata->setText(key->strippedText()); // This works across applications! } } @@ -149,7 +145,7 @@ void BtHtmlJsObject::timeOutEvent(const QString& attributes) { } // Update the mag if valid attributes were found if (!(infoList.isEmpty())) { - CPointers::infoDisplay()->setInfo(infoList); + BibleTime::instance()->infoDisplay()->setInfo(infoList); } } |