Removed script error message support. Now it should return empty result if fails.
This commit is contained in:
		
							parent
							
								
									67a4c8e0ea
								
							
						
					
					
						commit
						6bacb14c56
					
				@ -27,7 +27,6 @@ WebTranslator::WebTranslator ()
 | 
			
		||||
  translationTimeout_.setSingleShot (true);
 | 
			
		||||
  connect (&translationTimeout_, SIGNAL (timeout ()), SLOT (abortTranslation ()));
 | 
			
		||||
 | 
			
		||||
  connect (proxy_, SIGNAL (error (QString)), SLOT (proxyError (QString)));
 | 
			
		||||
  connect (proxy_, SIGNAL (translated (QString)), SLOT (proxyTranslated (QString)));
 | 
			
		||||
 | 
			
		||||
  applySettings ();
 | 
			
		||||
@ -61,11 +60,6 @@ void WebTranslator::runScriptForItem (const ProcessingItem &item) {
 | 
			
		||||
  view_->page ()->mainFrame ()->evaluateJavaScript ("translate();");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WebTranslator::proxyError (const QString &message) {
 | 
			
		||||
  emit error (message);
 | 
			
		||||
  finishTranslation ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WebTranslator::proxyTranslated (const QString &text) {
 | 
			
		||||
  if (!queue_.isEmpty () && queue_.first ().recognized == proxy_->sourceText ()) {
 | 
			
		||||
    ProcessingItem &item = queue_.first ();
 | 
			
		||||
 | 
			
		||||
@ -33,7 +33,6 @@ class WebTranslator : public QObject {
 | 
			
		||||
    void replyFinished (QNetworkReply *reply);
 | 
			
		||||
    void addProxyToView ();
 | 
			
		||||
    void abortTranslation ();
 | 
			
		||||
    void proxyError (const QString &message);
 | 
			
		||||
    void proxyTranslated (const QString &text);
 | 
			
		||||
 | 
			
		||||
  private:
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,6 @@ class WebTranslatorProxy : public QObject {
 | 
			
		||||
 | 
			
		||||
  signals:
 | 
			
		||||
    void translated (const QString &text);
 | 
			
		||||
    void error (const QString &message);
 | 
			
		||||
 | 
			
		||||
    void resourceLoaded (const QString &url);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user