There is no benefit in storing the same pointer multiple times in
openedInspectors. This occurred when an article inspector window was
closed then shown again. When the tab corresponding to the duplicated
article inspector pointer was closed, ArticleInspector::beforeClosed()
erased only one pointer from openedInspectors. This left dangling
duplicate pointer(s) in the list and eventually caused a crash when
another inspector's showEvent() accessed a dangling pointer at
openedInspectors.front().
Silently ignore empty or whitespace-only translation requests. It should
be clear to most users why GoldenDict ignores them.
The translated word ends up as the "word" URL query item value, which is
trimmed in ArticleNetworkAccessManager::getResource(). So the added
trimming in MainWindow::translateInputFinished() should be fine.
When a trimmed translated word was empty, InputPhrase::isValid()
returned false, ArticleNetworkAccessManager::getResource() returned a
null pointer and ArticleNetworkAccessManager::createRequest() fell back
to QNetworkAccessManager::createRequest(), which:
* failed silently in the Qt 4 version;
* displayed the
Protocol "gdlookup" is unknown
Failed to load URL gdlookup://localhost?word= &group=4.
QtNetwork Error 301
error page in the Qt 5 version.
Fixes #1179.
An attempt to clone the git:// URL fails on my Manjaro GNU/Linux system
and produces the following output:
$ git clone git://github.com/goldendict/goldendict.git
Cloning into 'goldendict'...
fatal: unable to connect to github.com:
github.com[0: 140.82.121.4]: errno=Connection timed out
128✗
The GitHub UI offers the replacement https:// URL when the green Code
button in the GoldenDict repository is clicked.
Fixes #1561.