From 7cb508eb877ae0a696427073b1105ee8d9c19876 Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 21 Apr 2011 23:35:02 +0200 Subject: uniformed ident 3-spaced.... --- src/javascriptinterface.cpp | 120 ++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'src/javascriptinterface.cpp') diff --git a/src/javascriptinterface.cpp b/src/javascriptinterface.cpp index 66ec7a5..eba4027 100644 --- a/src/javascriptinterface.cpp +++ b/src/javascriptinterface.cpp @@ -12,8 +12,8 @@ * Is of type QWebFrame. */ JavascriptInterface::JavascriptInterface(QWebFrame *parent) { - qxtLog->debug() << "Initializing javascript interface..."; - _parent = parent; + qxtLog->debug() << "Initializing javascript interface..."; + _parent = parent; } //------------------------------------------------------------------------------------------------------- /** @@ -33,8 +33,8 @@ JavascriptInterface::~JavascriptInterface() { /* destructor dummy */ * @see JavascriptInterface::loadJQuery() */ void JavascriptInterface::attachToDOM() { - _parent->addToJavaScriptWindowObject(QString("fbgui"), this); - loadJQuery(); + _parent->addToJavaScriptWindowObject(QString("fbgui"), this); + loadJQuery(); } //------------------------------------------------------------------------------------------------------- /** @@ -49,30 +49,30 @@ void JavascriptInterface::attachToDOM() { * @see JavascriptInterface::attachToDOM() */ void JavascriptInterface::loadJQuery() { - QString js; - QString pathToJsDir(DEFAULT_QRC_HTML_DIR); - pathToJsDir.append("/js"); + QString js; + QString pathToJsDir(DEFAULT_QRC_HTML_DIR); + pathToJsDir.append("/js"); - QDir qrcJSDir(pathToJsDir); - QFileInfoList fiList = qrcJSDir.entryInfoList(); - QFileInfo fi; - foreach(fi, fiList) - { - if (fi.suffix() == "js") { - //qDebug()<< fi.fileName(); - //qxtLog->debug() << fi.fileName(); - if (fi.fileName() != "test.js") { - QFile file; - file.setFileName(pathToJsDir + "/" + fi.fileName()); - file.open(QIODevice::ReadOnly); - js = file.readAll(); - file.close(); + QDir qrcJSDir(pathToJsDir); + QFileInfoList fiList = qrcJSDir.entryInfoList(); + QFileInfo fi; +foreach(fi, fiList) +{ + if (fi.suffix() == "js") { + //qDebug()<< fi.fileName(); + //qxtLog->debug() << fi.fileName(); + if (fi.fileName() != "test.js") { + QFile file; + file.setFileName(pathToJsDir + "/" + fi.fileName()); + file.open(QIODevice::ReadOnly); + js = file.readAll(); + file.close(); - _parent->evaluateJavaScript(js); - //qxtLog->debug() << "evaluated " + fi.fileName(); - } - } - } + _parent->evaluateJavaScript(js); + //qxtLog->debug() << "evaluated " + fi.fileName(); + } + } +} } //------------------------------------------------------------------------------------------------------- // Javascript functions for webpage @@ -85,12 +85,12 @@ void JavascriptInterface::loadJQuery() { * Emits the JavascriptInterface::requestFile(const QString) signal. */ void JavascriptInterface::startDownload(const QString& filename) { - // ignore if empty filename - if (filename.isEmpty()) { - _parent->evaluateJavaScript("alert(\"No filename!\")"); - return; - } - emit requestFile(filename); + // ignore if empty filename + if (filename.isEmpty()) { + _parent->evaluateJavaScript("alert(\"No filename!\")"); + return; + } + emit requestFile(filename); } //------------------------------------------------------------------------------------------------------- /** @@ -102,8 +102,8 @@ void JavascriptInterface::startDownload(const QString& filename) { * @todo add some more informations */ void JavascriptInterface::setCallbackOnFinished(const QString& function) { - qxtLog->debug() << "[jsi] Callback set: " << function; - _callbackOnDownloadsFinished = QString(function); + qxtLog->debug() << "[jsi] Callback set: " << function; + _callbackOnDownloadsFinished = QString(function); } //------------------------------------------------------------------------------------------------------- /** @@ -127,8 +127,8 @@ void JavascriptInterface::setCallbackOnFinished(const QString& function) { * @see SysInfo::getInfo(const QString& infoName) */ const QString JavascriptInterface::getSysInfo(const QString& info) { - SysInfo si; - return si.getInfo(info); + SysInfo si; + return si.getInfo(info); } //------------------------------------------------------------------------------------------------------- /** @@ -139,7 +139,7 @@ const QString JavascriptInterface::getSysInfo(const QString& info) { * Emits JavascriptInterface::quitFbgui() signal */ void JavascriptInterface::quit() { - emit quitFbgui(); + emit quitFbgui(); } //------------------------------------------------------------------------------------------------------- @@ -153,7 +153,7 @@ void JavascriptInterface::quit() { * @see fbgui::performShutDown() */ void JavascriptInterface::shutDown() { - emit shutDownClient(); + emit shutDownClient(); } //------------------------------------------------------------------------------------------------------- /** @@ -166,7 +166,7 @@ void JavascriptInterface::shutDown() { * @see fbgui::performReboot() */ void JavascriptInterface::reboot() { - emit rebootClient(); + emit rebootClient(); } //------------------------------------------------------------------------------------------------------- // Download Manager information exchange @@ -179,10 +179,10 @@ void JavascriptInterface::reboot() { * @todo add some more informations */ void JavascriptInterface::downloadInfo(const QString& filename, - const double& filesize) { - QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg( - filesize); - _parent->evaluateJavaScript(code); + const double& filesize) { + QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg( + filesize); + _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- /** @@ -194,12 +194,12 @@ void JavascriptInterface::downloadInfo(const QString& filename, * @todo add some more informations */ void JavascriptInterface::updateProgressBar(const int& percent, - const double& speed, const QString& unit) { - if (percent == 0) - return; - QString code = QString("updateProgress(\%1, \%2, '\%3')").arg(percent).arg( - speed).arg(unit); - _parent->evaluateJavaScript(code); + const double& speed, const QString& unit) { + if (percent == 0) + return; + QString code = QString("updateProgress(\%1, \%2, '\%3')").arg(percent).arg( + speed).arg(unit); + _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- /** @@ -208,17 +208,17 @@ void JavascriptInterface::updateProgressBar(const int& percent, * @todo add some more informations. */ void JavascriptInterface::notify(const QString& msg) { - qxtLog->debug() << "[jsi] Notifying: " << msg; - QString code = QString("notify('\%1')").arg(msg); - _parent->evaluateJavaScript(code); + qxtLog->debug() << "[jsi] Notifying: " << msg; + QString code = QString("notify('\%1')").arg(msg); + _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- /** * @todo add some more informations */ void JavascriptInterface::callbackOnFinished() { - QString code = QString("\%1").arg(_callbackOnDownloadsFinished); - _parent->evaluateJavaScript(code); + QString code = QString("\%1").arg(_callbackOnDownloadsFinished); + _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------- @@ -237,10 +237,10 @@ void JavascriptInterface::callbackOnFinished() { * @see void fbgui::loadURL() */ void JavascriptInterface::trigger() { - QFile file(fileToTriggerURL); - if (file.open(QIODevice::WriteOnly)) { - file.write("data\n"); - qxtLog->debug() << "[jsi] *trigger watcher*"; - } - file.close(); + QFile file(fileToTriggerURL); + if (file.open(QIODevice::WriteOnly)) { + file.write("data\n"); + qxtLog->debug() << "[jsi] *trigger watcher*"; + } + file.close(); } -- cgit v1.2.3-55-g7522