diff options
| author | Jonathan Bauer | 2011-03-21 10:51:51 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-03-21 10:51:51 +0100 |
| commit | 635b5c64f3107d4c01ae314fb75e02c571b51c54 (patch) | |
| tree | 4d2a3a679a569f9133ca8d3d5f5159b393accde3 /src/javascriptInterface.cpp | |
| parent | debug modes. -D now needs an arg: 0 for regular terminal output, 1 for debug ... (diff) | |
| download | fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.tar.gz fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.tar.xz fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.zip | |
transformed c syntax comments to c++ convention...
Diffstat (limited to 'src/javascriptInterface.cpp')
| -rw-r--r-- | src/javascriptInterface.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/javascriptInterface.cpp b/src/javascriptInterface.cpp index 1a9b470..c70347c 100644 --- a/src/javascriptInterface.cpp +++ b/src/javascriptInterface.cpp @@ -3,8 +3,7 @@ #include "sysInfo.h" //------------------------------------------------------------------------------------------------------- -javascriptInterface::javascriptInterface(QWebFrame *parent) -{ +javascriptInterface::javascriptInterface(QWebFrame *parent){ qxtLog->debug() << "Initializing javascript interface..."; //TODO: check for better way to use evaluateJavaScript() _parent = parent; @@ -12,7 +11,7 @@ javascriptInterface::javascriptInterface(QWebFrame *parent) //------------------------------------------------------------------------------------------------------- javascriptInterface::~javascriptInterface() {} //------------------------------------------------------------------------------------------------------- -QString javascriptInterface::getSysInfo(QString info){ +QString javascriptInterface::getSysInfo(const QString& info){ sysInfo si; return si.getInfo(info); } @@ -22,7 +21,7 @@ void javascriptInterface::attachToDOM(){ } //------------------------------------------------------------------------------------------------------- void javascriptInterface::startDownload(QString filename){ - /* ignore if empty filename */ + // ignore if empty filename if (filename.isEmpty()){ _parent->evaluateJavaScript("alert(\"No filename!\")"); return; @@ -30,19 +29,18 @@ void javascriptInterface::startDownload(QString filename){ emit requestFile(filename); } //------------------------------------------------------------------------------------------------------- -void javascriptInterface::downloadInfo(QString filename, double filesize){ +void javascriptInterface::downloadInfo(const QString& filename, const double& filesize){ QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg(filesize); _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- -void javascriptInterface::notify(QString msg){ +void javascriptInterface::notify(const QString& msg){ QString code = QString("notify('\%1')").arg(msg); _parent->evaluateJavaScript(code); - return; } //------------------------------------------------------------------------------------------------------- -void javascriptInterface::updateProgressBar(int percent, double speed, QString unit){ +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); |
