mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
feat: add dict://
handler to linux
* Remove any thing before first occurance of :// * so that user may add custom handler by just changing the .desktop file
This commit is contained in:
parent
81e1b5d9a6
commit
9716acb2ee
|
@ -7,4 +7,4 @@ GenericName=Multiformat Dictionary
|
||||||
Comment=A feature-rich dictionary lookup program
|
Comment=A feature-rich dictionary lookup program
|
||||||
Icon=goldendict
|
Icon=goldendict
|
||||||
Exec=goldendict %u
|
Exec=goldendict %u
|
||||||
MimeType=x-scheme-handler/goldendict
|
MimeType=x-scheme-handler/goldendict;x-scheme-handler/dict;
|
||||||
|
|
|
@ -175,8 +175,8 @@ void processCommandLine( QCoreApplication * app, GDOptions * result)
|
||||||
result->word = posArgs.at( 0 );
|
result->word = posArgs.at( 0 );
|
||||||
|
|
||||||
#if defined( Q_OS_LINUX ) || defined( Q_OS_WIN )
|
#if defined( Q_OS_LINUX ) || defined( Q_OS_WIN )
|
||||||
// handle url scheme like "goldendict://" on windows
|
// handle url scheme like "goldendict://" or "dict://" on windows/linux
|
||||||
result->word.remove( "goldendict://" );
|
result->word.remove( 0, result->word.indexOf( "://" ) + 3 );
|
||||||
// In microsoft Words, the / will be automatically appended
|
// In microsoft Words, the / will be automatically appended
|
||||||
if ( result->word.endsWith( "/" ) ) {
|
if ( result->word.endsWith( "/" ) ) {
|
||||||
result->word.chop( 1 );
|
result->word.chop( 1 );
|
||||||
|
|
Loading…
Reference in a new issue